Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

ContextMatch Class Reference

Context sensitive node. More...

#include <ctree.h>

Inheritance diagram for ContextMatch:

Node

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 Nodecopy () 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 Nodesubstitute (const Assignment &assign)
 Substitutes variables in the node accordingly to the given assignment.


Protected Attributes

Nodenode
 A node on that constext matching is performend.

Tester * tester
 A tester for the node. If true the node can be matched.


Detailed Description

Context sensitive node.

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 & Destructor Documentation

ContextMatch::ContextMatch Node inode,
Tester *  itester
[inline]
 

Constructor.

Definition at line 22 of file ctree.h.

References node, and tester.

Referenced by copy().

virtual ContextMatch::~ContextMatch  )  [inline, virtual]
 

Destructor.

Definition at line 25 of file ctree.h.

References node, and tester.


Member Function Documentation

virtual bool ContextMatch::compare const Node p  )  const [inline, virtual]
 

Comares node p to the node.

Implements Node.

Definition at line 60 of file ctree.h.

References Node::compare(), and node.

virtual Node* ContextMatch::copy  )  const [inline, virtual]
 

Copies the node.

Implements Node.

Definition at line 64 of file ctree.h.

References ContextMatch(), Node::copy(), node, and tester.

virtual string ContextMatch::evaluate const NameSpace nameSpace  )  const [inline, virtual]
 

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.

virtual int ContextMatch::getLength  )  const [inline, virtual]
 

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.

virtual string ContextMatch::getName  )  const [inline, virtual]
 

Returs string representing node type or name for List.

Implements Node.

Definition at line 32 of file ctree.h.

References Node::getName(), and node.

virtual SType ContextMatch::getType  )  const [inline, virtual]
 

Returns type of the node.

Implements Node.

Definition at line 30 of file ctree.h.

References Node::getType(), node, and SType.

virtual void ContextMatch::getVariables VariableList vlist  )  const [inline, virtual]
 

Returns list of variables used in the node.

Implements Node.

Definition at line 68 of file ctree.h.

References Node::getVariables(), and node.

virtual bool ContextMatch::match const Node p,
Assignment &  assign,
const NameSpace nameSpace
const [inline, virtual]
 

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.

virtual bool ContextMatch::matchToBegining const List p,
Assignment &  assign,
const NameSpace nameSpace
const [inline, virtual]
 

Matches the list to the begining of p.

Implements Node.

Definition at line 55 of file ctree.h.

References Node::matchToBegining(), node, and tester.

virtual ostream& ContextMatch::php ostream &  os  )  const [inline, virtual]
 

Writes node to the stream as php.

Implements Node.

Definition at line 41 of file ctree.h.

References node, and Node::php().

virtual ostream& ContextMatch::print ostream &  os  )  const [inline, virtual]
 

Writes node to the stream.

Implements Node.

Definition at line 34 of file ctree.h.

References node, and Node::print().

virtual Node* ContextMatch::substitute const Assignment &  assign  )  [inline, protected, virtual]
 

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.


Field Documentation

Node* ContextMatch::node [protected]
 

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().

Tester* ContextMatch::tester [protected]
 

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().


The documentation for this class was generated from the following file:
Generated on Fri Nov 21 17:54:06 2003 for PHPX by doxygen 1.3.3