Hi, I'm having shift/reduce conflict with the unary expression in my grammar
file. I've tried using the %prec modifier but it doesn't seem to work. 

%token NUMBER 
%token BIT_NOT NOT
%left PLUS MINUS OR XOR
%left UPLUS
%%

expression_list
                : /* empty */
                | expression_list summation_expression
                ;

summation_expression
                :unary_expression
                | summation_expression PLUS unary_expression 
                | summation_expression MINUS unary_expression
                | summation_expression OR unary_expression
                | summation_expression XOR unary_expression
                ;

unary_expression
                : NUMBER
                | PLUS NUMBER %prec UPLUS 
                | BIT_NOT NUMBER
                | NOT NUMBER
                ;

I hope someone can help me with this. Thanks.
-- 
View this message in context: 
http://www.nabble.com/shift-reduce-conflict-with-unary-tf4303942.html#a12250917
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.



_______________________________________________
[email protected] http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to