Mercurial > lcfOS
diff python/ppci/irutils.py @ 318:e84047f29c78
Add burg and yacc initial attempts
author | Windel Bouwman |
---|---|
date | Tue, 31 Dec 2013 12:38:15 +0100 |
parents | e30a77ae359b |
children | 988f3fb861e4 |
line wrap: on
line diff
--- a/python/ppci/irutils.py Sun Dec 22 15:50:59 2013 +0100 +++ b/python/ppci/irutils.py Tue Dec 31 12:38:15 2013 +0100 @@ -119,7 +119,7 @@ return self.next_token() else: raise IrParseException('Expected "{}" got "{}"'.format(typ, self.Peak)) - + def parse_module(self): """ Entry for recursive descent parser """ self.Consume('module') @@ -132,7 +132,7 @@ else: raise IrParseException('Expected function got {}'.format(self.Peak)) return module - + def parse_function(self): self.Consume('function') self.parse_type() @@ -259,7 +259,7 @@ assert block.LastInstruction.IsTerminator for i in block.Instructions[:-1]: assert not isinstance(i, ir.LastStatement) - + def verify_block(self, block): for instruction in block.Instructions: self.verify_instruction(instruction)