[antlr-interest] Antlr3b6 [bug?] Can't find template matchSetTrack.st

femto gary femtowin at gmail.com
Sun Apr 15 07:30:25 PDT 2007


Hi David, this is a bug in antlr3b6, I've downloaded
the daily build, Terence has fixed it.

On 4/15/07, David Holroyd <dave at badgers-in-foil.co.uk> wrote:
> On Sun, Apr 15, 2007 at 08:17:21PM +0800, femto gary wrote:
> > for the following grammar, antlr reports error:
>
> > Can't find template matchSetTrack.st
>
> > doing a google search reveals somebody has also this problem:
> > http://www.antlr.org/pipermail/antlr-interest/2007-January/019038.html,
> > is this an antlr3b6 bug?
>
> I can't say for sure which parser rule is causing the error, but this
> looks a bit suspicious,
>
> > if_expression
> >       :       'if' b=boolean_expression ('then'|':'|LINE_BREAK)
> >               body0=body ('elsif' b1=boolean_expression
> > ('then'|':'|LINE_BREAK) body1+=body)*
> >               ('else' body2=body)?
> >               'end' -> ^(IF $b $body0 $b1* $body1* $body2? )
> >               ;
>
> simply because if I recall correctly, the construction
>
>  (... b1=boolean_expression ...)*
>
> will overwrite b1 each time that ()* subrule matches, so that only the
> last boolean_expression matched will appear in the result tree.  Might
> be better for you to create a new rule to build the "elsif" subtree.
>
>
> ta,
> dave
>
> --
> http://david.holroyd.me.uk/
>


-- 
Best Regards
XRuby http://xruby.com
femto http://hi.baidu.com/femto


More information about the antlr-interest mailing list