[antlr-interest] failed predicate problem

YINGAnnie yimm8369 at hotmail.com
Mon Mar 16 17:43:05 PDT 2009


 

Hi Michael,


* ?  ----- Match element one or more times.

 

Does that what you mean?

 

 

Annie

 
> Date: Tue, 17 Mar 2009 11:30:40 +1100
> Subject: Re: [antlr-interest] failed predicate problem
> From: michael.bedward at gmail.com
> To: yimm8369 at hotmail.com
> CC: antlr-interest at antlr.org
> 
> Hi Annie,
> 
> > using-> before {  } ?
> 
> Oops, you're quite right. The arrow should be before the predicate,
> not after (although that page in the book is about writing output with
> string templates. For rewriting ASTs you're better off looking at the
> wiki pages, for example...
> 
> http://www.antlr.org/wiki/display/ANTLR3/Tree+construction
> (look for the heading Tree Construction During Tree Parsing)
> 
> In your grammar...
> 
> callExpression
> : ^(CALL_EXPRESSION memberExpression indexSuffix
> *propertyReferenceSuffix* argumentSuffix*)
> ->{$memberExpression.text.equals("Math.abs")}?
> mathabs(x={$argumentSuffix.text})
> ;
> 
> what are the asterisks for ?
> 
> Michael

_________________________________________________________________
Live Search视频搜索,快速检索视频的利器!
http://www.live.com/?scope=video
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090317/d362d4f6/attachment.html 


More information about the antlr-interest mailing list