Mercurial > lcfOS
annotate python/asm.py @ 192:6cd6260789a1
Added more tests for parser generator
author | Windel Bouwman |
---|---|
date | Sun, 26 May 2013 23:19:27 +0200 |
parents | 5e1dd04cb61c |
children |
rev | line source |
---|---|
159 | 1 #!/usr/bin/python |
2 | |
3 # Assembler | |
4 | |
5 import sys, argparse | |
6 import pdb | |
7 | |
8 import libasm | |
9 | |
10 parser = argparse.ArgumentParser(description="Assembler") | |
11 pdb.set_trace() | |
12 parser.add_argument('sourcefile', type=argparse.FileType('r'), help='the source file to assemble') | |
13 args = parser.parse_args() | |
14 | |
15 | |
16 a = libasm.Assembler() | |
17 obj = a.assemble(args.sourcefile.read()) | |
18 | |
19 print('object:', obj) | |
20 |