antlr::BaseAST Class Reference

#include <BaseAST.hpp>

Inheritance diagram for antlr::BaseAST:
[legend]
Collaboration diagram for antlr::BaseAST:
[legend]

List of all members.

Public Member Functions

 BaseAST ()
 BaseAST (const BaseAST &other)
virtual ~BaseAST ()
virtual const char * typeName (void) const =0
 Return the class name.
virtual RefAST clone (void) const =0
 Clone this AST node.
virtual bool equals (RefAST t) const
 Is node t equal to this in terms of token type and text?
virtual bool equalsList (RefAST t) const
virtual bool equalsListPartial (RefAST t) const
virtual bool equalsTree (RefAST t) const
virtual bool equalsTreePartial (RefAST t) const
virtual std::vector< RefASTfindAll (RefAST t)
virtual std::vector< RefASTfindAllPartial (RefAST t)
virtual void addChild (RefAST c)
 Add a node to the end of the child list for this node.
virtual size_t getNumberOfChildren () const
virtual RefAST getFirstChild () const
 Get the first child of this node; null if no children.
virtual RefAST getNextSibling () const
 Get the next sibling in line after this one.
virtual std::string getText () const
 Get the token text for this node.
virtual int getType () const
 Get the token type for this node.
virtual void removeChildren ()
 Remove all children.
virtual void setFirstChild (RefAST c)
 Set the first child of a node.
virtual void setNextSibling (RefAST n)
 Set the next sibling after this one.
virtual void setText (const std::string &txt)
 Set the token text for this node.
virtual void setType (int type)
 Set the token type for this node.
virtual std::string toString () const
 Return string representation for the AST.
virtual std::string toStringList () const
 Print out a child sibling tree in LISP notation.
virtual std::string toStringTree () const

Protected Attributes

RefBaseAST down
RefBaseAST right

Private Member Functions

void doWorkForFindAll (std::vector< RefAST > &v, RefAST target, bool partialMatch)

Constructor & Destructor Documentation

antlr::BaseAST::BaseAST (  )  [inline]
antlr::BaseAST::BaseAST ( const BaseAST other  )  [inline]
virtual antlr::BaseAST::~BaseAST (  )  [inline, virtual]

Member Function Documentation

virtual void antlr::BaseAST::addChild ( RefAST  c  )  [inline, virtual]

Add a node to the end of the child list for this node.

Implements antlr::AST.

virtual RefAST antlr::BaseAST::clone ( void   )  const [pure virtual]

Clone this AST node.

Implements antlr::AST.

Implemented in antlr::CommonAST, and antlr::CommonASTWithHiddenTokens.

void antlr::BaseAST::doWorkForFindAll ( std::vector< RefAST > &  v,
RefAST  target,
bool  partialMatch 
) [private]
bool antlr::BaseAST::equals ( RefAST  t  )  const [inline, virtual]

Is node t equal to this in terms of token type and text?

Implements antlr::AST.

bool antlr::BaseAST::equalsList ( RefAST  t  )  const [virtual]

Is t an exact structural and equals() match of this tree. The 'this' reference is considered the start of a sibling list.

Implements antlr::AST.

bool antlr::BaseAST::equalsListPartial ( RefAST  sub  )  const [virtual]

Is 't' a subtree of this list? The siblings of the root are NOT ignored.

Is 'sub' a subtree of this list? The siblings of the root are NOT ignored.

Implements antlr::AST.

bool antlr::BaseAST::equalsTree ( RefAST  t  )  const [virtual]

Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.

Implements antlr::AST.

bool antlr::BaseAST::equalsTreePartial ( RefAST  sub  )  const [virtual]

Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.

Is 'sub' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.

Implements antlr::AST.

std::vector< RefAST > antlr::BaseAST::findAll ( RefAST  target  )  [virtual]

Walk the tree looking for all exact subtree matches. Return an ASTEnumerator that lets the caller walk the list of subtree roots found herein.

Implements antlr::AST.

std::vector< RefAST > antlr::BaseAST::findAllPartial ( RefAST  target  )  [virtual]

Walk the tree looking for all subtrees. Return an ASTEnumerator that lets the caller walk the list of subtree roots found herein.

Implements antlr::AST.

virtual RefAST antlr::BaseAST::getFirstChild (  )  const [inline, virtual]

Get the first child of this node; null if no children.

Implements antlr::AST.

virtual RefAST antlr::BaseAST::getNextSibling (  )  const [inline, virtual]

Get the next sibling in line after this one.

Implements antlr::AST.

size_t antlr::BaseAST::getNumberOfChildren (  )  const [virtual]

Get the number of child nodes of this node (shallow e.g. not of the whole tree it spans).

Implements antlr::AST.

virtual std ::string antlr::BaseAST::getText (  )  const [inline, virtual]

Get the token text for this node.

Implements antlr::AST.

Reimplemented in antlr::CommonAST.

virtual int antlr::BaseAST::getType (  )  const [inline, virtual]

Get the token type for this node.

Implements antlr::AST.

Reimplemented in antlr::CommonAST.

virtual void antlr::BaseAST::removeChildren (  )  [inline, virtual]

Remove all children.

virtual void antlr::BaseAST::setFirstChild ( RefAST  c  )  [inline, virtual]

Set the first child of a node.

Implements antlr::AST.

virtual void antlr::BaseAST::setNextSibling ( RefAST  n  )  [inline, virtual]

Set the next sibling after this one.

Implements antlr::AST.

virtual void antlr::BaseAST::setText ( const std::string &  txt  )  [inline, virtual]

Set the token text for this node.

Implements antlr::AST.

Reimplemented in antlr::CommonAST.

virtual void antlr::BaseAST::setType ( int  type  )  [inline, virtual]

Set the token type for this node.

Implements antlr::AST.

Reimplemented in antlr::CommonAST.

virtual std ::string antlr::BaseAST::toString (  )  const [inline, virtual]

Return string representation for the AST.

Implements antlr::AST.

std::string antlr::BaseAST::toStringList (  )  const [virtual]

Print out a child sibling tree in LISP notation.

Implements antlr::AST.

std::string antlr::BaseAST::toStringTree (  )  const [virtual]

Implements antlr::AST.

virtual const char* antlr::BaseAST::typeName ( void   )  const [pure virtual]

Return the class name.

Implements antlr::AST.

Implemented in antlr::CommonAST, and antlr::CommonASTWithHiddenTokens.


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines
Generated by  doxygen 1.6.2-20100208