--- branches/development/src/antlr/BaseAST.hpp 2010/07/09 23:08:25 1465 +++ branches/development/src/antlr/BaseAST.hpp 2011/09/15 13:39:36 1633 @@ -8,11 +8,11 @@ * $Id$ */ -#include - #include #include +#include + #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE namespace antlr { #endif @@ -34,17 +34,10 @@ class ANTLR_API BaseAST : public AST { (public) } /// Return the class name - const char* typeName( void ) const - { - return BaseAST::TYPE_NAME; - } + virtual const char* typeName( void ) const = 0; /// Clone this AST node. - RefAST clone( void ) const - { - ANTLR_USE_NAMESPACE(std)cerr << "BaseAST::clone()" << ANTLR_USE_NAMESPACE(std)endl; - return nullAST; - } + virtual RefAST clone( void ) const = 0; /// Is node t equal to this in terms of token type and text? virtual bool equals(RefAST t) const; @@ -138,7 +131,7 @@ class ANTLR_API BaseAST : public AST { (public) } /// Set the next sibling after this one. - void setNextSibling(RefAST n) + virtual void setNextSibling(RefAST n) { right = static_cast(static_cast(n)); } @@ -175,8 +168,6 @@ class ANTLR_API BaseAST : public AST { (public) /// Print out a child sibling tree in LISP notation virtual ANTLR_USE_NAMESPACE(std)string toStringList() const; virtual ANTLR_USE_NAMESPACE(std)string toStringTree() const; - - static const char* const TYPE_NAME; protected: RefBaseAST down; RefBaseAST right;