Hello list,

Did someone solve this? I have a similar problem with a grammar I took 
from this list (Eval.g and Simple.g). It concerns the .

ifElse
scope {
   bool expResult;
} :
    ^(
       IFTHEN b = expression { $ifElse::expResult = b; }
       (
          {$ifElse::expResult == true}?=> actionSequence
          | . // if expResult == false, no action required but eat the token
       )
      )
    |
    ^(
       IFTHENELSE b = expression { $ifElse::expResult = b; }
       (
          {$ifElse::expResult == true}? actionSequence
          . // if expResult == true, call the 'then' action and 'eat' 
the else action
          | . actionSequence // if expResult == false, 'eat' the 'then' 
action and call the else action
       )
      );
On nested statements this fails to throw away the 'false' part of the tree.
How can I fix that?

Kind regards,


Jan


On 7-5-2009 20:38, Martijn Reuvers wrote:
> Hello!
>
> I tried it, but neither works. :/ I ran it against a snapshot of 3.1.4
> runtime that I built with mave (3.1.3 has the same errors btw):
>
> The skip option says when run:
> * Wildcard invalid as root; wildcard can itself be a tree.
>
> As for the | * option it still has a similar error as before:
> * node from after line 22:12 no viable alternative at input 'DOWN'.
>
> This is what I have for the |*
> --------------
> bool_function_content[Boolean value]
> scope {
>       Boolean t;
> }
> @init {
>       $bool_function_content::t = $value;
> }
>   : {$bool_function_content::t  != null&&
> $bool_function_content::t.booleanValue() }? =>  function_content*
>   | .*
>   ;   
>
> Any thoughts?
>
> Martijn
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>
>    

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to