view 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
line wrap: on
line source

#!/usr/bin/python

# Assembler

import sys, argparse
import pdb

import libasm

parser = argparse.ArgumentParser(description="Assembler")
pdb.set_trace()
parser.add_argument('sourcefile', type=argparse.FileType('r'), help='the source file to assemble')
args = parser.parse_args()


a = libasm.Assembler()
obj = a.assemble(args.sourcefile.read())

print('object:', obj)