parsing

What Lisp is better at parsing?

I'd like to implement a Lisp interpreter in a Lisp dialect mainly as a learning exercise. The one thing I'm thrown off by is just how many choices there are in this area. Primarily, I'm a bit more interested in learning about some of the Lisps that have been around a while (like Scheme or Common Lisp). I don't want to use Clojure to d...

JSON Parsing Error

Hi there, I got problem. I have this JSON automatically generated by Open Flash Chart php library. The problem is, OFC report JSON Parse Error [Syntax Error] while test result using http://www.jsonlint.com/ report that my JSON is fine. But, w3c parser report error too:( Any help? Here's the JSON: { "title": "Followers Trend", ...

How to efficiently parse concatenated XML documents from a file

I have a file that consists of concatenated valid XML documents. I'd like to separate individual XML documents efficiently. Contents of the concatenated file will look like this, thus the concatenated file is not itself a valid XML document. <?xml version="1.0" encoding="UTF-8"?> <someData>...</someData> <?xml version="1.0" encoding="...

XML parsing with AS2

I'm using an XMLparser class to convert XML into an object. The problem is that the XML I have contains a dot in the nodeName (estate_size.primary_room_area). This of course doesn't work since it uses the dot notation for the object path already. Some ideas, but have no idea how to do them: -Replace the dot in the name somehow -Change ...

Match database output (balanced parentheses, table & rows structure) and output as a list?

How would I parse the following input (either going line by line or via regex... or combination of both): Table[ Row[ C_ID[Data:12345.0][Sec:12345.0][Type:Double] F_ID[Data:17660][Sec:17660][Type:Long] NAME[Data:Mike Jones][Sec:Mike Jones][Type:String] ] Row[ C_ID[Data:2560.0][Sec:2560.0][Type:Double]...

Parsing DateTime strings

Hi, I'm having some difficulties parsing strings of DateTime using DateTime.ParseExact. DateTime result; CultureInfo provider = CultureInfo.InvariantCulture; // Parse date-only value with invariant culture. //format = "mm/dd/yyyy"; format = "d"; try { result = DateTime.ParseExact(data+" 12:00:00 AM", forma...

HTML to DOM Library

I am looking for a C# library that would translate the HTML code (and the css specified in the code) into a DOM tree for simpler parsing. I am looking for something similar to this one (which is in PHP): http://simplehtmldom.sourceforge.net/ Of course I know I could embed a browser control, but I am looking for something more efficient....

mathematical expression parser in Delphi?

Duplicate Best algorithm for evaluating a mathematical expression? Is there a built-in Delphi function which would convert a string such as '2*x+power(x,2)' or any equation to float? StrToFloat raises an exception because of the char X and power. Thanks. ...

Delphi, evaluate formula string

Duplicate Best algorithm for evaluating a mathematical expression? mathematical expression parser in Delphi? I need a program in Delphi that get one variable equation from Edit1 such as "F(x)=4*X+2*log(x)+4*power(X,2)"and get X value variable from Edit2 then show the result F(X) in Edit3. Please help me. Thanks. ...

Need to parse a string, having a mask (something like this "%yr-%mh-%dy"), so i get the int values.

For example i have to find time in format mentioned in the title(but %-tags order can be different) in a string "The date is 2009-August-25." How can i make the program interprete the tags and what construction is better to use for storing them among with information about how to act with certain pieces of date string? ...

Java name parse library?

I'm searching for a library similar in functionality to the Perl Lingua::EN::NameParse module. Essentially, I'd like to parse strings like 'Mr. Bob R. Smith' into prefix, first name, last name, and name suffix components. Google hasn't been much help in finding something like this and I'd prefer not to roll my own if possible. Anyone k...

Object reference problem when reaching the end of a XML string

Hi, I've been developing a small xml parser for a specific file with this data structure : <questionnaire type="Echo"> <quest etat="0" ord="0"> <intro> <t>bla bla bla</t> </intro> <rep1> <t>word</t> <ev id="Q0R1"/> </rep1> <rep2> <t>word</t> ...

Parsing Tab Delim Lines Into Array in C Programming Language

Given a file (e.g. myfile.txt) with this content (always three lines): 0 2 5 9 10 12 0 1 0 2 4 1 2 3 4 2 1 4 2 3 3 -1 4 4 -3 1 2 2 6 1 How can we parse the file, such that it is stored in arrays, just as if they were hard coded this way: int Line1[] = { 0, 2, 5, 9, 10, 12 }; int Line2[] = { 0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, ...

HTML comment scraping in PHP

Hi there, I've been looking around but have yet to find a solution. I'm trying to scrape an HTML document and get the text between two comments however have been unable to do this successfully so far. I'm using PHP and have tried the PHP Simple DOM parser recommended here many times but can't seem to get it to do what I want. Here's (...

Simple HTML DOM Parser error handling

Hello, I'm using SimpleHTMLDOM Parser to scape a website and I would like to know if there's any error handling method. For example, if the link is broken there is no use to advance in the code and search the document. Thank you. ...

Parsing Excel XML with PHP

INTRODUCTION I'm using excel downloads as a way of users downloading a score sheet, filling out scores and then re-uploading this score sheet into the system. Part of this requires the data in the database to be put into a CSV. Then its opened on the client computer. PROBLEM The problem I'm having is that the CSV does not allow me to...

Parsing Size and Position Objects from an XmlDocument?

Is there more elegant syntax for reading/parsing Size and Point objects in an Xml document? Source Xml Nodes: <objSize>{Width=64, Height=64}</objSize> <Location_X>20</Location_X> <Location_Y>20</Location_Y> Currently I use: For Size: Dim sizeNode As String = objSize.InnerText Dim sizeText() As String = sizeNode.Split(CChar("="...

Why isn't telligent's RSS.Net fork parsing dates?

I'm using Telligent's RSS.Net fork to parse an XML Stream. The stream is well-formed and most of the desired elements are being parsed, but for some reason the pubData element isn't. Inspecting the feed contents shows the pubData element nicely displayed, no issues with the RSS or the element contents. But... As I said, no parsing, ei...

Best parser for C#?

I need a parser or grammar for C# 3.0 (open-source license). What's the best choice today? ...

Howto Generalize SSCANF and #DEFINE in C programming

The code below tries to parse a file containing these 3 lines: 0 2 5 9 10 12 0 1 0 2 4 1 2 3 4 2 1 4 2 3 3 -1 4 4 -3 1 2 2 6 1 and stores them in these arrays: int Line1[] = { 0, 2, 5, 9, 10, 12 }; int Line2[] = { 0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4 }; double Line3[] = { 2, 3, 3, -1, 4, 4, -3, 1, 2, 2, 6, 1 }; However in p...