1 /**************************************************************************/
5 /* François Pottier, INRIA Rocquencourt */
6 /* Yann Régis-Gianas, PPS, Université Paris Diderot */
8 /* Copyright 2005-2008 Institut National de Recherche en Informatique */
9 /* et en Automatique. All rights reserved. This file is distributed */
10 /* under the terms of the Q Public License version 1.0, with the change */
11 /* described in file LICENSE. */
13 /**************************************************************************/
16 %token PLUS MINUS TIMES DIV
20 %left PLUS MINUS /* lowest precedence */
21 %left TIMES DIV /* medium precedence */
22 %nonassoc UMINUS /* highest precedence */
35 | LPAREN e = expr RPAREN
37 | e1 = expr PLUS e2 = expr
39 | e1 = expr MINUS e2 = expr
41 | e1 = expr TIMES e2 = expr
43 | e1 = expr DIV e2 = expr
45 | MINUS e = expr %prec UMINUS