The JepInstance type exposes the following members.
Constructors
Name | Description | |
---|---|---|
JepInstance | Overloaded. |
Methods
Name | Description | |
---|---|---|
AddConstant |
Add a constant: a variable who's value cannot be changed.
|
|
AddFunction |
Adds a function to the parser.
|
|
AddStandardConstants |
Adds the constants pi and e to the parser. The values are added as the
Math.PI and Math.E values.
|
|
AddVariable | Overloaded. | |
ContinueParsing |
Continue parsing without re-initialising the stream. This requires
InitMultiParse to be called first.
Allows re-entrance of parser so that strings like
"x=1; y=2; z=3;" can be parsed.
When a semicolon is encountered parsing finishes leaving the rest of
the string unparsed.
Parsing can be resumed from the current position by using this method.
ExamplesCopyC# JepInstance j = new JepInstance(); j.InitMultiParse("x=1;y=2; z=3;"); INode node; try { while((node = j.ContinueParsing())!=null) { j.Println(node); } }catch(ParseException e) {} |
|
Equals | (Inherited from Object.) | |
Evaluate | Overloaded. | |
EvaluateD |
Evaluates the most recently parsed expression and returns the result as a double.
|
|
Finalize |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) |
|
GetDefaultValue |
Returns the default value used for new variables.
|
|
GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) |
|
GetType |
Gets the Type of the current instance.
(Inherited from Object.) |
|
GetVariable |
Returns the Variable instance of the variable
name. If the variable has not been added, null is returned.
|
|
GetVariableValue |
Returns the value of the variable name. If the variable has
not been added, or if it's value is null, null is returned.
|
|
InitMultiParse | Overloaded. | |
MemberwiseClone |
Creates a shallow copy of the current Object.
(Inherited from Object.) |
|
Parse | Overloaded. | |
Overloaded. | ||
PrintLine | Overloaded. | |
ReinitializeComponents |
Calls the Init() method of all components. This is necessary
in a few cases, such as after adding new operators to the configurable
parser.
|
|
RootNodeToString |
Returns a string representation of the last expression parsed.
|
|
SetComponents |
Sets one or more components for this Jep instance.
Each component can be one of the following:
|
|
SetDefaultValue |
Sets the default value used for new variables.
If the value is null (the default) then exceptions
will be thrown when trying to evaluate the variables which do not have values set.
|
|
ToString | Overloaded. |
Fields
Name | Description | |
---|---|---|
_allowAssignment |
Allow Assignment option
|
|
_allowUndeclared |
Allow Undeclared Variables option
|
|
_evaluator |
IEvaluator instance used for evaluating parse trees
|
|
_funTab |
Function Table
|
|
_implicitMul |
Implicit Multiplication option
|
|
_lastRootNode |
Root node of the last parsed expression
|
|
_nodeFac |
Node Factory
|
|
_numFac |
Number Factory
|
|
_opTab |
Operator Table
|
|
_parser |
Parser instance used for parsing expressions
|
|
_pv |
PrintVisitor
|
|
_varFac |
Variable Factory
|
|
_varTab |
Variable Table
|
Properties
Name | Description | |
---|---|---|
AllowAssignment |
Sets whether assignment equations like y=x+1 are allowed.
The default is true (assignment allowed).
|
|
AllowUndeclared |
Sets the value for the undeclared variables option. If this option
is set to true, expressions containing variables that were not
previously added to Jep will be automatically be added while parsing,
and initialized to 0. Note this only affects the parsing stage,
EvaluationException will still be thrown when trying to evaluate a variable
with an undefined value.
If this option is set to false, variables that were not previously added to Jep will produce an ParseException while parsing. The default value is true. |
|
Evaluator |
Evaluator gets/sets the _evaluator data member
|
|
FunTab |
FunTab gets/sets the _funTab data member
|
|
ImplicitMul |
Sets the value of the implicit multiplication option.
If this option is set to true before parsing, implicit multiplication
will be allowed. That means that an expression such as
"1 2" is valid and is interpreted as "1*2".
The default value is true. |
|
LastRootNode |
Returns the root node of the last successfully parsed expression
|
|
NodeFac |
NodeFac gets/sets the _nodeFac data member
|
|
NumFac |
NumFac gets/sets the _numFac data member
|
|
OpTab |
OpTab gets/sets the _opTab data member
|
|
Parser |
Parser gets/sets the _parser data member
|
|
PrintVisitor |
PrintVisitor gets/sets the _pv data member
|
|
VarFac |
VarFac gets/sets the _varFac data member
|
|
VarTab |
VarTab gets/sets the _varTab data member
|