[antlr-interest] specialStateTransition too big for Java (AntLR3)

Gavin Lambert antlr at mirality.co.nz
Fri May 4 02:23:47 PDT 2007


At 21:10 4/05/2007, Ruben Fonseca wrote:
 >I'm using AntLR3 to build a PHP parser. I need to get rid of 
HTML.
 >In order to do this I implemented a syntatic predicate on my 
Lexer,
 >to see if I'm getting HTML or PHP tokens (see an example
 >http://svn.perl.org/viewcvs/parrot/trunk/languages/plumhead/src/ant
 >lr3/Plumhead.g?view=markup )

If you want to parse both PHP and HTML, then you ought to be able 
to do something along the lines of the island grammar example, 
since the PHP/not-PHP markers are fairly distinctive.

Alternatively if you want to ignore the HTML entirely then you 
should be able to capture the entire lot within a single token 
(which is then either skipped or put in a hidden channel).

Either way you shouldn't need the predicate.  I think that's 
what's tripping you up at the moment.



More information about the antlr-interest mailing list