@@ -35,10 +35,8 @@ namespace ecc {
35
35
// Keep track of file information
36
36
int tokenLine = 1 ;
37
37
int tokenColumn = 1 ;
38
- int tokenPosition = 0 ;
39
38
int line = 1 ;
40
39
int column = 1 ;
41
- int position = 0 ;
42
40
43
41
// Keep track of the state
44
42
std::shared_ptr<State> state = m_graph->getInitialState ();
@@ -60,7 +58,6 @@ namespace ecc {
60
58
if (state->getType () == State::INITIAL) {
61
59
tokenLine = line;
62
60
tokenColumn = column;
63
- tokenPosition = position;
64
61
}
65
62
66
63
// Jump to the next state
@@ -79,7 +76,7 @@ namespace ecc {
79
76
80
77
// Create token
81
78
std::shared_ptr<LexicalToken> token =createToken (state->getTokenName (), tokenValueStream.str (),
82
- tokenLine, tokenColumn, tokenPosition );
79
+ tokenLine, tokenColumn);
83
80
84
81
// If token created
85
82
if (token) {
@@ -121,8 +118,6 @@ namespace ecc {
121
118
} else {
122
119
column++;
123
120
}
124
-
125
- position++;
126
121
}
127
122
128
123
// One more call for the end of file
@@ -140,7 +135,7 @@ namespace ecc {
140
135
// If final state, then create the last token
141
136
if (state->getType () == State::FINAL) {
142
137
std::shared_ptr<LexicalToken> token = createToken (state->getTokenName (), tokenValueStream.str (),
143
- tokenLine, tokenColumn, tokenPosition );
138
+ tokenLine, tokenColumn);
144
139
145
140
// If token created
146
141
if (token) {
@@ -157,7 +152,7 @@ namespace ecc {
157
152
// Add final token
158
153
lexicalVector.push_back (std::make_shared<LexicalToken>(
159
154
LexicalToken::Type::NORMAL_FINAL_TOKEN, LexicalToken::END_OF_FILE,
160
- LexicalToken::END_OF_FILE, line, column, position ));
155
+ LexicalToken::END_OF_FILE, line, column));
161
156
162
157
// Log generate tokens
163
158
BOOST_LOG (ecc_logger::get ()) << " Finished generating lexical tokens:" ;
@@ -174,18 +169,18 @@ namespace ecc {
174
169
* @return object | null if the token should be ignored
175
170
*/
176
171
std::shared_ptr<LexicalToken> Lexical::createToken (
177
- std::string tokenName, std::string tokenValue, const int &line, const int &column, const int &position ) {
172
+ std::string tokenName, std::string tokenValue, const int &line, const int &column) {
178
173
179
174
// Check the type of the token name
180
175
if (m_config->isErrorToken (tokenName)) {
181
176
return std::make_shared<LexicalToken>(
182
177
LexicalToken::Type::ERROR_TOKEN, tokenName,
183
- tokenValue, line, column, position );
178
+ tokenValue, line, column);
184
179
} else if (!m_config->mustIgnoreToken (tokenName)) {
185
180
tokenName = m_config->updateTokenName (tokenName, tokenValue);
186
181
return std::make_shared<LexicalToken>(
187
182
LexicalToken::Type::NORMAL_TOKEN, tokenName,
188
- tokenValue, line, column, position );
183
+ tokenValue, line, column);
189
184
}
190
185
return nullptr ;
191
186
}
0 commit comments