#include <streevariable.h>
Inheritance diagram for Variable:
Public Member Functions | |
int | getId () const |
Returns the identifier of the variable. | |
Variable (int iid) | |
Creates Varable with given identifier. | |
Variable (Constant *name) | |
Creates Variable from constant by converting constant to int Constant::toInt. | |
Variable (const string &name) | |
Creates Variable from strnig by converting string to int. | |
virtual SType | getType () const |
Returns type of the node. | |
virtual string | getName () const |
Returs string representing node type or name for List. | |
virtual ostream & | print (ostream &os) const |
Writes node to the stream. | |
virtual ostream & | php (ostream &os) const |
Writes node to the stream as php. | |
virtual bool | match (const Node *p, Assignment &assign, const NameSpace &nameSpace) const |
Matches node p to the node. If node matches sets the assignment. | |
virtual bool | matchToBegining (const List *p, Assignment &assign, const NameSpace &nameSpace) const |
Matches the list to the begining of p. | |
virtual bool | compare (const Node *p) const |
Comares node p to the node. | |
virtual Node * | copy () const |
Copies the node. | |
virtual void | getVariables (VariableList &vlist) const |
Returns list of variables used in the node. | |
virtual string | evaluate (const NameSpace &nameSpace) const |
Computes the value of the expression (only basic atihmetic and string operations). | |
Protected Member Functions | |
virtual Node * | substitute (const Assignment &assign) |
Substitutes variables in the node accordingly to the given assignment. | |
Private Attributes | |
int | id |
Identifier of the variable. |
Definition at line 11 of file streevariable.h.
|
Creates Varable with given identifier.
Definition at line 4 of file streevariable.cpp. Referenced by copy(). |
|
Creates Variable from constant by converting constant to int Constant::toInt.
Definition at line 6 of file streevariable.cpp. |
|
Creates Variable from strnig by converting string to int.
Definition at line 10 of file streevariable.cpp. References id. |
|
Comares node p to the node.
Implements Node. Definition at line 40 of file streevariable.cpp. References getId(), Node::getType(), and SVariable. |
|
Copies the node.
Implements Node. Definition at line 53 of file streevariable.cpp. References getId(), and Variable(). Referenced by MultiContextRule::copy(), and NamedContextRule::execute(). |
|
Computes the value of the expression (only basic atihmetic and string operations).
Implements Node. Definition at line 61 of file streevariable.cpp. |
|
Returns the identifier of the variable.
Definition at line 17 of file streevariable.h. References id. Referenced by compare(), copy(), NamedContextRule::execute(), MultiContextRule::generateSubcontext(), getVariables(), match(), matchToBegining(), and substitute(). |
|
Returs string representing node type or name for List.
Implements Node. Definition at line 30 of file streevariable.h. References CVariable. |
|
Returns type of the node.
Implements Node. Definition at line 28 of file streevariable.h. |
|
Returns list of variables used in the node.
Implements Node. Definition at line 57 of file streevariable.cpp. References getId(). |
|
Matches node p to the node. If node matches sets the assignment.
Implements Node. Definition at line 25 of file streevariable.cpp. References Node::copy(), and getId(). |
|
Matches the list to the begining of p.
Implements Node. Definition at line 33 of file streevariable.cpp. References List::copy(), and getId(). |
|
Writes node to the stream as php.
Implements Node. Definition at line 19 of file streevariable.cpp. References id. |
|
Writes node to the stream.
Implements Node. Definition at line 15 of file streevariable.cpp. References id. |
|
Substitutes variables in the node accordingly to the given assignment.
Implements Node. Definition at line 46 of file streevariable.cpp. References Node::copy(), and getId(). |
|
Identifier of the variable.
Definition at line 14 of file streevariable.h. Referenced by getId(), php(), print(), and Variable(). |