annotate python/asm.py @ 363:396e5cefba13

Removed debuginfo instruction
author Windel Bouwman
date Sun, 16 Mar 2014 11:28:47 +0100
parents 6f4753202b9a
children 6df89163e114
rev   line source
303
be7f60545368 Final fixups
Windel Bouwman
parents: 287
diff changeset
1 #!/usr/bin/env python3
be7f60545368 Final fixups
Windel Bouwman
parents: 287
diff changeset
2
318
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents: 315
diff changeset
3 import argparse
334
6f4753202b9a Added more recipes
Windel Bouwman
parents: 319
diff changeset
4 from ppci.assembler import Assembler
196
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
5
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
6 if __name__ == '__main__':
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
7 # When run as main file, try to grab command line arguments:
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
8 parser = argparse.ArgumentParser(description="Assembler")
318
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents: 315
diff changeset
9 parser.add_argument('sourcefile', type=argparse.FileType('r'),
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents: 315
diff changeset
10 help='the source file to assemble')
196
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
11 args = parser.parse_args()
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
12 a = Assembler()
ec2b423cdbea Merge asm and asmlib files
Windel Bouwman
parents: 195
diff changeset
13 obj = a.assemble(args.sourcefile.read())