Writing a lexer for a new programming language in python
问题 I have no idea how/where to start. I'm supposed to be using python, and more specifically, the ply library. So far, all I've done in create a list of tokens that will be part of the language. That list is given below: tokens = ( # OPERATORS # 'PLUS' , # + 'MINUS' , # - 'MULTIPLY', # * 'DIVIDE', # / 'MODULO', # % 'NOT', # ~ 'EQUALS', # = # COMPARATORS # 'LT', # < 'GT', # > 'LTE', # <= 'GTE', # >= 'DOUBLEEQUAL', # == 'NE', # # 'AND', # & 'OR', # | # CONDITIONS AND LOOPS # 'IF', # if 'ELSE', #