[antlr-interest] Test dynamic scope presence

Joël Marty joelmarty2 at gmail.com
Sat Aug 13 05:33:51 PDT 2011


I'm currently working with the Java 1.6 grammar available on antlr 
website (not the tree grammar) and I need to detect method calls in my 
code (probably in the identifierSuffix rule).
Since parameter passing doesn't work very well with predicates, I 
thought following the advice of using a dynamic scope high enough in the 
hierarchy to pass contextual information between an arbitrary rule (say 
methodDeclaration) and identifierSuffix; but how can I be certain that 
the scope defined in methodDeclaration is available to identifierSuffix? 
What happens if identifierSuffix is called from another rule and the 
scope is not available?


More information about the antlr-interest mailing list