You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
4.5 KiB
122 lines
4.5 KiB
4 years ago
|
#ifndef INC_PascalLexer_h_
|
||
|
#define INC_PascalLexer_h_
|
||
15 years ago
|
|
||
|
#line 29 "pascal.g"
|
||
|
|
||
|
#include "problemreporter.h"
|
||
4 years ago
|
#include "PascalAST.h"
|
||
15 years ago
|
|
||
15 years ago
|
#include <tqlistview.h>
|
||
15 years ago
|
#include <kdebug.h>
|
||
|
|
||
|
#define SET_POSITION(ast,t)\
|
||
|
{ \
|
||
|
RefPascalAST(ast)->setLine( t->getLine() );\
|
||
|
RefPascalAST(ast)->setColumn( t->getColumn() ); \
|
||
|
}
|
||
|
|
||
4 years ago
|
#line 19 "PascalLexer.h"
|
||
|
#include <antlr/config.h>
|
||
|
/* $ANTLR 2.7.7 (20061129): "pascal.g" -> "PascalLexer.h"$ */
|
||
|
#include <antlr/CommonToken.h>
|
||
|
#include <antlr/InputBuffer.h>
|
||
|
#include <antlr/BitSet.h>
|
||
|
#include "PascalTokenTypes.h"
|
||
|
#include <antlr/CharScanner.h>
|
||
15 years ago
|
class CUSTOM_API PascalLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public PascalTokenTypes
|
||
|
{
|
||
|
#line 1067 "pascal.g"
|
||
|
|
||
|
private:
|
||
|
ProblemReporter* m_problemReporter;
|
||
|
unsigned int m_numberOfErrors;
|
||
|
|
||
|
public:
|
||
|
void resetErrors() { m_numberOfErrors = 0; }
|
||
|
unsigned int numberOfErrors() const { return m_numberOfErrors; }
|
||
|
void setProblemReporter( ProblemReporter* r ) { m_problemReporter = r; }
|
||
|
|
||
|
virtual void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
|
||
|
m_problemReporter->reportError( ex.getMessage().c_str(),
|
||
|
ex.getFilename().c_str(),
|
||
|
ex.getLine(),
|
||
|
ex.getColumn() );
|
||
|
++m_numberOfErrors;
|
||
|
}
|
||
|
|
||
|
virtual void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
|
||
|
m_problemReporter->reportError( errorMessage.c_str(),
|
||
|
getFilename().c_str(),
|
||
|
getLine(), getColumn() );
|
||
|
++m_numberOfErrors;
|
||
|
}
|
||
|
|
||
|
virtual void reportWarning( const ANTLR_USE_NAMESPACE(std)string& warnMessage ){
|
||
|
m_problemReporter->reportWarning( warnMessage.c_str(),
|
||
|
getFilename().c_str(),
|
||
|
getLine(), getColumn() );
|
||
|
}
|
||
4 years ago
|
#line 30 "PascalLexer.h"
|
||
15 years ago
|
private:
|
||
|
void initLiterals();
|
||
|
public:
|
||
|
bool getCaseSensitiveLiterals() const
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
public:
|
||
|
PascalLexer(ANTLR_USE_NAMESPACE(std)istream& in);
|
||
|
PascalLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib);
|
||
|
PascalLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state);
|
||
|
ANTLR_USE_NAMESPACE(antlr)RefToken nextToken();
|
||
|
public: void mPLUS(bool _createToken);
|
||
|
public: void mMINUS(bool _createToken);
|
||
|
public: void mSTAR(bool _createToken);
|
||
|
public: void mSLASH(bool _createToken);
|
||
|
public: void mASSIGN(bool _createToken);
|
||
|
public: void mCOMMA(bool _createToken);
|
||
|
public: void mSEMI(bool _createToken);
|
||
|
public: void mCOLON(bool _createToken);
|
||
13 years ago
|
public: void mEQUAL(bool _createToken);
|
||
15 years ago
|
public: void mNOT_EQUAL(bool _createToken);
|
||
|
public: void mLTH(bool _createToken);
|
||
|
public: void mLE(bool _createToken);
|
||
|
public: void mGE(bool _createToken);
|
||
|
public: void mGT(bool _createToken);
|
||
|
public: void mLPAREN(bool _createToken);
|
||
|
public: void mRPAREN(bool _createToken);
|
||
|
public: void mLBRACK(bool _createToken);
|
||
|
public: void mLBRACK2(bool _createToken);
|
||
|
public: void mRBRACK(bool _createToken);
|
||
|
public: void mRBRACK2(bool _createToken);
|
||
|
public: void mPOINTER(bool _createToken);
|
||
|
public: void mAT(bool _createToken);
|
||
|
public: void mDOT(bool _createToken);
|
||
|
public: void mLCURLY(bool _createToken);
|
||
|
public: void mRCURLY(bool _createToken);
|
||
|
public: void mPLUSEQ(bool _createToken);
|
||
|
public: void mMINUSEQ(bool _createToken);
|
||
|
public: void mSTAREQ(bool _createToken);
|
||
|
public: void mSLASHQE(bool _createToken);
|
||
|
public: void mWS(bool _createToken);
|
||
|
public: void mCOMMENT_1(bool _createToken);
|
||
|
public: void mCOMMENT_2(bool _createToken);
|
||
|
public: void mCOMMENT_3(bool _createToken);
|
||
|
public: void mIDENT(bool _createToken);
|
||
|
public: void mSTRING_LITERAL(bool _createToken);
|
||
|
public: void mNUM_INT(bool _createToken);
|
||
|
protected: void mEXPONENT(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;
|
||
|
};
|
||
|
|
||
4 years ago
|
#endif /*INC_PascalLexer_h_*/
|