Commit ae69da2f authored by sebastien's avatar sebastien
Browse files

v4 preprocessor: fixed minor issues with operators precedence


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1706 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 8149bfc2
......@@ -112,11 +112,12 @@ class ParsingDriver;
%token XLS_SHEET XLS_RANGE
%token NORMCDF
%token HOMOTOPY_SETUP HOMOTOPY_MODE HOMOTOPY_STEPS
%left LESS GREATER LESS_EQUAL GREATER_EQUAL EQUAL_EQUAL EXCLAMATION EXCLAMATION_EQUAL
%left COMMA
%left EQUAL_EQUAL EXCLAMATION_EQUAL
%left LESS GREATER LESS_EQUAL GREATER_EQUAL
%left PLUS MINUS
%left TIMES DIVIDE
%left UMINUS
%left UMINUS UPLUS
%nonassoc POWER
%token EXP LOG LN LOG10 SIN COS TAN ASIN ACOS ATAN SINH COSH TANH ASINH ACOSH ATANH SQRT
/* GSA analysis */
......@@ -315,7 +316,7 @@ expression : '(' expression ')'
{ $$ = driver.add_different($1, $3); }
| MINUS expression %prec UMINUS
{ $$ = driver.add_uminus($2); }
| PLUS expression
| PLUS expression %prec UPLUS
{ $$ = $2; }
| EXP '(' expression ')'
{ $$ = driver.add_exp($3); }
......
......@@ -305,7 +305,6 @@ int sigma_e = 0;
<DYNARE_STATEMENT,DYNARE_BLOCK>"<=" {return token::LESS_EQUAL;}
<DYNARE_STATEMENT,DYNARE_BLOCK>"==" {return token::EQUAL_EQUAL;}
<DYNARE_STATEMENT,DYNARE_BLOCK>"!=" {return token::EXCLAMATION_EQUAL;}
<DYNARE_STATEMENT,DYNARE_BLOCK>[!] {return token::EXCLAMATION;}
<DYNARE_STATEMENT,DYNARE_BLOCK>[\^] {return token::POWER;}
<DYNARE_STATEMENT,DYNARE_BLOCK>exp {return token::EXP;}
<DYNARE_STATEMENT,DYNARE_BLOCK>log {return token::LOG;}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment