[antlr-interest] How to translate this V2 Lexer rule to V3 Lexer rule?

chain one chainone at gmail.com
Tue Dec 2 22:57:09 PST 2008


Sorry for spaming
I noticed that only to remove the '$' in front of getText and setType()
would work.
What a stupid question! : )

2008/12/3 chain one <chainone at gmail.com>

> The V2 Lexer rule is:
> IDENT
>
> : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*
>  {
>  if (!parser.isFirst) $setType(globalSearchId($getText()));
> }
>  ;
>
>
> I searched in the ANTLR V3 book but failed to find the way to get the Lexer
> rule's Text and Type directly from its alternatives.
>
> Anyone who knows , could you please drop me an email?
> Thanks very much!
> Best Regards,
> Chainone
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081203/542e9f0c/attachment.html 


More information about the antlr-interest mailing list