Files
openfoam/src/OpenFOAM/primitives/strings/stringOps/toScalar/createCode
Mark Olesen 836d3a849f ENH: add stringOps::toScalar and dictionary #eval directive
- the #eval directive is similar to the #calc directive, but for evaluating
  string expressions into scalar values. It uses an internal parser for
  the evaluation instead of dynamic code compilation. This can make it
  more suitable for 'quick' evaluations.

  The evaluation supports the following:
    - 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: rand(), rand(seed)
2019-09-30 16:40:32 +02:00

12 lines
366 B
Bash
Executable File

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Manually create ragel scanner and the lemon parser header
"$WM_PROJECT_DIR/wmake/scripts/makeParser" \
-scanner=evalStringToScalarScanner.rl \
-parser=evalStringToScalarLemonParser.lyy \
;
#------------------------------------------------------------------------------