[antlr-interest] How to parse eg. a PHP file?

Micheal J open.zone at virgin.net
Mon Jul 24 15:01:55 PDT 2006


Check out Anakreon's (I hope I spelled hat correctly) ASP parser that parses
embedded VBScript and JScript source.
 
 
Micheal

-----------------------
The best way to contact me is via the list/forum. My time is very limited. 

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Peter Palotas
Sent: 24 July 2006 21:48
To: antlr-interest at antlr.org
Subject: [antlr-interest] How to parse eg. a PHP file?


Hi,

I'm wondering if anyone has any pointers on how to go about creating a
lexer/parser for something that looks like a PHP file in the sense that the
actual source code that needs to be parsed is enclosed in special "tags" in
the file, any text outside these "tags" are allowed, and is treated as some
sort of special statement in the parser. (In the PHP case it is translated
into an "echo <string>" statement. 

I need to do a preprocessor kind of thing that will work in pretty much this
way, but I'm having troubles figuring out how to write the lexer for this?
Any tips are greatly appreciated.

Sincerely,
Peter


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060724/9a0d0e92/attachment.html


More information about the antlr-interest mailing list