[antlr-interest] Help getting familiar with ANTLR

Paul Johnson gt54-antlr at cyconix.com
Mon Jun 20 02:32:24 PDT 2005


Nigel Sheridan-Smith wrote:

>>4. In ANTLR is the operator precedence explicit or implied? I noticed that
>>the Java 1.3 grammar included the precedence level in the comments but
>>there
>>didn't appear to an explicit declaration. If they are implicit by the
>>order
>>of declaration is there a way to explicitly set the precedence?
>>
>>***Note: From what I can tell the operator precedence in the AST is
>>implicit
>>by order of inclusion - just want to make sure that's the case.

In addition to Nigel's comments - for the AST, presumably you're 
referring to java.tree.g? There's no precedence specified in this file 
because the AST is already presumed to be correct: the precedence is 
specified within the structure of the input tree itself. You're not 
cheking the AST for 'correctness'; you're just giving the tree walker 
enough information to walk the tree.

Paul



More information about the antlr-interest mailing list