From 4ae7b32dc09eb7acd9411a8af63a767660aa64ec Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 17 Dec 2020 20:50:19 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro (cherry picked from commit 3e3d9eda9d1dd8c67c1c27c6a9bdc68bdecfcc30) --- languages/java/JavaAST.h | 77 +++++ languages/java/JavaAST.hpp | 77 ----- languages/java/JavaLexer.cpp | 16 +- languages/java/JavaLexer.h | 132 +++++++++ languages/java/JavaLexer.hpp | 132 --------- languages/java/JavaRecognizer.cpp | 8 +- languages/java/JavaRecognizer.h | 423 +++++++++++++++++++++++++++ languages/java/JavaRecognizer.hpp | 423 --------------------------- languages/java/JavaStoreWalker.cpp | 14 +- languages/java/JavaStoreWalker.h | 164 +++++++++++ languages/java/JavaStoreWalker.hpp | 164 ----------- languages/java/JavaStoreWalkerTokenTypes.h | 169 +++++++++++ languages/java/JavaStoreWalkerTokenTypes.hpp | 169 ----------- languages/java/JavaTokenTypes.h | 168 +++++++++++ languages/java/JavaTokenTypes.hpp | 168 ----------- languages/java/Makefile.am | 4 +- languages/java/backgroundparser.h | 2 +- languages/java/driver.cpp | 6 +- languages/java/driver.h | 2 +- languages/java/java.g | 2 +- languages/java/java.store.g | 2 +- languages/java/javasupportpart.cpp | 4 +- languages/java/kdevdriver.cpp | 2 +- 23 files changed, 1164 insertions(+), 1164 deletions(-) create mode 100644 languages/java/JavaAST.h delete mode 100644 languages/java/JavaAST.hpp create mode 100644 languages/java/JavaLexer.h delete mode 100644 languages/java/JavaLexer.hpp create mode 100644 languages/java/JavaRecognizer.h delete mode 100644 languages/java/JavaRecognizer.hpp create mode 100644 languages/java/JavaStoreWalker.h delete mode 100644 languages/java/JavaStoreWalker.hpp create mode 100644 languages/java/JavaStoreWalkerTokenTypes.h delete mode 100644 languages/java/JavaStoreWalkerTokenTypes.hpp create mode 100644 languages/java/JavaTokenTypes.h delete mode 100644 languages/java/JavaTokenTypes.hpp (limited to 'languages/java') diff --git a/languages/java/JavaAST.h b/languages/java/JavaAST.h new file mode 100644 index 00000000..4d89452e --- /dev/null +++ b/languages/java/JavaAST.h @@ -0,0 +1,77 @@ +#ifndef JAVAAST_HPP +#define JAVAAST_HPP + +#include +#include + +class JavaAST; +typedef ANTLR_USE_NAMESPACE(antlr)ASTRefCount RefJavaAST; + +class JavaAST : public ANTLR_USE_NAMESPACE(antlr)CommonAST +{ +public: + JavaAST() + : m_line(0), m_column(0) {} + + virtual ~JavaAST() {} + + int getLine() const { return m_line; } + void setLine( int line ) { m_line = line; } + + int getColumn() const { return m_column; } + void setColumn( int column ) { m_column = column; } + + void initialize( ANTLR_USE_NAMESPACE(antlr)RefToken t ) + { + CommonAST::initialize(t); + m_line = t->getLine() - 1; + m_column = t->getColumn() - 1; + } + + void initialize( ANTLR_USE_NAMESPACE(antlr)RefAST t ) + { + CommonAST::initialize( t ); + + m_line = 0; + m_column = 0; + + RefJavaAST a( dynamic_cast(t.get()) ); + m_line = a->getLine(); + m_column = a->getColumn(); + } + + void initialize(int t, const ANTLR_USE_NAMESPACE(std)string& txt) + { + CommonAST::initialize( t, txt ); + m_line = 0; + m_column = 0; + } + + static ANTLR_USE_NAMESPACE(antlr)RefAST factory() + { + RefJavaAST n(new JavaAST); + return n.get(); + } + + +private: + int m_line; + int m_column; + +private: + JavaAST( const JavaAST& source ); + void operator = ( const JavaAST& source ); +}; + +namespace antlr +{ + +class JavaASTFactory: public ASTFactory +{ +public: + JavaASTFactory(): ASTFactory( "JavaAST", JavaAST::factory ) {} +}; + +} // namespace antlr + +#endif diff --git a/languages/java/JavaAST.hpp b/languages/java/JavaAST.hpp deleted file mode 100644 index 7108fca1..00000000 --- a/languages/java/JavaAST.hpp +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef JAVAAST_HPP -#define JAVAAST_HPP - -#include -#include - -class JavaAST; -typedef ANTLR_USE_NAMESPACE(antlr)ASTRefCount RefJavaAST; - -class JavaAST : public ANTLR_USE_NAMESPACE(antlr)CommonAST -{ -public: - JavaAST() - : m_line(0), m_column(0) {} - - virtual ~JavaAST() {} - - int getLine() const { return m_line; } - void setLine( int line ) { m_line = line; } - - int getColumn() const { return m_column; } - void setColumn( int column ) { m_column = column; } - - void initialize( ANTLR_USE_NAMESPACE(antlr)RefToken t ) - { - CommonAST::initialize(t); - m_line = t->getLine() - 1; - m_column = t->getColumn() - 1; - } - - void initialize( ANTLR_USE_NAMESPACE(antlr)RefAST t ) - { - CommonAST::initialize( t ); - - m_line = 0; - m_column = 0; - - RefJavaAST a( dynamic_cast(t.get()) ); - m_line = a->getLine(); - m_column = a->getColumn(); - } - - void initialize(int t, const ANTLR_USE_NAMESPACE(std)string& txt) - { - CommonAST::initialize( t, txt ); - m_line = 0; - m_column = 0; - } - - static ANTLR_USE_NAMESPACE(antlr)RefAST factory() - { - RefJavaAST n(new JavaAST); - return n.get(); - } - - -private: - int m_line; - int m_column; - -private: - JavaAST( const JavaAST& source ); - void operator = ( const JavaAST& source ); -}; - -namespace antlr -{ - -class JavaASTFactory: public ASTFactory -{ -public: - JavaASTFactory(): ASTFactory( "JavaAST", JavaAST::factory ) {} -}; - -} // namespace antlr - -#endif diff --git a/languages/java/JavaLexer.cpp b/languages/java/JavaLexer.cpp index 623e816f..4230b156 100644 --- a/languages/java/JavaLexer.cpp +++ b/languages/java/JavaLexer.cpp @@ -1,12 +1,12 @@ /* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaLexer.cpp"$ */ -#include "JavaLexer.hpp" -#include -#include -#include -#include -#include -#include -#include +#include "JavaLexer.h" +#include +#include +#include +#include +#include +#include +#include #line 1041 "java.g" diff --git a/languages/java/JavaLexer.h b/languages/java/JavaLexer.h new file mode 100644 index 00000000..e5b6fb1d --- /dev/null +++ b/languages/java/JavaLexer.h @@ -0,0 +1,132 @@ +#ifndef INC_JavaLexer_h_ +#define INC_JavaLexer_h_ + +#line 2 "java.g" + + #include "driver.h" + #include "JavaAST.h" + + #include + #include + + #define SET_POSITION(ast,t)\ + { \ + RefJavaAST(ast)->setLine( t->getLine() );\ + RefJavaAST(ast)->setColumn( t->getColumn() ); \ + } + +#line 19 "JavaLexer.h" +#include +/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaLexer.h"$ */ +#include +#include +#include +#include "JavaTokenTypes.h" +#include +class CUSTOM_API JavaLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public JavaTokenTypes +{ +#line 1058 "java.g" + +private: + Driver* m_driver; + +public: + void setDriver( Driver* d ) { m_driver = d; } + void setFileName( const TQString& fileName ) { m_driver->currentFileName() = fileName; } + + virtual void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){ + m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(ex.getMessage().c_str()), ex.getLine(), ex.getColumn()) ); + } + + virtual void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){ + m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(errorMessage.c_str()), getLine(), getColumn()) ); + } + + virtual void reportWarning( const ANTLR_USE_NAMESPACE(std)string& warnMessage ){ + m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(warnMessage.c_str()), getLine(), getColumn()) ); + } +#line 30 "JavaLexer.h" +private: + void initLiterals(); +public: + bool getCaseSensitiveLiterals() const + { + return true; + } +public: + JavaLexer(ANTLR_USE_NAMESPACE(std)istream& in); + JavaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib); + JavaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state); + ANTLR_USE_NAMESPACE(antlr)RefToken nextToken(); + public: void mQUESTION(bool _createToken); + public: void mLPAREN(bool _createToken); + public: void mRPAREN(bool _createToken); + public: void mLBRACK(bool _createToken); + public: void mRBRACK(bool _createToken); + public: void mLCURLY(bool _createToken); + public: void mRCURLY(bool _createToken); + public: void mCOLON(bool _createToken); + public: void mCOMMA(bool _createToken); + public: void mASSIGN(bool _createToken); + public: void mEQUAL(bool _createToken); + public: void mLNOT(bool _createToken); + public: void mBNOT(bool _createToken); + public: void mNOT_EQUAL(bool _createToken); + public: void mDIV(bool _createToken); + public: void mDIV_ASSIGN(bool _createToken); + public: void mPLUS(bool _createToken); + public: void mPLUS_ASSIGN(bool _createToken); + public: void mINC(bool _createToken); + public: void mMINUS(bool _createToken); + public: void mMINUS_ASSIGN(bool _createToken); + public: void mDEC(bool _createToken); + public: void mSTAR(bool _createToken); + public: void mSTAR_ASSIGN(bool _createToken); + public: void mMOD(bool _createToken); + public: void mMOD_ASSIGN(bool _createToken); + public: void mSR(bool _createToken); + public: void mSR_ASSIGN(bool _createToken); + public: void mBSR(bool _createToken); + public: void mBSR_ASSIGN(bool _createToken); + public: void mGE(bool _createToken); + public: void mGT(bool _createToken); + public: void mSL(bool _createToken); + public: void mSL_ASSIGN(bool _createToken); + public: void mLE(bool _createToken); + public: void mLT_(bool _createToken); + public: void mBXOR(bool _createToken); + public: void mBXOR_ASSIGN(bool _createToken); + public: void mBOR(bool _createToken); + public: void mBOR_ASSIGN(bool _createToken); + public: void mLOR(bool _createToken); + public: void mBAND(bool _createToken); + public: void mBAND_ASSIGN(bool _createToken); + public: void mLAND(bool _createToken); + public: void mSEMI(bool _createToken); + public: void mWS(bool _createToken); + public: void mSL_COMMENT(bool _createToken); + public: void mML_COMMENT(bool _createToken); + public: void mCHAR_LITERAL(bool _createToken); + protected: void mESC(bool _createToken); + public: void mSTRING_LITERAL(bool _createToken); + protected: void mHEX_DIGIT(bool _createToken); + protected: void mVOCAB(bool _createToken); + public: void mIDENT(bool _createToken); + public: void mNUM_INT(bool _createToken); + protected: void mEXPONENT(bool _createToken); + protected: void mFLOAT_SUFFIX(bool _createToken); +private: + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; + static const unsigned long _tokenSet_4_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; +}; + +#endif /*INC_JavaLexer_h_*/ diff --git a/languages/java/JavaLexer.hpp b/languages/java/JavaLexer.hpp deleted file mode 100644 index 9d185686..00000000 --- a/languages/java/JavaLexer.hpp +++ /dev/null @@ -1,132 +0,0 @@ -#ifndef INC_JavaLexer_hpp_ -#define INC_JavaLexer_hpp_ - -#line 2 "java.g" - - #include "driver.h" - #include "JavaAST.hpp" - - #include - #include - - #define SET_POSITION(ast,t)\ - { \ - RefJavaAST(ast)->setLine( t->getLine() );\ - RefJavaAST(ast)->setColumn( t->getColumn() ); \ - } - -#line 19 "JavaLexer.hpp" -#include -/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaLexer.hpp"$ */ -#include -#include -#include -#include "JavaTokenTypes.hpp" -#include -class CUSTOM_API JavaLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public JavaTokenTypes -{ -#line 1058 "java.g" - -private: - Driver* m_driver; - -public: - void setDriver( Driver* d ) { m_driver = d; } - void setFileName( const TQString& fileName ) { m_driver->currentFileName() = fileName; } - - virtual void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){ - m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(ex.getMessage().c_str()), ex.getLine(), ex.getColumn()) ); - } - - virtual void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){ - m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(errorMessage.c_str()), getLine(), getColumn()) ); - } - - virtual void reportWarning( const ANTLR_USE_NAMESPACE(std)string& warnMessage ){ - m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(warnMessage.c_str()), getLine(), getColumn()) ); - } -#line 30 "JavaLexer.hpp" -private: - void initLiterals(); -public: - bool getCaseSensitiveLiterals() const - { - return true; - } -public: - JavaLexer(ANTLR_USE_NAMESPACE(std)istream& in); - JavaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib); - JavaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state); - ANTLR_USE_NAMESPACE(antlr)RefToken nextToken(); - public: void mQUESTION(bool _createToken); - public: void mLPAREN(bool _createToken); - public: void mRPAREN(bool _createToken); - public: void mLBRACK(bool _createToken); - public: void mRBRACK(bool _createToken); - public: void mLCURLY(bool _createToken); - public: void mRCURLY(bool _createToken); - public: void mCOLON(bool _createToken); - public: void mCOMMA(bool _createToken); - public: void mASSIGN(bool _createToken); - public: void mEQUAL(bool _createToken); - public: void mLNOT(bool _createToken); - public: void mBNOT(bool _createToken); - public: void mNOT_EQUAL(bool _createToken); - public: void mDIV(bool _createToken); - public: void mDIV_ASSIGN(bool _createToken); - public: void mPLUS(bool _createToken); - public: void mPLUS_ASSIGN(bool _createToken); - public: void mINC(bool _createToken); - public: void mMINUS(bool _createToken); - public: void mMINUS_ASSIGN(bool _createToken); - public: void mDEC(bool _createToken); - public: void mSTAR(bool _createToken); - public: void mSTAR_ASSIGN(bool _createToken); - public: void mMOD(bool _createToken); - public: void mMOD_ASSIGN(bool _createToken); - public: void mSR(bool _createToken); - public: void mSR_ASSIGN(bool _createToken); - public: void mBSR(bool _createToken); - public: void mBSR_ASSIGN(bool _createToken); - public: void mGE(bool _createToken); - public: void mGT(bool _createToken); - public: void mSL(bool _createToken); - public: void mSL_ASSIGN(bool _createToken); - public: void mLE(bool _createToken); - public: void mLT_(bool _createToken); - public: void mBXOR(bool _createToken); - public: void mBXOR_ASSIGN(bool _createToken); - public: void mBOR(bool _createToken); - public: void mBOR_ASSIGN(bool _createToken); - public: void mLOR(bool _createToken); - public: void mBAND(bool _createToken); - public: void mBAND_ASSIGN(bool _createToken); - public: void mLAND(bool _createToken); - public: void mSEMI(bool _createToken); - public: void mWS(bool _createToken); - public: void mSL_COMMENT(bool _createToken); - public: void mML_COMMENT(bool _createToken); - public: void mCHAR_LITERAL(bool _createToken); - protected: void mESC(bool _createToken); - public: void mSTRING_LITERAL(bool _createToken); - protected: void mHEX_DIGIT(bool _createToken); - protected: void mVOCAB(bool _createToken); - public: void mIDENT(bool _createToken); - public: void mNUM_INT(bool _createToken); - protected: void mEXPONENT(bool _createToken); - protected: void mFLOAT_SUFFIX(bool _createToken); -private: - - static const unsigned long _tokenSet_0_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; - static const unsigned long _tokenSet_1_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; - static const unsigned long _tokenSet_2_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; - static const unsigned long _tokenSet_3_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; - static const unsigned long _tokenSet_4_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; -}; - -#endif /*INC_JavaLexer_hpp_*/ diff --git a/languages/java/JavaRecognizer.cpp b/languages/java/JavaRecognizer.cpp index 1021c6a0..7d010b49 100644 --- a/languages/java/JavaRecognizer.cpp +++ b/languages/java/JavaRecognizer.cpp @@ -1,8 +1,8 @@ /* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaRecognizer.cpp"$ */ -#include "JavaRecognizer.hpp" -#include -#include -#include +#include "JavaRecognizer.h" +#include +#include +#include #line 1 "java.g" #line 8 "JavaRecognizer.cpp" JavaRecognizer::JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k) diff --git a/languages/java/JavaRecognizer.h b/languages/java/JavaRecognizer.h new file mode 100644 index 00000000..32311a3d --- /dev/null +++ b/languages/java/JavaRecognizer.h @@ -0,0 +1,423 @@ +#ifndef INC_JavaRecognizer_h_ +#define INC_JavaRecognizer_h_ + +#line 2 "java.g" + + #include "driver.h" + #include "JavaAST.h" + + #include + #include + + #define SET_POSITION(ast,t)\ + { \ + RefJavaAST(ast)->setLine( t->getLine() );\ + RefJavaAST(ast)->setColumn( t->getColumn() ); \ + } + +#line 19 "JavaRecognizer.h" +#include +/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaRecognizer.h"$ */ +#include +#include +#include "JavaTokenTypes.h" +#include + +/** Java 1.3 Recognizer + * + * Run 'java Main [-showtree] directory-full-of-java-files' + * + * [The -showtree option pops up a Swing frame that shows + * the AST constructed from the parser.] + * + * Run 'java Main ' + * + * Contributing authors: + * John Mitchell johnm@non.net + * Terence Parr parrt@magelang.com + * John Lilley jlilley@empathy.com + * Scott Stanchfield thetick@magelang.com + * Markus Mohnen mohnen@informatik.rwth-aachen.de + * Peter Williams pete.williams@sun.com + * Allan Jacobs Allan.Jacobs@eng.sun.com + * Steve Messick messick@redhills.com + * John Pybus john@pybus.org + * + * Version 1.00 December 9, 1997 -- initial release + * Version 1.01 December 10, 1997 + * fixed bug in octal def (0..7 not 0..8) + * Version 1.10 August 1998 (parrt) + * added tree construction + * fixed definition of WS,comments for mac,pc,unix newlines + * added unary plus + * Version 1.11 (Nov 20, 1998) + * Added "shutup" option to turn off last ambig warning. + * Fixed inner class def to allow named class defs as statements + * synchronized requires compound not simple statement + * add [] after builtInType DOT class in primaryExpression + * "const" is reserved but not valid..removed from modifiers + * Version 1.12 (Feb 2, 1999) + * Changed LITERAL_xxx to xxx in tree grammar. + * Updated java.g to use tokens {...} now for 2.6.0 (new feature). + * + * Version 1.13 (Apr 23, 1999) + * Didn't have (stat)? for else clause in tree parser. + * Didn't gen ASTs for interface extends. Updated tree parser too. + * Updated to 2.6.0. + * Version 1.14 (Jun 20, 1999) + * Allowed final/abstract on local classes. + * Removed local interfaces from methods + * Put instanceof precedence where it belongs...in relationalExpr + * It also had expr not type as arg; fixed it. + * Missing ! on SEMI in classBlock + * fixed: (expr) + "string" was parsed incorrectly (+ as unary plus). + * fixed: didn't like Object[].class in parser or tree parser + * Version 1.15 (Jun 26, 1999) + * Screwed up rule with instanceof in it. :( Fixed. + * Tree parser didn't like (expr).something; fixed. + * Allowed multiple inheritance in tree grammar. oops. + * Version 1.16 (August 22, 1999) + * Extending an interface built a wacky tree: had extra EXTENDS. + * Tree grammar didn't allow multiple superinterfaces. + * Tree grammar didn't allow empty var initializer: {} + * Version 1.17 (October 12, 1999) + * ESC lexer rule allowed 399 max not 377 max. + * java.tree.g didn't handle the expression of synchronized + * statements. + * Version 1.18 (August 12, 2001) + * Terence updated to Java 2 Version 1.3 by + * observing/combining work of Allan Jacobs and Steve + * Messick. Handles 1.3 src. Summary: + * o primary didn't include boolean.class kind of thing + * o constructor calls parsed explicitly now: + * see explicitConstructorInvocation + * o add strictfp modifier + * o missing objBlock after new expression in tree grammar + * o merged local class definition alternatives, moved after declaration + * o fixed problem with ClassName.super.field + * o reordered some alternatives to make things more efficient + * o long and double constants were not differentiated from int/float + * o whitespace rule was inefficient: matched only one char + * o add an examples directory with some nasty 1.3 cases + * o made Main.java use buffered IO and a Reader for Unicode support + * o supports UNICODE? + * Using Unicode charVocabulay makes code file big, but only + * in the bitsets at the end. I need to make ANTLR generate + * unicode bitsets more efficiently. + * Version 1.19 (April 25, 2002) + * Terence added in nice fixes by John Pybus concerning floating + * constants and problems with super() calls. John did a nice + * reorg of the primary/postfix expression stuff to read better + * and makes f.g.super() parse properly (it was METHOD_CALL not + * a SUPER_CTOR_CALL). Also: + * + * o "finally" clause was a root...made it a child of "try" + * o Added stuff for asserts too for Java 1.4, but *commented out* + * as it is not backward compatible. + * + * Version 1.20 (October 27, 2002) + * + * Terence ended up reorging John Pybus' stuff to + * remove some nondeterminisms and some syntactic predicates. + * Note that the grammar is stricter now; e.g., this(...) must + * be the first statement. + * + * Trinary ?: operator wasn't working as array name: + * (isBig ? bigDigits : digits)[i]; + * + * Checked parser/tree parser on source for + * Resin-2.0.5, jive-2.1.1, jdk 1.3.1, Lucene, antlr 2.7.2a4, + * and the 110k-line jGuru server source. + * + * Version tracking now done with following ID: + * + * $Id$ + * + * This grammar is in the PUBLIC DOMAIN + */ +class CUSTOM_API JavaRecognizer : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public JavaTokenTypes +{ +#line 154 "java.g" + +private: + Driver* m_driver; + +public: + void setDriver( Driver* d ) { m_driver = d; } + void setFileName( const TQString& fileName ) { m_driver->currentFileName() = fileName; } + + void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){ + m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(ex.getMessage().c_str()), ex.getLine(), ex.getColumn()) ); + } + + void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){ + m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(errorMessage.c_str()), LT(1)->getLine(), LT(1)->getColumn()) ); + } + + void reportMessage( const ANTLR_USE_NAMESPACE(std)string& message ){ + m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(message.c_str()), LT(1)->getLine(), LT(1)->getColumn()) ); + } +#line 142 "JavaRecognizer.h" +public: + void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); +protected: + JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k); +public: + JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf); +protected: + JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k); +public: + JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer); + JavaRecognizer(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state); + int getNumTokens() const + { + return JavaRecognizer::NUM_TOKENS; + } + const char* getTokenName( int type ) const + { + if( type > getNumTokens() ) return 0; + return JavaRecognizer::tokenNames[type]; + } + const char* const* getTokenNames() const + { + return JavaRecognizer::tokenNames; + } + public: void compilationUnit(); + public: void packageDefinition(); + public: void importDefinition(); + public: void typeDefinition(); + public: void identifier(); + public: void identifierStar(); + public: void modifiers(); + public: void classDefinition( + RefJavaAST modifiers + ); + public: void interfaceDefinition( + RefJavaAST modifiers + ); + public: void declaration(); + public: void typeSpec( + bool addImagNode + ); + public: void variableDefinitions( + RefJavaAST mods, RefJavaAST t + ); + public: void classTypeSpec( + bool addImagNode + ); + public: void builtInTypeSpec( + bool addImagNode + ); + public: void builtInType(); + public: void type(); + public: void modifier(); + public: void superClassClause(); + public: void implementsClause(); + public: void classBlock(); + public: void interfaceExtends(); + public: void field(); + public: void ctorHead(); + public: void constructorBody(); + public: void parameterDeclarationList(); + public: void declaratorBrackets( + RefJavaAST typ + ); + public: void throwsClause(); + public: void compoundStatement(); + public: void explicitConstructorInvocation(); + public: void statement(); + public: void argList(); + public: void variableDeclarator( + RefJavaAST mods, RefJavaAST t + ); + public: void varInitializer(); + public: void initializer(); + public: void arrayInitializer(); + public: void expression(); + public: void parameterDeclaration(); + public: void parameterModifier(); + public: void forInit(); + public: void forCond(); + public: void forIter(); + public: void casesGroup(); + public: void tryBlock(); + public: void aCase(); + public: void caseSList(); + public: void expressionList(); + public: void handler(); + public: void finallyClause(); + public: void assignmentExpression(); + public: void conditionalExpression(); + public: void logicalOrExpression(); + public: void logicalAndExpression(); + public: void inclusiveOrExpression(); + public: void exclusiveOrExpression(); + public: void andExpression(); + public: void equalityExpression(); + public: void relationalExpression(); + public: void shiftExpression(); + public: void additiveExpression(); + public: void multiplicativeExpression(); + public: void unaryExpression(); + public: void unaryExpressionNotPlusMinus(); + public: void postfixExpression(); + public: void primaryExpression(); + public: void newExpression(); + public: void identPrimary(); + public: void constant(); + public: void newArrayDeclarator(); +public: + ANTLR_USE_NAMESPACE(antlr)RefAST getAST() + { + return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST); + } + +protected: + RefJavaAST returnAST; +private: + static const char* tokenNames[]; +#ifndef NO_STATIC_CONSTS + static const int NUM_TOKENS = 152; +#else + enum { + NUM_TOKENS = 152 + }; +#endif + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; + static const unsigned long _tokenSet_4_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; + static const unsigned long _tokenSet_5_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5; + static const unsigned long _tokenSet_6_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6; + static const unsigned long _tokenSet_7_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7; + static const unsigned long _tokenSet_8_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8; + static const unsigned long _tokenSet_9_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9; + static const unsigned long _tokenSet_10_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10; + static const unsigned long _tokenSet_11_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11; + static const unsigned long _tokenSet_12_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12; + static const unsigned long _tokenSet_13_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13; + static const unsigned long _tokenSet_14_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14; + static const unsigned long _tokenSet_15_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_15; + static const unsigned long _tokenSet_16_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_16; + static const unsigned long _tokenSet_17_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_17; + static const unsigned long _tokenSet_18_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_18; + static const unsigned long _tokenSet_19_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_19; + static const unsigned long _tokenSet_20_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_20; + static const unsigned long _tokenSet_21_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21; + static const unsigned long _tokenSet_22_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_22; + static const unsigned long _tokenSet_23_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23; + static const unsigned long _tokenSet_24_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_24; + static const unsigned long _tokenSet_25_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_25; + static const unsigned long _tokenSet_26_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_26; + static const unsigned long _tokenSet_27_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_27; + static const unsigned long _tokenSet_28_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_28; + static const unsigned long _tokenSet_29_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_29; + static const unsigned long _tokenSet_30_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_30; + static const unsigned long _tokenSet_31_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_31; + static const unsigned long _tokenSet_32_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_32; + static const unsigned long _tokenSet_33_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_33; + static const unsigned long _tokenSet_34_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_34; + static const unsigned long _tokenSet_35_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_35; + static const unsigned long _tokenSet_36_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_36; + static const unsigned long _tokenSet_37_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_37; + static const unsigned long _tokenSet_38_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_38; + static const unsigned long _tokenSet_39_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_39; + static const unsigned long _tokenSet_40_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_40; + static const unsigned long _tokenSet_41_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_41; + static const unsigned long _tokenSet_42_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_42; + static const unsigned long _tokenSet_43_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_43; + static const unsigned long _tokenSet_44_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_44; + static const unsigned long _tokenSet_45_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_45; + static const unsigned long _tokenSet_46_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_46; + static const unsigned long _tokenSet_47_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_47; + static const unsigned long _tokenSet_48_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_48; + static const unsigned long _tokenSet_49_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_49; + static const unsigned long _tokenSet_50_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_50; + static const unsigned long _tokenSet_51_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_51; + static const unsigned long _tokenSet_52_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_52; + static const unsigned long _tokenSet_53_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_53; + static const unsigned long _tokenSet_54_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_54; + static const unsigned long _tokenSet_55_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_55; + static const unsigned long _tokenSet_56_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_56; + static const unsigned long _tokenSet_57_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_57; + static const unsigned long _tokenSet_58_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_58; + static const unsigned long _tokenSet_59_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_59; + static const unsigned long _tokenSet_60_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_60; + static const unsigned long _tokenSet_61_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_61; + static const unsigned long _tokenSet_62_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_62; + static const unsigned long _tokenSet_63_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_63; + static const unsigned long _tokenSet_64_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_64; + static const unsigned long _tokenSet_65_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_65; + static const unsigned long _tokenSet_66_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_66; +}; + +#endif /*INC_JavaRecognizer_h_*/ diff --git a/languages/java/JavaRecognizer.hpp b/languages/java/JavaRecognizer.hpp deleted file mode 100644 index fab59972..00000000 --- a/languages/java/JavaRecognizer.hpp +++ /dev/null @@ -1,423 +0,0 @@ -#ifndef INC_JavaRecognizer_hpp_ -#define INC_JavaRecognizer_hpp_ - -#line 2 "java.g" - - #include "driver.h" - #include "JavaAST.hpp" - - #include - #include - - #define SET_POSITION(ast,t)\ - { \ - RefJavaAST(ast)->setLine( t->getLine() );\ - RefJavaAST(ast)->setColumn( t->getColumn() ); \ - } - -#line 19 "JavaRecognizer.hpp" -#include -/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaRecognizer.hpp"$ */ -#include -#include -#include "JavaTokenTypes.hpp" -#include - -/** Java 1.3 Recognizer - * - * Run 'java Main [-showtree] directory-full-of-java-files' - * - * [The -showtree option pops up a Swing frame that shows - * the AST constructed from the parser.] - * - * Run 'java Main ' - * - * Contributing authors: - * John Mitchell johnm@non.net - * Terence Parr parrt@magelang.com - * John Lilley jlilley@empathy.com - * Scott Stanchfield thetick@magelang.com - * Markus Mohnen mohnen@informatik.rwth-aachen.de - * Peter Williams pete.williams@sun.com - * Allan Jacobs Allan.Jacobs@eng.sun.com - * Steve Messick messick@redhills.com - * John Pybus john@pybus.org - * - * Version 1.00 December 9, 1997 -- initial release - * Version 1.01 December 10, 1997 - * fixed bug in octal def (0..7 not 0..8) - * Version 1.10 August 1998 (parrt) - * added tree construction - * fixed definition of WS,comments for mac,pc,unix newlines - * added unary plus - * Version 1.11 (Nov 20, 1998) - * Added "shutup" option to turn off last ambig warning. - * Fixed inner class def to allow named class defs as statements - * synchronized requires compound not simple statement - * add [] after builtInType DOT class in primaryExpression - * "const" is reserved but not valid..removed from modifiers - * Version 1.12 (Feb 2, 1999) - * Changed LITERAL_xxx to xxx in tree grammar. - * Updated java.g to use tokens {...} now for 2.6.0 (new feature). - * - * Version 1.13 (Apr 23, 1999) - * Didn't have (stat)? for else clause in tree parser. - * Didn't gen ASTs for interface extends. Updated tree parser too. - * Updated to 2.6.0. - * Version 1.14 (Jun 20, 1999) - * Allowed final/abstract on local classes. - * Removed local interfaces from methods - * Put instanceof precedence where it belongs...in relationalExpr - * It also had expr not type as arg; fixed it. - * Missing ! on SEMI in classBlock - * fixed: (expr) + "string" was parsed incorrectly (+ as unary plus). - * fixed: didn't like Object[].class in parser or tree parser - * Version 1.15 (Jun 26, 1999) - * Screwed up rule with instanceof in it. :( Fixed. - * Tree parser didn't like (expr).something; fixed. - * Allowed multiple inheritance in tree grammar. oops. - * Version 1.16 (August 22, 1999) - * Extending an interface built a wacky tree: had extra EXTENDS. - * Tree grammar didn't allow multiple superinterfaces. - * Tree grammar didn't allow empty var initializer: {} - * Version 1.17 (October 12, 1999) - * ESC lexer rule allowed 399 max not 377 max. - * java.tree.g didn't handle the expression of synchronized - * statements. - * Version 1.18 (August 12, 2001) - * Terence updated to Java 2 Version 1.3 by - * observing/combining work of Allan Jacobs and Steve - * Messick. Handles 1.3 src. Summary: - * o primary didn't include boolean.class kind of thing - * o constructor calls parsed explicitly now: - * see explicitConstructorInvocation - * o add strictfp modifier - * o missing objBlock after new expression in tree grammar - * o merged local class definition alternatives, moved after declaration - * o fixed problem with ClassName.super.field - * o reordered some alternatives to make things more efficient - * o long and double constants were not differentiated from int/float - * o whitespace rule was inefficient: matched only one char - * o add an examples directory with some nasty 1.3 cases - * o made Main.java use buffered IO and a Reader for Unicode support - * o supports UNICODE? - * Using Unicode charVocabulay makes code file big, but only - * in the bitsets at the end. I need to make ANTLR generate - * unicode bitsets more efficiently. - * Version 1.19 (April 25, 2002) - * Terence added in nice fixes by John Pybus concerning floating - * constants and problems with super() calls. John did a nice - * reorg of the primary/postfix expression stuff to read better - * and makes f.g.super() parse properly (it was METHOD_CALL not - * a SUPER_CTOR_CALL). Also: - * - * o "finally" clause was a root...made it a child of "try" - * o Added stuff for asserts too for Java 1.4, but *commented out* - * as it is not backward compatible. - * - * Version 1.20 (October 27, 2002) - * - * Terence ended up reorging John Pybus' stuff to - * remove some nondeterminisms and some syntactic predicates. - * Note that the grammar is stricter now; e.g., this(...) must - * be the first statement. - * - * Trinary ?: operator wasn't working as array name: - * (isBig ? bigDigits : digits)[i]; - * - * Checked parser/tree parser on source for - * Resin-2.0.5, jive-2.1.1, jdk 1.3.1, Lucene, antlr 2.7.2a4, - * and the 110k-line jGuru server source. - * - * Version tracking now done with following ID: - * - * $Id$ - * - * This grammar is in the PUBLIC DOMAIN - */ -class CUSTOM_API JavaRecognizer : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public JavaTokenTypes -{ -#line 154 "java.g" - -private: - Driver* m_driver; - -public: - void setDriver( Driver* d ) { m_driver = d; } - void setFileName( const TQString& fileName ) { m_driver->currentFileName() = fileName; } - - void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){ - m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(ex.getMessage().c_str()), ex.getLine(), ex.getColumn()) ); - } - - void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){ - m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(errorMessage.c_str()), LT(1)->getLine(), LT(1)->getColumn()) ); - } - - void reportMessage( const ANTLR_USE_NAMESPACE(std)string& message ){ - m_driver->addProblem( m_driver->currentFileName(), Problem( TQString::fromLocal8Bit(message.c_str()), LT(1)->getLine(), LT(1)->getColumn()) ); - } -#line 142 "JavaRecognizer.hpp" -public: - void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); -protected: - JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k); -public: - JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf); -protected: - JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k); -public: - JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer); - JavaRecognizer(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state); - int getNumTokens() const - { - return JavaRecognizer::NUM_TOKENS; - } - const char* getTokenName( int type ) const - { - if( type > getNumTokens() ) return 0; - return JavaRecognizer::tokenNames[type]; - } - const char* const* getTokenNames() const - { - return JavaRecognizer::tokenNames; - } - public: void compilationUnit(); - public: void packageDefinition(); - public: void importDefinition(); - public: void typeDefinition(); - public: void identifier(); - public: void identifierStar(); - public: void modifiers(); - public: void classDefinition( - RefJavaAST modifiers - ); - public: void interfaceDefinition( - RefJavaAST modifiers - ); - public: void declaration(); - public: void typeSpec( - bool addImagNode - ); - public: void variableDefinitions( - RefJavaAST mods, RefJavaAST t - ); - public: void classTypeSpec( - bool addImagNode - ); - public: void builtInTypeSpec( - bool addImagNode - ); - public: void builtInType(); - public: void type(); - public: void modifier(); - public: void superClassClause(); - public: void implementsClause(); - public: void classBlock(); - public: void interfaceExtends(); - public: void field(); - public: void ctorHead(); - public: void constructorBody(); - public: void parameterDeclarationList(); - public: void declaratorBrackets( - RefJavaAST typ - ); - public: void throwsClause(); - public: void compoundStatement(); - public: void explicitConstructorInvocation(); - public: void statement(); - public: void argList(); - public: void variableDeclarator( - RefJavaAST mods, RefJavaAST t - ); - public: void varInitializer(); - public: void initializer(); - public: void arrayInitializer(); - public: void expression(); - public: void parameterDeclaration(); - public: void parameterModifier(); - public: void forInit(); - public: void forCond(); - public: void forIter(); - public: void casesGroup(); - public: void tryBlock(); - public: void aCase(); - public: void caseSList(); - public: void expressionList(); - public: void handler(); - public: void finallyClause(); - public: void assignmentExpression(); - public: void conditionalExpression(); - public: void logicalOrExpression(); - public: void logicalAndExpression(); - public: void inclusiveOrExpression(); - public: void exclusiveOrExpression(); - public: void andExpression(); - public: void equalityExpression(); - public: void relationalExpression(); - public: void shiftExpression(); - public: void additiveExpression(); - public: void multiplicativeExpression(); - public: void unaryExpression(); - public: void unaryExpressionNotPlusMinus(); - public: void postfixExpression(); - public: void primaryExpression(); - public: void newExpression(); - public: void identPrimary(); - public: void constant(); - public: void newArrayDeclarator(); -public: - ANTLR_USE_NAMESPACE(antlr)RefAST getAST() - { - return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST); - } - -protected: - RefJavaAST returnAST; -private: - static const char* tokenNames[]; -#ifndef NO_STATIC_CONSTS - static const int NUM_TOKENS = 152; -#else - enum { - NUM_TOKENS = 152 - }; -#endif - - static const unsigned long _tokenSet_0_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; - static const unsigned long _tokenSet_1_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; - static const unsigned long _tokenSet_2_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; - static const unsigned long _tokenSet_3_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; - static const unsigned long _tokenSet_4_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; - static const unsigned long _tokenSet_5_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5; - static const unsigned long _tokenSet_6_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6; - static const unsigned long _tokenSet_7_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7; - static const unsigned long _tokenSet_8_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8; - static const unsigned long _tokenSet_9_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9; - static const unsigned long _tokenSet_10_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10; - static const unsigned long _tokenSet_11_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11; - static const unsigned long _tokenSet_12_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12; - static const unsigned long _tokenSet_13_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13; - static const unsigned long _tokenSet_14_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14; - static const unsigned long _tokenSet_15_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_15; - static const unsigned long _tokenSet_16_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_16; - static const unsigned long _tokenSet_17_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_17; - static const unsigned long _tokenSet_18_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_18; - static const unsigned long _tokenSet_19_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_19; - static const unsigned long _tokenSet_20_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_20; - static const unsigned long _tokenSet_21_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21; - static const unsigned long _tokenSet_22_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_22; - static const unsigned long _tokenSet_23_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23; - static const unsigned long _tokenSet_24_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_24; - static const unsigned long _tokenSet_25_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_25; - static const unsigned long _tokenSet_26_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_26; - static const unsigned long _tokenSet_27_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_27; - static const unsigned long _tokenSet_28_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_28; - static const unsigned long _tokenSet_29_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_29; - static const unsigned long _tokenSet_30_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_30; - static const unsigned long _tokenSet_31_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_31; - static const unsigned long _tokenSet_32_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_32; - static const unsigned long _tokenSet_33_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_33; - static const unsigned long _tokenSet_34_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_34; - static const unsigned long _tokenSet_35_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_35; - static const unsigned long _tokenSet_36_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_36; - static const unsigned long _tokenSet_37_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_37; - static const unsigned long _tokenSet_38_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_38; - static const unsigned long _tokenSet_39_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_39; - static const unsigned long _tokenSet_40_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_40; - static const unsigned long _tokenSet_41_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_41; - static const unsigned long _tokenSet_42_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_42; - static const unsigned long _tokenSet_43_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_43; - static const unsigned long _tokenSet_44_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_44; - static const unsigned long _tokenSet_45_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_45; - static const unsigned long _tokenSet_46_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_46; - static const unsigned long _tokenSet_47_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_47; - static const unsigned long _tokenSet_48_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_48; - static const unsigned long _tokenSet_49_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_49; - static const unsigned long _tokenSet_50_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_50; - static const unsigned long _tokenSet_51_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_51; - static const unsigned long _tokenSet_52_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_52; - static const unsigned long _tokenSet_53_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_53; - static const unsigned long _tokenSet_54_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_54; - static const unsigned long _tokenSet_55_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_55; - static const unsigned long _tokenSet_56_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_56; - static const unsigned long _tokenSet_57_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_57; - static const unsigned long _tokenSet_58_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_58; - static const unsigned long _tokenSet_59_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_59; - static const unsigned long _tokenSet_60_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_60; - static const unsigned long _tokenSet_61_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_61; - static const unsigned long _tokenSet_62_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_62; - static const unsigned long _tokenSet_63_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_63; - static const unsigned long _tokenSet_64_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_64; - static const unsigned long _tokenSet_65_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_65; - static const unsigned long _tokenSet_66_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_66; -}; - -#endif /*INC_JavaRecognizer_hpp_*/ diff --git a/languages/java/JavaStoreWalker.cpp b/languages/java/JavaStoreWalker.cpp index 1bdb9522..763f95e7 100644 --- a/languages/java/JavaStoreWalker.cpp +++ b/languages/java/JavaStoreWalker.cpp @@ -1,11 +1,11 @@ /* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalker.cpp"$ */ -#include "JavaStoreWalker.hpp" -#include -#include -#include -#include -#include -#include +#include "JavaStoreWalker.h" +#include +#include +#include +#include +#include +#include #line 1 "java.store.g" #line 11 "JavaStoreWalker.cpp" JavaStoreWalker::JavaStoreWalker() diff --git a/languages/java/JavaStoreWalker.h b/languages/java/JavaStoreWalker.h new file mode 100644 index 00000000..244c0978 --- /dev/null +++ b/languages/java/JavaStoreWalker.h @@ -0,0 +1,164 @@ +#ifndef INC_JavaStoreWalker_h_ +#define INC_JavaStoreWalker_h_ + +#line 3 "java.store.g" + + #include + #include "JavaAST.h" + + #include + #include + #include + #include + +#line 15 "JavaStoreWalker.h" +#include +#include "JavaStoreWalkerTokenTypes.h" +/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalker.h"$ */ +#include + +#line 13 "java.store.g" + + #include + + #include + +#line 27 "JavaStoreWalker.h" +/** Java 1.2 AST Recognizer Grammar + * + * Author: + * Terence Parr parrt@magelang.com + * + * Version tracking now done with following ID: + * + * $Id$ + * + * This grammar is in the PUBLIC DOMAIN + * + * BUGS + */ +class CUSTOM_API JavaStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public JavaStoreWalkerTokenTypes +{ +#line 43 "java.store.g" + +private: + TQStringList m_currentScope; + CodeModel* m_model; + FileDom m_file; + TQValueStack m_currentClass; + int m_currentAccess; + int m_anon; + ANTLR_USE_NAMESPACE(antlr)JavaASTFactory ast_factory; + +public: + void setCodeModel( CodeModel* model ) + { + m_model = model; + } + + void setFile( FileDom file ) + { + m_file = file; + } + + void init() + { + m_currentScope.clear(); + m_currentAccess = CodeModelItem::Public; + m_anon = 0; + + initializeASTFactory (ast_factory); + setASTFactory (&ast_factory); + } +#line 44 "JavaStoreWalker.h" +public: + JavaStoreWalker(); + static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); + int getNumTokens() const + { + return JavaStoreWalker::NUM_TOKENS; + } + const char* getTokenName( int type ) const + { + if( type > getNumTokens() ) return 0; + return JavaStoreWalker::tokenNames[type]; + } + const char* const* getTokenNames() const + { + return JavaStoreWalker::tokenNames; + } + public: void compilationUnit(RefJavaAST _t); + public: TQString packageDefinition(RefJavaAST _t); + public: TQString importDefinition(RefJavaAST _t); + public: void typeDefinition(RefJavaAST _t); + public: TQString identifier(RefJavaAST _t); + public: TQString identifierStar(RefJavaAST _t); + public: TQStringList modifiers(RefJavaAST _t); + public: TQStringList extendsClause(RefJavaAST _t); + public: TQStringList implementsClause(RefJavaAST _t); + public: void objBlock(RefJavaAST _t, + ClassDom klass + ); + public: void interfaceBlock(RefJavaAST _t, + ClassDom klass + ); + public: TQString typeSpec(RefJavaAST _t); + public: TQString typeSpecArray(RefJavaAST _t); + public: TQString type(RefJavaAST _t); + public: void builtInType(RefJavaAST _t); + public: void modifier(RefJavaAST _t); + public: FunctionDom methodDecl(RefJavaAST _t); + public: VariableDom variableDef(RefJavaAST _t); + public: FunctionDom ctorDef(RefJavaAST _t); + public: FunctionDom methodDef(RefJavaAST _t); + public: void slist(RefJavaAST _t); + public: void methodHead(RefJavaAST _t, + FunctionDom meth + ); + public: void variableDeclarator(RefJavaAST _t, + VariableDom attr + ); + public: void varInitializer(RefJavaAST _t); + public: ArgumentDom parameterDef(RefJavaAST _t); + public: void objectinitializer(RefJavaAST _t); + public: void initializer(RefJavaAST _t); + public: void expression(RefJavaAST _t); + public: void arrayInitializer(RefJavaAST _t); + public: void throwsClause(RefJavaAST _t); + public: void stat(RefJavaAST _t); + public: void elist(RefJavaAST _t); + public: void caseGroup(RefJavaAST _t); + public: void tryBlock(RefJavaAST _t); + public: void handler(RefJavaAST _t); + public: void expr(RefJavaAST _t); + public: void primaryExpression(RefJavaAST _t); + public: void arrayIndex(RefJavaAST _t); + public: void newExpression(RefJavaAST _t); + public: void constant(RefJavaAST _t); + public: void newArrayDeclarator(RefJavaAST _t); +public: + ANTLR_USE_NAMESPACE(antlr)RefAST getAST() + { + return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST); + } + +protected: + RefJavaAST returnAST; + RefJavaAST _retTree; +private: + static const char* tokenNames[]; +#ifndef NO_STATIC_CONSTS + static const int NUM_TOKENS = 153; +#else + enum { + NUM_TOKENS = 153 + }; +#endif + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; +}; + +#endif /*INC_JavaStoreWalker_h_*/ diff --git a/languages/java/JavaStoreWalker.hpp b/languages/java/JavaStoreWalker.hpp deleted file mode 100644 index 676163ad..00000000 --- a/languages/java/JavaStoreWalker.hpp +++ /dev/null @@ -1,164 +0,0 @@ -#ifndef INC_JavaStoreWalker_hpp_ -#define INC_JavaStoreWalker_hpp_ - -#line 3 "java.store.g" - - #include - #include "JavaAST.hpp" - - #include - #include - #include - #include - -#line 15 "JavaStoreWalker.hpp" -#include -#include "JavaStoreWalkerTokenTypes.hpp" -/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalker.hpp"$ */ -#include - -#line 13 "java.store.g" - - #include - - #include - -#line 27 "JavaStoreWalker.hpp" -/** Java 1.2 AST Recognizer Grammar - * - * Author: - * Terence Parr parrt@magelang.com - * - * Version tracking now done with following ID: - * - * $Id$ - * - * This grammar is in the PUBLIC DOMAIN - * - * BUGS - */ -class CUSTOM_API JavaStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public JavaStoreWalkerTokenTypes -{ -#line 43 "java.store.g" - -private: - TQStringList m_currentScope; - CodeModel* m_model; - FileDom m_file; - TQValueStack m_currentClass; - int m_currentAccess; - int m_anon; - ANTLR_USE_NAMESPACE(antlr)JavaASTFactory ast_factory; - -public: - void setCodeModel( CodeModel* model ) - { - m_model = model; - } - - void setFile( FileDom file ) - { - m_file = file; - } - - void init() - { - m_currentScope.clear(); - m_currentAccess = CodeModelItem::Public; - m_anon = 0; - - initializeASTFactory (ast_factory); - setASTFactory (&ast_factory); - } -#line 44 "JavaStoreWalker.hpp" -public: - JavaStoreWalker(); - static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); - int getNumTokens() const - { - return JavaStoreWalker::NUM_TOKENS; - } - const char* getTokenName( int type ) const - { - if( type > getNumTokens() ) return 0; - return JavaStoreWalker::tokenNames[type]; - } - const char* const* getTokenNames() const - { - return JavaStoreWalker::tokenNames; - } - public: void compilationUnit(RefJavaAST _t); - public: TQString packageDefinition(RefJavaAST _t); - public: TQString importDefinition(RefJavaAST _t); - public: void typeDefinition(RefJavaAST _t); - public: TQString identifier(RefJavaAST _t); - public: TQString identifierStar(RefJavaAST _t); - public: TQStringList modifiers(RefJavaAST _t); - public: TQStringList extendsClause(RefJavaAST _t); - public: TQStringList implementsClause(RefJavaAST _t); - public: void objBlock(RefJavaAST _t, - ClassDom klass - ); - public: void interfaceBlock(RefJavaAST _t, - ClassDom klass - ); - public: TQString typeSpec(RefJavaAST _t); - public: TQString typeSpecArray(RefJavaAST _t); - public: TQString type(RefJavaAST _t); - public: void builtInType(RefJavaAST _t); - public: void modifier(RefJavaAST _t); - public: FunctionDom methodDecl(RefJavaAST _t); - public: VariableDom variableDef(RefJavaAST _t); - public: FunctionDom ctorDef(RefJavaAST _t); - public: FunctionDom methodDef(RefJavaAST _t); - public: void slist(RefJavaAST _t); - public: void methodHead(RefJavaAST _t, - FunctionDom meth - ); - public: void variableDeclarator(RefJavaAST _t, - VariableDom attr - ); - public: void varInitializer(RefJavaAST _t); - public: ArgumentDom parameterDef(RefJavaAST _t); - public: void objectinitializer(RefJavaAST _t); - public: void initializer(RefJavaAST _t); - public: void expression(RefJavaAST _t); - public: void arrayInitializer(RefJavaAST _t); - public: void throwsClause(RefJavaAST _t); - public: void stat(RefJavaAST _t); - public: void elist(RefJavaAST _t); - public: void caseGroup(RefJavaAST _t); - public: void tryBlock(RefJavaAST _t); - public: void handler(RefJavaAST _t); - public: void expr(RefJavaAST _t); - public: void primaryExpression(RefJavaAST _t); - public: void arrayIndex(RefJavaAST _t); - public: void newExpression(RefJavaAST _t); - public: void constant(RefJavaAST _t); - public: void newArrayDeclarator(RefJavaAST _t); -public: - ANTLR_USE_NAMESPACE(antlr)RefAST getAST() - { - return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST); - } - -protected: - RefJavaAST returnAST; - RefJavaAST _retTree; -private: - static const char* tokenNames[]; -#ifndef NO_STATIC_CONSTS - static const int NUM_TOKENS = 153; -#else - enum { - NUM_TOKENS = 153 - }; -#endif - - static const unsigned long _tokenSet_0_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; - static const unsigned long _tokenSet_1_data_[]; - static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; -}; - -#endif /*INC_JavaStoreWalker_hpp_*/ diff --git a/languages/java/JavaStoreWalkerTokenTypes.h b/languages/java/JavaStoreWalkerTokenTypes.h new file mode 100644 index 00000000..d8a07893 --- /dev/null +++ b/languages/java/JavaStoreWalkerTokenTypes.h @@ -0,0 +1,169 @@ +#ifndef INC_JavaStoreWalkerTokenTypes_h_ +#define INC_JavaStoreWalkerTokenTypes_h_ + +/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalkerTokenTypes.h"$ */ + +#ifndef CUSTOM_API +# define CUSTOM_API +#endif + +#ifdef __cplusplus +struct CUSTOM_API JavaStoreWalkerTokenTypes { +#endif + enum { + EOF_ = 1, + BLOCK = 4, + MODIFIERS = 5, + OBJBLOCK = 6, + SLIST = 7, + CTOR_DEF = 8, + METHOD_DEF = 9, + VARIABLE_DEF = 10, + INSTANCE_INIT = 11, + STATIC_INIT = 12, + TYPE = 13, + CLASS_DEF = 14, + INTERFACE_DEF = 15, + PACKAGE_DEF = 16, + ARRAY_DECLARATOR = 17, + EXTENDS_CLAUSE = 18, + IMPLEMENTS_CLAUSE = 19, + PARAMETERS = 20, + PARAMETER_DEF = 21, + LABELED_STAT = 22, + TYPECAST = 23, + INDEX_OP = 24, + POST_INC = 25, + POST_DEC = 26, + METHOD_CALL = 27, + EXPR = 28, + ARRAY_INIT = 29, + IMPORT = 30, + UNARY_MINUS = 31, + UNARY_PLUS = 32, + CASE_GROUP = 33, + ELIST = 34, + FOR_INIT = 35, + FOR_CONDITION = 36, + FOR_ITERATOR = 37, + EMPTY_STAT = 38, + FINAL = 39, + ABSTRACT = 40, + STRICTFP = 41, + SUPER_CTOR_CALL = 42, + CTOR_CALL = 43, + LITERAL_package = 44, + SEMI = 45, + LITERAL_import = 46, + LBRACK = 47, + RBRACK = 48, + LITERAL_void = 49, + LITERAL_boolean = 50, + LITERAL_byte = 51, + LITERAL_char = 52, + LITERAL_short = 53, + LITERAL_int = 54, + LITERAL_float = 55, + LITERAL_long = 56, + LITERAL_double = 57, + IDENT = 58, + DOT = 59, + STAR = 60, + LITERAL_private = 61, + LITERAL_public = 62, + LITERAL_protected = 63, + LITERAL_static = 64, + LITERAL_transient = 65, + LITERAL_native = 66, + LITERAL_threadsafe = 67, + LITERAL_synchronized = 68, + LITERAL_volatile = 69, + LITERAL_class = 70, + LITERAL_extends = 71, + LITERAL_interface = 72, + LCURLY = 73, + RCURLY = 74, + COMMA = 75, + LITERAL_implements = 76, + LPAREN = 77, + RPAREN = 78, + LITERAL_this = 79, + LITERAL_super = 80, + ASSIGN = 81, + LITERAL_throws = 82, + COLON = 83, + LITERAL_if = 84, + LITERAL_else = 85, + LITERAL_for = 86, + LITERAL_while = 87, + LITERAL_do = 88, + LITERAL_break = 89, + LITERAL_continue = 90, + LITERAL_return = 91, + LITERAL_switch = 92, + LITERAL_throw = 93, + LITERAL_case = 94, + LITERAL_default = 95, + LITERAL_try = 96, + LITERAL_finally = 97, + LITERAL_catch = 98, + PLUS_ASSIGN = 99, + MINUS_ASSIGN = 100, + STAR_ASSIGN = 101, + DIV_ASSIGN = 102, + MOD_ASSIGN = 103, + SR_ASSIGN = 104, + BSR_ASSIGN = 105, + SL_ASSIGN = 106, + BAND_ASSIGN = 107, + BXOR_ASSIGN = 108, + BOR_ASSIGN = 109, + QUESTION = 110, + LOR = 111, + LAND = 112, + BOR = 113, + BXOR = 114, + BAND = 115, + NOT_EQUAL = 116, + EQUAL = 117, + LT_ = 118, + GT = 119, + LE = 120, + GE = 121, + LITERAL_instanceof = 122, + SL = 123, + SR = 124, + BSR = 125, + PLUS = 126, + MINUS = 127, + DIV = 128, + MOD = 129, + INC = 130, + DEC = 131, + BNOT = 132, + LNOT = 133, + LITERAL_true = 134, + LITERAL_false = 135, + LITERAL_null = 136, + LITERAL_new = 137, + NUM_INT = 138, + CHAR_LITERAL = 139, + STRING_LITERAL = 140, + NUM_FLOAT = 141, + NUM_LONG = 142, + NUM_DOUBLE = 143, + WS = 144, + SL_COMMENT = 145, + ML_COMMENT = 146, + ESC = 147, + HEX_DIGIT = 148, + VOCAB = 149, + EXPONENT = 150, + FLOAT_SUFFIX = 151, + LITERAL_const = 152, + NULL_TREE_LOOKAHEAD = 3 + }; +#ifdef __cplusplus +}; +#endif +#endif /*INC_JavaStoreWalkerTokenTypes_h_*/ diff --git a/languages/java/JavaStoreWalkerTokenTypes.hpp b/languages/java/JavaStoreWalkerTokenTypes.hpp deleted file mode 100644 index 44322944..00000000 --- a/languages/java/JavaStoreWalkerTokenTypes.hpp +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef INC_JavaStoreWalkerTokenTypes_hpp_ -#define INC_JavaStoreWalkerTokenTypes_hpp_ - -/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalkerTokenTypes.hpp"$ */ - -#ifndef CUSTOM_API -# define CUSTOM_API -#endif - -#ifdef __cplusplus -struct CUSTOM_API JavaStoreWalkerTokenTypes { -#endif - enum { - EOF_ = 1, - BLOCK = 4, - MODIFIERS = 5, - OBJBLOCK = 6, - SLIST = 7, - CTOR_DEF = 8, - METHOD_DEF = 9, - VARIABLE_DEF = 10, - INSTANCE_INIT = 11, - STATIC_INIT = 12, - TYPE = 13, - CLASS_DEF = 14, - INTERFACE_DEF = 15, - PACKAGE_DEF = 16, - ARRAY_DECLARATOR = 17, - EXTENDS_CLAUSE = 18, - IMPLEMENTS_CLAUSE = 19, - PARAMETERS = 20, - PARAMETER_DEF = 21, - LABELED_STAT = 22, - TYPECAST = 23, - INDEX_OP = 24, - POST_INC = 25, - POST_DEC = 26, - METHOD_CALL = 27, - EXPR = 28, - ARRAY_INIT = 29, - IMPORT = 30, - UNARY_MINUS = 31, - UNARY_PLUS = 32, - CASE_GROUP = 33, - ELIST = 34, - FOR_INIT = 35, - FOR_CONDITION = 36, - FOR_ITERATOR = 37, - EMPTY_STAT = 38, - FINAL = 39, - ABSTRACT = 40, - STRICTFP = 41, - SUPER_CTOR_CALL = 42, - CTOR_CALL = 43, - LITERAL_package = 44, - SEMI = 45, - LITERAL_import = 46, - LBRACK = 47, - RBRACK = 48, - LITERAL_void = 49, - LITERAL_boolean = 50, - LITERAL_byte = 51, - LITERAL_char = 52, - LITERAL_short = 53, - LITERAL_int = 54, - LITERAL_float = 55, - LITERAL_long = 56, - LITERAL_double = 57, - IDENT = 58, - DOT = 59, - STAR = 60, - LITERAL_private = 61, - LITERAL_public = 62, - LITERAL_protected = 63, - LITERAL_static = 64, - LITERAL_transient = 65, - LITERAL_native = 66, - LITERAL_threadsafe = 67, - LITERAL_synchronized = 68, - LITERAL_volatile = 69, - LITERAL_class = 70, - LITERAL_extends = 71, - LITERAL_interface = 72, - LCURLY = 73, - RCURLY = 74, - COMMA = 75, - LITERAL_implements = 76, - LPAREN = 77, - RPAREN = 78, - LITERAL_this = 79, - LITERAL_super = 80, - ASSIGN = 81, - LITERAL_throws = 82, - COLON = 83, - LITERAL_if = 84, - LITERAL_else = 85, - LITERAL_for = 86, - LITERAL_while = 87, - LITERAL_do = 88, - LITERAL_break = 89, - LITERAL_continue = 90, - LITERAL_return = 91, - LITERAL_switch = 92, - LITERAL_throw = 93, - LITERAL_case = 94, - LITERAL_default = 95, - LITERAL_try = 96, - LITERAL_finally = 97, - LITERAL_catch = 98, - PLUS_ASSIGN = 99, - MINUS_ASSIGN = 100, - STAR_ASSIGN = 101, - DIV_ASSIGN = 102, - MOD_ASSIGN = 103, - SR_ASSIGN = 104, - BSR_ASSIGN = 105, - SL_ASSIGN = 106, - BAND_ASSIGN = 107, - BXOR_ASSIGN = 108, - BOR_ASSIGN = 109, - QUESTION = 110, - LOR = 111, - LAND = 112, - BOR = 113, - BXOR = 114, - BAND = 115, - NOT_EQUAL = 116, - EQUAL = 117, - LT_ = 118, - GT = 119, - LE = 120, - GE = 121, - LITERAL_instanceof = 122, - SL = 123, - SR = 124, - BSR = 125, - PLUS = 126, - MINUS = 127, - DIV = 128, - MOD = 129, - INC = 130, - DEC = 131, - BNOT = 132, - LNOT = 133, - LITERAL_true = 134, - LITERAL_false = 135, - LITERAL_null = 136, - LITERAL_new = 137, - NUM_INT = 138, - CHAR_LITERAL = 139, - STRING_LITERAL = 140, - NUM_FLOAT = 141, - NUM_LONG = 142, - NUM_DOUBLE = 143, - WS = 144, - SL_COMMENT = 145, - ML_COMMENT = 146, - ESC = 147, - HEX_DIGIT = 148, - VOCAB = 149, - EXPONENT = 150, - FLOAT_SUFFIX = 151, - LITERAL_const = 152, - NULL_TREE_LOOKAHEAD = 3 - }; -#ifdef __cplusplus -}; -#endif -#endif /*INC_JavaStoreWalkerTokenTypes_hpp_*/ diff --git a/languages/java/JavaTokenTypes.h b/languages/java/JavaTokenTypes.h new file mode 100644 index 00000000..8689c5ef --- /dev/null +++ b/languages/java/JavaTokenTypes.h @@ -0,0 +1,168 @@ +#ifndef INC_JavaTokenTypes_h_ +#define INC_JavaTokenTypes_h_ + +/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaTokenTypes.h"$ */ + +#ifndef CUSTOM_API +# define CUSTOM_API +#endif + +#ifdef __cplusplus +struct CUSTOM_API JavaTokenTypes { +#endif + enum { + EOF_ = 1, + BLOCK = 4, + MODIFIERS = 5, + OBJBLOCK = 6, + SLIST = 7, + CTOR_DEF = 8, + METHOD_DEF = 9, + VARIABLE_DEF = 10, + INSTANCE_INIT = 11, + STATIC_INIT = 12, + TYPE = 13, + CLASS_DEF = 14, + INTERFACE_DEF = 15, + PACKAGE_DEF = 16, + ARRAY_DECLARATOR = 17, + EXTENDS_CLAUSE = 18, + IMPLEMENTS_CLAUSE = 19, + PARAMETERS = 20, + PARAMETER_DEF = 21, + LABELED_STAT = 22, + TYPECAST = 23, + INDEX_OP = 24, + POST_INC = 25, + POST_DEC = 26, + METHOD_CALL = 27, + EXPR = 28, + ARRAY_INIT = 29, + IMPORT = 30, + UNARY_MINUS = 31, + UNARY_PLUS = 32, + CASE_GROUP = 33, + ELIST = 34, + FOR_INIT = 35, + FOR_CONDITION = 36, + FOR_ITERATOR = 37, + EMPTY_STAT = 38, + FINAL = 39, + ABSTRACT = 40, + STRICTFP = 41, + SUPER_CTOR_CALL = 42, + CTOR_CALL = 43, + LITERAL_package = 44, + SEMI = 45, + LITERAL_import = 46, + LBRACK = 47, + RBRACK = 48, + LITERAL_void = 49, + LITERAL_boolean = 50, + LITERAL_byte = 51, + LITERAL_char = 52, + LITERAL_short = 53, + LITERAL_int = 54, + LITERAL_float = 55, + LITERAL_long = 56, + LITERAL_double = 57, + IDENT = 58, + DOT = 59, + STAR = 60, + LITERAL_private = 61, + LITERAL_public = 62, + LITERAL_protected = 63, + LITERAL_static = 64, + LITERAL_transient = 65, + LITERAL_native = 66, + LITERAL_threadsafe = 67, + LITERAL_synchronized = 68, + LITERAL_volatile = 69, + LITERAL_class = 70, + LITERAL_extends = 71, + LITERAL_interface = 72, + LCURLY = 73, + RCURLY = 74, + COMMA = 75, + LITERAL_implements = 76, + LPAREN = 77, + RPAREN = 78, + LITERAL_this = 79, + LITERAL_super = 80, + ASSIGN = 81, + LITERAL_throws = 82, + COLON = 83, + LITERAL_if = 84, + LITERAL_else = 85, + LITERAL_for = 86, + LITERAL_while = 87, + LITERAL_do = 88, + LITERAL_break = 89, + LITERAL_continue = 90, + LITERAL_return = 91, + LITERAL_switch = 92, + LITERAL_throw = 93, + LITERAL_case = 94, + LITERAL_default = 95, + LITERAL_try = 96, + LITERAL_finally = 97, + LITERAL_catch = 98, + PLUS_ASSIGN = 99, + MINUS_ASSIGN = 100, + STAR_ASSIGN = 101, + DIV_ASSIGN = 102, + MOD_ASSIGN = 103, + SR_ASSIGN = 104, + BSR_ASSIGN = 105, + SL_ASSIGN = 106, + BAND_ASSIGN = 107, + BXOR_ASSIGN = 108, + BOR_ASSIGN = 109, + QUESTION = 110, + LOR = 111, + LAND = 112, + BOR = 113, + BXOR = 114, + BAND = 115, + NOT_EQUAL = 116, + EQUAL = 117, + LT_ = 118, + GT = 119, + LE = 120, + GE = 121, + LITERAL_instanceof = 122, + SL = 123, + SR = 124, + BSR = 125, + PLUS = 126, + MINUS = 127, + DIV = 128, + MOD = 129, + INC = 130, + DEC = 131, + BNOT = 132, + LNOT = 133, + LITERAL_true = 134, + LITERAL_false = 135, + LITERAL_null = 136, + LITERAL_new = 137, + NUM_INT = 138, + CHAR_LITERAL = 139, + STRING_LITERAL = 140, + NUM_FLOAT = 141, + NUM_LONG = 142, + NUM_DOUBLE = 143, + WS = 144, + SL_COMMENT = 145, + ML_COMMENT = 146, + ESC = 147, + HEX_DIGIT = 148, + VOCAB = 149, + EXPONENT = 150, + FLOAT_SUFFIX = 151, + NULL_TREE_LOOKAHEAD = 3 + }; +#ifdef __cplusplus +}; +#endif +#endif /*INC_JavaTokenTypes_h_*/ diff --git a/languages/java/JavaTokenTypes.hpp b/languages/java/JavaTokenTypes.hpp deleted file mode 100644 index e36fa54c..00000000 --- a/languages/java/JavaTokenTypes.hpp +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef INC_JavaTokenTypes_hpp_ -#define INC_JavaTokenTypes_hpp_ - -/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaTokenTypes.hpp"$ */ - -#ifndef CUSTOM_API -# define CUSTOM_API -#endif - -#ifdef __cplusplus -struct CUSTOM_API JavaTokenTypes { -#endif - enum { - EOF_ = 1, - BLOCK = 4, - MODIFIERS = 5, - OBJBLOCK = 6, - SLIST = 7, - CTOR_DEF = 8, - METHOD_DEF = 9, - VARIABLE_DEF = 10, - INSTANCE_INIT = 11, - STATIC_INIT = 12, - TYPE = 13, - CLASS_DEF = 14, - INTERFACE_DEF = 15, - PACKAGE_DEF = 16, - ARRAY_DECLARATOR = 17, - EXTENDS_CLAUSE = 18, - IMPLEMENTS_CLAUSE = 19, - PARAMETERS = 20, - PARAMETER_DEF = 21, - LABELED_STAT = 22, - TYPECAST = 23, - INDEX_OP = 24, - POST_INC = 25, - POST_DEC = 26, - METHOD_CALL = 27, - EXPR = 28, - ARRAY_INIT = 29, - IMPORT = 30, - UNARY_MINUS = 31, - UNARY_PLUS = 32, - CASE_GROUP = 33, - ELIST = 34, - FOR_INIT = 35, - FOR_CONDITION = 36, - FOR_ITERATOR = 37, - EMPTY_STAT = 38, - FINAL = 39, - ABSTRACT = 40, - STRICTFP = 41, - SUPER_CTOR_CALL = 42, - CTOR_CALL = 43, - LITERAL_package = 44, - SEMI = 45, - LITERAL_import = 46, - LBRACK = 47, - RBRACK = 48, - LITERAL_void = 49, - LITERAL_boolean = 50, - LITERAL_byte = 51, - LITERAL_char = 52, - LITERAL_short = 53, - LITERAL_int = 54, - LITERAL_float = 55, - LITERAL_long = 56, - LITERAL_double = 57, - IDENT = 58, - DOT = 59, - STAR = 60, - LITERAL_private = 61, - LITERAL_public = 62, - LITERAL_protected = 63, - LITERAL_static = 64, - LITERAL_transient = 65, - LITERAL_native = 66, - LITERAL_threadsafe = 67, - LITERAL_synchronized = 68, - LITERAL_volatile = 69, - LITERAL_class = 70, - LITERAL_extends = 71, - LITERAL_interface = 72, - LCURLY = 73, - RCURLY = 74, - COMMA = 75, - LITERAL_implements = 76, - LPAREN = 77, - RPAREN = 78, - LITERAL_this = 79, - LITERAL_super = 80, - ASSIGN = 81, - LITERAL_throws = 82, - COLON = 83, - LITERAL_if = 84, - LITERAL_else = 85, - LITERAL_for = 86, - LITERAL_while = 87, - LITERAL_do = 88, - LITERAL_break = 89, - LITERAL_continue = 90, - LITERAL_return = 91, - LITERAL_switch = 92, - LITERAL_throw = 93, - LITERAL_case = 94, - LITERAL_default = 95, - LITERAL_try = 96, - LITERAL_finally = 97, - LITERAL_catch = 98, - PLUS_ASSIGN = 99, - MINUS_ASSIGN = 100, - STAR_ASSIGN = 101, - DIV_ASSIGN = 102, - MOD_ASSIGN = 103, - SR_ASSIGN = 104, - BSR_ASSIGN = 105, - SL_ASSIGN = 106, - BAND_ASSIGN = 107, - BXOR_ASSIGN = 108, - BOR_ASSIGN = 109, - QUESTION = 110, - LOR = 111, - LAND = 112, - BOR = 113, - BXOR = 114, - BAND = 115, - NOT_EQUAL = 116, - EQUAL = 117, - LT_ = 118, - GT = 119, - LE = 120, - GE = 121, - LITERAL_instanceof = 122, - SL = 123, - SR = 124, - BSR = 125, - PLUS = 126, - MINUS = 127, - DIV = 128, - MOD = 129, - INC = 130, - DEC = 131, - BNOT = 132, - LNOT = 133, - LITERAL_true = 134, - LITERAL_false = 135, - LITERAL_null = 136, - LITERAL_new = 137, - NUM_INT = 138, - CHAR_LITERAL = 139, - STRING_LITERAL = 140, - NUM_FLOAT = 141, - NUM_LONG = 142, - NUM_DOUBLE = 143, - WS = 144, - SL_COMMENT = 145, - ML_COMMENT = 146, - ESC = 147, - HEX_DIGIT = 148, - VOCAB = 149, - EXPONENT = 150, - FLOAT_SUFFIX = 151, - NULL_TREE_LOOKAHEAD = 3 - }; -#ifdef __cplusplus -}; -#endif -#endif /*INC_JavaTokenTypes_hpp_*/ diff --git a/languages/java/Makefile.am b/languages/java/Makefile.am index a1a1e812..f4a05f62 100644 --- a/languages/java/Makefile.am +++ b/languages/java/Makefile.am @@ -22,10 +22,10 @@ JavaStoreWalker.cpp javasupport_utils.cpp problemreporter.cpp driver.cpp kdevdri EXTRA_DIST = java.g java.tree.g java.store.g -#JavaLexer.hpp JavaLexer.cpp JavaRecognizer.hpp JavaRecognizer.cpp: # java.g +#JavaLexer.h JavaLexer.cpp JavaRecognizer.h JavaRecognizer.cpp: # java.g # antlr java.g -#JavaStoreWalker.hpp JavaStoreWalker.cpp: # java.store.g +#JavaStoreWalker.h JavaStoreWalker.cpp: # java.store.g # antlr java.store.g METASOURCES = AUTO diff --git a/languages/java/backgroundparser.h b/languages/java/backgroundparser.h index fee2bc78..4823cf43 100644 --- a/languages/java/backgroundparser.h +++ b/languages/java/backgroundparser.h @@ -13,7 +13,7 @@ #define BACKGROUNDPARSER_H #include "driver.h" -#include "JavaAST.hpp" +#include "JavaAST.h" #include #include diff --git a/languages/java/driver.cpp b/languages/java/driver.cpp index c22bc9ce..3fbcd07b 100644 --- a/languages/java/driver.cpp +++ b/languages/java/driver.cpp @@ -17,9 +17,9 @@ Boston, MA 02110-1301, USA. */ -#include "JavaAST.hpp" -#include "JavaLexer.hpp" -#include "JavaRecognizer.hpp" +#include "JavaAST.h" +#include "JavaLexer.h" +#include "JavaRecognizer.h" #include #include diff --git a/languages/java/driver.h b/languages/java/driver.h index def7e400..3575ccfb 100644 --- a/languages/java/driver.h +++ b/languages/java/driver.h @@ -20,7 +20,7 @@ #ifndef DRIVER_H #define DRIVER_H -#include "JavaAST.hpp" +#include "JavaAST.h" #include #include diff --git a/languages/java/java.g b/languages/java/java.g index 1f825ec5..4228a573 100644 --- a/languages/java/java.g +++ b/languages/java/java.g @@ -1,7 +1,7 @@ header "pre_include_hpp" { #include "driver.h" - #include "JavaAST.hpp" + #include "JavaAST.h" #include #include diff --git a/languages/java/java.store.g b/languages/java/java.store.g index b69b7323..cc545c64 100644 --- a/languages/java/java.store.g +++ b/languages/java/java.store.g @@ -2,7 +2,7 @@ header "pre_include_hpp" { #include - #include "JavaAST.hpp" + #include "JavaAST.h" #include #include diff --git a/languages/java/javasupportpart.cpp b/languages/java/javasupportpart.cpp index f9bbbd88..50571ba6 100644 --- a/languages/java/javasupportpart.cpp +++ b/languages/java/javasupportpart.cpp @@ -23,8 +23,8 @@ #include "kdevdriver.h" #include "javasupport_utils.h" -#include "JavaStoreWalker.hpp" -#include "JavaAST.hpp" +#include "JavaStoreWalker.h" +#include "JavaAST.h" #include #include diff --git a/languages/java/kdevdriver.cpp b/languages/java/kdevdriver.cpp index d19a20c3..d3cffb68 100644 --- a/languages/java/kdevdriver.cpp +++ b/languages/java/kdevdriver.cpp @@ -1,6 +1,6 @@ #include "kdevdriver.h" -#include "JavaLexer.hpp" +#include "JavaLexer.h" #include #include -- cgit v1.2.1