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

Jens Boeykens jens.boeykens at gmail.com
Thu Jul 10 02:04:16 PDT 2008


2008/7/8 Terence Parr <parrt at cs.usfca.edu>:

>
> 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
>

Hmm if I do a search for "rewrite_template_block" in the files on the site,
it is found only once. Thus it is not used in rewrite_tree_element and ebnf.
Is it possible that you have considered "rewrite_tree_block" instead of
"rewrite_template_block"?

Now a rule like: "r : a -> (template() <<this is a temp>>);" doesn't parse
because of the parentheses around template. I assume
"rewrite_template_block" was defined for this case, but since it is never
used...

Greetz,
Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080710/a23193a1/attachment.html 


More information about the antlr-interest mailing list