Mercurial > lcfOS
comparison python/asm.py @ 219:1fa3e0050b49
Expanded ad hoc code generator
author | Windel Bouwman |
---|---|
date | Sat, 06 Jul 2013 12:38:09 +0200 |
parents | 494828a7adf1 |
children | ff40407c0240 |
comparison
equal
deleted
inserted
replaced
218:494828a7adf1 | 219:1fa3e0050b49 |
---|---|
135 | 135 |
136 def parse(self, tokens, emitter): | 136 def parse(self, tokens, emitter): |
137 self.emit = emitter | 137 self.emit = emitter |
138 self.p.parse(tokens) | 138 self.p.parse(tokens) |
139 | 139 |
140 # Pre construct parser to save time: | |
140 asmParser = Parser() | 141 asmParser = Parser() |
142 | |
141 class Assembler: | 143 class Assembler: |
142 def __init__(self, target=None): | 144 def __init__(self, target=None): |
143 self.target = target | 145 self.target = target |
144 self.restart() | 146 self.restart() |
145 self.p = asmParser | 147 self.p = asmParser |