[antlr-interest] [newbie] Lexer Confusion

UW Student uw.anon at gmail.com
Fri Jul 4 19:29:29 PDT 2008


 >  >2) Can you please confirm my understanding of your use of a
 >  >syntactic predicate?  On a single DOT, the lexer will return
 >  >a TERM1 token.  On a double DOT, the lexer will return a TERM2
 >  >token.  If this is the case, won't a triple DOT be lexed as
 >  >TERM2 TERM1 (rather than the reverse)?
 >
 > That's correct.  But isn't that what you want anyway?  (One thing that
 > is different between the two: your original rule would turn '....' into
 > a single TERM2 token, while Johannes' version would turn it into two
 > TERM2 tokens.)

I would really prefer to have a single token.  Is it possible to modify 
Johannes' version to handle that?

Thanks,
Andrew


More information about the antlr-interest mailing list