[antlr-interest] How to keep the embedded Java code to minimum.

Terence Parr parrt at cs.usfca.edu
Thu Mar 27 11:30:56 PDT 2008


or, subclass the grammar  To override abstract member methods.
Ter
On Mar 27, 2008, at 11:26 AM, Thomas Karcher wrote:
> Hi,
>
>>> I have a general question for  ANTLR folks.  How do you keep the
>>> embedded java (or other) code in your grammar to a minimum to  
>>> preserve
>>> readability of the grammar?
>
> Another possibility is to call functions of an inherited grammar class
> (by reference):
>
> options { superClass=GrammarParentClass; }
>
> rule:	a=A { inheritedFunction($a); }
>
>
> Thomas
>
>



More information about the antlr-interest mailing list