diff --git a/META-INFO/api-info b/META-INFO/api-info index 51dc839429..a3a8b0b719 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ -api=1909 -patch=191001 +api=1910 +patch=191111 diff --git a/applications/test/dictionary/testDictEval3 b/applications/test/dictionary/testDictEval3 new file mode 100644 index 0000000000..73130ee21e --- /dev/null +++ b/applications/test/dictionary/testDictEval3 @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: Any | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDictEval1; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +expr1 "hypot(3,4)"; + +expr2 hypot(6,8); + +eval1 #eval +#{ + ( + ${FOAM_API} >= 1812 && !${FOAM_API} > 2100 + ? $expr1 + : $expr2 + ) +#}; + +eval2 #eval +#{ + (false ? pi() * 2 * $expr1 : pi() * 2 * $expr2) +#}; + + +eval3 #eval +#{ + (bool(0.1) ? 10 : 0) +#}; + + +eval4 #eval +#{ + 2 * mag(true) * pi() +#}; + + +eval4b #eval +#{ + 2 * mag(!false) * pi() +#}; + + +eval5 #eval +#{ + 2 * mag(${FOAM_API} >= 1909) * pi() +#}; + + +// Can use round or floor for this: +apiYear #eval{ round($FOAM_API / 100) }; + +// Should not need round or floor: +apiMonth #eval{ ($FOAM_API % 100) }; + + +// Could flag as an input error or treat as zero +empty #eval ""; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 400a2dcdbc..39da0df0b0 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -136,7 +136,7 @@ $(strings)/parsing/genericRagelLemonDriver.C $(strings)/stringOps/stringOps.C $(strings)/stringOps/stringOpsSort.C $(strings)/stringOps/toScalar/evalStringToScalarDriver.C -$(strings)/stringOps/toScalar/evalStringToScalarLemonParser.lyy +$(strings)/stringOps/toScalar/evalStringToScalarLemonParser.lyy-m4 $(strings)/stringOps/toScalar/evalStringToScalarScanner.cc ops = primitives/ops diff --git a/src/OpenFOAM/db/dictionary/functionEntries/evalEntry/evalEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/evalEntry/evalEntry.C index 10a84ad422..0c19433a59 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/evalEntry/evalEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/evalEntry/evalEntry.C @@ -66,8 +66,8 @@ Foam::scalar Foam::functionEntries::evalEntry::evaluate { #ifdef FULLDEBUG DetailInfo - << "Using #eval at line " << is.lineNumber() - << " in file " << parentDict.name() << nl; + << "Using #eval - line " + << is.lineNumber() << " in file " << parentDict.name() << nl; #endif // String to evaluate @@ -109,12 +109,31 @@ Foam::scalar Foam::functionEntries::evalEntry::evaluate stringOps::inplaceRemoveComments(s); stringOps::inplaceExpand(s, parentDict, true, true); + stringOps::inplaceTrim(s); + + // A common input error, so catch it now + if (std::string::npos != s.find(';')) + { + FatalIOErrorInFunction(is) + << "Invalid input for #eval" << nl + << s << endl + << exit(FatalIOError); + } #ifdef FULLDEBUG DetailInfo << "expanded: " << s << endl; #endif + if (s.empty()) + { + InfoErr + << "Empty #eval (treat as 0) - line " + << is.lineNumber() << " in file " << parentDict.name() << nl; + + return scalar(0); + } + return stringOps::toScalar(s); } diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode b/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode index 979fcd398d..4c6bf1cb15 100755 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode @@ -7,7 +7,7 @@ prefix=evalStringToScalar "${WM_PROJECT_DIR:?}/wmake/scripts/makeParser" \ -prefix="$prefix" \ -scanner=Scanner.rl \ - -parser=LemonParser.lyy \ + -parser=LemonParser.lyy-m4 \ "$@" #------------------------------------------------------------------------------ diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalar.H b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalar.H index 5d7873df0f..bd7fbc563d 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalar.H +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalar.H @@ -47,16 +47,22 @@ namespace stringOps //- expressions. For trivial input, use readScalar instead (faster). // // The evaluation supports the following: - // - operations: - + * / + // - operations: - + * / % // - functions: exp, log, log10, pow, sqrt, cbrt, sqr, mag, magSqr // - trigonometric: sin, cos, tan, asin, acos, atan, atan2, hypot // - hyperbolic: sinh, cosh, tanh // - conversions: degToRad, radToDeg - // - constants: pi() - // - misc: floor, ceil, round, rand, rand(seed) + // - constants: pi(), true, false + // - misc: floor, ceil, round, rand, rand(seed), bool() + // - logic: ! ? : == != <= => < > // - // \note The rand() function returns a uniform scalar on [0-1] interval - // and uses a constant seed + // \note + // Unlike C/C++, the ternary and logical operations are \b not + // short-circuiting. So additional guards may be required. + // + // \note + // The rand() function returns a uniform scalar on [0-1] interval + // and uses a constant seed. scalar toScalar ( const std::string& s, diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarDriver.C b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarDriver.C index 4fc7c14ed6..2e079a85bd 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarDriver.C +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarDriver.C @@ -30,6 +30,28 @@ License #include "evalStringToScalarScanner.H" #include "error.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace parsing +{ + +int evalStringToScalar::debug +( + ::Foam::debug::debugSwitch("stringToScalar", 0) +); +registerDebugSwitchWithName +( + evalStringToScalar, + evalStringToScalar, + "stringToScalar" +); + +} // End namespace parsing +} // End namespace Foam + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::parsing::evalStringToScalar::parseDriver::parseDriver() @@ -65,12 +87,11 @@ Foam::scalar Foam::stringOps::toScalar size_t len ) { - Foam::parsing::evalStringToScalar::parseDriver driver; + parsing::evalStringToScalar::parseDriver driver; - scalar val = driver.execute(s, pos, len); - // val = driver.value(); + driver.execute(s, pos, len); - return val; + return driver.value(); } diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarDriver.H b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarDriver.H index f8c6794d16..e9dfadfc55 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarDriver.H +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarDriver.H @@ -50,6 +50,12 @@ namespace parsing namespace evalStringToScalar { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +//- The debug flag. 2 = debug parser, 4 = debug scanner +extern int debug; + + /*---------------------------------------------------------------------------*\ Class parseDriver Declaration \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.h b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.h index e4bb0f674a..8b01964b14 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.h +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.h @@ -1,38 +1,53 @@ -#define TOK_PLUS 1 -#define TOK_MINUS 2 -#define TOK_TIMES 3 -#define TOK_DIVIDE 4 -#define TOK_NEGATE 5 -#define TOK_NUMBER 6 -#define TOK_LPAREN 7 -#define TOK_RPAREN 8 -#define TOK_PI 9 -#define TOK_DEG_TO_RAD 10 -#define TOK_RAD_TO_DEG 11 -#define TOK_EXP 12 -#define TOK_LOG 13 -#define TOK_LOG10 14 -#define TOK_POW 15 -#define TOK_COMMA 16 -#define TOK_SQR 17 -#define TOK_SQRT 18 -#define TOK_CBRT 19 -#define TOK_SIN 20 -#define TOK_COS 21 -#define TOK_TAN 22 -#define TOK_ASIN 23 -#define TOK_ACOS 24 -#define TOK_ATAN 25 -#define TOK_ATAN2 26 -#define TOK_HYPOT 27 -#define TOK_SINH 28 -#define TOK_COSH 29 -#define TOK_TANH 30 -#define TOK_MIN 31 -#define TOK_MAX 32 -#define TOK_MAG 33 -#define TOK_MAGSQR 34 -#define TOK_FLOOR 35 -#define TOK_CEIL 36 -#define TOK_ROUND 37 -#define TOK_RAND 38 +#define TOK_QUESTION 1 +#define TOK_COLON 2 +#define TOK_LOR 3 +#define TOK_LAND 4 +#define TOK_EQUAL 5 +#define TOK_NOT_EQUAL 6 +#define TOK_LESS_EQ 7 +#define TOK_GREATER_EQ 8 +#define TOK_LESS 9 +#define TOK_GREATER 10 +#define TOK_PLUS 11 +#define TOK_MINUS 12 +#define TOK_TIMES 13 +#define TOK_DIVIDE 14 +#define TOK_PERCENT 15 +#define TOK_NEGATE 16 +#define TOK_NOT 17 +#define TOK_NUMBER 18 +#define TOK_LPAREN 19 +#define TOK_RPAREN 20 +#define TOK_MAG 21 +#define TOK_PI 22 +#define TOK_DEG_TO_RAD 23 +#define TOK_RAD_TO_DEG 24 +#define TOK_EXP 25 +#define TOK_LOG 26 +#define TOK_LOG10 27 +#define TOK_SQR 28 +#define TOK_SQRT 29 +#define TOK_CBRT 30 +#define TOK_SIN 31 +#define TOK_COS 32 +#define TOK_TAN 33 +#define TOK_ASIN 34 +#define TOK_ACOS 35 +#define TOK_ATAN 36 +#define TOK_SINH 37 +#define TOK_COSH 38 +#define TOK_TANH 39 +#define TOK_MAGSQR 40 +#define TOK_FLOOR 41 +#define TOK_CEIL 42 +#define TOK_ROUND 43 +#define TOK_POW 44 +#define TOK_COMMA 45 +#define TOK_ATAN2 46 +#define TOK_HYPOT 47 +#define TOK_MIN 48 +#define TOK_MAX 49 +#define TOK_RAND 50 +#define TOK_BOOL_FALSE 51 +#define TOK_BOOL_TRUE 52 +#define TOK_BOOL 53 diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.lyy b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.lyy deleted file mode 100644 index c5d05436a7..0000000000 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.lyy +++ /dev/null @@ -1,299 +0,0 @@ -%include { -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Description - Lemon grammar of a simple string to scalar evaluation. - - The generated parser is localized in an anonymous namespace. - Interface code wrapping is near the bottom of the file. - -\*---------------------------------------------------------------------------*/ - -#include "evalStringToScalarDriver.H" -#include "evalStringToScalarParser.H" -#include "unitConversion.H" -#include "Random.H" -#include "error.H" - -#pragma GCC diagnostic ignored "-Wold-style-cast" -#pragma GCC diagnostic ignored "-Wunused-function" -#pragma GCC diagnostic ignored "-Wunused-variable" -#pragma GCC diagnostic ignored "-Wsign-compare" -} // End of %include - -%namespace {} - -// Use extra argument for the return value -%extra_context { Foam::parsing::evalStringToScalar::parseDriver* driver } -%parse_failure { driver->reportFatal("Parse failure, giving up..."); } -%syntax_error { driver->reportFatal("Syntax error"); } - -%token_prefix TOK_ - -// Terminals -%token_type {Foam::scalar} -// Non-terminals -%type exp {Foam::scalar} - -%left PLUS MINUS. -%left TIMES DIVIDE. -%left NEGATE. - -%start_symbol evaluate - -evaluate ::= exp(a). -{ - driver->setValue(a); -} - -exp(lhs) ::= NUMBER(a). { lhs = a; } -exp(lhs) ::= MINUS exp(a). [NEGATE] { lhs = -a; } - -// Operations - -exp(lhs) ::= exp(a) PLUS exp(b). { lhs = a + b; } -exp(lhs) ::= exp(a) MINUS exp(b). { lhs = a - b; } -exp(lhs) ::= exp(a) TIMES exp(b). { lhs = a * b; } -exp(lhs) ::= exp(a) DIVIDE exp(b). { lhs = a / b; } -exp(lhs) ::= LPAREN exp(a) RPAREN. { lhs = a; } - - -// Constants - -exp(lhs) ::= PI LPAREN RPAREN. { lhs = Foam::constant::mathematical::pi; } -exp(lhs) ::= DEG_TO_RAD LPAREN RPAREN. { lhs = Foam::degToRad(); } -exp(lhs) ::= RAD_TO_DEG LPAREN RPAREN. { lhs = Foam::radToDeg(); } - - -// Functions - -exp(lhs) ::= DEG_TO_RAD LPAREN exp(a) RPAREN. -{ - lhs = Foam::degToRad(a); -} - -exp(lhs) ::= RAD_TO_DEG LPAREN exp(a) RPAREN. -{ - lhs = Foam::radToDeg(a); -} - -exp(lhs) ::= EXP LPAREN exp(a) RPAREN. -{ - lhs = Foam::exp(a); -} - -exp(lhs) ::= LOG LPAREN exp(a) RPAREN. -{ - lhs = Foam::log(a); -} - -exp(lhs) ::= LOG10 LPAREN exp(a) RPAREN. -{ - lhs = Foam::log10(a); -} - -exp(lhs) ::= POW LPAREN exp(a) COMMA exp(b) RPAREN. -{ - lhs = Foam::pow(a, b); -} - -exp(lhs) ::= SQR LPAREN exp(a) RPAREN. -{ - lhs = Foam::sqr(a); -} - -exp(lhs) ::= SQRT LPAREN exp(a) RPAREN. -{ - lhs = Foam::sqrt(a); -} - -exp(lhs) ::= CBRT LPAREN exp(a) RPAREN. -{ - lhs = Foam::cbrt(a); -} - -exp(lhs) ::= SIN LPAREN exp(a) RPAREN. -{ - lhs = Foam::sin(a); -} - -exp(lhs) ::= COS LPAREN exp(a) RPAREN. -{ - lhs = Foam::cos(a); -} - -exp(lhs) ::= TAN LPAREN exp(a) RPAREN. -{ - lhs = Foam::tan(a); -} - -exp(lhs) ::= ASIN LPAREN exp(a) RPAREN. -{ - lhs = Foam::asin(a); -} - -exp(lhs) ::= ACOS LPAREN exp(a) RPAREN. -{ - lhs = Foam::acos(a); -} - -exp(lhs) ::= ATAN LPAREN exp(a) RPAREN. -{ - lhs = Foam::atan(a); -} - -exp(lhs) ::= ATAN2 LPAREN exp(a) COMMA exp(b) RPAREN. -{ - lhs = Foam::atan2(a, b); -} - -exp(lhs) ::= HYPOT LPAREN exp(a) COMMA exp(b) RPAREN. -{ - lhs = Foam::hypot(a, b); -} - -exp(lhs) ::= SINH LPAREN exp(a) RPAREN. -{ - lhs = Foam::sinh(a); -} - -exp(lhs) ::= COSH LPAREN exp(a) RPAREN. -{ - lhs = Foam::cosh(a); -} - -exp(lhs) ::= TANH LPAREN exp(a) RPAREN. -{ - lhs = Foam::tanh(a); -} - -exp(lhs) ::= MIN LPAREN exp(a) COMMA exp(b) RPAREN. -{ - lhs = Foam::min(a, b); -} - -exp(lhs) ::= MAX LPAREN exp(a) COMMA exp(b) RPAREN. -{ - lhs = Foam::max(a, b); -} - -exp(lhs) ::= MAG LPAREN exp(a) RPAREN. -{ - lhs = Foam::mag(a); -} - -exp(lhs) ::= MAGSQR LPAREN exp(a) RPAREN. -{ - lhs = Foam::magSqr(a); -} - -exp(lhs) ::= FLOOR LPAREN exp(a) RPAREN. -{ - lhs = std::floor(a); -} - -exp(lhs) ::= CEIL LPAREN exp(a) RPAREN. -{ - lhs = std::ceil(a); -} - -exp(lhs) ::= ROUND LPAREN exp(a) RPAREN. -{ - lhs = std::round(a); -} - -exp(lhs) ::= RAND LPAREN RPAREN. -{ - lhs = Foam::Random().sample01(); -} - -exp(lhs) ::= RAND LPAREN exp(seed) RPAREN. -{ - lhs = Foam::Random(seed).sample01(); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -%code -{ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::parsing::evalStringToScalar::parser::stop() -{ - if (lemon_) - { - ParseFree(lemon_, ::operator delete); - lemon_ = nullptr; - } -} - - -void Foam::parsing::evalStringToScalar::parser::start(parseDriver& driver) -{ - this->stop(); - lemon_ = ParseAlloc(::operator new, &driver); -} - - -void Foam::parsing::evalStringToScalar::parser::parse -( - int tokenId, - Foam::scalar val /* The value for the token */ -) -{ - Parse(lemon_, tokenId, val); -} - - -Foam::word Foam::parsing::evalStringToScalar::parser::nameOfToken -( - int tokenId -) const -{ - #ifndef NDEBUG - if - ( - tokenId > 0 - && unsigned(tokenId) < (sizeof(yyTokenName) / sizeof(char*)) - ) - { - return yyTokenName[tokenId]; - } - return ""; - #else - return word(); - #endif -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End of %code - - -// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.lyy-m4 b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.lyy-m4 new file mode 100644 index 0000000000..61dc201f57 --- /dev/null +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarLemonParser.lyy-m4 @@ -0,0 +1,399 @@ +%include +{ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2019 OpenCFD Ltd. +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Description + Lemon grammar of a simple string to scalar evaluation. + + The generated parser is localized in an anonymous namespace. + Interface code wrapping is near the bottom of the file. + +\*---------------------------------------------------------------------------*/ +} + +/*---------------------------------------------------------------------------*\ +dnl Begin m4 definitions +dnl +undefine(`substr')dnl> Avoid collision with C++ string substr() method +dnl +dnl +dnl --------------------------------------------------------------------------- +dnl rule_binary_op(out, in1, in2, tok, op) +dnl Production rule for binary field operations +dnl +dnl Example: +dnl rule_binary_op(sfield, sfield, sfield, PLUS, +) +dnl +dnl sfield (lhs) ::= sfield (a) PLUS sfield (b) . +dnl { +dnl lhs = (a) + (b); +dnl } +dnl +dnl --------------------------------------------------------------------------- +define(`rule_binary_op', +`$1 (lhs) ::= $2 (a) $4 $3 (b) . +{ + lhs = (a) $5 (b); +}' +)dnl> +dnl +dnl --------------------------------------------------------------------------- +dnl rule_binary_logical_op(type, valType, compare, tok, op) +dnl Production rule for binary logical field operations +dnl Operates on identical field types, producing an lfield. +dnl +dnl Example: +dnl rule_binary_logical_op(vfield, Foam::vector, greaterOp, GREATER, >) +dnl +dnl lfield (lhs) ::= vfield (a) GREATER vfield (b) . +dnl { +dnl lhs = Foam::greaterOp()(a, b); +dnl } +dnl --------------------------------------------------------------------------- +define(`rule_binary_logical_op', +`lfield (lhs) ::= $1 (a) $4 $1 (b) . +{ + lhs = Foam::$3<$2>()(a, b); +}' +)dnl> +dnl +dnl --------------------------------------------------------------------------- +dnl rule_ternary_op(inOut) +dnl Production rule for ternary field operations +dnl +dnl Example: +dnl rule_ternary_op(sfield) +dnl +dnl sfield (lhs) ::= lfield(cond) QUESTION sfield (a) COLON sfield (b) . +dnl { +dnl lhs = (cond ? a : b); +dnl } +dnl +define(`rule_ternary_op', +`$1 (lhs) ::= lfield(cond) QUESTION $1 (a) COLON $1 (b) . +{ + lhs = (cond ? a : b); +}' +)dnl> +dnl +dnl --------------------------------------------------------------------------- +dnl rule_unary_func(out, in1, tok, func) +dnl Production rule for unary functions: +dnl +dnl Example: +dnl rule_unary_func(sfield, vfield, MAG, Foam::mag) +dnl +dnl sfield (lhs) ::= MAG LPAREN vfield (a) RPAREN . +dnl { +dnl lhs = Foam::mag(a); +dnl } +dnl +define(`rule_unary_func', +`$1 (lhs) ::= $3 LPAREN $2 (a) RPAREN . +{ + lhs = $4 (a); +}' +)dnl> +dnl +dnl --------------------------------------------------------------------------- +dnl rule_binary_func(out, in1, in2, tok, func) +dnl Production rule for binary functions: +dnl +dnl Example: +dnl rule_binary_func(sfield, sfield, sfield, POW, Foam::pow) +dnl +dnl sfield (lhs) ::= POW LPAREN sfield (a) COMMA sfield (b) RPAREN . +dnl { +dnl lhs = Foam::pow((a), (b)); +dnl } +dnl +define(`rule_binary_func', +`$1 (lhs) ::= $4 LPAREN $2 (a) COMMA $3 (b) RPAREN . +{ + lhs = $5((a), (b)); +}' +)dnl> +dnl +dnl End m4 definitions +\*---------------------------------------------------------------------------*/ + +%include +{ +#include "evalStringToScalarDriver.H" +#include "evalStringToScalarParser.H" +#include "unitConversion.H" +#include "Random.H" +#include "Switch.H" +#include "error.H" + +#pragma GCC diagnostic ignored "-Wold-style-cast" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wsign-compare" + +// Enable ParseTrace +#undef NDEBUG + +// Local Functions + +//- Test for value close to zero +template +bool equalZero(const T& val) +{ + return (Foam::mag(val) < Foam::ROOTVSMALL); +} + + +} // %include + +// ------------------------------------------------------------------------- // + +%namespace {} + +// Use extra argument for the return value +%extra_context { Foam::parsing::evalStringToScalar::parseDriver* driver } +%parse_failure { driver->reportFatal("Parse failure, giving up..."); } +%syntax_error { driver->reportFatal("Syntax error"); } + +%token_prefix TOK_ + +// Terminals +%token_type {Foam::scalar} +// Non-terminals +%type lfield {bool} +%type sfield {Foam::scalar} + + +// (https://en.cppreference.com/w/cpp/language/operator_precedence) + +%right QUESTION COLON . // 16: right-to-left +%left LOR . // 15: +%left LAND . // 14: +// %left BIT_OR . // 13 +// %left BIT_XOR . // 12 +// %left BIT_AND . // 11 +%left EQUAL NOT_EQUAL . // 10 +%left LESS_EQ GREATER_EQ LESS GREATER . // 9 +%left PLUS MINUS . // 6 +%left TIMES DIVIDE PERCENT . // 5 +%right NEGATE NOT . // 3: right-to-left + +%start_symbol evaluate + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +/*---------------------------------------------------------------------------*\ + * Productions (Foam::scalar) +\*---------------------------------------------------------------------------*/ + +evaluate ::= sfield(a). +{ + driver->setValue(a); +} + + +// Basics + +sfield(lhs) ::= NUMBER(a). { lhs = a; } // From scanToken +sfield(lhs) ::= LPAREN sfield(a) RPAREN. { lhs = a; } +sfield(lhs) ::= MINUS sfield(a). [NEGATE] { lhs = -a; } + +// Conversion (cast) +sfield(lhs) ::= MAG LPAREN lfield(a) RPAREN . { lhs = Foam::scalar(a); } + +// Constants + +sfield(lhs) ::= PI LPAREN RPAREN. { lhs = Foam::constant::mathematical::pi; } +sfield(lhs) ::= DEG_TO_RAD LPAREN RPAREN. { lhs = Foam::degToRad(); } +sfield(lhs) ::= RAD_TO_DEG LPAREN RPAREN. { lhs = Foam::radToDeg(); } + +// Operations + +rule_ternary_op(sfield) + +rule_binary_op(sfield, sfield, sfield, PLUS, +) +rule_binary_op(sfield, sfield, sfield, MINUS, -) +rule_binary_op(sfield, sfield, sfield, TIMES, *) + +sfield(lhs) ::= sfield(a) DIVIDE sfield(b). +{ + lhs = equalZero(b) ? Foam::scalar(0) : (a / b); +} +sfield(lhs) ::= sfield(a) PERCENT sfield(b). +{ + lhs = equalZero(b) ? Foam::scalar(0) : std::fmod(a, b); +} + +// Functions + +rule_unary_func(sfield, sfield, DEG_TO_RAD, Foam::degToRad) +rule_unary_func(sfield, sfield, RAD_TO_DEG, Foam::radToDeg) + +rule_unary_func(sfield, sfield, EXP, Foam::exp) +rule_unary_func(sfield, sfield, LOG, Foam::log) +rule_unary_func(sfield, sfield, LOG10, Foam::log10) +rule_unary_func(sfield, sfield, SQR, Foam::sqr) +rule_unary_func(sfield, sfield, SQRT, Foam::sqrt) +rule_unary_func(sfield, sfield, CBRT, Foam::cbrt) +rule_unary_func(sfield, sfield, SIN, Foam::sin) +rule_unary_func(sfield, sfield, COS, Foam::cos) +rule_unary_func(sfield, sfield, TAN, Foam::tan) +rule_unary_func(sfield, sfield, ASIN, Foam::asin) +rule_unary_func(sfield, sfield, ACOS, Foam::acos) +rule_unary_func(sfield, sfield, ATAN, Foam::atan) +rule_unary_func(sfield, sfield, SINH, Foam::sinh) +rule_unary_func(sfield, sfield, COSH, Foam::cosh) +rule_unary_func(sfield, sfield, TANH, Foam::tanh) +rule_unary_func(sfield, sfield, MAG, Foam::mag) +rule_unary_func(sfield, sfield, MAGSQR, Foam::magSqr) +rule_unary_func(sfield, sfield, FLOOR, std::floor) +rule_unary_func(sfield, sfield, CEIL, std::ceil) +rule_unary_func(sfield, sfield, ROUND, std::round) + +rule_binary_func(sfield, sfield, sfield, POW, Foam::pow) +rule_binary_func(sfield, sfield, sfield, ATAN2, Foam::atan2) +rule_binary_func(sfield, sfield, sfield, HYPOT, Foam::hypot) +rule_binary_func(sfield, sfield, sfield, MIN, Foam::min) +rule_binary_func(sfield, sfield, sfield, MAX, Foam::max) + +sfield(lhs) ::= RAND LPAREN RPAREN. +{ + lhs = Foam::Random().sample01(); +} + +sfield(lhs) ::= RAND LPAREN sfield(seed) RPAREN. +{ + lhs = Foam::Random(seed).sample01(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Productions for bool (logical) fields + +evaluate ::= lfield(a). +{ + driver->setValue(Foam::scalar(a)); +} + +// Basics + +lfield(lhs) ::= BOOL_FALSE . { lhs = false; } +lfield(lhs) ::= BOOL_TRUE . { lhs = true; } +lfield(lhs) ::= LPAREN lfield(a) RPAREN . { lhs = a; } +lfield(lhs) ::= NOT lfield(a). [NEGATE] { lhs = !a; } + +// Conversion (cast) +lfield(lhs) ::= BOOL LPAREN lfield(a) RPAREN . { lhs = a; } +lfield(lhs) ::= BOOL LPAREN sfield(a) RPAREN . { lhs = Foam::Switch(a); } + +// Operations + +rule_ternary_op(lfield) + +rule_binary_logical_op(lfield, bool, andOp, LAND, &&) +rule_binary_logical_op(lfield, bool, orOp, LOR, ||) + +rule_binary_logical_op(sfield, Foam::scalar, equalOp, EQUAL, ==) +rule_binary_logical_op(sfield, Foam::scalar, notEqualOp, NOT_EQUAL, !=) +rule_binary_logical_op(sfield, Foam::scalar, lessOp, LESS, <) +rule_binary_logical_op(sfield, Foam::scalar, lessEqOp, LESS_EQ, <=) +rule_binary_logical_op(sfield, Foam::scalar, greaterOp, GREATER, >) +rule_binary_logical_op(sfield, Foam::scalar, greaterEqOp, GREATER_EQ, >=) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +%code +{ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::parsing::evalStringToScalar::parser::stop() +{ + if (lemon_) + { + ParseFree(lemon_, ::operator delete); + #ifndef NDEBUG + ParseTrace(nullptr, nullptr); + #endif + lemon_ = nullptr; + } +} + + +void Foam::parsing::evalStringToScalar::parser::start(parseDriver& driver) +{ + this->stop(); + lemon_ = ParseAlloc(::operator new, &driver); + + if (debug & 2) + { + #ifndef NDEBUG + ParseTrace(stderr, const_cast(prompt_)); + #endif + } +} + + +void Foam::parsing::evalStringToScalar::parser::parse +( + int tokenId, + Foam::scalar val /* The value for the token */ +) +{ + Parse(lemon_, tokenId, val); +} + + +Foam::word Foam::parsing::evalStringToScalar::parser::nameOfToken +( + int tokenId +) const +{ + #ifndef NDEBUG + if + ( + tokenId > 0 + && unsigned(tokenId) < (sizeof(yyTokenName) / sizeof(char*)) + ) + { + return yyTokenName[tokenId]; + } + return ""; + #else + return word(); + #endif +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End of %code + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarParser.H b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarParser.H index ebaad788e9..44f16c996b 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarParser.H +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarParser.H @@ -54,9 +54,13 @@ class parser { // Private Data + //- Prompt for parser tracing + static constexpr const char* const prompt_ = "#eval:"; + //- The lemon parser (demand-driven) void* lemon_; + public: // Constructors diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.H b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.H index 36badad3ed..aa2847a37d 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.H +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.H @@ -67,10 +67,6 @@ class scanner public: - //- Debug/tracing of scan - static int debug; - - // Constructors //- Construct null diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.cc b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.cc index 333347f376..aa7e16fa59 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.cc +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.cc @@ -42,11 +42,6 @@ Description #pragma GCC diagnostic ignored "-Wold-style-cast" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -int Foam::parsing::evalStringToScalar::scanner::debug = 0; - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Ragel lexer with lemon parser integration @@ -57,27 +52,32 @@ int Foam::parsing::evalStringToScalar::scanner::debug = 0; // Can use 'variable p xxx;' etc to change these names -#line 61 "evalStringToScalarScanner.cc" -static const int evalScanner_start = 4; -static const int evalScanner_first_final = 4; +#line 56 "evalStringToScalarScanner.cc" +static const int evalScanner_start = 7; +static const int evalScanner_first_final = 7; static const int evalScanner_error = 0; -static const int evalScanner_en_main = 4; +static const int evalScanner_en_main = 7; -#line 60 "evalStringToScalarScanner.rl" +#line 55 "evalStringToScalarScanner.rl" + + + +#undef DebugScannerInfo +#define DebugScannerInfo if (debug & 4) InfoErr #define TOKEN_OF(T) TOK_##T #define EMIT_TOKEN(T) \ driver.parsePosition() = (ts-buf); \ - DebugInfo<< STRINGIFY(T) << ": " << driver.parsePosition() << nl; \ + DebugScannerInfo << STRINGIFY(T) << ": "<< driver.parsePosition() << nl; \ parser_->parse(TOKEN_OF(T), 0); \ driver.parsePosition() = (p-buf); -#line 160 "evalStringToScalarScanner.rl" +#line 181 "evalStringToScalarScanner.rl" @@ -151,7 +151,7 @@ bool Foam::parsing::evalStringToScalar::scanner::process act = 0; } -#line 224 "evalStringToScalarScanner.rl" +#line 245 "evalStringToScalarScanner.rl" /* ^^^ FSM initialization here ^^^ */; @@ -161,12 +161,16 @@ bool Foam::parsing::evalStringToScalar::scanner::process goto _test_eof; switch ( cs ) { -tr2: +tr0: +#line 134 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(LAND); }} + goto st7; +tr3: #line 73 "evalStringToScalarScanner.rl" {{p = ((te))-1;}{ driver.parsePosition() = (ts-buf); - DebugInfo + DebugScannerInfo << "Number:" << std::string(ts, te-ts).c_str() << " at " << driver.parsePosition() << nl; @@ -185,45 +189,73 @@ tr2: driver.parsePosition() = (p-buf); }} - goto st4; + goto st7; tr6: -#line 116 "evalStringToScalarScanner.rl" - {te = p+1;{ EMIT_TOKEN(LPAREN); }} - goto st4; +#line 132 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(EQUAL); }} + goto st7; tr7: +#line 135 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(LOR); }} + goto st7; +tr10: #line 117 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(PERCENT); }} + goto st7; +tr12: +#line 118 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(LPAREN); }} + goto st7; +tr13: +#line 119 "evalStringToScalarScanner.rl" {te = p+1;{ EMIT_TOKEN(RPAREN); }} - goto st4; -tr8: + goto st7; +tr14: #line 120 "evalStringToScalarScanner.rl" {te = p+1;{ EMIT_TOKEN(TIMES); }} - goto st4; -tr9: -#line 118 "evalStringToScalarScanner.rl" - {te = p+1;{ EMIT_TOKEN(PLUS); }} - goto st4; -tr10: -#line 122 "evalStringToScalarScanner.rl" - {te = p+1;{ EMIT_TOKEN(COMMA); }} - goto st4; -tr11: -#line 119 "evalStringToScalarScanner.rl" - {te = p+1;{ EMIT_TOKEN(MINUS); }} - goto st4; -tr13: + goto st7; +tr15: #line 121 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(PLUS); }} + goto st7; +tr16: +#line 123 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(COMMA); }} + goto st7; +tr17: +#line 122 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(MINUS); }} + goto st7; +tr19: +#line 124 "evalStringToScalarScanner.rl" {te = p+1;{ EMIT_TOKEN(DIVIDE); }} - goto st4; -tr28: + goto st7; +tr21: +#line 127 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(COLON); }} + goto st7; +tr25: +#line 126 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(QUESTION); }} + goto st7; +tr41: #line 111 "evalStringToScalarScanner.rl" {te = p;p--;} - goto st4; -tr29: + goto st7; +tr42: +#line 116 "evalStringToScalarScanner.rl" + {te = p;p--;{ EMIT_TOKEN(NOT); }} + goto st7; +tr43: +#line 133 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(NOT_EQUAL); }} + goto st7; +tr44: #line 73 "evalStringToScalarScanner.rl" {te = p;p--;{ driver.parsePosition() = (ts-buf); - DebugInfo + DebugScannerInfo << "Number:" << std::string(ts, te-ts).c_str() << " at " << driver.parsePosition() << nl; @@ -242,8 +274,24 @@ tr29: driver.parsePosition() = (p-buf); }} - goto st4; -tr31: + goto st7; +tr46: +#line 128 "evalStringToScalarScanner.rl" + {te = p;p--;{ EMIT_TOKEN(LESS); }} + goto st7; +tr47: +#line 129 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(LESS_EQ); }} + goto st7; +tr48: +#line 130 "evalStringToScalarScanner.rl" + {te = p;p--;{ EMIT_TOKEN(GREATER); }} + goto st7; +tr49: +#line 131 "evalStringToScalarScanner.rl" + {te = p+1;{ EMIT_TOKEN(GREATER_EQ); }} + goto st7; +tr50: #line 96 "evalStringToScalarScanner.rl" {te = p;p--;{ driver.parsePosition() = (ts-buf); @@ -252,77 +300,86 @@ tr31: driver.reportFatal("Unknown function/type: " + ident); driver.parsePosition() = (p-buf); }} - goto st4; -tr33: + goto st7; +tr52: #line 1 "NONE" { switch( act ) { - case 10: + case 23: {{p = ((te))-1;} EMIT_TOKEN(PI); } break; - case 11: + case 24: {{p = ((te))-1;} EMIT_TOKEN(DEG_TO_RAD); } break; - case 12: + case 25: {{p = ((te))-1;} EMIT_TOKEN(RAD_TO_DEG); } break; - case 13: + case 26: {{p = ((te))-1;} EMIT_TOKEN(EXP); } break; - case 15: + case 28: {{p = ((te))-1;} EMIT_TOKEN(LOG10); } break; - case 16: + case 29: {{p = ((te))-1;} EMIT_TOKEN(POW); } break; - case 18: + case 31: {{p = ((te))-1;} EMIT_TOKEN(SQRT); } break; - case 19: + case 32: {{p = ((te))-1;} EMIT_TOKEN(CBRT); } break; - case 23: + case 36: {{p = ((te))-1;} EMIT_TOKEN(ASIN); } break; - case 24: + case 37: {{p = ((te))-1;} EMIT_TOKEN(ACOS); } break; - case 26: + case 39: {{p = ((te))-1;} EMIT_TOKEN(ATAN2); } break; - case 27: + case 40: {{p = ((te))-1;} EMIT_TOKEN(HYPOT); } break; - case 28: + case 41: {{p = ((te))-1;} EMIT_TOKEN(SINH); } break; - case 29: + case 42: {{p = ((te))-1;} EMIT_TOKEN(COSH); } break; - case 30: + case 43: {{p = ((te))-1;} EMIT_TOKEN(TANH); } break; - case 31: + case 44: {{p = ((te))-1;} EMIT_TOKEN(MIN); } break; - case 32: + case 45: {{p = ((te))-1;} EMIT_TOKEN(MAX); } break; - case 34: + case 47: {{p = ((te))-1;} EMIT_TOKEN(MAGSQR); } break; - case 35: + case 48: {{p = ((te))-1;} EMIT_TOKEN(FLOOR); } break; - case 36: + case 49: {{p = ((te))-1;} EMIT_TOKEN(CEIL); } break; - case 37: + case 50: {{p = ((te))-1;} EMIT_TOKEN(ROUND); } break; - case 38: - {{p = ((te))-1;} p--; EMIT_TOKEN(RAND); } + case 51: + {{p = ((te))-1;} EMIT_TOKEN(RAND); } break; - case 39: + case 52: + {{p = ((te))-1;} EMIT_TOKEN(BOOL); } + break; + case 53: + {{p = ((te))-1;} EMIT_TOKEN(BOOL_FALSE); } + break; + case 54: + {{p = ((te))-1;} EMIT_TOKEN(BOOL_TRUE); } + break; + case 55: {{p = ((te))-1;} driver.parsePosition() = (ts-buf); const word ident = word::validate(ts, te); @@ -333,1421 +390,1628 @@ tr33: break; } } - goto st4; -tr43: -#line 140 "evalStringToScalarScanner.rl" + goto st7; +tr62: +#line 156 "evalStringToScalarScanner.rl" {te = p;p--;{ EMIT_TOKEN(ATAN); }} - goto st4; -tr53: -#line 136 "evalStringToScalarScanner.rl" + goto st7; +tr75: +#line 152 "evalStringToScalarScanner.rl" {te = p;p--;{ EMIT_TOKEN(COS); }} - goto st4; -tr74: -#line 129 "evalStringToScalarScanner.rl" + goto st7; +tr100: +#line 145 "evalStringToScalarScanner.rl" {te = p;p--;{ EMIT_TOKEN(LOG); }} - goto st4; -tr81: -#line 148 "evalStringToScalarScanner.rl" + goto st7; +tr107: +#line 164 "evalStringToScalarScanner.rl" {te = p;p--;{ EMIT_TOKEN(MAG); }} - goto st4; -tr105: -#line 135 "evalStringToScalarScanner.rl" + goto st7; +tr131: +#line 151 "evalStringToScalarScanner.rl" {te = p;p--;{ EMIT_TOKEN(SIN); }} - goto st4; -tr108: -#line 132 "evalStringToScalarScanner.rl" + goto st7; +tr134: +#line 148 "evalStringToScalarScanner.rl" {te = p;p--;{ EMIT_TOKEN(SQR); }} - goto st4; -tr112: -#line 137 "evalStringToScalarScanner.rl" + goto st7; +tr139: +#line 153 "evalStringToScalarScanner.rl" {te = p;p--;{ EMIT_TOKEN(TAN); }} - goto st4; -st4: + goto st7; +st7: #line 1 "NONE" {ts = 0;} if ( ++p == pe ) - goto _test_eof4; -case 4: + goto _test_eof7; +case 7: #line 1 "NONE" {ts = p;} -#line 374 "evalStringToScalarScanner.cc" +#line 431 "evalStringToScalarScanner.cc" switch( (*p) ) { - case 32: goto st5; - case 40: goto tr6; - case 41: goto tr7; - case 42: goto tr8; - case 43: goto tr9; - case 44: goto tr10; - case 45: goto tr11; - case 46: goto st1; - case 47: goto tr13; - case 95: goto st9; - case 97: goto st11; - case 99: goto st19; - case 100: goto st26; - case 101: goto st33; - case 102: goto st35; - case 104: goto st39; - case 108: goto st43; - case 109: goto st47; - case 112: goto st53; - case 114: goto st55; - case 115: goto st66; - case 116: goto st71; + case 32: goto st8; + case 33: goto st9; + case 37: goto tr10; + case 38: goto st1; + case 40: goto tr12; + case 41: goto tr13; + case 42: goto tr14; + case 43: goto tr15; + case 44: goto tr16; + case 45: goto tr17; + case 46: goto st2; + case 47: goto tr19; + case 58: goto tr21; + case 60: goto st13; + case 61: goto st5; + case 62: goto st14; + case 63: goto tr25; + case 95: goto st15; + case 97: goto st17; + case 98: goto st25; + case 99: goto st28; + case 100: goto st35; + case 101: goto st42; + case 102: goto st44; + case 104: goto st51; + case 108: goto st55; + case 109: goto st59; + case 112: goto st65; + case 114: goto st67; + case 115: goto st78; + case 116: goto st83; + case 124: goto st6; } if ( (*p) < 48 ) { if ( 9 <= (*p) && (*p) <= 13 ) - goto st5; + goto st8; } else if ( (*p) > 57 ) { if ( (*p) > 90 ) { - if ( 98 <= (*p) && (*p) <= 122 ) - goto st9; + if ( 103 <= (*p) && (*p) <= 122 ) + goto st15; } else if ( (*p) >= 65 ) - goto st9; + goto st15; } else - goto tr14; + goto tr20; goto st0; st0: cs = 0; goto _out; -st5: - if ( ++p == pe ) - goto _test_eof5; -case 5: - if ( (*p) == 32 ) - goto st5; - if ( 9 <= (*p) && (*p) <= 13 ) - goto st5; - goto tr28; -st1: - if ( ++p == pe ) - goto _test_eof1; -case 1: - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr0; - goto st0; -tr0: -#line 1 "NONE" - {te = p+1;} - goto st6; -st6: - if ( ++p == pe ) - goto _test_eof6; -case 6: -#line 438 "evalStringToScalarScanner.cc" - switch( (*p) ) { - case 69: goto st2; - case 101: goto st2; - } - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr0; - goto tr29; -st2: - if ( ++p == pe ) - goto _test_eof2; -case 2: - switch( (*p) ) { - case 43: goto st3; - case 45: goto st3; - } - if ( 48 <= (*p) && (*p) <= 57 ) - goto st7; - goto tr2; -st3: - if ( ++p == pe ) - goto _test_eof3; -case 3: - if ( 48 <= (*p) && (*p) <= 57 ) - goto st7; - goto tr2; -st7: - if ( ++p == pe ) - goto _test_eof7; -case 7: - if ( 48 <= (*p) && (*p) <= 57 ) - goto st7; - goto tr29; -tr14: -#line 1 "NONE" - {te = p+1;} - goto st8; st8: if ( ++p == pe ) goto _test_eof8; case 8: -#line 479 "evalStringToScalarScanner.cc" - switch( (*p) ) { - case 46: goto tr0; - case 69: goto st2; - case 101: goto st2; - } - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr14; - goto tr29; + if ( (*p) == 32 ) + goto st8; + if ( 9 <= (*p) && (*p) <= 13 ) + goto st8; + goto tr41; st9: if ( ++p == pe ) goto _test_eof9; case 9: - if ( (*p) == 95 ) - goto tr32; - if ( (*p) < 65 ) { - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; - } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; - } else - goto tr32; - goto tr31; -tr32: + if ( (*p) == 61 ) + goto tr43; + goto tr42; +st1: + if ( ++p == pe ) + goto _test_eof1; +case 1: + if ( (*p) == 38 ) + goto tr0; + goto st0; +st2: + if ( ++p == pe ) + goto _test_eof2; +case 2: + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr2; + goto st0; +tr2: #line 1 "NONE" {te = p+1;} -#line 96 "evalStringToScalarScanner.rl" - {act = 39;} - goto st10; -tr38: -#line 1 "NONE" - {te = p+1;} -#line 139 "evalStringToScalarScanner.rl" - {act = 24;} - goto st10; -tr40: -#line 1 "NONE" - {te = p+1;} -#line 138 "evalStringToScalarScanner.rl" - {act = 23;} - goto st10; -tr44: -#line 1 "NONE" - {te = p+1;} -#line 141 "evalStringToScalarScanner.rl" - {act = 26;} - goto st10; -tr49: -#line 1 "NONE" - {te = p+1;} -#line 134 "evalStringToScalarScanner.rl" - {act = 19;} - goto st10; -tr51: -#line 1 "NONE" - {te = p+1;} -#line 151 "evalStringToScalarScanner.rl" - {act = 36;} - goto st10; -tr54: -#line 1 "NONE" - {te = p+1;} -#line 144 "evalStringToScalarScanner.rl" - {act = 29;} - goto st10; -tr61: -#line 1 "NONE" - {te = p+1;} -#line 126 "evalStringToScalarScanner.rl" - {act = 11;} - goto st10; -tr63: -#line 1 "NONE" - {te = p+1;} -#line 128 "evalStringToScalarScanner.rl" - {act = 13;} - goto st10; -tr67: -#line 1 "NONE" - {te = p+1;} -#line 150 "evalStringToScalarScanner.rl" - {act = 35;} - goto st10; -tr71: -#line 1 "NONE" - {te = p+1;} -#line 142 "evalStringToScalarScanner.rl" - {act = 27;} - goto st10; -tr76: -#line 1 "NONE" - {te = p+1;} -#line 130 "evalStringToScalarScanner.rl" - {act = 15;} - goto st10; -tr80: -#line 1 "NONE" - {te = p+1;} -#line 147 "evalStringToScalarScanner.rl" - {act = 32;} - goto st10; -tr84: -#line 1 "NONE" - {te = p+1;} -#line 149 "evalStringToScalarScanner.rl" - {act = 34;} - goto st10; -tr85: -#line 1 "NONE" - {te = p+1;} -#line 146 "evalStringToScalarScanner.rl" - {act = 31;} - goto st10; -tr86: -#line 1 "NONE" - {te = p+1;} -#line 125 "evalStringToScalarScanner.rl" - {act = 10;} - goto st10; -tr88: -#line 1 "NONE" - {te = p+1;} -#line 131 "evalStringToScalarScanner.rl" - {act = 16;} - goto st10; -tr97: -#line 1 "NONE" - {te = p+1;} -#line 127 "evalStringToScalarScanner.rl" - {act = 12;} - goto st10; -tr98: -#line 1 "NONE" - {te = p+1;} -#line 153 "evalStringToScalarScanner.rl" - {act = 38;} - goto st10; -tr101: -#line 1 "NONE" - {te = p+1;} -#line 152 "evalStringToScalarScanner.rl" - {act = 37;} - goto st10; -tr106: -#line 1 "NONE" - {te = p+1;} -#line 143 "evalStringToScalarScanner.rl" - {act = 28;} - goto st10; -tr109: -#line 1 "NONE" - {te = p+1;} -#line 133 "evalStringToScalarScanner.rl" - {act = 18;} - goto st10; -tr113: -#line 1 "NONE" - {te = p+1;} -#line 145 "evalStringToScalarScanner.rl" - {act = 30;} goto st10; st10: if ( ++p == pe ) goto _test_eof10; case 10: -#line 645 "evalStringToScalarScanner.cc" - if ( (*p) == 95 ) - goto tr32; - if ( (*p) < 65 ) { - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; - } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; - } else - goto tr32; - goto tr33; +#line 519 "evalStringToScalarScanner.cc" + switch( (*p) ) { + case 69: goto st3; + case 101: goto st3; + } + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr2; + goto tr44; +st3: + if ( ++p == pe ) + goto _test_eof3; +case 3: + switch( (*p) ) { + case 43: goto st4; + case 45: goto st4; + } + if ( 48 <= (*p) && (*p) <= 57 ) + goto st11; + goto tr3; +st4: + if ( ++p == pe ) + goto _test_eof4; +case 4: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st11; + goto tr3; st11: if ( ++p == pe ) goto _test_eof11; case 11: - switch( (*p) ) { - case 95: goto tr32; - case 99: goto st12; - case 115: goto st14; - case 116: goto st16; - } - if ( (*p) < 65 ) { - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; - } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; - } else - goto tr32; - goto tr31; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st11; + goto tr44; +tr20: +#line 1 "NONE" + {te = p+1;} + goto st12; st12: if ( ++p == pe ) goto _test_eof12; case 12: +#line 560 "evalStringToScalarScanner.cc" switch( (*p) ) { - case 95: goto tr32; - case 111: goto st13; + case 46: goto tr2; + case 69: goto st3; + case 101: goto st3; } - if ( (*p) < 65 ) { - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; - } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; - } else - goto tr32; - goto tr31; + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr20; + goto tr44; st13: if ( ++p == pe ) goto _test_eof13; case 13: - switch( (*p) ) { - case 95: goto tr32; - case 115: goto tr38; - } - if ( (*p) < 65 ) { - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; - } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; - } else - goto tr32; - goto tr31; + if ( (*p) == 61 ) + goto tr47; + goto tr46; +st5: + if ( ++p == pe ) + goto _test_eof5; +case 5: + if ( (*p) == 61 ) + goto tr6; + goto st0; st14: if ( ++p == pe ) goto _test_eof14; case 14: - switch( (*p) ) { - case 95: goto tr32; - case 105: goto st15; - } - if ( (*p) < 65 ) { - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; - } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; - } else - goto tr32; - goto tr31; + if ( (*p) == 61 ) + goto tr49; + goto tr48; st15: if ( ++p == pe ) goto _test_eof15; case 15: - switch( (*p) ) { - case 95: goto tr32; - case 110: goto tr40; - } + if ( (*p) == 95 ) + goto tr51; if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; +tr51: +#line 1 "NONE" + {te = p+1;} +#line 96 "evalStringToScalarScanner.rl" + {act = 55;} + goto st16; +tr57: +#line 1 "NONE" + {te = p+1;} +#line 155 "evalStringToScalarScanner.rl" + {act = 37;} + goto st16; +tr59: +#line 1 "NONE" + {te = p+1;} +#line 154 "evalStringToScalarScanner.rl" + {act = 36;} + goto st16; +tr63: +#line 1 "NONE" + {te = p+1;} +#line 157 "evalStringToScalarScanner.rl" + {act = 39;} + goto st16; +tr66: +#line 1 "NONE" + {te = p+1;} +#line 170 "evalStringToScalarScanner.rl" + {act = 52;} + goto st16; +tr71: +#line 1 "NONE" + {te = p+1;} +#line 150 "evalStringToScalarScanner.rl" + {act = 32;} + goto st16; +tr73: +#line 1 "NONE" + {te = p+1;} +#line 167 "evalStringToScalarScanner.rl" + {act = 49;} + goto st16; +tr76: +#line 1 "NONE" + {te = p+1;} +#line 160 "evalStringToScalarScanner.rl" + {act = 42;} + goto st16; +tr83: +#line 1 "NONE" + {te = p+1;} +#line 142 "evalStringToScalarScanner.rl" + {act = 24;} + goto st16; +tr85: +#line 1 "NONE" + {te = p+1;} +#line 144 "evalStringToScalarScanner.rl" + {act = 26;} + goto st16; +tr90: +#line 1 "NONE" + {te = p+1;} +#line 173 "evalStringToScalarScanner.rl" + {act = 53;} + goto st16; +tr93: +#line 1 "NONE" + {te = p+1;} +#line 166 "evalStringToScalarScanner.rl" + {act = 48;} + goto st16; +tr97: +#line 1 "NONE" + {te = p+1;} +#line 158 "evalStringToScalarScanner.rl" + {act = 40;} + goto st16; +tr102: +#line 1 "NONE" + {te = p+1;} +#line 146 "evalStringToScalarScanner.rl" + {act = 28;} + goto st16; +tr106: +#line 1 "NONE" + {te = p+1;} +#line 163 "evalStringToScalarScanner.rl" + {act = 45;} + goto st16; +tr110: +#line 1 "NONE" + {te = p+1;} +#line 165 "evalStringToScalarScanner.rl" + {act = 47;} + goto st16; +tr111: +#line 1 "NONE" + {te = p+1;} +#line 162 "evalStringToScalarScanner.rl" + {act = 44;} + goto st16; +tr112: +#line 1 "NONE" + {te = p+1;} +#line 141 "evalStringToScalarScanner.rl" + {act = 23;} + goto st16; +tr114: +#line 1 "NONE" + {te = p+1;} +#line 147 "evalStringToScalarScanner.rl" + {act = 29;} + goto st16; +tr123: +#line 1 "NONE" + {te = p+1;} +#line 143 "evalStringToScalarScanner.rl" + {act = 25;} + goto st16; +tr124: +#line 1 "NONE" + {te = p+1;} +#line 169 "evalStringToScalarScanner.rl" + {act = 51;} + goto st16; +tr127: +#line 1 "NONE" + {te = p+1;} +#line 168 "evalStringToScalarScanner.rl" + {act = 50;} + goto st16; +tr132: +#line 1 "NONE" + {te = p+1;} +#line 159 "evalStringToScalarScanner.rl" + {act = 41;} + goto st16; +tr135: +#line 1 "NONE" + {te = p+1;} +#line 149 "evalStringToScalarScanner.rl" + {act = 31;} + goto st16; +tr140: +#line 1 "NONE" + {te = p+1;} +#line 161 "evalStringToScalarScanner.rl" + {act = 43;} + goto st16; +tr142: +#line 1 "NONE" + {te = p+1;} +#line 174 "evalStringToScalarScanner.rl" + {act = 54;} + goto st16; st16: if ( ++p == pe ) goto _test_eof16; case 16: - switch( (*p) ) { - case 95: goto tr32; - case 97: goto st17; - } +#line 765 "evalStringToScalarScanner.cc" + if ( (*p) == 95 ) + goto tr51; if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 98 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr52; st17: if ( ++p == pe ) goto _test_eof17; case 17: switch( (*p) ) { - case 95: goto tr32; - case 110: goto st18; + case 95: goto tr51; + case 99: goto st18; + case 115: goto st20; + case 116: goto st22; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st18: if ( ++p == pe ) goto _test_eof18; case 18: switch( (*p) ) { - case 50: goto tr44; - case 95: goto tr32; + case 95: goto tr51; + case 111: goto st19; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr43; + goto tr51; + goto tr50; st19: if ( ++p == pe ) goto _test_eof19; case 19: switch( (*p) ) { - case 95: goto tr32; - case 98: goto st20; - case 101: goto st22; - case 111: goto st24; + case 95: goto tr51; + case 115: goto tr57; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st20: if ( ++p == pe ) goto _test_eof20; case 20: switch( (*p) ) { - case 95: goto tr32; - case 114: goto st21; + case 95: goto tr51; + case 105: goto st21; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st21: if ( ++p == pe ) goto _test_eof21; case 21: switch( (*p) ) { - case 95: goto tr32; - case 116: goto tr49; + case 95: goto tr51; + case 110: goto tr59; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st22: if ( ++p == pe ) goto _test_eof22; case 22: switch( (*p) ) { - case 95: goto tr32; - case 105: goto st23; + case 95: goto tr51; + case 97: goto st23; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 98 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st23: if ( ++p == pe ) goto _test_eof23; case 23: switch( (*p) ) { - case 95: goto tr32; - case 108: goto tr51; + case 95: goto tr51; + case 110: goto st24; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st24: if ( ++p == pe ) goto _test_eof24; case 24: switch( (*p) ) { - case 95: goto tr32; - case 115: goto st25; + case 50: goto tr63; + case 95: goto tr51; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr62; st25: if ( ++p == pe ) goto _test_eof25; case 25: switch( (*p) ) { - case 95: goto tr32; - case 104: goto tr54; + case 95: goto tr51; + case 111: goto st26; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr53; + goto tr51; + goto tr50; st26: if ( ++p == pe ) goto _test_eof26; case 26: switch( (*p) ) { - case 95: goto tr32; - case 101: goto st27; + case 95: goto tr51; + case 111: goto st27; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st27: if ( ++p == pe ) goto _test_eof27; case 27: switch( (*p) ) { - case 95: goto tr32; - case 103: goto st28; + case 95: goto tr51; + case 108: goto tr66; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st28: if ( ++p == pe ) goto _test_eof28; case 28: switch( (*p) ) { - case 84: goto st29; - case 95: goto tr32; + case 95: goto tr51; + case 98: goto st29; + case 101: goto st31; + case 111: goto st33; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st29: if ( ++p == pe ) goto _test_eof29; case 29: switch( (*p) ) { - case 95: goto tr32; - case 111: goto st30; + case 95: goto tr51; + case 114: goto st30; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st30: if ( ++p == pe ) goto _test_eof30; case 30: switch( (*p) ) { - case 82: goto st31; - case 95: goto tr32; + case 95: goto tr51; + case 116: goto tr71; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st31: if ( ++p == pe ) goto _test_eof31; case 31: switch( (*p) ) { - case 95: goto tr32; - case 97: goto st32; + case 95: goto tr51; + case 105: goto st32; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 98 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st32: if ( ++p == pe ) goto _test_eof32; case 32: switch( (*p) ) { - case 95: goto tr32; - case 100: goto tr61; + case 95: goto tr51; + case 108: goto tr73; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st33: if ( ++p == pe ) goto _test_eof33; case 33: switch( (*p) ) { - case 95: goto tr32; - case 120: goto st34; + case 95: goto tr51; + case 115: goto st34; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st34: if ( ++p == pe ) goto _test_eof34; case 34: switch( (*p) ) { - case 95: goto tr32; - case 112: goto tr63; + case 95: goto tr51; + case 104: goto tr76; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr75; st35: if ( ++p == pe ) goto _test_eof35; case 35: switch( (*p) ) { - case 95: goto tr32; - case 108: goto st36; + case 95: goto tr51; + case 101: goto st36; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st36: if ( ++p == pe ) goto _test_eof36; case 36: switch( (*p) ) { - case 95: goto tr32; - case 111: goto st37; + case 95: goto tr51; + case 103: goto st37; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st37: if ( ++p == pe ) goto _test_eof37; case 37: switch( (*p) ) { - case 95: goto tr32; - case 111: goto st38; + case 84: goto st38; + case 95: goto tr51; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st38: if ( ++p == pe ) goto _test_eof38; case 38: switch( (*p) ) { - case 95: goto tr32; - case 114: goto tr67; + case 95: goto tr51; + case 111: goto st39; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st39: if ( ++p == pe ) goto _test_eof39; case 39: switch( (*p) ) { - case 95: goto tr32; - case 121: goto st40; + case 82: goto st40; + case 95: goto tr51; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st40: if ( ++p == pe ) goto _test_eof40; case 40: switch( (*p) ) { - case 95: goto tr32; - case 112: goto st41; + case 95: goto tr51; + case 97: goto st41; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 98 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st41: if ( ++p == pe ) goto _test_eof41; case 41: switch( (*p) ) { - case 95: goto tr32; - case 111: goto st42; + case 95: goto tr51; + case 100: goto tr83; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st42: if ( ++p == pe ) goto _test_eof42; case 42: switch( (*p) ) { - case 95: goto tr32; - case 116: goto tr71; + case 95: goto tr51; + case 120: goto st43; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st43: if ( ++p == pe ) goto _test_eof43; case 43: switch( (*p) ) { - case 95: goto tr32; - case 111: goto st44; + case 95: goto tr51; + case 112: goto tr85; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st44: if ( ++p == pe ) goto _test_eof44; case 44: switch( (*p) ) { - case 95: goto tr32; - case 103: goto st45; + case 95: goto tr51; + case 97: goto st45; + case 108: goto st48; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 98 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st45: if ( ++p == pe ) goto _test_eof45; case 45: switch( (*p) ) { - case 49: goto st46; - case 95: goto tr32; + case 95: goto tr51; + case 108: goto st46; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr74; + goto tr51; + goto tr50; st46: if ( ++p == pe ) goto _test_eof46; case 46: switch( (*p) ) { - case 48: goto tr76; - case 95: goto tr32; + case 95: goto tr51; + case 115: goto st47; } if ( (*p) < 65 ) { - if ( 49 <= (*p) && (*p) <= 57 ) - goto tr32; + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st47: if ( ++p == pe ) goto _test_eof47; case 47: switch( (*p) ) { - case 95: goto tr32; - case 97: goto st48; - case 105: goto st52; + case 95: goto tr51; + case 101: goto tr90; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 98 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st48: if ( ++p == pe ) goto _test_eof48; case 48: switch( (*p) ) { - case 95: goto tr32; - case 103: goto st49; - case 120: goto tr80; + case 95: goto tr51; + case 111: goto st49; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st49: if ( ++p == pe ) goto _test_eof49; case 49: switch( (*p) ) { - case 83: goto st50; - case 95: goto tr32; + case 95: goto tr51; + case 111: goto st50; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr81; + goto tr51; + goto tr50; st50: if ( ++p == pe ) goto _test_eof50; case 50: switch( (*p) ) { - case 95: goto tr32; - case 113: goto st51; + case 95: goto tr51; + case 114: goto tr93; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st51: if ( ++p == pe ) goto _test_eof51; case 51: switch( (*p) ) { - case 95: goto tr32; - case 114: goto tr84; + case 95: goto tr51; + case 121: goto st52; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st52: if ( ++p == pe ) goto _test_eof52; case 52: switch( (*p) ) { - case 95: goto tr32; - case 110: goto tr85; + case 95: goto tr51; + case 112: goto st53; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st53: if ( ++p == pe ) goto _test_eof53; case 53: switch( (*p) ) { - case 95: goto tr32; - case 105: goto tr86; + case 95: goto tr51; case 111: goto st54; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st54: if ( ++p == pe ) goto _test_eof54; case 54: switch( (*p) ) { - case 95: goto tr32; - case 119: goto tr88; + case 95: goto tr51; + case 116: goto tr97; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st55: if ( ++p == pe ) goto _test_eof55; case 55: switch( (*p) ) { - case 95: goto tr32; - case 97: goto st56; - case 111: goto st63; + case 95: goto tr51; + case 111: goto st56; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 98 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st56: if ( ++p == pe ) goto _test_eof56; case 56: switch( (*p) ) { - case 95: goto tr32; - case 100: goto st57; - case 110: goto st62; + case 95: goto tr51; + case 103: goto st57; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st57: if ( ++p == pe ) goto _test_eof57; case 57: switch( (*p) ) { - case 84: goto st58; - case 95: goto tr32; + case 49: goto st58; + case 95: goto tr51; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr100; st58: if ( ++p == pe ) goto _test_eof58; case 58: switch( (*p) ) { - case 95: goto tr32; - case 111: goto st59; + case 48: goto tr102; + case 95: goto tr51; } if ( (*p) < 65 ) { - if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + if ( 49 <= (*p) && (*p) <= 57 ) + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st59: if ( ++p == pe ) goto _test_eof59; case 59: switch( (*p) ) { - case 68: goto st60; - case 95: goto tr32; + case 95: goto tr51; + case 97: goto st60; + case 105: goto st64; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 98 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st60: if ( ++p == pe ) goto _test_eof60; case 60: switch( (*p) ) { - case 95: goto tr32; - case 101: goto st61; + case 95: goto tr51; + case 103: goto st61; + case 120: goto tr106; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st61: if ( ++p == pe ) goto _test_eof61; case 61: switch( (*p) ) { - case 95: goto tr32; - case 103: goto tr97; + case 83: goto st62; + case 95: goto tr51; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr107; st62: if ( ++p == pe ) goto _test_eof62; case 62: switch( (*p) ) { - case 95: goto tr32; - case 100: goto tr98; + case 95: goto tr51; + case 113: goto st63; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st63: if ( ++p == pe ) goto _test_eof63; case 63: switch( (*p) ) { - case 95: goto tr32; - case 117: goto st64; + case 95: goto tr51; + case 114: goto tr110; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st64: if ( ++p == pe ) goto _test_eof64; case 64: switch( (*p) ) { - case 95: goto tr32; - case 110: goto st65; + case 95: goto tr51; + case 110: goto tr111; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st65: if ( ++p == pe ) goto _test_eof65; case 65: switch( (*p) ) { - case 95: goto tr32; - case 100: goto tr101; + case 95: goto tr51; + case 105: goto tr112; + case 111: goto st66; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st66: if ( ++p == pe ) goto _test_eof66; case 66: switch( (*p) ) { - case 95: goto tr32; - case 105: goto st67; - case 113: goto st69; + case 95: goto tr51; + case 119: goto tr114; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st67: if ( ++p == pe ) goto _test_eof67; case 67: switch( (*p) ) { - case 95: goto tr32; - case 110: goto st68; + case 95: goto tr51; + case 97: goto st68; + case 111: goto st75; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 98 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st68: if ( ++p == pe ) goto _test_eof68; case 68: switch( (*p) ) { - case 95: goto tr32; - case 104: goto tr106; + case 95: goto tr51; + case 100: goto st69; + case 110: goto st74; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr105; + goto tr51; + goto tr50; st69: if ( ++p == pe ) goto _test_eof69; case 69: switch( (*p) ) { - case 95: goto tr32; - case 114: goto st70; + case 84: goto st70; + case 95: goto tr51; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st70: if ( ++p == pe ) goto _test_eof70; case 70: switch( (*p) ) { - case 95: goto tr32; - case 116: goto tr109; + case 95: goto tr51; + case 111: goto st71; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr108; + goto tr51; + goto tr50; st71: if ( ++p == pe ) goto _test_eof71; case 71: switch( (*p) ) { - case 95: goto tr32; - case 97: goto st72; + case 68: goto st72; + case 95: goto tr51; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { - if ( 98 <= (*p) && (*p) <= 122 ) - goto tr32; + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st72: if ( ++p == pe ) goto _test_eof72; case 72: switch( (*p) ) { - case 95: goto tr32; - case 110: goto st73; + case 95: goto tr51; + case 101: goto st73; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr31; + goto tr51; + goto tr50; st73: if ( ++p == pe ) goto _test_eof73; case 73: switch( (*p) ) { - case 95: goto tr32; - case 104: goto tr113; + case 95: goto tr51; + case 103: goto tr123; } if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) - goto tr32; + goto tr51; } else if ( (*p) > 90 ) { if ( 97 <= (*p) && (*p) <= 122 ) - goto tr32; + goto tr51; } else - goto tr32; - goto tr112; + goto tr51; + goto tr50; +st74: + if ( ++p == pe ) + goto _test_eof74; +case 74: + switch( (*p) ) { + case 95: goto tr51; + case 100: goto tr124; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st75: + if ( ++p == pe ) + goto _test_eof75; +case 75: + switch( (*p) ) { + case 95: goto tr51; + case 117: goto st76; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st76: + if ( ++p == pe ) + goto _test_eof76; +case 76: + switch( (*p) ) { + case 95: goto tr51; + case 110: goto st77; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st77: + if ( ++p == pe ) + goto _test_eof77; +case 77: + switch( (*p) ) { + case 95: goto tr51; + case 100: goto tr127; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st78: + if ( ++p == pe ) + goto _test_eof78; +case 78: + switch( (*p) ) { + case 95: goto tr51; + case 105: goto st79; + case 113: goto st81; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st79: + if ( ++p == pe ) + goto _test_eof79; +case 79: + switch( (*p) ) { + case 95: goto tr51; + case 110: goto st80; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st80: + if ( ++p == pe ) + goto _test_eof80; +case 80: + switch( (*p) ) { + case 95: goto tr51; + case 104: goto tr132; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr131; +st81: + if ( ++p == pe ) + goto _test_eof81; +case 81: + switch( (*p) ) { + case 95: goto tr51; + case 114: goto st82; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st82: + if ( ++p == pe ) + goto _test_eof82; +case 82: + switch( (*p) ) { + case 95: goto tr51; + case 116: goto tr135; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr134; +st83: + if ( ++p == pe ) + goto _test_eof83; +case 83: + switch( (*p) ) { + case 95: goto tr51; + case 97: goto st84; + case 114: goto st86; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 98 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st84: + if ( ++p == pe ) + goto _test_eof84; +case 84: + switch( (*p) ) { + case 95: goto tr51; + case 110: goto st85; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st85: + if ( ++p == pe ) + goto _test_eof85; +case 85: + switch( (*p) ) { + case 95: goto tr51; + case 104: goto tr140; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr139; +st86: + if ( ++p == pe ) + goto _test_eof86; +case 86: + switch( (*p) ) { + case 95: goto tr51; + case 117: goto st87; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st87: + if ( ++p == pe ) + goto _test_eof87; +case 87: + switch( (*p) ) { + case 95: goto tr51; + case 101: goto tr142; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto tr51; + } else if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr51; + } else + goto tr51; + goto tr50; +st6: + if ( ++p == pe ) + goto _test_eof6; +case 6: + if ( (*p) == 124 ) + goto tr7; + goto st0; } - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof1: cs = 1; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; _test_eof7: cs = 7; goto _test_eof; _test_eof8: cs = 8; goto _test_eof; _test_eof9: cs = 9; goto _test_eof; + _test_eof1: cs = 1; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; _test_eof10: cs = 10; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; _test_eof11: cs = 11; goto _test_eof; _test_eof12: cs = 12; goto _test_eof; _test_eof13: cs = 13; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; _test_eof14: cs = 14; goto _test_eof; _test_eof15: cs = 15; goto _test_eof; _test_eof16: cs = 16; goto _test_eof; @@ -1808,89 +2072,115 @@ case 73: _test_eof71: cs = 71; goto _test_eof; _test_eof72: cs = 72; goto _test_eof; _test_eof73: cs = 73; goto _test_eof; + _test_eof74: cs = 74; goto _test_eof; + _test_eof75: cs = 75; goto _test_eof; + _test_eof76: cs = 76; goto _test_eof; + _test_eof77: cs = 77; goto _test_eof; + _test_eof78: cs = 78; goto _test_eof; + _test_eof79: cs = 79; goto _test_eof; + _test_eof80: cs = 80; goto _test_eof; + _test_eof81: cs = 81; goto _test_eof; + _test_eof82: cs = 82; goto _test_eof; + _test_eof83: cs = 83; goto _test_eof; + _test_eof84: cs = 84; goto _test_eof; + _test_eof85: cs = 85; goto _test_eof; + _test_eof86: cs = 86; goto _test_eof; + _test_eof87: cs = 87; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; _test_eof: {} if ( p == eof ) { switch ( cs ) { - case 5: goto tr28; - case 6: goto tr29; - case 2: goto tr2; - case 3: goto tr2; - case 7: goto tr29; - case 8: goto tr29; - case 9: goto tr31; - case 10: goto tr33; - case 11: goto tr31; - case 12: goto tr31; - case 13: goto tr31; - case 14: goto tr31; - case 15: goto tr31; - case 16: goto tr31; - case 17: goto tr31; - case 18: goto tr43; - case 19: goto tr31; - case 20: goto tr31; - case 21: goto tr31; - case 22: goto tr31; - case 23: goto tr31; - case 24: goto tr31; - case 25: goto tr53; - case 26: goto tr31; - case 27: goto tr31; - case 28: goto tr31; - case 29: goto tr31; - case 30: goto tr31; - case 31: goto tr31; - case 32: goto tr31; - case 33: goto tr31; - case 34: goto tr31; - case 35: goto tr31; - case 36: goto tr31; - case 37: goto tr31; - case 38: goto tr31; - case 39: goto tr31; - case 40: goto tr31; - case 41: goto tr31; - case 42: goto tr31; - case 43: goto tr31; - case 44: goto tr31; - case 45: goto tr74; - case 46: goto tr31; - case 47: goto tr31; - case 48: goto tr31; - case 49: goto tr81; - case 50: goto tr31; - case 51: goto tr31; - case 52: goto tr31; - case 53: goto tr31; - case 54: goto tr31; - case 55: goto tr31; - case 56: goto tr31; - case 57: goto tr31; - case 58: goto tr31; - case 59: goto tr31; - case 60: goto tr31; - case 61: goto tr31; - case 62: goto tr31; - case 63: goto tr31; - case 64: goto tr31; - case 65: goto tr31; - case 66: goto tr31; - case 67: goto tr31; - case 68: goto tr105; - case 69: goto tr31; - case 70: goto tr108; - case 71: goto tr31; - case 72: goto tr31; - case 73: goto tr112; + case 8: goto tr41; + case 9: goto tr42; + case 10: goto tr44; + case 3: goto tr3; + case 4: goto tr3; + case 11: goto tr44; + case 12: goto tr44; + case 13: goto tr46; + case 14: goto tr48; + case 15: goto tr50; + case 16: goto tr52; + case 17: goto tr50; + case 18: goto tr50; + case 19: goto tr50; + case 20: goto tr50; + case 21: goto tr50; + case 22: goto tr50; + case 23: goto tr50; + case 24: goto tr62; + case 25: goto tr50; + case 26: goto tr50; + case 27: goto tr50; + case 28: goto tr50; + case 29: goto tr50; + case 30: goto tr50; + case 31: goto tr50; + case 32: goto tr50; + case 33: goto tr50; + case 34: goto tr75; + case 35: goto tr50; + case 36: goto tr50; + case 37: goto tr50; + case 38: goto tr50; + case 39: goto tr50; + case 40: goto tr50; + case 41: goto tr50; + case 42: goto tr50; + case 43: goto tr50; + case 44: goto tr50; + case 45: goto tr50; + case 46: goto tr50; + case 47: goto tr50; + case 48: goto tr50; + case 49: goto tr50; + case 50: goto tr50; + case 51: goto tr50; + case 52: goto tr50; + case 53: goto tr50; + case 54: goto tr50; + case 55: goto tr50; + case 56: goto tr50; + case 57: goto tr100; + case 58: goto tr50; + case 59: goto tr50; + case 60: goto tr50; + case 61: goto tr107; + case 62: goto tr50; + case 63: goto tr50; + case 64: goto tr50; + case 65: goto tr50; + case 66: goto tr50; + case 67: goto tr50; + case 68: goto tr50; + case 69: goto tr50; + case 70: goto tr50; + case 71: goto tr50; + case 72: goto tr50; + case 73: goto tr50; + case 74: goto tr50; + case 75: goto tr50; + case 76: goto tr50; + case 77: goto tr50; + case 78: goto tr50; + case 79: goto tr50; + case 80: goto tr131; + case 81: goto tr50; + case 82: goto tr134; + case 83: goto tr50; + case 84: goto tr50; + case 85: goto tr139; + case 86: goto tr50; + case 87: goto tr50; } } _out: {} } -#line 226 "evalStringToScalarScanner.rl" +#line 247 "evalStringToScalarScanner.rl" /* ^^^ FSM execution here ^^^ */; if (0 == cs) diff --git a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.rl b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.rl index ced51f2950..d4c19c85ca 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.rl +++ b/src/OpenFOAM/primitives/strings/stringOps/toScalar/evalStringToScalarScanner.rl @@ -40,11 +40,6 @@ Description #pragma GCC diagnostic ignored "-Wold-style-cast" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -int Foam::parsing::evalStringToScalar::scanner::debug = 0; - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Ragel lexer with lemon parser integration @@ -59,10 +54,15 @@ int Foam::parsing::evalStringToScalar::scanner::debug = 0; write data; }%% + +#undef DebugScannerInfo +#define DebugScannerInfo if (debug & 4) InfoErr + + #define TOKEN_OF(T) TOK_##T #define EMIT_TOKEN(T) \ driver.parsePosition() = (ts-buf); \ - DebugInfo<< STRINGIFY(T) << ": " << driver.parsePosition() << nl; \ + DebugScannerInfo << STRINGIFY(T) << ": "<< driver.parsePosition() << nl; \ parser_->parse(TOKEN_OF(T), 0); \ driver.parsePosition() = (p-buf); @@ -73,7 +73,7 @@ int Foam::parsing::evalStringToScalar::scanner::debug = 0; action emit_number { driver.parsePosition() = (ts-buf); - DebugInfo + DebugScannerInfo << "Number:" << std::string(ts, te-ts).c_str() << " at " << driver.parsePosition() << nl; @@ -113,13 +113,29 @@ int Foam::parsing::evalStringToScalar::scanner::debug = 0; number => emit_number; ## operators + '!' => { EMIT_TOKEN(NOT); }; + '%' => { EMIT_TOKEN(PERCENT); }; '(' => { EMIT_TOKEN(LPAREN); }; ')' => { EMIT_TOKEN(RPAREN); }; + '*' => { EMIT_TOKEN(TIMES); }; '+' => { EMIT_TOKEN(PLUS); }; '-' => { EMIT_TOKEN(MINUS); }; - '*' => { EMIT_TOKEN(TIMES); }; - '/' => { EMIT_TOKEN(DIVIDE); }; ',' => { EMIT_TOKEN(COMMA); }; + '/' => { EMIT_TOKEN(DIVIDE); }; + '!' => { EMIT_TOKEN(NOT); }; + '?' => { EMIT_TOKEN(QUESTION); }; + ':' => { EMIT_TOKEN(COLON); }; + '<' => { EMIT_TOKEN(LESS); }; + '<=' => { EMIT_TOKEN(LESS_EQ); }; + '>' => { EMIT_TOKEN(GREATER); }; + '>=' => { EMIT_TOKEN(GREATER_EQ); }; + '==' => { EMIT_TOKEN(EQUAL); }; + '!=' => { EMIT_TOKEN(NOT_EQUAL); }; + '&&' => { EMIT_TOKEN(LAND); }; + '||' => { EMIT_TOKEN(LOR); }; +## Not needed '&' => { EMIT_TOKEN(BIT_AND); }; +## Not needed '|' => { EMIT_TOKEN(BIT_OR); }; +## Not needed '^' => { EMIT_TOKEN(BIT_XOR); }; ## Regular functions 'pi' => { EMIT_TOKEN(PI); }; @@ -150,7 +166,12 @@ int Foam::parsing::evalStringToScalar::scanner::debug = 0; 'floor' => { EMIT_TOKEN(FLOOR); }; 'ceil' => { EMIT_TOKEN(CEIL); }; 'round' => { EMIT_TOKEN(ROUND); }; - 'rand' => { fhold; EMIT_TOKEN(RAND); }; + 'rand' => { EMIT_TOKEN(RAND); }; + 'bool' => { EMIT_TOKEN(BOOL); }; + + ## Constants + 'false' =>{ EMIT_TOKEN(BOOL_FALSE); }; + 'true' =>{ EMIT_TOKEN(BOOL_TRUE); }; ## Catch-all for identifiers/errors ident => emit_ident; diff --git a/tutorials/IO/dictionary/good-if2.dict b/tutorials/IO/dictionary/good-if2.dict index 7b51cf6f32..fe1390ea40 100644 --- a/tutorials/IO/dictionary/good-if2.dict +++ b/tutorials/IO/dictionary/good-if2.dict @@ -29,4 +29,11 @@ FoamFile #endif +#if #eval "${FOAM_API:-0} >= 1910" + evalType hasEvalWithConditionals; +#else + evalType none; +#endif + + // ************************************************************************* // diff --git a/wmake/rules/General/general b/wmake/rules/General/general index c8e57a5e61..46e12fd5cb 100644 --- a/wmake/rules/General/general +++ b/wmake/rules/General/general @@ -1,5 +1,5 @@ #-------------------------------*- makefile -*--------------------------------- -WM_VERSION = OPENFOAM=1909 +WM_VERSION = OPENFOAM=1910 AR = ar ARFLAGS = cr