int main() {
for (int i = 0; i < 50; i = i + 1) {
i = i + 1;
}
}
Traceback (most recent call last):
File "parser.py", line 46, in <module>
main()
File "parser.py", line 41, in main
p.parse('./input.cpp', './output_lexer.txt',
File "parser.py", line 31, in parse
self.semantic_analyser.parse(self.syntax_analyser.tokens, self.syntax_analyser.positions,
File "/compiler/semanticanalyser.py", line 58, in parse
self.Start()
File "/compiler/semanticanalyser.py", line 133, in Start
self.Statement()
File "/compiler/semanticanalyser.py", line 162, in Statement
start = self.For_Loop()
File "/compiler/semanticanalyser.py", line 323, in For_Loop
self.Statement()
File "/compiler/semanticanalyser.py", line 148, in Statement
start = self.Assignment((self.backup('lexeme'), self.cur_depth))
File "/compiler/semanticanalyser.py", line 204, in Assignment
elif self.Instruction(_id):
File "/compiler/semanticanalyser.py", line 228, in Instruction
if self.Expression(_id):
File "/compiler/semanticanalyser.py", line 360, in Expression
if self.Term(_id):
File "/compiler/semanticanalyser.py", line 385, in Term
if self.Factor(_id):
File "/compiler/semanticanalyser.py", line 480, in Factor
if self.ids_to_tokens[_id] != self.ids_to_tokens[(self.backup('lexeme'), self.cur_depth)]:
KeyError: ('i', 2)