#include <streenode.h>
Inheritance diagram for Node:
Public Types | |
typedef set< int > | VariableList |
A list of variables. | |
Public Member Functions | |
Node (const string &icomment, const int ilineno=0) | |
Constructor. | |
Node () | |
Constructor. | |
virtual | ~Node () |
Destrys the node and frees memory. | |
virtual SType | getType () const=0 |
Returns type of the node. | |
virtual string | getName () const=0 |
Returs string representing node type or name for List. | |
virtual ostream & | print (ostream &os) const=0 |
Writes node to the stream. | |
virtual ostream & | php (ostream &os) const=0 |
Writes node to the stream as php. | |
virtual bool | match (const Node *p, Assignment &assign, const NameSpace &nameSpace) const=0 |
Matches node p to the node. If node matches sets the assignment. | |
virtual bool | matchToBegining (const List *p, Assignment &assign, const NameSpace &nameSpace) const=0 |
Matches the list to the begining of p. | |
virtual bool | compare (const Node *p) const=0 |
Comares node p to the node. | |
virtual Node * | copy () const=0 |
Copies the node. | |
virtual void | getVariables (VariableList &vlist) const=0 |
Returns list of variables used in the node. | |
string | toString () const |
Returns the string representing the node. | |
virtual Node * | push_back (Node *statement) |
Correct only for lists. | |
virtual Node * | transform (const Transformer *transformer) |
Applies Transformer to every node in the tree. | |
virtual bool | forall (const Tester *tester, const NameSpace &nameSpace) const |
Returns true is for all nodes in the. | |
virtual bool | exists (const Tester *tester, const NameSpace &nameSpace) const |
Applies Transformer to every node in the tree. | |
virtual string | evaluate (const NameSpace &nameSpace) const=0 |
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)=0 |
Substitutes variables in the node accordingly to the given assignment. | |
Protected Attributes | |
Location | location |
The location of the node -- not used. | |
Friends | |
ostream & | operator<< (ostream &os, const Assignment &data) |
Writes assignment to stream. | |
ostream & | operator<< (ostream &os, const Node *data) |
Writes the node to the stream by using Node::php. | |
void | substituteNode (Node *&node, const Assignment &assign) |
Substitutes variables in the node accordingly to the given assignment. |
Definition at line 28 of file streenode.h.
|
A list of variables.
Definition at line 64 of file streenode.h. Referenced by RuleContext::assignVariableNames(). |
|
Constructor.
Definition at line 70 of file streenode.h. References location. |
|
Constructor.
Definition at line 73 of file streenode.h. References location. |
|
Destrys the node and frees memory.
Definition at line 76 of file streenode.h. |
|
Comares node p to the node.
Implemented in ContextMatch, AttributeValue, Constant, List, Pin, and Variable. Referenced by ContextMatch::compare(). |
|
|
Computes the value of the expression (only basic atihmetic and string operations).
Implemented in ContextMatch, AttributeValue, EncapsList, DoubleQuote, UnaryOperator, PostUnaryOperator, BinaryOperator, EncapsExpr, AskOperator, ConstantEncapsedString, ConstantString, Constant, List, Pin, and Variable. Referenced by ConstantString::evaluate(), ConstantEncapsedString::evaluate(), AskOperator::evaluate(), EncapsExpr::evaluate(), BinaryOperator::evaluate(), UnaryOperator::evaluate(), DoubleQuote::evaluate(), ContextMatch::evaluate(), ActionSet::execute(), and ActionWrite::execute(). |
|
Applies Transformer to every node in the tree.
Reimplemented in List. Definition at line 37 of file streenode.cpp. References Node::Tester::test(). Referenced by ExistsTester::test(). |
|
Returns true is for all nodes in the.
Reimplemented in List. Definition at line 33 of file streenode.cpp. References Node::Tester::test(). Referenced by ForallTester::test(). |
|
Returns teh length of the list -- valid only for List and ContextMatch.
Reimplemented in ContextMatch, and List. Definition at line 41 of file streenode.cpp. Referenced by ContextMatch::getLength(). |
|
Returs string representing node type or name for List.
Implemented in ContextMatch, AttributeValue, Constant, List, Pin, and Variable. Referenced by RuleContext::execute(), MultiContextRule::generateSubcontext(), ContextMatch::getName(), TypeTester::test(), TPLConstantNormalizer::transform(), HTMLBox::Replacer::transform(), and HTMLBox::Putter::transform(). |
|
Returns type of the node.
Implemented in ContextMatch, AttributeValue, Constant, List, Pin, and Variable. Referenced by Variable::compare(), Pin::compare(), List::compare(), Constant::compare(), ContextMatch::getType(), List::match(), ArrayPair::php(), FunctionCall::php(), Parameter::php(), Case::php(), Class::php(), Foreach::php(), and If::php(). |
|
Returns list of variables used in the node.
Implemented in ContextMatch, AttributeValue, Constant, List, Pin, and Variable. Referenced by ContextMatch::getVariables(). |
|
Matches node p to the node. If node matches sets the assignment.
Implemented in ContextMatch, AttributeValue, Constant, List, Pin, and Variable. Referenced by ContextMatch::match(). |
|
Matches the list to the begining of p.
Implemented in ContextMatch, AttributeValue, Constant, List, Pin, and Variable. Referenced by ContextMatch::matchToBegining(). |
|
Writes node to the stream as php.
Implemented in ContextMatch, AttributeValue, StatementList, InlineHTMLList, TemplateList, ExpressionList, ArrayPairList, DeclareList, CaseList, EncapsList, AssignmentList, PHP, EchoPHP, CurlyBraces, SmartyBraces, DoubleQuote, If, For, While, Do, Switch, Break, Continue, Return, Global, Static, Echo, Template, SmartyAssign, InlineHTML, Expression, Unset, Use, Foreach, Declare, EmptyStatement, Function, Class, Const, Case, Parameter, ClassVariable, UnaryOperator, PostUnaryOperator, BinaryOperator, AList, EncapsExpr, AskOperator, Exit, Print, Array, FunctionCall, ArrayPair, ObjectOperator, ArrayOperator, MapOperator, Isset, ConstantEncapsedString, ConstantString, PHPVariable, Constant, List, Nullary, Unary, Binary, Ternary, Quadary, Pin, and Variable. Referenced by operator<<(), and ContextMatch::php(). |
|
Writes node to the stream.
Implemented in ContextMatch, AttributeValue, Constant, List, Pin, and Variable. Referenced by AttributeValue::print(), and ContextMatch::print(). |
|
Correct only for lists.
Reimplemented in List. Definition at line 25 of file streenode.cpp. |
|
Substitutes variables in the node accordingly to the given assignment.
Implemented in ContextMatch, AttributeValue, Constant, List, Pin, and Variable. Referenced by substituteNode(). |
|
Returns the string representing the node.
Definition at line 18 of file streenode.cpp. Referenced by EncapsList::evaluate(), AttributeValue::evaluate(), NamedContextRule::execute(), ActionSet::execute(), RuleContext::executeOnPHPList(), LocalAttributeIsequalTester::test(), AttributeIsequalTester::test(), AttributeIssetTester::test(), TypeTester::test(), and NameTester::test(). |
|
Applies Transformer to every node in the tree.
Reimplemented in List. Definition at line 29 of file streenode.cpp. References Node::Transformer::transform(). Referenced by TransformerSet::apply(), and List::transform(). |
|
Writes the node to the stream by using Node::php.
Definition at line 14 of file streenode.cpp. |
|
Writes assignment to stream.
Definition at line 4 of file streenode.cpp. |
|
Substitutes variables in the node accordingly to the given assignment.
Definition at line 45 of file streenode.cpp. Referenced by List::substitute(), AttributeValue::substitute(), and ContextMatch::substitute(). |
|
The location of the node -- not used.
Definition at line 32 of file streenode.h. Referenced by Node(). |