blob: 9c068ab6cb0ded80672b225a8d7f8bf94b7697d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/usr/bin/env python3
import sys
from py_nand_ass.lexer import lexer # pyright: ignore[reportImplicitRelativeImport]
if len(sys.argv) != 2:
sys.exit(-1)
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
print(tok)
|