[antlr-interest] The ^ and !
Terence Parr
parrt at jguru.com
Fri Sep 20 15:50:38 PDT 2002
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 jguru.com>
> To: <antlr-interest at yahoogroups.com>
> 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