[−][src]Module fasteval::parser
This module parses string expressions into an AST which can then be compiled or evaluated.
fasteval Algebra Grammar
Expression: Value (BinaryOp Value)*
Value: Constant || UnaryOp || PrintFunc || StdFunc
Constant: [+-]?[0-9]*(\.[0-9]+)?( ([eE][+-]?[0-9]+) || [pnuµmkKMGT] )? || [+-]?(NaN || inf)
UnaryOp: +Value || -Value || (Expression) || [Expression] || !Value
BinaryOp: + || - || * || / || % || ^ || < || <= || == || != || >= || > || (or || '||') || (and || '&&')
VarName: [a-zA-Z_][a-zA-Z_0-9]*
StdFunc: VarName((Expression,)*)? || VarName[(Expression,)*]?
PrintFunc: print(ExpressionOrString,*)
ExpressionOrString: Expression || String
String: ".*"
Structs
Expression | An |
ExpressionI | An |
Parser | |
PrintFunc | Represents a |
ValueI | A |
Enums
BinaryOp | Binary Operators |
ExpressionOrString | Used by the |
StdFunc | A Function Call with Standard Syntax. |
UnaryOp | Unary Operators |
Value | A |
Constants
DEFAULT_EXPR_DEPTH_LIMIT | |
DEFAULT_EXPR_LEN_LIMIT |