@@ -35,10 +35,8 @@ namespace ecc {
3535 // Keep track of file information
3636 int tokenLine = 1 ;
3737 int tokenColumn = 1 ;
38- int tokenPosition = 0 ;
3938 int line = 1 ;
4039 int column = 1 ;
41- int position = 0 ;
4240
4341 // Keep track of the state
4442 std::shared_ptr<State> state = m_graph->getInitialState ();
@@ -60,7 +58,6 @@ namespace ecc {
6058 if (state->getType () == State::INITIAL) {
6159 tokenLine = line;
6260 tokenColumn = column;
63- tokenPosition = position;
6461 }
6562
6663 // Jump to the next state
@@ -79,7 +76,7 @@ namespace ecc {
7976
8077 // Create token
8178 std::shared_ptr<LexicalToken> token =createToken (state->getTokenName (), tokenValueStream.str (),
82- tokenLine, tokenColumn, tokenPosition );
79+ tokenLine, tokenColumn);
8380
8481 // If token created
8582 if (token) {
@@ -121,8 +118,6 @@ namespace ecc {
121118 } else {
122119 column++;
123120 }
124-
125- position++;
126121 }
127122
128123 // One more call for the end of file
@@ -140,7 +135,7 @@ namespace ecc {
140135 // If final state, then create the last token
141136 if (state->getType () == State::FINAL) {
142137 std::shared_ptr<LexicalToken> token = createToken (state->getTokenName (), tokenValueStream.str (),
143- tokenLine, tokenColumn, tokenPosition );
138+ tokenLine, tokenColumn);
144139
145140 // If token created
146141 if (token) {
@@ -157,7 +152,7 @@ namespace ecc {
157152 // Add final token
158153 lexicalVector.push_back (std::make_shared<LexicalToken>(
159154 LexicalToken::Type::NORMAL_FINAL_TOKEN, LexicalToken::END_OF_FILE,
160- LexicalToken::END_OF_FILE, line, column, position ));
155+ LexicalToken::END_OF_FILE, line, column));
161156
162157 // Log generate tokens
163158 BOOST_LOG (ecc_logger::get ()) << " Finished generating lexical tokens:" ;
@@ -174,18 +169,18 @@ namespace ecc {
174169 * @return object | null if the token should be ignored
175170 */
176171 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) {
178173
179174 // Check the type of the token name
180175 if (m_config->isErrorToken (tokenName)) {
181176 return std::make_shared<LexicalToken>(
182177 LexicalToken::Type::ERROR_TOKEN, tokenName,
183- tokenValue, line, column, position );
178+ tokenValue, line, column);
184179 } else if (!m_config->mustIgnoreToken (tokenName)) {
185180 tokenName = m_config->updateTokenName (tokenName, tokenValue);
186181 return std::make_shared<LexicalToken>(
187182 LexicalToken::Type::NORMAL_TOKEN, tokenName,
188- tokenValue, line, column, position );
183+ tokenValue, line, column);
189184 }
190185 return nullptr ;
191186 }
0 commit comments