[antlr-interest] Compiler error, CSharp2 target: empty if condition
Ben Gillis
wbgillis at gmail.com
Sun Jan 11 19:46:02 PST 2009
This is probably a known CSharp2 target compile issue, but googling the error message only turned up others with the same problem, no resolution/status.
Questions: Will it be fixed? best work-arounds?
The compile error is: Invalid expression term ')'
Anytime I use a token in single quotes in an AST rewrite, I get the above. For example,
someRule : 'KEYWORD' 'TOKEN' -> ^(KEYWORD TOKEN);
which produces an empty condition in a C# if statement:
if ( )
If I remove the single quotes, the error is resolved:
someRule : KEYWORD TOKEN -> ^(KEYWORD TOKEN);
the newly gen'd code being:
if ( stream_KEYWORD.HasNext() )
Regards,
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090111/634aa422/attachment.html
More information about the antlr-interest
mailing list