class SyntaxTree

Represents a syntax tree

Public Methods

[more]void (*genCPL)(SyntaxTree*, String* , CPL3BlockStack &)
Used as an alternative to the subclass-based generateCode function
[more]void (*genAS)(SyntaxTree*, String* , CPL3BlockStack &)
Used as an alternative to the subclass based secondary function
[more]void setLine(int l)
Line, column setting routines
[more] SyntaxTree(String* type, Vector* branches)
Constructs a new syntax tree with a specified type and branches.
[more]void setType(String* type)
Sets the type of the tree. Sets the type of the tree.
[more]String* getType()
Gets the type of the tree Gets the type of the tree
[more]void addBranch(SyntaxTree_Object* branch)
Adds a branch to the end of the branches list. Adds a branch to the end of the branches list.
[more]SyntaxTree_Object* getBranch(int number)
Returns a specified branch. Returns a specified branch.
[more]void serialize(ostream &output)
Outputs a string with the serialized form of the entire tree. Returns a string with the serialized form of the entire tree.
[more]void toString(ostream &output)
Returns a string representation of the tree (without formatting). Returns a string representation of the tree (without formatting).
[more]void generateCPL(String* data, CPL3BlockStack &blocks)
Calls the codeGenerationFunction Calls the codeGenerationFunction
[more]void generateAssembly(String* data, CPL3BlockStack &blocks)
Calls the secondaryFunction. Calls the secondaryFunction.
[more]unsigned int size()
Function to return the size of the vector (ie. Function to return the size of the vector (ie.


Documentation

Represents a syntax tree
ovoid (*genCPL)(SyntaxTree*, String* , CPL3BlockStack &)
Used as an alternative to the subclass-based generateCode function

ovoid (*genAS)(SyntaxTree*, String* , CPL3BlockStack &)
Used as an alternative to the subclass based secondary function

ovoid setLine(int l)
Line, column setting routines

o SyntaxTree(String* type, Vector* branches)

Constructs a new syntax tree with a specified type and branches.

Parameters:
- type the type of the tree.
- branches the list of branches.
- type the type of the tree.
- branches the list of branches.

ovoid setType(String* type)
Sets the type of the tree.

Sets the type of the tree.

Parameters:
- type the type of the tree.
- type the type of the tree.

oString* getType()
Gets the type of the tree

Gets the type of the tree

Returns:
the type of the tree.
the type of the tree.

ovoid addBranch(SyntaxTree_Object* branch)
Adds a branch to the end of the branches list.

Adds a branch to the end of the branches list.

Parameters:
branch - the branch to be added.
branch - the branch to be added.

oSyntaxTree_Object* getBranch(int number)
Returns a specified branch.

Returns a specified branch.

Parameters:
number - the branch number, base index 0.
number - the branch number.
Returns:
the branch value.
the branch value.

ovoid serialize(ostream &output)
Outputs a string with the serialized form of the entire tree.

Returns a string with the serialized form of the entire tree.

ovoid toString(ostream &output)
Returns a string representation of the tree (without formatting).

Returns a string representation of the tree (without formatting).

ovoid generateCPL(String* data, CPL3BlockStack &blocks)
Calls the codeGenerationFunction Calls the codeGenerationFunction

ovoid generateAssembly(String* data, CPL3BlockStack &blocks)
Calls the secondaryFunction.

Calls the secondaryFunction.

Parameters:
- data the data to be passed and/or returned from the function.
- data the data to be passed and/or returned from the function.

ounsigned int size()
Function to return the size of the vector (ie. the number of branches) in the SyntaxTree Function to return the size of the vector (ie. the number of branches) in the SyntaxTree


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.