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

Terence Parr parrt at jguru.com
Mon May 27 12:23:30 PDT 2002


I have added a FAQ entry (using your name and answer if that's ok Greg):

http://www.jguru.com/faq/view.jsp?EID=893706

Ter

On Monday, May 27, 2002, at 08:37  AM, Greg Lindholm wrote:

> 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/
>
>
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org


 

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



More information about the antlr-interest mailing list