#include <ctree.h>
Inheritance diagram for ContextMatch:
Public Member Functions | |
ContextMatch (Node *inode, Tester *itester) | |
Constructor. | |
virtual | ~ContextMatch () |
Destructor. | |
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). | |
virtual int | getLength () const |
Returns teh length of the list -- valid only for List and ContextMatch. | |
Protected Member Functions | |
virtual Node * | substitute (const Assignment &assign) |
Substitutes variables in the node accordingly to the given assignment. | |
Protected Attributes | |
Node * | node |
A node on that constext matching is performend. | |
Tester * | tester |
A tester for the node. If true the node can be matched. |
Defines a class of nodes, that can perform context sensitive matching. After a match function is called does some chack on what was matched. These nodes try to be invisible to all functions.
Definition at line 13 of file ctree.h.
|
Constructor.
Definition at line 22 of file ctree.h. Referenced by copy(). |
|
Destructor.
|
|
Comares node p to the node.
Implements Node. Definition at line 60 of file ctree.h. References Node::compare(), and node. |
|
Copies the node.
Implements Node. Definition at line 64 of file ctree.h. References ContextMatch(), Node::copy(), node, and tester. |
|
Computes the value of the expression (only basic atihmetic and string operations).
Implements Node. Definition at line 72 of file ctree.h. References Node::evaluate(), and node. |
|
Returns teh length of the list -- valid only for List and ContextMatch.
Reimplemented from Node. Definition at line 76 of file ctree.h. References Node::getLength(), and node. |
|
Returs string representing node type or name for List.
Implements Node. Definition at line 32 of file ctree.h. References Node::getName(), and node. |
|
Returns type of the node.
Implements Node. Definition at line 30 of file ctree.h. References Node::getType(), node, and SType. |
|
Returns list of variables used in the node.
Implements Node. Definition at line 68 of file ctree.h. References Node::getVariables(), and node. |
|
Matches node p to the node. If node matches sets the assignment.
Implements Node. Definition at line 45 of file ctree.h. References Node::match(), node, and tester. |
|
Matches the list to the begining of p.
Implements Node. Definition at line 55 of file ctree.h. References Node::matchToBegining(), node, and tester. |
|
Writes node to the stream as php.
Implements Node. Definition at line 41 of file ctree.h. References node, and Node::php(). |
|
Writes node to the stream.
Implements Node. Definition at line 34 of file ctree.h. References node, and Node::print(). |
|
Substitutes variables in the node accordingly to the given assignment.
Implements Node. Definition at line 82 of file ctree.h. References node, and Node::substituteNode. |
|
A node on that constext matching is performend.
Definition at line 17 of file ctree.h. Referenced by compare(), ContextMatch(), copy(), evaluate(), getLength(), getName(), getType(), getVariables(), match(), matchToBegining(), php(), print(), substitute(), and ~ContextMatch(). |
|
A tester for the node. If true the node can be matched.
Definition at line 19 of file ctree.h. Referenced by ContextMatch(), copy(), match(), matchToBegining(), and ~ContextMatch(). |