[antlr-interest] Re: aspectANTLR sketch

lgcraymer lgc at mail1.jpl.nasa.gov
Thu Jun 20 00:18:40 PDT 2002

--- In antlr-interest at y..., mzukowski at y... wrote:
> Do you see any validity to wanting to override a rule but not change 
> syntax?  


If I interpret your question correctly (future orientation), then 
there are only a few cases that I can think of.  Tree structuring may 
change, especially if calling rules are overridden.  Actions may 
change--different languages have different ideas of scoping, and 
symbol table management changes accordingly (in theory, this should be 
abstracted out by the developer; practice and theory don't always 
match).  In line expansion of called rules may be desirable to match 
new semantics attached to a syntactic fragment (A B C has meaning, but 
the encountered phrase is A B foo and foo might begin with a C; 
therefore foo should be expanded inline).  Replacement of calling (or 
called) rules can introduce syntactic ambiguities, making it necessary 
to add a syntactic predicate to a rule.

These cases would most likely arise from either building on a 
less-than-perfect grammar or doing heavy-duty composition which draws 
rules from multiple grammars to write a language processor for a "new" 
language.  Both of these situations would be good candidates for 
refactoring and benefit from an IDE which included refactoring 
support.  [Of course, we would have to figure out what refactoring 
patterns are desirable--iteration to recursion is obvious, as is rule 
expansion, and restructurings which resolve ambiguities would be 
useful; but I can think of others which I have difficulty describing.] 

> Monty


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list