MyParser class
The expression parser behind WapEvaluator; use WapEvaluator instead.
Constructors
- MyParser()
- Creates a parser with the built-in functions registered.
Properties
- datasetResolver ↔ ExprDataSet? Function(String name)?
-
Resolves dataset names used in expressions (
ds.field).getter/setter pair - error ↔ String
-
Error message of the last evaluation ('' when none).
getter/setter pair
- expression ↔ String
-
The expression to evaluate.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- nul ↔ bool
-
Null-substitution mode: unknown names evaluate to null instead of failing.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ dynamic
-
Result of the last evaluation.
getter/setter pair
Methods
-
addFunction0Param(
String name, Func0 fn) → void - Registers a function without parameters; an existing one of the same name is kept.
-
addFunction1Param(
String name, Func1 fn) → void - Registers a one-parameter function; an existing one of the same name is kept.
-
addFunction2Param(
String name, Func2 fn) → void - Registers a two-parameter function; an existing one of the same name is kept.
-
addFunction3Param(
String name, Func3 fn) → void - Registers a three-parameter function; an existing one of the same name is kept.
-
addFunction4Param(
String name, Func4 fn) → void - Registers a four-parameter function; an existing one of the same name is kept.
-
addFunctionAParam(
String name, FuncA fn) → void - Registers a variadic function; an existing one of the same name is kept.
-
addInternalFunctions(
) → void - Registers the built-in function library.
-
analyzeExpression(
) → bool - Evaluates expression into value; returns false and sets error on failure.
-
clearDataSets(
) → void - Removes every registered dataset.
-
clearIdentifiers(
) → void - Removes every variable and function.
-
clearUserVars(
) → void - Clears only user variables (variable/constant), keeps built-in functions (function_)
-
delVar(
String name) → void -
Deletes variable
name. -
findDataSet(
String name) → ExprDataSet? -
The dataset called
name, or null. -
findIdent(
String name) → int -
Index of identifier
name, or -1. -
getUserVars(
) → Map< String, dynamic> - Gets all user-set variables
-
getVar(
String name) → dynamic -
Value of variable
name, or null. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerDataSet(
String name, ExprDataSet ds) → void -
Makes
dsavailable to expressions asname. -
setAry(
String name, int index, dynamic val) → void -
Sets element
indexof array variablename. -
setVar(
String name, dynamic value) → void -
Sets variable
nametovalue(not evaluated). -
toString(
) → String -
A string representation of this object.
inherited
-
unregisterDataSet(
String name) → void -
Removes the dataset registered as
name.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited