Skip to content
Snippets Groups Projects
Commit f164292e authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

STYLE: adjust parser entry point

- avoid the name eval(), since this collides with the identical
  macro name if m4 is used sometime in the future
parent f2c4d7b8
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ Description ...@@ -40,7 +40,7 @@ Description
#pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-compare"
} } // End of %include
%namespace {} %namespace {}
...@@ -51,17 +51,17 @@ Description ...@@ -51,17 +51,17 @@ Description
%token_prefix TOK_ %token_prefix TOK_
%token_type { Foam::scalar } %token_type {Foam::scalar}
%type exp {Foam::scalar}
%left PLUS MINUS. %left PLUS MINUS.
%left TIMES DIVIDE. %left TIMES DIVIDE.
%left NEGATE. %left NEGATE.
eval(lhs) ::= exp(a). evaluate ::= exp(a).
{ {
lhs = a; driver->setValue(a);
driver->setValue(lhs);
} }
exp(lhs) ::= NUMBER(a). exp(lhs) ::= NUMBER(a).
...@@ -69,7 +69,7 @@ exp(lhs) ::= NUMBER(a). ...@@ -69,7 +69,7 @@ exp(lhs) ::= NUMBER(a).
lhs = a; lhs = a;
} }
exp(lhs) ::= MINUS exp(a). exp(lhs) ::= MINUS exp(a). // Could add [NEGATE] precedence
{ {
lhs = -a; lhs = -a;
} }
...@@ -299,7 +299,7 @@ void Foam::parsing::evalStringToScalar::parser::parse ...@@ -299,7 +299,7 @@ void Foam::parsing::evalStringToScalar::parser::parse
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // Code } // End of %code
// ************************************************************************* // // ************************************************************************* //
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment