The Node abstract base class for building any expression tree.
This class is responsible for defining the methods of the abstract
Node class. The Node class is the foundation for the entire
expression tree, and is able to evaluate itself (returning a Number
pointer), print itself (to any output stream), and copy itself
(return a pointer to a copy of itself). All operators, variables,
etc. fall under this superclass heading.
- Source:
- node.hh:25
- Author:
- Jonathan Kitchens
- Version:
- v0.9
| Entity | Type | Scope | Short Description |
| ~Node | destructor | public | The virtual destructor must be described.
|
| Node | constructor | public | automatically generated |
| Node | constructor | public | automatically generated |
| Copy | method | public | Creates a copy of the current Node
This returns a pointer to a copy of the current node.
|
| Evaluate | method | public | Evaluates the expression tree starting at the current node.
|
| operator = | operator | public | automatically generated |
| Print | method | public | Prints the expression tree starting with the current node.
|
The virtual destructor must be described.
- Source:
- node.hh:33
- Author:
- Jonathan Kitchens
- Version:
- v0.9
- Code:
| public virtual ~ Node ( ) |
automatically generated
- Source:
- node.hh
- Code:
-
automatically generated
- Source:
- node.hh
- Code:
| public Node ( | const Node & ) |
Creates a copy of the current Node
This returns a pointer to a copy of the current node.
The
definition of a "copy" is left up to each individual
node. For instance, global variables return a pointer to
themselves as a "copy" because they should never be copied
by value.
- Source:
- node.hh:73
- Author:
- Jonathan Kitchens
- Version:
- v0.9
- Returns:
- a Node pointer to a "copy" of the current node
- Code:
| public virtual Node * Copy ( | ) = 0 |
Evaluates the expression tree starting at the current node.
This function returns a Number pointer to the evaluated
tree which has itself as its root.
- Source:
- node.hh:46
- Author:
- Jonathan Kitchens
- Version:
- v0.9
- Returns:
- a Number pointer to the evaluated expression tree
having this node as its root.
- Code:
| public virtual Number * Evaluate ( | ) = 0 |
automatically generated
- Source:
- node.hh
- Code:
| public Node & operator = ( | const Node & ) |
Prints the expression tree starting with the current node.
This displays the expression tree (starting with this node
as the root) in a pretty, easy-to-read infix format.
- Source:
- node.hh:58
- Author:
- Jonathan Kitchens
- Version:
- v0.9
- Param:
| out
| the stream to which the output will be sent
|
- Code:
| public virtual void Print ( | ostream & out ) const = 0 |
Created Sun Oct 6 21:22:17 2002.
This documentation was generated automatically by
ccdoc v0.8 r26 2001/11/28 bin_opt_suncc_solaris-2.8.
Click here to submit a bug report or feature request.
Click here to return to the top of the page.