parsing

Erlang and Antlr

Is it possible to write an Antlr code generation target for Erlang? ...

Parsing a blackberry .ipd file

I recently lost my Blackberry. When I discovered it was gone very shortly afterwards and called it, the sim card had already been removed. I ain't seeing that Blackberry again. Ok. I am out $300, but at least my data is backed up. I had an older working Blackberry fortunately and I got a new sim card and proceeded to restore my data usi...

a good practical book about language parsing

it appears the basic course I took at the university, is not nearly enough. is there a good basic practical book that would help me understand the principles of building a scanner/parser. what I need is a down to earth book, heavy on examples and light on long winded theoretical-mathematical discussions ...

JOOMLA + XML Parsing Error at 1:1496. Error 4: not well-formed (invalid token)

I am receiving the error: "XML Parsing Error at 1:1496. Error 4: not well-formed (invalid token)" on all pages of a Joomla install. Not sure exactly when the error started but it was working before. I have recently installed SOBI2 and 4RSS components, however when I disable or uninstall them the error still shows up. Joomla Version 1.5....

Use PHP to parse a confirmation email?

I'm integrating my website with a third party system. Here's the workflow between my website and the third party system: 1) From my website, I use PHP to automate upload of a CSV file to the third party system. 2) After the third party system receives my file, it will conduct a few operations. 3) The third party system will email ...

Haskell readFile type problem

Hi, I have some troubles with Haskell type system. Situation: Following program is taking list of filenames on the cmdline For all filename it reads its content using the function readFile Content of each file is passed to inputParser (Parsec) Rest is not so important Main problem is in function read_modules First two statements of th...

Parsing a structured text file in Ruby

How can i easily parse a document which has this structure description some line of text another line of text more lines of text quality 3 47 88 4 4 4 4 text: type 1 stats some funny stats description some line of text2 another line of text2 more lines of text2 quality 1 2 4 6 7 text: type 1 stats some funny stats . . . Ideall...

"Errors During Preprocessing" is non-zero in ASP.NET perfmon counters

While testing an ASP.NET application with perfmon, we find that the following field is non-zero: ASP.NET Apps v2.0.50727 > Errors During Preprocessing Documentation says that this field is "The number of errors that occurred during parsing, excluding compilation and run-time errors." However, I have not been able to track down why...

Complex line parse - need help.

Could you help me to correct my parse code. constant fixup privite ConfigAlarms = <U1 0> /* comment here*/ Slip of my code below, I don't know how to get the value of U1 and 0 and **/* comment here*/**. if(/^\s*(constant)\s*(fixup|\/\*fixup\*\/|)\s*(private|)\s*(\w+)^ ...(Need help here.) { $name1 = $1; # for content ...

SQL Formatter using C#

I need to create an SQL formatter in C#. Could anyone point me to some resources on the net? Do I need to implement a full-fledged parser, or is there an easier way to do it? ...

ActionScript3: filtering xml-attributes that contain dashes ?

There are dashes in attributes of an xml, and I don't know how to filter them: Here you can see a simple example of the xml: <posts> <post> <photo-url max-width="1280">http://blabla.tumblr.com/photo/98&lt;/photo-url&gt; </post> </posts> Because also the photo-url-tag has a dash, I needed to parse it with …child("photo-url"). T...

Seting User Agent param in PHP Simple HTML DOM Parser

Is there any way to include the user agent string along with the request send by PHP Simple HTML DOM Parser? ...

How do I extract and parse quoted strings in Perl?

Hello. Good day. My text file content below. tmp.txt (a very big size file) constant fixup private AlarmFileName = <A "C:\\TMP\\ALARM.LOG"> /* A Format */ constant fixup ConfigAlarms = <U1 0> /* U1 Format */ constant fixup ConfigEvents = <U2 0> /* U2 Format */ My parse code below. The code can't handle C:\\TMP...

Retrieve base URL path to be used in download image, CSS and javascript files from web page.

Dear All, We are downloading web page linked Images, style sheet(.css) and javascript files using web browser control (IWebbrowser2 and IHTMLDocument interface) ATL win32 application. Now for some of the web page image src= "/images/a1.jpg" are relative, so we need to append a base host address to the location and download. Do we have...

Libs for HTML sanitizing

I'm looking for a html sanitizer which I can call per API to sanitise strings which I get from my webapp. Are there some useful easy to use libs available? Does anyone knows maybe one or two? I don't need something big it just must be able to find unclosed tags and close them. ...

Doubt on using polymorphism in coding an expression parse tree/evaluator

I am working on an interpreter for a toy language, just to learn about building an interpreter. I have already implemented a simple parser for the grammar that generates a parse tree. Now, the usual way of evaluating the parse tree would be to use polymorphism on the nodes of the parse tree, with code that looks something like below (in ...

Extracting nodes only when they have specific attributes with specific values

Building on this this post, I needed a clean way to extract nodes in a for comprehension only if they had specific attribute values. Here's what I came up with: def attributeValue(attrs: (String, String)*)(n: Node) = attrs.map { p => n.attribute(p._1).exists(_ == p._2) } reduceLeft(_ && _) And here's an example that uses it t...

How to turn type-labeled tokens into a parse-tree?

So I'm writing a programming language in C++. I've written pretty much all of it except for one little bit where I need to turn my tokens into a parse tree. The tokens are already type labeled and ready to go, but I don't want to go through the effort of making my own parse tree generator. I've been looking around for apps to do this bu...

How to get ANTLR to output hierarchical ASTs?

I have a Lua grammar, (minor modifications to get it to output for C#, just namespace directives and a couple of option changes) and when I run it on some sample input, it gives me back a tree with a root "nil" node and as childs what looks to be a tokenized version of the input code. It looks like ANTLR's tree grammars operate on hierar...

How might I complete this example using LINQ and string parsing?

I'm trying to write a simple program that will compare the files in separate folders. I'm currently using LINQ to Objects to parse the folder and would like to included information extracted from the string in my result set as well. Here's what I have so far: FileInfo[] fileList = new DirectoryInfo(@"G:\Norton Backups").GetFiles(); v...