[antlr-interest] failed predicate problem
    Michael Bedward 
    michael.bedward at gmail.com
       
    Sun Mar 15 21:28:53 PDT 2009
    
    
  
Hi
You are re-writing an AST ?  I ask because your question made it sound
like you are running actions but the grammar looks like re-writing.
I was under the impression that you MUST provide an explicit
alternative for when the predicate is not true.
So...
callExpression
: ^(CALL_EXPRESSION memberExpression indexSuffix *
propertyReferenceSuffix* argumentSuffix*)
       {$memberExpression.text.equals("Math.abs")}?
->mathabs(x={$argumentSuffix.text})
       -> [ alternative re-write (or blank to just drop the node from
the tree) ]
    ;
Hope this helps
Michael
    
    
More information about the antlr-interest
mailing list