Class Evaluation
- Namespace
- BOOSE
- Assembly
- BOOSE.dll
An evaluation encompasses all things that can have a value, such as variables, expressions and conditions used in loops and ifs.
public class Evaluation : Command, ICommand
- Inheritance
-
Evaluation
- Implements
- Derived
- Inherited Members
Constructors
Evaluation()
Blank constructor,
public Evaluation()
Fields
evaluatedExpression
protected string evaluatedExpression
Field Value
expression
protected string expression
Field Value
value
protected int value
Field Value
varName
protected string varName
Field Value
Properties
Expression
The right hand side of an expression in a variable initialisetion or variable change of value, or a boolean in a conditional command
public string Expression { get; set; }
Property Value
Local
Is this a local variable/method variable? This is so that variables of the same name can exist in defferent scopes.
public bool Local { get; set; }
Property Value
Value
Value of variable once the expression has been calculated. Virtual so that variables of other types can override it.
public virtual int Value { get; set; }
Property Value
VarName
Name of variable as a string (as opposed to Name which is the name of the class, such as Int, Real or Boolean).
public string VarName { get; set; }
Property Value
Methods
CheckParameters(string[])
Does nothing in this case.
public override void CheckParameters(string[] parameterList)
Parameters
parameterList
string[]
Compile()
public override void Compile()
Execute()
Evaluate any expression and store the evaluatedExpression result in instance data for sub classes. Expressions are evaluated at runtime by a StoredProgram object (Program)
public override void Execute()
ProcessExpression(string)
Takes a complete expression with left hand side and right hand side and returns only the right hand side (i.e. the bit after the =).
public virtual string ProcessExpression(string Expression)
Parameters
Expression
stringExpression to evaluate
Returns
- string
Right hand side of expression (the bit after the =)
Exceptions
- VarException
Var exception if it isn't an expression