%{
%}
expr : 
     | expr "+" expr { s0 + s2 }
     | expr "-" expr { s0 - s2 }
     | expr "*" expr { s0 * s2 }
     | expr "/" expr { s0 / s2 }
     | "(" expr ")"  { s1 }
     | unaryExpr     { s0 }
     | NUMBER        { s0 }

// unique head of production instead of %prec 
unaryExpr : 
     | "-" expr { -s1 }

%%

%left "+" "-"
%left "*" "/"
%right unaryExpr

%%

%type <float> NUMBER expr unaryExpr
