diff options
| author | Ajax <commial@gmail.com> | 2015-04-24 10:08:23 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-04-24 10:08:23 +0200 |
| commit | 568dd3641a10e0887700a3a3433e2e20e8e37825 (patch) | |
| tree | d957d20917a97635d4d2b56a3d60a3360aaa1879 /miasm2/core/sembuilder.py | |
| parent | d0fd34c341103d17c7f7a6409d23a34b7d362747 (diff) | |
| download | miasm-568dd3641a10e0887700a3a3433e2e20e8e37825.tar.gz miasm-568dd3641a10e0887700a3a3433e2e20e8e37825.zip | |
SemBuilder: PreInit context with needed values
Diffstat (limited to '')
| -rw-r--r-- | miasm2/core/sembuilder.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/miasm2/core/sembuilder.py b/miasm2/core/sembuilder.py index ba9d9d80..ddf1cb32 100644 --- a/miasm2/core/sembuilder.py +++ b/miasm2/core/sembuilder.py @@ -4,6 +4,9 @@ import inspect import ast import re +import miasm2.expression.expression as m2_expr +from miasm2.ir.ir import irbloc + class MiasmTransformer(ast.NodeTransformer): """AST visitor translating DSL to Miasm expression @@ -99,8 +102,14 @@ class SemBuilder(object): """Create a SemBuilder @ctx: context dictionnary used during parsing """ - self.ctx = dict(ctx) + # Init self.transformer = MiasmTransformer() + self.ctx = dict(m2_expr.__dict__) + self.ctx["irbloc"] = irbloc + + # Update context + self.ctx.update(ctx) + def parse(self, func): """Function decorator, returning a correct method from a pseudo-Python |