[antlr-interest] Bug with tree construction

Martin Probst mail at martin-probst.com
Wed Nov 16 10:05:53 PST 2005


Hi,

I don't have time right now (it's 7pm in Europe...) but maybe it's
because of the labels? I'll try tomorrow...

Martin

On Wed, 2005-11-16 at 09:54 -0800, Terence Parr wrote:
> On Nov 16, 2005, at 6:56 AM, Martin Probst wrote:
> 
> > Hi,
> > I have the following code in a grammar file:
> >
> > varDefn:
> >   kd:Kdefine_variable^ q:bindVar! (td:typeDeclaration!)?
> >   { ... }
> >   ( COLON_EQUALS! expr
> >   | ext:Kexternal
> >       { ... }
> >   )
> 
> Hi Martin, I just tried this grammar:
> 
> a: A^ b! (c!)?
>    {;}
>    ( E! expr
>    | D {;}
>    )
> ;
> 
> and it generates correct code (nothing like what you have).  Very  
> odd!  Relevant chunks:
> 
>              tmp1_AST = astFactory.create(LT(1));
>              astFactory.makeASTRoot(currentAST, tmp1_AST);
>              match(A);
> 
> correct.
> 
>                  match(E);
>                  expr();
>                  astFactory.addASTChild(currentAST, returnAST);
> 
> correct.
> 
> Hmm...using  2.7.6rc1 (2005-11-04).  Perhaps we've fixed something in  
> 2.7.6 but I doubt it.
> 
> Ter
> 
> 



More information about the antlr-interest mailing list