javacc-7.0.3.examples.JavaGrammars.cpp.gen.JavaParserTokenManager.h Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javacc Show documentation
Show all versions of javacc Show documentation
JavaCC is a parser/scanner generator for Java.
#ifndef JAVAPARSERTOKENMANAGER_H
#define JAVAPARSERTOKENMANAGER_H
#include "stdio.h"
#include "JavaCC.h"
#include "CharStream.h"
#include "Token.h"
#include "ErrorHandler.h"
#include "TokenManager.h"
#include "JavaParserConstants.h"
#include "mytm.h"
namespace java {
namespace parser {
class JavaParser;
/** Token Manager. */
class JavaParserTokenManager : public TokenManager, public MyTm {
public:
FILE *debugStream;
void setDebugStream(FILE *ds);
int jjStopStringLiteralDfa_0(int pos, unsigned long long active0, unsigned long long active1);
int jjStartNfa_0(int pos, unsigned long long active0, unsigned long long active1);
int jjStopAtPos(int pos, int kind);
int jjMoveStringLiteralDfa0_0();
int jjMoveStringLiteralDfa1_0(unsigned long long active0, unsigned long long active1);
int jjMoveStringLiteralDfa2_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa3_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa4_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);
int jjMoveStringLiteralDfa5_0(unsigned long long old0, unsigned long long active0);
int jjMoveStringLiteralDfa6_0(unsigned long long old0, unsigned long long active0);
int jjMoveStringLiteralDfa7_0(unsigned long long old0, unsigned long long active0);
int jjMoveStringLiteralDfa8_0(unsigned long long old0, unsigned long long active0);
int jjMoveStringLiteralDfa9_0(unsigned long long old0, unsigned long long active0);
int jjMoveStringLiteralDfa10_0(unsigned long long old0, unsigned long long active0);
int jjMoveStringLiteralDfa11_0(unsigned long long old0, unsigned long long active0);
int jjStartNfaWithStates_0(int pos, int kind, int state);
int jjMoveNfa_0(int startState, int curPos);
int jjMoveStringLiteralDfa0_3();
int jjMoveStringLiteralDfa1_3(unsigned long long active0);
int jjMoveStringLiteralDfa0_1();
int jjMoveNfa_1(int startState, int curPos);
int jjMoveStringLiteralDfa0_2();
int jjMoveStringLiteralDfa1_2(unsigned long long active0);
bool jjCanMove_0(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2);
bool jjCanMove_1(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2);
bool jjCanMove_2(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2);
Token * jjFillToken();
public:
int curLexState;
int jjnewStateCnt;
int jjround;
int jjmatchedPos;
int jjmatchedKind;
Token * getNextToken();
void SkipLexicalActions(Token *matchedToken);
void MoreLexicalActions();
void TokenLexicalActions(Token *matchedToken);
#define jjCheckNAdd(state)\
{\
if (jjrounds[state] != jjround)\
{\
jjstateSet[jjnewStateCnt++] = state;\
jjrounds[state] = jjround;\
}\
}
#define jjAddStates(start, end)\
{\
for (int x = start; x <= end; x++) {\
jjstateSet[jjnewStateCnt++] = jjnextStates[x];\
} /*while (start++ != end);*/\
}
#define jjCheckNAddTwoStates(state1, state2)\
{\
jjCheckNAdd(state1);\
jjCheckNAdd(state2);\
}
#define jjCheckNAddStates(start, end)\
{\
for (int x = start; x <= end; x++) {\
jjCheckNAdd(jjnextStates[x]);\
} /*while (start++ != end);*/\
}
#ifndef JAVACC_CHARSTREAM
#define JAVACC_CHARSTREAM CharStream
#endif
private:
void ReInitRounds();
public:
JavaParserTokenManager(JAVACC_CHARSTREAM *stream, int lexState = 0);
virtual ~JavaParserTokenManager();
void ReInit(JAVACC_CHARSTREAM *stream, int lexState = 0);
void SwitchTo(int lexState);
void clear();
const JJSimpleString jjKindsForBitVector(int i, unsigned long long vec);
const JJSimpleString jjKindsForStateVector(int lexState, int vec[], int start, int end);
JAVACC_CHARSTREAM* input_stream;
int jjrounds[52];
int jjstateSet[2 * 52];
JJString jjimage;
JJString image;
int jjimageLen;
int lengthOfMatch;
JJChar curChar;
TokenManagerErrorHandler* errorHandler = nullptr;
public:
void setErrorHandler(TokenManagerErrorHandler *eh) {
if (errorHandler) delete errorHandler, errorHandler = nullptr;
errorHandler = eh;
}
};
}
}
#endif