help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help with an if rule!


From: Roberto Mandall
Subject: help with an if rule!
Date: Sun, 14 Aug 2005 18:53:12 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

hi there, i have these rules for a pascal comp:

open_if_statement : IF boolean_expression THEN  statement
|IF boolean_expression THEN closed_statement ELSE open_statement;

closed_if_statement : IF boolean_expression THEN closed_statement ELSE closed_statement;

i want to add some semantic actions after the then ,but i get conflicts, which is pretty understable, as what i would like to do is this.
open_if_statement : IF boolean_expression THEN {} statement
|IF boolean_expression THEN {}closed_statement ELSE open_statement;

closed_if_statement : IF boolean_expression THEN {}closed_statement ELSE closed_statement;

can anyone tell me how could i add some rules there? i have tried this:
open_if_statement : IF boolean_expression {sifthen($2);}THEN  statement;
open_if_else_statement: IF boolean_expression {sifthen($2);}THEN closed_statement ELSE open_statement;
and this
open_if_statement : IF boolean_expression THEN cosa  statement;
cosa:{sifthen($2);} I know cosa will fail with the $2, but what i want to know i swhat else could i do so i do not get a conflict.


thank u in advance!


        
        
                
______________________________________________ Renovamos el Correo Yahoo! Nuevos servicios, más seguridad http://correo.yahoo.es





reply via email to

[Prev in Thread] Current Thread [Next in Thread]