[antlr-interest] How do I specify start-of-line (^ in [F]Lex in ANTLR Lexers?

Greg Lindholm glindholm at yahoo.com
Mon May 27 08:37:00 PDT 2002


ANTLR doesn't have a way of specifing start-of-line as part of a rule. 
Once you have entered a rule you can use a sematic predicate to check
what column your at, but this probably doesn't help you.

IMHO ANTLR is not well suited for writing a preprocessor as; 
1) Preprocessors are line-oriented and ANTLR isn't.
2) The output of an ANTLR lexer is a token stream where the 
output of a preprocessor is a character stream (or file) that
then gets fed into a lexer.

Greg


--- micheal_jor <open.zone at virgin.net> wrote:
> I am still struggling with handling preprocessor directives with 
> ANTLR. ;-)
> 
> In addition to an answer for my question in the subject line, I would
> 
> appreciate a link to examples of ANTLR projects that deals with 
> preprocessor directives if such a thing exists -- maybe I can learn 
> from them....
> 
> Thanks
> 
> Micheal
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

 

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



More information about the antlr-interest mailing list