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

List Class Reference

List is used for representing multiargument php elements. More...

#include <streelist.h>

Inheritance diagram for List:

Node Binary NamedList Nullary Quadary Ternary Unary ArrayOperator ArrayPair Case Const Declare Do MapOperator ObjectOperator PostUnaryOperator SmartyAssign Switch UnaryOperator While ArrayPairList AssignmentList CaseList DeclareList EncapsList ExpressionList InlineHTMLList StatementList TemplateList EmptyStatement For Foreach Function AskOperator BinaryOperator Class EncapsExpr FunctionCall If Parameter AList Array Break ClassVariable ConstantEncapsedString ConstantString Continue CurlyBraces DoubleQuote Echo EchoPHP Exit Expression Global InlineHTML Isset PHP PHPVariable Print Return SmartyBraces Static Template Unset Use

Public Member Functions

virtual SType getType () const
 Returns type of the node.

virtual string getName () const
 Returs string representing node type or name for List.

virtual int getLength () const
 Returns the length of the list.

 List (string iname)
 Creates a list with a given name.

 List (string iname, Node *statement)
 Creates a list with a given name containing one elemnet.

virtual Listpush_back (Node *statement)
 Pushes an element to the end of the list.

virtual Listpush_front (Node *statement)
 Pushes an element to the front of the list.

Listappend (List *toappend)
 Append toappend to the 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.

ListcopyList () const
 Copies the list.

virtual ~List ()
 Destroys the list.

virtual void getVariables (VariableList &vlist) const
 Returns list of variables used in the node.

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

virtual string evaluate (const NameSpace &nameSpace) const
 Computes the value of the expression (only basic atihmetic and string operations).


Protected Member Functions

ListcopyContent (List *newList) const
 Copies content of the list to newList nad returns pointer to newList.


Protected Attributes

string name
 Name of the list.


Detailed Description

List is used for representing multiargument php elements.

Definition at line 10 of file streelist.h.


Constructor & Destructor Documentation

List::List string  iname  ) 
 

Creates a list with a given name.

Definition at line 13 of file streelist.cpp.

Referenced by copy().

List::List string  iname,
Node statement
 

Creates a list with a given name containing one elemnet.

Definition at line 15 of file streelist.cpp.

References push_back().

List::~List  )  [virtual]
 

Destroys the list.

Definition at line 127 of file streelist.cpp.


Member Function Documentation

List * List::append List toappend  ) 
 

Append toappend to the list.

Definition at line 29 of file streelist.cpp.

Referenced by SubstitutionRule::execute(), and NamedContextRule::execute().

bool List::compare const Node p  )  const [virtual]
 

Comares node p to the node.

Implements Node.

Definition at line 91 of file streelist.cpp.

References getLength(), getName(), Node::getType(), and SList.

Node * List::copy  )  const [virtual]
 

Copies the node.

Implements Node.

Reimplemented in 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, Nullary, Unary, Binary, Ternary, and Quadary.

Definition at line 119 of file streelist.cpp.

References copyContent(), getName(), and List().

Referenced by copyList(), SubstitutionRule::execute(), NamedContextRule::execute(), and Variable::matchToBegining().

List * List::copyContent List newList  )  const [protected]
 

Copies content of the list to newList nad returns pointer to newList.

Definition at line 3 of file streelist.cpp.

References push_back().

Referenced by copy(), AssignmentList::copy(), EncapsList::copy(), CaseList::copy(), DeclareList::copy(), ArrayPairList::copy(), ExpressionList::copy(), TemplateList::copy(), InlineHTMLList::copy(), and StatementList::copy().

List * List::copyList  )  const
 

Copies the list.

Definition at line 123 of file streelist.cpp.

References copy().

Referenced by SubstitutionRule::copy(), SingleContextRule::copy(), MultiContextRule::copy(), and ActionRule::copy().

string List::evaluate const NameSpace nameSpace  )  const [virtual]
 

Computes the value of the expression (only basic atihmetic and string operations).

Implements Node.

