[antlr-interest] C-style includes: problem with parser vs. lexer rules

Johannes Luber jaluber at gmx.de
Mon Aug 27 07:09:18 PDT 2007


Bjoern Doebel wrote:
> Hi,
> 
> Johannes Luber wrote:
>> My guess is that FNAME should be a parser rule, not a lexer rule. Or
>> WORD hat do be changed into a fragment rule.
> 
> Thanks. I already had it working with FNAME being a parser rule and
> changing WORD to a fragment also made it work the other way round. However,
> this is kind of inconvenient, because if WORD is a fragment rule, it cannot
> be used from parser rules directly, unless I duplicate a rule and have it
> as a fragment and a normal lexer rule:
> 
...
> Can we improve this?
> 
> Sincerely,
> Bjoern
> 

How about using WORD2 in WORD, too?

Best regards,
Johannes Luber


More information about the antlr-interest mailing list