KDevelop API Documentation

BaseAST Class Reference

#include <BaseAST.hpp>

Inheritance diagram for BaseAST:

Inheritance graph
[legend]
Collaboration diagram for BaseAST:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BaseAST ()
 BaseAST (const BaseAST &other)
virtual ~BaseAST ()
virtual const char * typeName (void) const
 Return the class name.
virtual RefAST clone (void) const
 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
 Is t an exact structural and equals() match of this tree.
virtual bool equalsListPartial (RefAST t) const
 Is 't' a subtree of this list? The siblings of the root are NOT ignored.
virtual bool equalsTree (RefAST t) const
 Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.
virtual bool equalsTreePartial (RefAST t) const
 Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.
virtual std::vector< RefASTfindAll (RefAST t)
 Walk the tree looking for all exact subtree matches.
virtual std::vector< RefASTfindAllPartial (RefAST t)
 Walk the tree looking for all subtrees.
virtual void addChild (RefAST c)
 Add a node to the end of the child list for this node.
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.
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

BaseAST::BaseAST  ) 
 

Definition at line 23 of file BaseAST.cpp.

BaseAST::BaseAST const BaseAST other  ) 
 

Definition at line 31 of file BaseAST.cpp.

BaseAST::~BaseAST  )  [virtual]
 

Definition at line 27 of file BaseAST.cpp.


Member Function Documentation

void BaseAST::addChild RefAST  c  )  [virtual]
 

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

Implements AST.

Definition at line 47 of file BaseAST.cpp.

References down, RefAST, and RefBaseAST.

RefAST BaseAST::clone void   )  const [virtual]
 

Clone this AST node.

Implements AST.

Reimplemented in CommonAST, and CommonASTWithHiddenTokens.

Definition at line 41 of file BaseAST.cpp.

References RefAST.

void BaseAST::doWorkForFindAll std::vector< RefAST > &  v,
RefAST  target,
bool  partialMatch
[private]
 

Definition at line 64 of file BaseAST.cpp.

References RefAST, and RefBaseAST.

bool BaseAST::equals RefAST  t  )  const [inline, virtual]
 

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

Implements AST.

Definition at line 147 of file BaseAST.hpp.

References AST::getText(), AST::getType(), and RefAST.

Referenced by equalsTree(), and equalsTreePartial().

bool 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 AST.

Definition at line 87 of file BaseAST.cpp.

References RefAST.

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

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

Implements AST.

Definition at line 120 of file BaseAST.cpp.

References RefAST.

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

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

Implements AST.

Definition at line 150 of file BaseAST.cpp.

References equals(), getFirstChild(), and RefAST.

bool BaseAST::equalsTreePartial RefAST  t  )  const [virtual]
 

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

Implements AST.

Definition at line 170 of file BaseAST.cpp.

References equals(), getFirstChild(), and RefAST.

std::vector< RefAST > BaseAST::findAll RefAST  t  )  [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 AST.

Definition at line 191 of file BaseAST.cpp.

References ANTLR_USE_NAMESPACE, and RefAST.

std::vector< RefAST > BaseAST::findAllPartial RefAST  t  )  [virtual]
 

Walk the tree looking for all subtrees.

Return an ASTEnumerator that lets the caller walk the list of subtree roots found herein.

Implements AST.

Definition at line 207 of file BaseAST.cpp.

References ANTLR_USE_NAMESPACE, and RefAST.

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

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

Implements AST.

Definition at line 71 of file BaseAST.hpp.

References RefAST.

Referenced by equalsTree(), and equalsTreePartial().

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

Get the next sibling in line after this one.

Implements AST.

Definition at line 76 of file BaseAST.hpp.

References RefAST.

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

Get the token text for this node.

Implements AST.

Reimplemented in CommonAST.

Definition at line 82 of file BaseAST.hpp.

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

Get the token type for this node.

Implements AST.

Reimplemented in CommonAST.

Definition at line 87 of file BaseAST.hpp.

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

Remove all children.

Definition at line 93 of file BaseAST.hpp.

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

Set the first child of a node.

Implements AST.

Definition at line 99 of file BaseAST.hpp.

References RefAST.

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

Set the next sibling after this one.

Implements AST.

Definition at line 105 of file BaseAST.hpp.

References RefAST.

void BaseAST::setText const std::string &  txt  )  [virtual]
 

Set the token text for this node.

Implements AST.

Reimplemented in CommonAST.

Definition at line 218 of file BaseAST.cpp.

void BaseAST::setType int  type  )  [virtual]
 

Set the token type for this node.

Implements AST.

Reimplemented in CommonAST.

Definition at line 222 of file BaseAST.cpp.

std::string BaseAST::toString  )  const [virtual]
 

Return string representation for the AST.

Implements AST.

Definition at line 226 of file BaseAST.cpp.

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

Print out a child sibling tree in LISP notation.

Implements AST.

Definition at line 231 of file BaseAST.cpp.

References ANTLR_USE_NAMESPACE.

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

Implements AST.

Definition at line 254 of file BaseAST.cpp.

References ANTLR_USE_NAMESPACE.

const char * BaseAST::typeName void   )  const [virtual]
 

Return the class name.

Implements AST.

Reimplemented in CommonAST, and CommonASTWithHiddenTokens.

Definition at line 36 of file BaseAST.cpp.


Member Data Documentation

RefBaseAST BaseAST::down [protected]
 

Definition at line 137 of file BaseAST.hpp.

Referenced by addChild().

RefBaseAST BaseAST::right [protected]
 

Definition at line 138 of file BaseAST.hpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:37:05 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003