KDevelop API Documentation

languages/java/JavaAST.hpp

Go to the documentation of this file.
00001 #ifndef JAVAAST_HPP 00002 #define JAVAAST_HPP 00003 00004 #include <antlr/CommonAST.hpp> 00005 #include <antlr/ASTFactory.hpp> 00006 00007 class JavaAST; 00008 typedef ANTLR_USE_NAMESPACE(antlr)ASTRefCount<JavaAST> RefJavaAST; 00009 00010 class JavaAST : public ANTLR_USE_NAMESPACE(antlr)CommonAST 00011 { 00012 public: 00013 JavaAST() 00014 : m_line(0), m_column(0) {} 00015 00016 virtual ~JavaAST() {} 00017 00018 int getLine() const { return m_line; } 00019 void setLine( int line ) { m_line = line; } 00020 00021 int getColumn() const { return m_column; } 00022 void setColumn( int column ) { m_column = column; } 00023 00024 void initialize( ANTLR_USE_NAMESPACE(antlr)RefToken t ) 00025 { 00026 CommonAST::initialize(t); 00027 m_line = t->getLine() - 1; 00028 m_column = t->getColumn() - 1; 00029 } 00030 00031 void initialize( ANTLR_USE_NAMESPACE(antlr)RefAST t ) 00032 { 00033 CommonAST::initialize( t ); 00034 00035 m_line = 0; 00036 m_column = 0; 00037 00038 RefJavaAST a( dynamic_cast<JavaAST*>(t.get()) ); 00039 m_line = a->getLine(); 00040 m_column = a->getColumn(); 00041 } 00042 00043 void initialize(int t, const ANTLR_USE_NAMESPACE(std)string& txt) 00044 { 00045 CommonAST::initialize( t, txt ); 00046 m_line = 0; 00047 m_column = 0; 00048 } 00049 00050 static ANTLR_USE_NAMESPACE(antlr)RefAST factory() 00051 { 00052 RefJavaAST n(new JavaAST); 00053 return n.get(); 00054 } 00055 00056 00057 private: 00058 int m_line; 00059 int m_column; 00060 00061 private: 00062 JavaAST( const JavaAST& source ); 00063 void operator = ( const JavaAST& source ); 00064 }; 00065 00066 namespace antlr 00067 { 00068 00069 class JavaASTFactory: public ASTFactory 00070 { 00071 public: 00072 JavaASTFactory(): ASTFactory( "JavaAST", JavaAST::factory ) {} 00073 }; 00074 00075 } // namespace antlr 00076 00077 #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 Tue Oct 19 08:01:43 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003