|
@@ -18,7 +18,6 @@ def bootstrap():
|
|
|
]
|
|
|
|
|
|
task_frame = [ "evalstack",
|
|
|
- "symbols",
|
|
|
"returnvalue",
|
|
|
]
|
|
|
|
|
@@ -187,11 +186,11 @@ def bootstrap():
|
|
|
# Bind task to the root
|
|
|
f.write('Dict (root, "%s", task_root)\n' % (task_manager))
|
|
|
|
|
|
- def compile_code_AL(filename, target, prepend="", main=False, symbols=None):
|
|
|
+ def compile_code_AL(filename, target, prepend="", main=False):
|
|
|
import sys
|
|
|
sys.path.append("interface/HUTN/")
|
|
|
from hutn_compiler.compiler import main as compile_code
|
|
|
- code = compile_code(filename, "interface/HUTN/grammars/actionlanguage.g", "BS", ["--debug", "--prepend:%s" % prepend, "--main" if main else "--not-main"], symbols=symbols)
|
|
|
+ code = compile_code(filename, "interface/HUTN/grammars/actionlanguage.g", "BS", ["--debug", "--prepend:%s" % prepend, "--main" if main else "--not-main"])
|
|
|
return code.replace("auto_initial_IP", target)
|
|
|
|
|
|
# Create all library code
|
|
@@ -234,8 +233,7 @@ def bootstrap():
|
|
|
# Compile the subfile
|
|
|
bootstrap_file = bootstrap_file.replace("\\", "/")
|
|
|
print("[ALC] %s" % bootstrap_file)
|
|
|
- symbols = {}
|
|
|
- f.write(compile_code_AL(bootstrap_file, "initial_IP", prepend=bootstrap_file, symbols=symbols, main = bootstrap_file in [initial_code_manager, initial_code_task]), both=False)
|
|
|
+ f.write(compile_code_AL(bootstrap_file, "initial_IP", prepend=bootstrap_file, main = bootstrap_file in [initial_code_manager, initial_code_task]), both=False)
|
|
|
|
|
|
# Now link the code with the compilation manager structure
|
|
|
f.write("Node elem()\n", both=False)
|
|
@@ -243,19 +241,6 @@ def bootstrap():
|
|
|
f.write('Dict (__objects, "%s", elem)\n' % bootstrap_file, both=False)
|
|
|
f.write('Dict (elem, "initializers", %s_initial_IP)\n' % bootstrap_file, both=False)
|
|
|
|
|
|
- md5 = hashlib.md5()
|
|
|
- md5.update(open(bootstrap_file, 'r').read())
|
|
|
-
|
|
|
- f.write('Node hash_value("%s")\n' % md5.hexdigest(), both=False)
|
|
|
- f.write('Dict (elem, "hash_md5", hash_value)\n', both=False)
|
|
|
-
|
|
|
- f.write('Node __symbols()\n', both=False)
|
|
|
- f.write('Dict (elem, "symbols", __symbols)\n', both=False)
|
|
|
-
|
|
|
- for k, v in symbols.items():
|
|
|
- f.write('Node v(%s)\n' % v, both=False)
|
|
|
- f.write('Dict (__symbols, "%s", v)\n' % (k), both=False)
|
|
|
-
|
|
|
# Create code for initial task
|
|
|
print("[BOOT] task_manager")
|
|
|
f.write('Dict (task_frame, "IP", %s_initial_IP)\n' % (initial_code_manager), both=False)
|