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

clinton_olsen clinton_olsen at yahoo.com
Wed May 29 10:26:37 PDT 2002


I'd like to qualify this with the fact that _any_ parser is 
typically not suited to to do a pre-processor.  This needs to be 
done in the lexer for the reasons stated by Greg.  Besides, you need 
the replaced input to be lexed before it can be passed to the parser.


--- In antlr-interest at y..., Greg Lindholm <glindholm at y...> wrote:
> ANTLR doesn't have a way of specifing start-of-line as part of a 
> Once you have entered a rule you can use a sematic predicate to 
> 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.


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

More information about the antlr-interest mailing list