[antlr-interest] [C target] [3.1.1] Deriving imaginary nodes from real tokens

Sven Van Echelpoel sven.van.echelpoel at empolis.com
Mon Dec 15 00:09:56 PST 2008


[...]
>    -> FOO["bar"]
> Copy existing token FOO but give it "bar" as text, or create 
> imaginary token FOO with "bar" as text and no context.

OK, I looked at the overload set of the Java API and this is indeed in
there:

Object create (int tokenType, Token fromToken);
Object create (int tokenType, Token fromToken, String text);
Object create (int tokenType, String text);

However, as I said before, this is not what is explained in the book
and, as I'm programming against the C target, this is what I used at
first to reason from. It does not even mention the ability to set only
the text of a node.

Thanks for taking the time to explain me all of this

Sven



More information about the antlr-interest mailing list