1
class Parser(object):

    def __init__(self,tokens):
       self.tokens = tokens
       self.token_index = 0

    def parse(self):

       while self.token_index < len(self.tokens):
           token_type = self.tokens[self.token_index][0]
           token_value = self.tokens[self.token_index][1]
           print(token_type,token_value)
           self.token_index += 1

This is the parser file

This is the main file enter image description here

This is the error enter image description here

I have give the screenshots as I was facing error while postng my question so sorry for that Any rectification will be very helpful

cs95
  • 379,657
  • 97
  • 704
  • 746
Deepak Das
  • 41
  • 6

0 Answers0