Commit 53822c7b authored by sebastien's avatar sebastien
Browse files

v4 parser: made LOG and LN distinct tokens, but triggering the same actions


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1487 ac1d8469-bf42-47a9-8791-bf33cf982152
parent a60ab498
This diff is collapsed.
......@@ -78,7 +78,7 @@ class ParsingDriver;
%left TIMES DIVIDE
%left UMINUS
%nonassoc POWER
%token EXP LOG LOG10 SIN COS TAN ASIN ACOS ATAN SINH COSH TANH ASINH ACOSH ATANH SQRT
%token EXP LOG LN LOG10 SIN COS TAN ASIN ACOS ATAN SINH COSH TANH ASINH ACOSH ATANH SQRT
/* GSA analysis */
%token DYNARE_SENSITIVITY IDENTIFICATION MORRIS STAB REDFORM PPRIOR PRIOR_RANGE PPOST ILPTAU GLUE MORRIS_NLIV
%token MORRIS_NTRA NSAM LOAD_REDFORM LOAD_RMSE LOAD_STAB ALPHA2_STAB KSSTAT LOGTRANS_REDFORM THRESHOLD_REDFORM
......@@ -281,6 +281,8 @@ expression : '(' expression ')'
{ $$ = driver.add_exp($3); }
| LOG '(' expression ')'
{ $$ = driver.add_log($3); }
| LN '(' expression ')'
{ $$ = driver.add_log($3); }
| LOG10 '(' expression ')'
{ $$ = driver.add_log10($3); }
| SIN '(' expression ')'
......@@ -428,6 +430,8 @@ hand_side : '(' hand_side ')'
{ $$ = driver.add_exp($3); }
| LOG '(' hand_side ')'
{ $$ = driver.add_log($3); }
| LN '(' hand_side ')'
{ $$ = driver.add_log($3); }
| LOG10 '(' hand_side ')'
{ $$ = driver.add_log10($3); }
| SIN '(' hand_side ')'
......
......@@ -264,7 +264,7 @@ int sigma_e = 0;
<DYNARE_STATEMENT,DYNARE_BLOCK>exp {return token::EXP;}
<DYNARE_STATEMENT,DYNARE_BLOCK>log {return token::LOG;}
<DYNARE_STATEMENT,DYNARE_BLOCK>log10 {return token::LOG10;}
<DYNARE_STATEMENT,DYNARE_BLOCK>ln {return token::LOG;}
<DYNARE_STATEMENT,DYNARE_BLOCK>ln {return token::LN;}
<DYNARE_STATEMENT,DYNARE_BLOCK>sin {return token::SIN;}
<DYNARE_STATEMENT,DYNARE_BLOCK>cos {return token::COS;}
<DYNARE_STATEMENT,DYNARE_BLOCK>tan {return token::TAN;}
......
......@@ -287,52 +287,53 @@ namespace yy
POWER = 415,
EXP = 416,
LOG = 417,
LOG10 = 418,
SIN = 419,
COS = 420,
TAN = 421,
ASIN = 422,
ACOS = 423,
ATAN = 424,
SINH = 425,
COSH = 426,
TANH = 427,
ASINH = 428,
ACOSH = 429,
ATANH = 430,
SQRT = 431,
DYNARE_SENSITIVITY = 432,
IDENTIFICATION = 433,
MORRIS = 434,
STAB = 435,
REDFORM = 436,
PPRIOR = 437,
PRIOR_RANGE = 438,
PPOST = 439,
ILPTAU = 440,
GLUE = 441,
MORRIS_NLIV = 442,
MORRIS_NTRA = 443,
NSAM = 444,
LOAD_REDFORM = 445,
LOAD_RMSE = 446,
LOAD_STAB = 447,
ALPHA2_STAB = 448,
KSSTAT = 449,
LOGTRANS_REDFORM = 450,
THRESHOLD_REDFORM = 451,
KSSTAT_REDFORM = 452,
ALPHA2_REDFORM = 453,
NAMENDO = 454,
NAMLAGENDO = 455,
NAMEXO = 456,
RMSE = 457,
LIK_ONLY = 458,
VAR_RMSE = 459,
PFILT_RMSE = 460,
ISTART_RMSE = 461,
ALPHA_RMSE = 462,
ALPHA2_RMSE = 463
LN = 418,
LOG10 = 419,
SIN = 420,
COS = 421,
TAN = 422,
ASIN = 423,
ACOS = 424,
ATAN = 425,
SINH = 426,
COSH = 427,
TANH = 428,
ASINH = 429,
ACOSH = 430,
ATANH = 431,
SQRT = 432,
DYNARE_SENSITIVITY = 433,
IDENTIFICATION = 434,
MORRIS = 435,
STAB = 436,
REDFORM = 437,
PPRIOR = 438,
PRIOR_RANGE = 439,
PPOST = 440,
ILPTAU = 441,
GLUE = 442,
MORRIS_NLIV = 443,
MORRIS_NTRA = 444,
NSAM = 445,
LOAD_REDFORM = 446,
LOAD_RMSE = 447,
LOAD_STAB = 448,
ALPHA2_STAB = 449,
KSSTAT = 450,
LOGTRANS_REDFORM = 451,
THRESHOLD_REDFORM = 452,
KSSTAT_REDFORM = 453,
ALPHA2_REDFORM = 454,
NAMENDO = 455,
NAMLAGENDO = 456,
NAMEXO = 457,
RMSE = 458,
LIK_ONLY = 459,
VAR_RMSE = 460,
PFILT_RMSE = 461,
ISTART_RMSE = 462,
ALPHA_RMSE = 463,
ALPHA2_RMSE = 464
};
};
......
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