added C like precedence for operators
This commit is contained in:
parent
3ea179b4a9
commit
32b964444a
|
@ -104,12 +104,19 @@
|
||||||
%token FunExtsupport
|
%token FunExtsupport
|
||||||
|
|
||||||
/* Operator associativity */
|
/* Operator associativity */
|
||||||
|
/* Operators at lower line number have lower precedence */
|
||||||
|
/* Operators in same line have same precedence */
|
||||||
%right '='
|
%right '='
|
||||||
|
%left OpOr
|
||||||
|
%left OpXor
|
||||||
|
%left OpAnd
|
||||||
|
%left OpBitor
|
||||||
|
%left OpBitxor
|
||||||
|
%left OpBitand
|
||||||
|
%left OpEquals '<' '>'
|
||||||
%left '+' '-'
|
%left '+' '-'
|
||||||
%left '*' '/'
|
%left '*' '/'
|
||||||
%left OpEquals OpNot '<' '>'
|
%left OpNot OpBitnot
|
||||||
%left OpAnd OpOr OpXor
|
|
||||||
%left OpBitand OpBitor OpBitxor OpBitnot
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
program: program programbody {AST_push_node(root, $2);}
|
program: program programbody {AST_push_node(root, $2);}
|
||||||
|
|
Loading…
Reference in New Issue