Reimplemented in EncapsList, DoubleQuote, UnaryOperator, PostUnaryOperator, BinaryOperator, EncapsExpr, AskOperator, ConstantEncapsedString, and ConstantString.

Definition at line 185 of file streelist.cpp.

bool List::exists const Tester *  tester,
const NameSpace nameSpace
const [virtual]
 

Applies Transformer to every node in the tree.

Reimplemented from Node.

Definition at line 172 of file streelist.cpp.

bool List::forall const Tester *  tester,
const NameSpace nameSpace
const [virtual]
 

Returns true is for all nodes in the.

Reimplemented from Node.

Definition at line 159 of file streelist.cpp.

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

Returns the length of the list.

Reimplemented from Node.

Definition at line 25 of file streelist.h.

Referenced by compare(), SubstitutionRule::execute(), NamedContextRule::execute(), ActionRule::execute(), RuleContext::executeOnPHPList(), match(), matchToBegining(), and NamedContextRule::runRules().

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

Returs string representing node type or name for List.

Implements Node.

Definition at line 22 of file streelist.h.

References name.

Referenced by compare(), Quadary::copy(), Ternary::copy(), Binary::copy(), Unary::copy(), Nullary::copy(), copy(), match(), Quadary::php(), Ternary::php(), Binary::php(), Unary::php(), and Nullary::php().

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

Returns type of the node.

Implements Node.

Definition at line 21 of file streelist.h.

References SList, and SType.

void List::getVariables VariableList vlist  )  const [virtual]
 

Returns list of variables used in the node.

Implements Node.

Definition at line 136 of file streelist.cpp.

Referenced by RuleContext::assignVariableNames().

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

Matches node p to the node. If node matches sets the assignment.

Implements Node.

Definition at line 55 of file streelist.cpp.

References getLength(), getName(), Node::getType(), and SList.

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

Matches the list to the begining of p.

Implements Node.

Definition at line 74 of file streelist.cpp.

References getLength().

Referenced by SubstitutionRule::execute(), NamedContextRule::execute(), and ActionRule::execute().

ostream & List::php ostream &  os  )  const [virtual]
 

Writes node to the stream as php.

Implements Node.

Reimplemented in 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, Nullary, Unary, Binary, Ternary, and Quadary.

Definition at line 50 of file streelist.cpp.

References name, and print().

ostream & List::print ostream &  os  )  const [virtual]
 

Writes node to the stream.

Implements Node.

Definition at line 38 of file streelist.cpp.

References name.

Referenced by IncludeRule::execute(), RuleContext::executeOnPHP(), php(), SubstitutionRule::print(), SingleContextRule::print(), NamedContextRule::print(), MultiContextRule::print(), and ActionRule::print().

List * List::push_back Node statement  )  [virtual]
 

Pushes an element to the end of the list.

Reimplemented from Node.

Definition at line 19 of file streelist.cpp.

Referenced by Binary::Binary(), copyContent(), ContextRule::execute(), ActionRule::execute(), NamedContext::leaveContext(), List(), NamedList::NamedList(), PHPFiles::phpFooter(), Quadary::Quadary(), Ternary::Ternary(), EchoNormalizer::transform(), and Unary::Unary().

List * List::push_front Node statement  )  [virtual]
 

Pushes an element to the front of the list.

Definition at line 24 of file streelist.cpp.

Referenced by PHPFiles::phpHeader().

Node * List::substitute const Assignment &  assign  )  [virtual]
 

Substitutes variables in the node accordingly to the given assignment.

Implements Node.

Definition at line 109 of file streelist.cpp.

References Node::substituteNode.

Referenced by RuleContext::assignVariableNames(), SubstitutionRule::execute(), NamedContextRule::execute(), ContextRule::execute(), SubstitutionRule::substitute(), ContextRule::substitute(), and ActionRule::substitute().

Node * List::transform const Transformer *  transformer  )  [virtual]
 

Applies Transformer to every node in the tree.

Reimplemented from Node.

Definition at line 145 of file streelist.cpp.

References Node::transform().


Field Documentation

string List::name [protected]
 

Name of the list.

Definition at line 14 of file streelist.h.

Referenced by getName(), php(), and print().


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