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

Peter Palotas peter.palotas at gmail.com
Mon Jul 24 13:48:02 PDT 2006


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/0a204966/attachment.html


More information about the antlr-interest mailing list