parsing

Dojo 1.5 - possible to turn off new parser behaviour, where it interprets 'lang' attribute?

Hi, My site (http://lipik.in) does not work with dojo 1.5. The issue is that new parser propagates the lang attribute to contained widgets in the page, whereas I was using it purely as a selector for fonts. It would be OK if dojo could guarantee sensible default with arbitrary lang, instead of falling over with the error "Bundle not fou...

Bison Shift/Reduce conflict for simple grammar

I'm building a parser for a language I've designed, in which type names start with an upper case letter and variable names start with a lower case letter, such that the lexer can tell the difference and provide different tokens. Also, the string 'this' is recognised by the lexer (it's an OOP language) and passed as a separate token. Fina...

Combining values from 2 XML objects in PHP

Hi! ...well, actually I have an object which looks like this: object(AleParserXMLElement)#39 (4) { ["name:private"]=> string(6) "rowset" ["data:private"]=> object(SimpleXMLElement)#42 (2) { ["@attributes"]=> array(3) { ["name"]=> string(6) "skills" ["key"]=> string(6) "typeID" ["columns"]=> ...

How to develop an own browser for Android? How to parse HTML, JS & Co.?

Like the title says, I am thinking about developing my own browser for Android devices. My first thought is to know what kind of possibilities I have, before I begin creating my software architecture. Are there any (open?) Browser Engines you could include into your library and reuse them? (There are some unknown browsers in the Android...

What is the name of this technique?

I just finished writing a date parser for my ECMAScript implementation. Previously I had written a regular expressions compiler and I was really impressed with the way the spec described the process. Essentially the input is passed through a series of continuations that test each portion of the string. My date parser is loosely based aro...

How do I convert passed flags/arguments to my Perl program without parsing them myself?

Hi, I would like to pass a perl program a set of arguments and flags, e.g. my_script.pl --flag1 --arg1=value --flag2 … Is there a way to quickly convert all of these into some standard structure (hash) instead of parsing? Thanks, Dave ...

Parse ATOM in Ruby with custom namespaces

Hi, I'm trying to read this ATOM Feed (http://ffffound.com/feed), but I'm unable to get to any of the values which are defined as part of the namespace e.g. media:content and media:thumbnail. Do I need to make the parser aware of the namespaces? Here's what I 've got: require 'rss/2.0' require 'open-uri' source = "http://ffffound.co...

Curl in PHP having problems with redirects

Well, here's the code: <? // Getting the comic page if (!empty($_GET['c'])) $id = $_GET['c']; else $id = "new"; $url = "http://www.explosm.net/comics/$id/"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FAILONERROR, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT...

Markdown parser in Javascript

Does anyone know a markdown parser in Javascript ? PS : Actually, I do this with request to server to parse it, but a client side parser would be better :) . Edit : If there is no one, I will use HTML (with WYSIWYG editor). ...

Write recursive-descent parsing to parse epsilon(ε) in Java

For example, EBNF A ::= B c; B ::= T1 | T2 | ε T1 ::= a T2 ::= b parseA() { switch(currentToken.kind){ case Token.a : parseT1(); case Token.b : parseT2(); break; case <epsilon> : break; default: // report error break; } } How to write the parser parse the epsilon ( set of empty string ) in Java? ...

What is the best way to parse an Int to a Year?

I have a textbox where users can enter a year "YY" and I am parsing it using: int year; if (int.TryParse(txtYear.Text, out year)) { args.Year = year; } The problem is TryParse will convert '07' into '7' and my method is expecting the year to be in the format YYYY (e.g. input "07" should be "2007"). What is the best way to do this...

TSQL how do you iterate through rows while parsing them?

Sorry for the poor question wording I wasn't sure how to describe this. I want to iterate through every row in a table and while doing so, extract a column, parse the varchar that is in it and depending on what it finds insert rows into another table. Something along the lines of this: DECLARE @string varchar(max); foreach row in (selec...

Parsing a text file with different delimiters which contains nnumeric values

I have a text file which read: config<001>25 23<220>12 ..... how can i parse so that i need only the values config,001(to be converted into integer after extracting using strtok or any ohter methods please suggest), and 25(to be converted into integer) seperately. i tries strtok its not working as the way i need. Please help me. ...

Most efficient format for transfering data to and from embedded devices

I'm having hard time to choose the format on which my server and my end points will communicate with. I am considering: JSON YAML Too hard to parse CSV Google Protobufs Binary packing/unpacking (with no use of casting/memset/memcpy to enable portability) Some form of DSL Any other suggestion you might have My criterias are ordered ...

XML parsing of large amount of data

Which is the optimal way of XML parsing(XML may be of large amount of data) in php? ...

Passing Date Object With Ajaxpro

I pass an javascript object from client-side to server-side function with Ajaxpro. In server-side date variables comes inside object are looks like below. What does it mean? How can i parse it to formatted date? "/Date(1280381400000)/" ...

Where can I find get a dump of raw text on the web?

I am looking to do some text analysis in a program I am writing. I am looking for alternate sources of text in its raw form similar to what is provided in the Wikipedia dumps (download.wikimedia.com). I'd rather not have to go through the trouble of crawling websites, trying to parse the html , extracting text etc.. ...

How to define syntax

Hi, I am new at language processing and I want to create a parser with Irony for a following syntax: name1:value1 name2:value2 name3:value ... where name1 is the name of an xml element and value is the value of the element which can also include spaces. I have tried to modify included samples like this: public TestGrammar() ...

LALR Parser Generator Implementation Problem

Hi everyone! I'm currently trying to implement a LALR parser generator as described in "compilers principles techniques and tools" (also called "dragon book"). A lot already works. The parser generator is currently able to generate the full goto-graph. Example Grammar: S' --> S S --> C C ...

PHP HTML DomDocument getElementById problems

A little new to PHP parsing here, but I can't seem to get PHP's DomDocument to return what is clearly an identifiable node. The HTML loaded will come from the 'net so can't necessarily guarantee XML compliance, but I try the following: <?php header("Content-Type: text/plain"); $html = '<html><body>Hello <b id="bid">World</b>.</body></...