[antlr-interest] found more bugs in ANTLRv3.g + howto add separator when parallel iterating 2 lists in stringtemplate

Terence Parr parrt at cs.usfca.edu
Tue Jul 8 10:58:02 PDT 2008


On Jul 8, 2008, at 2:33 AM, Jens Boeykens wrote:

> Another detail for rule rewrite_tree_atom that I am not sure if it  
> is correct:
>
> In ANTLRv3.g :               ^(TOKEN_REF ARG_ACTION?)
> In ANTLRv3Tree.g:         ^(TOKEN_REF ARG_ACTION)
>
> The question mark dissapeared.  I added  it  in my code, but  not  
> sure if it is necessary...

Nope. not needed.  alt above takes care of it:

	|   TOKEN_REF
	|   ^(TOKEN_REF ARG_ACTION) // for imaginary nodes

> Another thing I did not understand very well (probably my own  
> fault ;) ) :
> There is a rule called "rewrite_template_block" which is defined,  
> but no other rule seems to be using it. Does this make the rule  
> obsolete? I noticed this because I have not yet encountered a  
> testcase where the rule was used, so I am not sure wether I should  
> write more tests or the rule is indeed obsolete.


Used by rewrite_tree_element and ebnf.
Ter


More information about the antlr-interest mailing list