[antlr-interest] simple parser lookahead problem

Monty Zukowski monty at codetransform.com
Thu May 13 09:46:47 PDT 2004


On May 13, 2004, at 6:27 AM, Robert Colquhoun wrote:

> The comments almost by definition were not lexable(unless there
> is a way to do a 'catch all' lexer rule) therefore you couldn't feed 
> this
> info through to the parser filter to figure out the context to 
> determine
> whether something was a statement/label/comment.

Did you try using lexer states? What made comments un-lexable?  You 
know about the greedy option, right?  There is a way to do the 'catch 
all' stuff-see the "ANTLR meets SED" article.

This will make a good example to reason about ANTLR 3 lexers with.

Monty Zukowski

ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit -- 
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list