parsing

PHP class for parsing diffs

Hello, I am writing a PHP script that needs to interpret Diff files as created by Git. How should I proceed if I want to parse the Diff file and basically print it in a completely different format? I have come across the Text_Diff PEAR library, but that one only creates the Diffs itself. Or rather, it only takes two different files as ...

Diff file syntax

I am currently playing around with parsing diff files, and have yet to come across a solid documentation on diff files. I am especially interested in specifications. E.g. I don't really understand the lines that look like this (at the beginning of each changed code block): @@ -296,7 +296,8 @@ I know they have to do with line numbers,...

Is it possible to use jQuery for HTML parsing?

Just out of curiosity, I am trying to see if it is possible to use jQuery to read a HTML file so that I can use it to output some values of some html elements? I am looking for some functionality like what Firebug provides i.e. Firebug lets me use the $() on any webpage so what I am trying to achieve is: I have a bunch of HTML files I ...

PHP: JSON like data format, searching parser

Hi, i would like to have an JSON like data format with the following features: support of arrays (ideal with [item; item; item] as notation and [key: value; key2: value2]), also nested string support, ideal with the following: "foo",0x0a,"bar" hex numbers, bin numbers, decimal numbers Does anyone know a parser for such a data format ...

How do I parse JSON like geo:point?

I'm trying to parse a JSON response using jquery from last.fm and getting longitude and latitude values. The part of the JSON that holds those values looks like this: "location":{"geo:point":{"geo:lat":"58.409901","geo:long":"15.563306"} The code I got is this: $.getJSON("http://ws.audioscrobbler.com/2.0/?method=artist.getevents&...

ANTLR Lua long string grammar rules

I'm trying to create ANTLR parser for Lua. So i took grammar produced by Nicolai Mainero(available at ANTLR's site, Lua 5.1 grammar) and begin to work. Grammar is good. One thing not working: LONG STRINGS. Lua specification rule: Literal strings can also be defined using a long format enclosed by long brackets. We define an op...