summaryrefslogtreecommitdiff
path: root/nandgame/assembler/tlexer.py
blob: 783029923513f648e0d68a9c646425f3989cf78d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3

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)