FermionOperatorLexer.cpp 6.53 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164

// Generated from FermionOperator.g4 by ANTLR 4.7.2


#include "FermionOperatorLexer.h"


using namespace antlr4;

using namespace fermion;

FermionOperatorLexer::FermionOperatorLexer(CharStream *input) : Lexer(input) {
  _interpreter = new atn::LexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache);
}

FermionOperatorLexer::~FermionOperatorLexer() {
  delete _interpreter;
}

std::string FermionOperatorLexer::getGrammarFileName() const {
  return "FermionOperator.g4";
}

const std::vector<std::string>& FermionOperatorLexer::getRuleNames() const {
  return _ruleNames;
}

const std::vector<std::string>& FermionOperatorLexer::getChannelNames() const {
  return _channelNames;
}

const std::vector<std::string>& FermionOperatorLexer::getModeNames() const {
  return _modeNames;
}

const std::vector<std::string>& FermionOperatorLexer::getTokenNames() const {
  return _tokenNames;
}

dfa::Vocabulary& FermionOperatorLexer::getVocabulary() const {
  return _vocabulary;
}

const std::vector<uint16_t> FermionOperatorLexer::getSerializedATN() const {
  return _serializedATN;
}

const atn::ATN& FermionOperatorLexer::getATN() const {
  return _atn;
}




// Static vars and initialization.
std::vector<dfa::DFA> FermionOperatorLexer::_decisionToDFA;
atn::PredictionContextCache FermionOperatorLexer::_sharedContextCache;

// We own the ATN which in turn owns the ATN states.
atn::ATN FermionOperatorLexer::_atn;
std::vector<uint16_t> FermionOperatorLexer::_serializedATN;

std::vector<std::string> FermionOperatorLexer::_ruleNames = {
  u8"T__0", u8"T__1", u8"T__2", u8"T__3", u8"T__4", u8"T__5", u8"COMMENT", 
  u8"REAL", u8"INT", u8"WS", u8"EOL"
};

std::vector<std::string> FermionOperatorLexer::_channelNames = {
  "DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};

std::vector<std::string> FermionOperatorLexer::_modeNames = {
  u8"DEFAULT_MODE"
};

std::vector<std::string> FermionOperatorLexer::_literalNames = {
  "", u8"'+'", u8"'-'", u8"'^'", u8"'('", u8"','", u8"')'"
};

std::vector<std::string> FermionOperatorLexer::_symbolicNames = {
  "", "", "", "", "", "", "", u8"COMMENT", u8"REAL", u8"INT", u8"WS", u8"EOL"
};

dfa::Vocabulary FermionOperatorLexer::_vocabulary(_literalNames, _symbolicNames);

std::vector<std::string> FermionOperatorLexer::_tokenNames;

FermionOperatorLexer::Initializer::Initializer() {
  // This code could be in a static initializer lambda, but VS doesn't allow access to private class members from there.
	for (size_t i = 0; i < _symbolicNames.size(); ++i) {
		std::string name = _vocabulary.getLiteralName(i);
		if (name.empty()) {
			name = _vocabulary.getSymbolicName(i);
		}

		if (name.empty()) {
			_tokenNames.push_back("<INVALID>");
		} else {
      _tokenNames.push_back(name);
    }
	}

  _serializedATN = {
    0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964, 
    0x2, 0xd, 0x45, 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 
    0x4, 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, 
    0x7, 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa, 0x4, 
    0xb, 0x9, 0xb, 0x4, 0xc, 0x9, 0xc, 0x3, 0x2, 0x3, 0x2, 0x3, 0x3, 0x3, 
    0x3, 0x3,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0x2, 0x2, 0x2e, 0x30, 0x7, 0x2f, 0x2, 0x2, 0x2f, 0x2e, 0x3, 
    0x2, 0x2, 0x2, 0x2f, 0x30, 0x3, 0x2, 0x2, 0x2, 0x30, 0x32, 0x3, 0x2, 
    0x2, 0x2, 0x31, 0x33, 0x5, 0x13, 0xa, 0x2, 0x32, 0x31, 0x3, 0x2, 0x2, 
    0x2, 0x32, 0x33, 0x3, 0x2, 0x2, 0x2, 0x33, 0x34, 0x3, 0x2, 0x2, 0x2, 
    0x34, 0x35, 0x7, 0x30, 0x2, 0x2, 0x35, 0x36, 0x5, 0x13, 0xa, 0x2, 0x36, 
    0x12, 0x3, 0x2, 0x2, 0x2, 0x37, 0x39, 0x4, 0x32, 0x3b, 0x2, 0x38, 0x37, 
    0x3, 0x2, 0x2, 0x2, 0x39, 0x3a, 0x3, 0x2, 0x2, 0x2, 0x3a, 0x38, 0x3, 
    0x2, 0x2, 0x2, 0x3a, 0x3b, 0x3, 0x2, 0x2, 0x2, 0x3b, 0x14, 0x3, 0x2, 
    0x2, 0x2, 0x3c, 0x3d, 0x9, 0x3, 0x2, 0x2, 0x3d, 0x3e, 0x3, 0x2, 0x2, 
    0x2, 0x3e, 0x3f, 0x8, 0xb, 0x2, 0x2, 0x3f, 0x16, 0x3, 0x2, 0x2, 0x2, 
    0x40, 0x42, 0x7, 0xf, 0x2, 0x2, 0x41, 0x40, 0x3, 0x2, 0x2, 0x2, 0x41, 
    0x42, 0x3, 0x2, 0x2, 0x2, 0x42, 0x43, 0x3, 0x2, 0x2, 0x2, 0x43, 0x44, 
    0x7, 0xc, 0x2, 0x2, 0x44, 0x18, 0x3, 0x2, 0x2, 0x2, 0x8, 0x2, 0x29, 
    0x2f, 0x32, 0x3a, 0x41, 0x3, 0x8, 0x2, 0x2, 
  };

  atn::ATNDeserializer deserializer;
  _atn = deserializer.deserialize(_serializedATN);

  size_t count = _atn.getNumberOfDecisions();
  _decisionToDFA.reserve(count);
  for (size_t i = 0; i < count; i++) { 
    _decisionToDFA.emplace_back(_atn.getDecisionState(i), i);
  }
}

FermionOperatorLexer::Initializer FermionOperatorLexer::_init;