forked from jasder/antlr
Fix special template for tests
This commit is contained in:
parent
258b1a4a38
commit
822e3762a0
|
@ -70,14 +70,14 @@ ParserPropertyCall(p, call) ::= "<call>"
|
||||||
|
|
||||||
PositionAdjustingLexer() ::= <<
|
PositionAdjustingLexer() ::= <<
|
||||||
protected:
|
protected:
|
||||||
class PositionAdjustingLexerATNSimulator : public atn::LexerATNSimulator {
|
class PositionAdjustingLexerATNSimulator : public antlr4::atn::LexerATNSimulator {
|
||||||
public:
|
public:
|
||||||
PositionAdjustingLexerATNSimulator(Lexer *recog, const atn::ATN &atn, std::vector\<dfa::DFA> &decisionToDFA,
|
PositionAdjustingLexerATNSimulator(antlr4::Lexer *recog, const antlr4::atn::ATN &atn, std::vector\<antlr4::dfa::DFA> &decisionToDFA,
|
||||||
atn::PredictionContextCache &sharedContextCache)
|
antlr4::atn::PredictionContextCache &sharedContextCache)
|
||||||
: atn::LexerATNSimulator(recog, atn, decisionToDFA, sharedContextCache) {
|
: antlr4::atn::LexerATNSimulator(recog, atn, decisionToDFA, sharedContextCache) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetAcceptPosition(CharStream *input, int index, int line, int charPositionInLine) {
|
void resetAcceptPosition(antlr4::CharStream *input, int index, int line, int charPositionInLine) {
|
||||||
input->seek(index);
|
input->seek(index);
|
||||||
_line = line;
|
_line = line;
|
||||||
_charPositionInLine = charPositionInLine;
|
_charPositionInLine = charPositionInLine;
|
||||||
|
@ -87,16 +87,16 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual std::unique_ptr\<Token> nextToken() override {
|
virtual std::unique_ptr\<antlr4::Token> nextToken() override {
|
||||||
if (dynamic_cast\<PositionAdjustingLexerATNSimulator *>(_interpreter) == nullptr) {
|
if (dynamic_cast\<PositionAdjustingLexerATNSimulator *>(_interpreter) == nullptr) {
|
||||||
delete _interpreter;
|
delete _interpreter;
|
||||||
_interpreter = new PositionAdjustingLexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache);
|
_interpreter = new PositionAdjustingLexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Lexer::nextToken();
|
return antlr4::Lexer::nextToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Token* emit() override {
|
virtual antlr4::Token* emit() override {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TOKENS:
|
case TOKENS:
|
||||||
handleAcceptPositionForKeyword("tokens");
|
handleAcceptPositionForKeyword("tokens");
|
||||||
|
@ -109,7 +109,7 @@ public:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return Lexer::emit();
|
return antlr4::Lexer::emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue