Skip to content
Snippets Groups Projects
Commit d6d0a69e authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[aorai] remove unused priority levels

parent 3a1e6089
No related branches found
No related tags found
No related merge requests found
...@@ -145,27 +145,20 @@ type pre_cond = Behavior of string | Pre of Promelaast.condition ...@@ -145,27 +145,20 @@ type pre_cond = Behavior of string | Pre of Promelaast.condition
%token NOT DOT AMP %token NOT DOT AMP
%token COLON SEMI_COLON COMMA PIPE CARET QUESTION COLUMNCOLUMN %token COLON SEMI_COLON COMMA PIPE CARET QUESTION COLUMNCOLUMN
%token EQ LT GT LE GE NEQ PLUS MINUS SLASH STAR PERCENT OR AND %token EQ LT GT LE GE NEQ PLUS MINUS SLASH STAR PERCENT OR AND
%token INIT ACCEPT DETERMINISTIC
%token OTHERWISE %token OTHERWISE
%token EOF %token EOF
%nonassoc highest %left OR AND
%left LPAREN RPAREN %nonassoc NOT
%left LCURLY %left STAR
%right EQ LT GT LE GE NEQ PLUS MINUS SLASH STAR PERCENT OR AND
/* [VP] priorities taken from cparser.mly */
%left LSQUARE RSQUARE
%left DOT %left DOT
%nonassoc NOT TRUE FALSE %left LSQUARE
%nonassoc QUESTION
%right SEMI_COLON
%nonassoc lowest
%type <Promelaast.parsed_automaton> main %type <Promelaast.parsed_automaton> main
%start main %start main
%% %%
main : options metavars states { build_automaton $1 $2 $3 } main : options metavars states EOF { build_automaton $1 $2 $3 }
options options
: options option { $1 @ [$2] } : options option { $1 @ [$2] }
...@@ -318,7 +311,7 @@ seq_elt: ...@@ -318,7 +311,7 @@ seq_elt:
; ;
repetition: repetition:
| /* empty */ %prec highest | /* empty */
{ Some Data_for_aorai.cst_one, Some Data_for_aorai.cst_one } { Some Data_for_aorai.cst_one, Some Data_for_aorai.cst_one }
| PLUS { Some Data_for_aorai.cst_one, None} | PLUS { Some Data_for_aorai.cst_one, None}
| STAR { None, None } | STAR { None, None }
...@@ -349,24 +342,24 @@ logic_relation ...@@ -349,24 +342,24 @@ logic_relation
| arith_relation LE arith_relation { PRel(Le, $1, $3) } | arith_relation LE arith_relation { PRel(Le, $1, $3) }
| arith_relation GE arith_relation { PRel(Ge, $1, $3) } | arith_relation GE arith_relation { PRel(Ge, $1, $3) }
| arith_relation NEQ arith_relation { PRel(Neq, $1, $3) } | arith_relation NEQ arith_relation { PRel(Neq, $1, $3) }
| arith_relation %prec TRUE { PRel (Neq, $1, PCst(IntConstant "0")) } | arith_relation { PRel (Neq, $1, PCst(IntConstant "0")) }
; ;
arith_relation arith_relation
: arith_relation_mul PLUS arith_relation { PBinop(Badd,$1,$3) } : arith_relation_mul PLUS arith_relation { PBinop(Badd,$1,$3) }
| arith_relation_mul MINUS arith_relation { PBinop(Bsub,$1,$3) } | arith_relation_mul MINUS arith_relation { PBinop(Bsub,$1,$3) }
| arith_relation_mul %prec highest { $1 } | arith_relation_mul { $1 }
; ;
arith_relation_mul arith_relation_mul
: arith_relation_mul SLASH access_or_const { PBinop(Bdiv,$1,$3) } : arith_relation_mul SLASH access_or_const { PBinop(Bdiv,$1,$3) }
| arith_relation_mul STAR access_or_const { PBinop(Bmul, $1, $3) } | arith_relation_mul STAR access_or_const { PBinop(Bmul, $1, $3) }
| arith_relation_mul PERCENT access_or_const { PBinop(Bmod, $1, $3) } | arith_relation_mul PERCENT access_or_const { PBinop(Bmod, $1, $3) }
| arith_relation_bw %prec highest { $1 } | arith_relation_bw { $1 }
; ;
arith_relation_bw arith_relation_bw
: access_or_const %prec highest { $1 } : access_or_const { $1 }
| arith_relation_bw AMP access_or_const { PBinop(Bbw_and,$1,$3) } | arith_relation_bw AMP access_or_const { PBinop(Bbw_and,$1,$3) }
| arith_relation_bw PIPE access_or_const { PBinop(Bbw_or,$1,$3) } | arith_relation_bw PIPE access_or_const { PBinop(Bbw_or,$1,$3) }
| arith_relation_bw CARET access_or_const { PBinop(Bbw_xor,$1,$3) } | arith_relation_bw CARET access_or_const { PBinop(Bbw_xor,$1,$3) }
...@@ -375,7 +368,7 @@ arith_relation_bw ...@@ -375,7 +368,7 @@ arith_relation_bw
access_or_const access_or_const
: INT { PCst (IntConstant $1) } : INT { PCst (IntConstant $1) }
| MINUS INT { PUnop (Uminus, PCst (IntConstant $2)) } | MINUS INT { PUnop (Uminus, PCst (IntConstant $2)) }
| access %prec TRUE { $1 } | access { $1 }
; ;
/* returns a lval */ /* returns a lval */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment