The JepInstance type exposes the following members.

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.

Examples

CopyC#
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) {}
Empty equations such as "x=1;;y=2" are silently ignored, in this case the second call will return the node representing y=2.
Equals
Determines whether the specified Object is equal to the current Object.
(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.
Print 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:
  • NumberFactory
  • VariableFactory
  • NodeFactory
  • VariableTable
  • FunctionTable
  • OperatorTable
  • Parser
  • Evaluator
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.

See Also