KDevelop API Documentation

languages/ada/AdaAST.hpp

Go to the documentation of this file.
00001 #ifndef ADAAST_HPP 00002 #define ADAAST_HPP 00003 00004 #include <antlr/CommonAST.hpp> 00005 00006 class AdaAST; 00007 typedef antlr::ASTRefCount<AdaAST> RefAdaAST; 00008 00009 class AdaAST : public antlr::CommonAST { 00010 public: 00011 AdaAST() : m_line (0), m_column (0) {} 00012 00013 ~AdaAST() {} 00014 00015 int getLine () const { return m_line; } 00016 void setLine (int line) { m_line = line; } 00017 00018 int getColumn () const { return m_column; } 00019 void setColumn (int column) { m_column = column; } 00020 00021 void initialize (antlr::RefToken t) { 00022 antlr::CommonAST::initialize (t); 00023 m_line = t->getLine () - 1; 00024 m_column = t->getColumn () - 1; 00025 } 00026 00027 void initialize (int t, const std::string& txt) { 00028 setType (t); 00029 setText (txt); 00030 m_line = 0; 00031 m_column = 0; 00032 } 00033 00034 RefAdaAST duplicate (void) const { 00035 AdaAST *ast = new AdaAST (*this); 00036 return RefAdaAST (ast); 00037 } 00038 00039 void set (int t, const std::string& txt) { 00040 setType (t); 00041 setText (txt); 00042 } 00043 00044 void addChild (RefAdaAST c) { 00045 antlr::RefAST n( c.get() ); 00046 antlr::BaseAST::addChild (n); 00047 } 00048 00049 RefAdaAST down () const { 00050 return RefAdaAST (antlr::BaseAST::getFirstChild ()); 00051 } 00052 00053 RefAdaAST right () const { 00054 return RefAdaAST (antlr::BaseAST::getNextSibling ()); 00055 } 00056 00057 /* bool equals(RefAdaAST t) const { 00058 return ((antlr::BaseAST*)this)->equals (t); 00059 } */ 00060 00061 static antlr::RefAST factory (void) { 00062 RefAdaAST n( new AdaAST ); 00063 return n.get(); 00064 } 00065 00066 static const RefAdaAST nullAdaAST; 00067 00068 private: 00069 int m_line; 00070 int m_column; 00071 }; 00072 00073 #define Set(n, t) (n)->set(t, #t) 00074 00075 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:38:56 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003