[antlr-interest] The ^ and !

Alexander Lenski alenski at dca.net
Fri Sep 20 14:30:03 PDT 2002


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/ 
> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20020920/fcc00aea/attachment.html


More information about the antlr-interest mailing list