[antlr-interest] Re: The ^ and !

lgcraymer lgc at mail1.jpl.nasa.gov
Fri Sep 20 18:24:45 PDT 2002


Ter--

In 2.7.1, ! on a root caused the first child to become the root 
instead of having the child list being promoted a level.  That is,

#( A! B C D )

becomes

#( B C D )

instead of B C D.

The fix should show up in your diff of JavaCodeGen.java with my stuff.

--Loring

--- In antlr-interest at y..., Terence Parr <parrt at j...> wrote:
> Hmm...the ! on a root should be ok, right?  So, 2.7.2a2 doesn't like 
! 
> on the root?  what does it generate vs 2.7.1?
> 
> Ter
> 
> On Friday, September 20, 2002, at 02:30  PM, Alexander Lenski wrote:
> 
> > Thank you Terence for the answer.
> > But what we got with the ! ?
> > I have the AST transformation rules that are ok with the 2.7.1 but 
the 
> > 2.7.2a2 generates err msgs as it is promised.
> > Should I change the rules or wait for the final 2.7.2?
> >  
> > Typical rule:
> >  
> > protected
> > me_to_s_literal[ MCall* pMC, TYPE_SP_T& spWS ]
> > { assert( pMC );
> >   TYPE_SP_AST spR;
> > }
> > : #( spO:PP_TO_S_LITERAL!
> >        (   IDENT!
> >            { Some code
> >            }
> >          | PP_VA_ARGS!
> >            { Some code
> >            }
> >    )  )
> >    { Some code
> >    }
> > ;
> >  
> > Thanks,
> > Alexander Lenski
> >  
> > ----- Original Message -----
> > From: "Terence Parr" <parrt at j...>
> > To: <antlr-interest at y...>
> > Sent: Friday, September 20, 2002 2:42 PM
> > Subject: Re: [antlr-interest] The ^ and !
> >
> > >
> > > On Friday, September 20, 2002, at 10:59  AM, Alexander Lenski 
wrote:
> > >
> > > > From the CHANGES-2.7.2.txt:
> > > >
> > > > "Bad code gen with ^ or ! on tree root
> > > > when building trees in a tree walker grammar such as:
> > > >
> > > > expr: #(PLUS^ expr expr)
> > > > | i:INT
> > > > ;
> > > >
> > > > Fortunately, ^ is simply redundant; removing it makes code ok.
> > > > Added a warning. Added an error message for ! saying that it
> > > > is not implemented."
> > > >
> > > > Are the ^ and ! not implemented yet or they are gone forever?
> > >
> > > Hi.  They are still there...just don't use ^ on the root...it's 
> > already
> > > a root.
> > >
> > > Ter
> > > --
> > > Co-founder, http://www.jguru.com
> > > Creator, ANTLR Parser Generator: http://www.antlr.org
> > >
> > >
> > >  
> > >
> > > Your use of Yahoo! Groups is subject to 
> > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> --
> Co-founder, http://www.jguru.com
> Creator, ANTLR Parser Generator: http://www.antlr.org
> Lecturer in Comp. Sci., University of San Francisco


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list