Browse Source

Remove some stupid prints; fixed some bugs in the generated
compilation_manager structure (still not working though)

Yentl Van Tendeloo 8 years ago
parent
commit
f67c46ea38
4 changed files with 2917 additions and 2254 deletions
  1. 2895 2238
      bootstrap/bootstrap.m
  2. 22 11
      bootstrap/bootstrap.py
  3. 0 3
      hybrid_server/classes/mvkcontroller.xml
  4. 0 2
      kernel/modelverse_kernel/main.py

File diff suppressed because it is too large
+ 2895 - 2238
bootstrap/bootstrap.m


+ 22 - 11
bootstrap/bootstrap.py

@@ -1,5 +1,6 @@
 ### Configuration for creating the bootstrap model using conformance_bottom.
 import glob
+import hashlib
 
 def bootstrap():
     root = ["__hierarchy"]
@@ -110,7 +111,7 @@ def bootstrap():
     \tElement root
     \troot = read_root()
     \troot = root["__hierarchy"]["objects"]
-    \texec(root["bootstrap/user_manager.alc"])
+    \texec(root["bootstrap/user_manager.alc"]["initializers"])
     \tuser_management()
     '''
 
@@ -123,15 +124,15 @@ def bootstrap():
     \tElement root
     \troot = read_root()
     \troot = root["__hierarchy"]["objects"]
-    \texec(root["bootstrap/primitives.alc"])
-    \texec(root["bootstrap/compilation_manager.alc"])
-    \texec(root["bootstrap/constructors.alc"])
-    \texec(root["bootstrap/library.alc"])
-    \texec(root["bootstrap/object_operations.alc"])
-    \texec(root["bootstrap/conformance_scd.alc"])
-    \texec(root["bootstrap/metamodels.alc"])
-    \texec(root["bootstrap/modelling.alc"])
-    \texec(root["bootstrap/user_interface.alc"])
+    \texec(root["bootstrap/primitives.alc"]["initializers"])
+    \texec(root["bootstrap/compilation_manager.alc"]["initializers"])
+    \texec(root["bootstrap/constructors.alc"]["initializers"])
+    \texec(root["bootstrap/library.alc"]["initializers"])
+    \texec(root["bootstrap/object_operations.alc"]["initializers"])
+    \texec(root["bootstrap/conformance_scd.alc"]["initializers"])
+    \texec(root["bootstrap/metamodels.alc"]["initializers"])
+    \texec(root["bootstrap/modelling.alc"]["initializers"])
+    \texec(root["bootstrap/user_interface.alc"]["initializers"])
     \tnew_user()
     '''
 
@@ -252,9 +253,19 @@ def bootstrap():
                     result = compile_code_AL(bootstrap_file, "initial_IP", prepend=bootstrap_file, is_file=True)
                     f.write(result, both=False)
                     # Now link the code with the compilation manager structure
+                    f.write("Node elem()\n", both=False)
+                    f.write('Node initializers("initializers")\n', both=False)
+                    f.write('Node hash("hash_md5")\n', both=False)
+                    f.write("Edge _(__objects, elem)\n", both=False)
                     f.write('Node filename("%s")\n' % bootstrap_file, both=False)
-                    f.write("Edge _(__objects, %s_initial_IP)\n" % bootstrap_file, both=False)
                     f.write("Edge _(_, filename)\n", both=False)
+                    f.write("Edge _(elem, %s_initial_IP)\n" % bootstrap_file, both=False)
+                    f.write("Edge _(_, initializers)\n", 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("Edge _(elem, hash_value)\n", both=False)
+                    #TODO add the symbols as well!
 
                 # Create code for initial user
                 print("[BOOT] initial_user")

+ 0 - 3
hybrid_server/classes/mvkcontroller.xml

@@ -151,9 +151,6 @@
                                         if self.mvk.success:
                                             self.destination = self.output_queue[user].pop(0)
                                             self.value = self.mvk.returnvalue
-                                            print("Send value1: " + str(self.value))
-                                            print("Send value2: " + str(self.value))
-                                            print("Send value3: " + str(self.value))
                                             self.all_failed = False
 
                             else:

+ 0 - 2
kernel/modelverse_kernel/main.py

@@ -966,8 +966,6 @@ class ModelverseKernel(object):
         value, =        yield [("RV", [new_var])]
         exists, =       yield [("RD", [global_symbols, value])]
 
-        print("Define global " + str(value))
-
         if exists is None:
             yield [("CD", [global_symbols, value, empty_node])]