[antlr-interest] BUG? ruleRefBangTrack.st not defined

Johannes Luber jaluber at gmx.de
Tue Oct 2 03:08:38 PDT 2007


Austin Hastings wrote:
> I made what seems like an error. I had a rule that contained a "!"
> (bang) to suppress generation of a node in my output tree.
> 
> I overlooked this, and added a -> rewrite rule, so that my rule looked like
> 
>    declaration: type_info! declarator (, declarator)* -> declarator* ;
> 
> The idea, of course, is that my AST was getting commas in it, and I
> wanted to get rid of them.
> 
> This caused ANTLR to throw an exception, which is likely caused by a
> missing file. Since the cause is the extraneous !, I can work around it.
> But I thought you'd like to know.
> 
> =Austin

This problem is due to mixing of inline tree operators and rewrite
rules. The error message in 3.0 is abysmal and no real help unless you
no what the meaning of this actually is. 3.1 should alleviate this
problem as then the grammar parser is written in ANTLR 3 and not in
ANTLR 2.7.7.

Best regards,
Johannes Luber


More information about the antlr-interest mailing list