summaryrefslogtreecommitdiff
path: root/nandgame/assembler/tlexer.py
blob: 6203b1ad2fbec5528dc1f2e2a8cbcc9076a2fccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import sys

from lexer import lexer

with open(sys.argv[1], 'rb') as f:
  data = f.read()
  data2 = data.decode('ascii')
  lexer.input(data2)

while True:
    tok = lexer.token()
    if not tok:
        break      # No more input
    print(tok)