forked from jasder/antlr
indent fix
This commit is contained in:
parent
027dde5e3e
commit
1ceb6a45dd
|
@ -392,9 +392,7 @@ ATN ATNDeserializer::deserialize(const std::vector<uint16_t>& input) {
|
||||||
data2 = -1;
|
data2 = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto la = lexerActionFactory(actionType, data1, data2);
|
atn.lexerActions[i] = lexerActionFactory(actionType, data1, data2);
|
||||||
assert(la != nullptr);
|
|
||||||
atn.lexerActions[i] = la;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// for compatibility with older serialized ATNs, convert the old
|
// for compatibility with older serialized ATNs, convert the old
|
||||||
|
@ -723,7 +721,7 @@ Ref<LexerAction> ATNDeserializer::lexerActionFactory(LexerActionType type, int d
|
||||||
return LexerMoreAction::getInstance();
|
return LexerMoreAction::getInstance();
|
||||||
|
|
||||||
case LexerActionType::POP_MODE:
|
case LexerActionType::POP_MODE:
|
||||||
return LexerPopModeAction::getInstance();
|
return LexerPopModeAction::getInstance();
|
||||||
|
|
||||||
case LexerActionType::PUSH_MODE:
|
case LexerActionType::PUSH_MODE:
|
||||||
return std::make_shared<LexerPushModeAction>(data1);
|
return std::make_shared<LexerPushModeAction>(data1);
|
||||||
|
|
|
@ -39,16 +39,16 @@ using namespace antlr4::atn;
|
||||||
using namespace antlr4::misc;
|
using namespace antlr4::misc;
|
||||||
|
|
||||||
const Ref<LexerPopModeAction> LexerPopModeAction::getInstance() {
|
const Ref<LexerPopModeAction> LexerPopModeAction::getInstance() {
|
||||||
static Ref<LexerPopModeAction> instance = std::shared_ptr<LexerPopModeAction>(
|
static Ref<LexerPopModeAction> instance = std::shared_ptr<LexerPopModeAction>(
|
||||||
new LexerPopModeAction());
|
new LexerPopModeAction());
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerPopModeAction::LexerPopModeAction() {
|
LexerPopModeAction::LexerPopModeAction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerActionType LexerPopModeAction::getActionType() const {
|
LexerActionType LexerPopModeAction::getActionType() const {
|
||||||
return LexerActionType::POP_MODE;
|
return LexerActionType::POP_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LexerPopModeAction::isPositionDependent() const {
|
bool LexerPopModeAction::isPositionDependent() const {
|
||||||
|
|
|
@ -39,36 +39,36 @@ using namespace antlr4::atn;
|
||||||
using namespace antlr4::misc;
|
using namespace antlr4::misc;
|
||||||
|
|
||||||
const Ref<LexerSkipAction> LexerSkipAction::getInstance() {
|
const Ref<LexerSkipAction> LexerSkipAction::getInstance() {
|
||||||
static Ref<LexerSkipAction> instance = std::shared_ptr<LexerSkipAction>(
|
static Ref<LexerSkipAction> instance = std::shared_ptr<LexerSkipAction>(
|
||||||
new LexerSkipAction());
|
new LexerSkipAction());
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerSkipAction::LexerSkipAction() {
|
LexerSkipAction::LexerSkipAction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerActionType LexerSkipAction::getActionType() const {
|
LexerActionType LexerSkipAction::getActionType() const {
|
||||||
return LexerActionType::SKIP;
|
return LexerActionType::SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LexerSkipAction::isPositionDependent() const {
|
bool LexerSkipAction::isPositionDependent() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LexerSkipAction::execute(Lexer *lexer) {
|
void LexerSkipAction::execute(Lexer *lexer) {
|
||||||
lexer->skip();
|
lexer->skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t LexerSkipAction::hashCode() const {
|
size_t LexerSkipAction::hashCode() const {
|
||||||
size_t hash = MurmurHash::initialize();
|
size_t hash = MurmurHash::initialize();
|
||||||
hash = MurmurHash::update(hash, (size_t) getActionType());
|
hash = MurmurHash::update(hash, (size_t) getActionType());
|
||||||
return MurmurHash::finish(hash, 1);
|
return MurmurHash::finish(hash, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LexerSkipAction::operator ==(const LexerAction &obj) const {
|
bool LexerSkipAction::operator ==(const LexerAction &obj) const {
|
||||||
return &obj == this;
|
return &obj == this;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string LexerSkipAction::toString() const {
|
std::string LexerSkipAction::toString() const {
|
||||||
return "skip";
|
return "skip";
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
|
|
||||||
#include "atn/LexerAction.h"
|
#include "atn/LexerAction.h"
|
||||||
#include "atn/LexerActionType.h"
|
#include "atn/LexerActionType.h"
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace antlr4 {
|
namespace antlr4 {
|
||||||
namespace atn {
|
namespace atn {
|
||||||
|
|
Loading…
Reference in New Issue