Planeshift
MathStatement Class Reference

This holds one line of a (potentially) multi-line script. More...

#include <mathscript.h>

Public Member Functions

double Evaluate (MathEnvironment *env) const
 
- Public Member Functions inherited from MathExpression
size_t GetOpcode () const
 
void SetOpcode (size_t newOpcode)
 
virtual ~MathExpression ()
 

Static Public Member Functions

static MathStatementCreate (const csString &expression, const char *name)
 
- Static Public Member Functions inherited from MathExpression
static MathExpressionCreate (const char *expression, const char *name="")
 Empty destructor. More...
 

Protected Member Functions

 MathStatement ()
 
- Protected Member Functions inherited from MathExpression
 MathExpression ()
 
bool Parse (const char *expression)
 

Protected Attributes

csString assignee
 variable the result will be assinged to More...
 
- Protected Attributes inherited from MathExpression
FunctionParser fp
 
const char * name
 
size_t opcode
 
csSet< PropertyRefpropertyRefs
 properties that have to be resolved prior to evaluation More...
 
csSet< csString > requiredObjs
 a subset of requiredVars which are known to be objects; for type checking More...
 
csSet< csString > requiredVars
 variables required to execute this expression More...
 

Additional Inherited Members

- Protected Types inherited from MathExpression
enum  {
  MATH_NONE = 0, MATH_COND = 1, MATH_EXP = 2, MATH_LOOP = 4,
  MATH_ASSIGN = 8, MATH_BREAK = 16, MATH_WHILE = MATH_COND | MATH_EXP | MATH_LOOP, MATH_IF = MATH_COND | MATH_EXP,
  MATH_ELSE = MATH_COND, MATH_DO = MATH_EXP | MATH_LOOP
}
 

Detailed Description

This holds one line of a (potentially) multi-line script.

It knows what <var> is on the left, and what <formula> is on the right of the = sign. When run, it executes the formula and sets the result in the Var. These vars are shared across Lines, which means the next Line can use that Var as an input.

Definition at line 404 of file mathscript.h.

Constructor & Destructor Documentation

MathStatement::MathStatement ( )
inlineprotected

Definition at line 407 of file mathscript.h.

Member Function Documentation

static MathStatement* MathStatement::Create ( const csString &  expression,
const char *  name 
)
static
double MathStatement::Evaluate ( MathEnvironment env) const
virtual

Reimplemented from MathExpression.

Member Data Documentation

csString MathStatement::assignee
protected

variable the result will be assinged to

Definition at line 409 of file mathscript.h.


The documentation for this class was generated from the following file: