about summary refs log tree commit diff stats
path: root/example/expression/expr_translate.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2020-11-30 17:44:57 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2020-12-01 09:43:09 +0100
commitf6804c42ec258ba0d53a41cb6deed5eb11eb7eca (patch)
tree099bcf8293b4b4e710c4dc9601d1eed0b64d5023 /example/expression/expr_translate.py
parent340429eb41295515203c32188430bcba7f0481dd (diff)
downloadmiasm-f6804c42ec258ba0d53a41cb6deed5eb11eb7eca.tar.gz
miasm-f6804c42ec258ba0d53a41cb6deed5eb11eb7eca.zip
Add missing == operator in translators
Diffstat (limited to 'example/expression/expr_translate.py')
-rw-r--r--example/expression/expr_translate.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/example/expression/expr_translate.py b/example/expression/expr_translate.py
index 8562975f..31408566 100644
--- a/example/expression/expr_translate.py
+++ b/example/expression/expr_translate.py
@@ -45,3 +45,14 @@ print("-> 0x%x" % eval(target_exprs["Python"]))
 print("[+] Validate the Miasm syntax rebuilding")
 exprRebuild = eval(target_exprs["Miasm"])
 assert(expr == exprRebuild)
+
+
+a = ExprId("a", 32)
+b = ExprId("b", 32)
+cst1 = ExprInt(1, 32)
+eq_test = ExprOp("==", a, b + cst1)
+
+for lang in Translator.available_languages():
+    translator = Translator.to_language(lang)
+    print("Translate to %s:" % lang)
+    print(translator.from_expr(eq_test))