class VsFunctionCall : public VsExpr


Inheritance:


Public Fields

VsStatementList* statements
Statements that make up this function. Used by VsFunctionCall.

Public Methods

static void addArg(const char *argName)
Again, used during parsing, adds arguments
void endDefinition(VsStatementList *stmnts)
And when function is done, this cleans everything up and remembers what statements are part of this function definition:
virtual VsValue evaluate(VsFunctionCall *parent)
Evaluate method.
static VsVar* findIdentifier(const char *name)
Returns the local variable, argument, or global variable with the given name
VsValue getArg(int whichArg)
Argument getting/setting routines, used by VsArgOrLocal class.
const char* getName()
Returns name of this function definition
int getNumArgs()
Returns number of arguments
int getNumLocals()
Returns number of local vars and args
static int isAnUnimplementedFunction(const char* fName)
void setArgOrLocal(int whichArg, const VsValue &newVal)
void setReturnValue(const VsValue &val)
The enclosing VsFunctionCall is passed to all expressions and statements so that a return statement can turn around and call this:
VsFunctionDef(const char *name, VsParseTree *parent)
FunctionDef constructor
virtual ~VsFunctionDef()

Protected Methods

virtual ~VsFunctionCall()

Private Fields

MbPList argOrLocalNames
Names of arguments and local vars
VsExprList args
Argument expressions
static VsFunctionDef* curFunction
When parsing, function being defined:
VsFunctionDef* function
Function definition contains statements
VsValue* locals
Arguments and local variables
char* name
This function's name
int numArgs
Number of arguments
int numLocals
Number of local variables
VsParseTree* parent
Script we're defined in
VsValue returnValue

Inherited from VsExpr:

Public Methods

virtual VsStatement::Status1 execute(VsFunctionCall *)
void ref()
void unref()

Private Fields

short refCount

Inherited from VsStatement:

Public Classes

enum Status1

Public

enum Status1

Documentation

VsFunctionDef(const char *name, VsParseTree *parent)
FunctionDef constructor. Called during parsing; gotta keep track of current function so that we know if identifiers found inside the function are function arguments, local variables, or global variables. The VsParseTree argument is needed because global variables are kept by the ParseTree class.

static void addArg(const char *argName)
Again, used during parsing, adds arguments. It is assumed that this is called BEFORE findIdentifier() is called.

static VsVar* findIdentifier(const char *name)
Returns the local variable, argument, or global variable with the given name. A new local variable is automatically created and returned if the name isn't already known in this function.

void endDefinition(VsStatementList *stmnts)
And when function is done, this cleans everything up and remembers what statements are part of this function definition:

int getNumLocals()
Returns number of local vars and args. Determines how many VsValues need to be pushed onto stack at a function call:

int getNumArgs()
Returns number of arguments. Event in functions need to have two arguments, so we need to test for this.

const char* getName()
Returns name of this function definition

VsStatementList* statements
Statements that make up this function. Used by VsFunctionCall.

virtual ~VsFunctionDef()

static VsFunctionDef* curFunction
When parsing, function being defined:

char* name
This function's name

int numArgs
Number of arguments

int numLocals
Number of local variables

MbPList argOrLocalNames
Names of arguments and local vars

VsParseTree* parent
Script we're defined in

virtual VsValue evaluate(VsFunctionCall *parent)
Evaluate method.

void setReturnValue(const VsValue &val)
The enclosing VsFunctionCall is passed to all expressions and statements so that a return statement can turn around and call this:

VsValue getArg(int whichArg)
Argument getting/setting routines, used by VsArgOrLocal class.

void setArgOrLocal(int whichArg, const VsValue &newVal)

static int isAnUnimplementedFunction(const char* fName)

virtual ~VsFunctionCall()

VsFunctionDef* function
Function definition contains statements

VsExprList args
Argument expressions

VsValue* locals
Arguments and local variables

VsValue returnValue


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de