[antlr-interest] Token replacement
fyaoxy at gmail.com
Mon May 19 18:02:48 PDT 2008
I found that about node creating most clear in
org.antlr.runtime.tree.TreeAdaptor API javadoc.
For your case, maybe add a parser ruler is an option.
2008/5/20 Marko Simovic <antlr.markobarko at gmail.com>:
> Hi, i have the following rule:
> someRule: something op='where' condition 'else' something;
> i'm trying to rewrite it by doing:
> -> ^(Function 'if' condition something+)
> i do this in order to keep the AST processing code unchanged (as it
> already handles the 'if' function correctly; and the 'where' syntax is
> just a variant of the same conditional syntax)
> however, the rewrite just generates the number '45' for that 'if'??
> i tried doing this:
> -> ^(Function 'if'[$op] condition something+)
> but that seems to be unsupported.
> what can i do?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest