[antlr-interest] Stupid problem (Antlr 2.7.6)
Xue Yong Zhi
zhixueyong at hotmail.com
Fri Jan 26 10:41:05 PST 2007
Jose Ventura wrote:
> With this very simple antlr parser I have problems generating java program
>
> class pru extends Parser;
> copy: la:"COPY" {System.out.println (#la.getText());};
>
> Antlr generate
>
> try { // for error handling
> la = LT(1);
> match(LITERAL_COPY);
> System.out.println (#la.getText());
> }
>
> Wy don't translate the #?
>
> Is a stupid question, sure. But I don't see it.
>
> Any help? Thank's.
>
You do not need one. Just use
copy: la:"COPY" {System.out.println (la.getText());};
--
Xue Yong Zhi
http://seclib.blogspot.com
More information about the antlr-interest
mailing list