Browse Source

Added a new interface specifically for modelling: interface 4

Yentl Van Tendeloo 8 years ago
parent
commit
dd827c145c

File diff suppressed because it is too large
+ 681 - 769
bootstrap/bootstrap.m


+ 2 - 4
bootstrap/bootstrap.py

@@ -163,19 +163,17 @@ def bootstrap():
     Void function __main():
     \tInteger interface
     \twhile (True):
-    \t\tlog("User interface select")
     \t\tinterface = input()
     \t\tif (interface == 0):
-    \t\t\tlog("DO deserialize")
     \t\t\texec(deserialize(input()))
     \t\telif (interface == 1):
-    \t\t\tlog("User entered constructors")
     \t\t\texec(construct_unknown())
     \t\telif (interface == 2):
-    \t\t\tlog("Done signalled")
     \t\t\toutput("DONE")
     \t\telif (interface == 3):
     \t\t\tcompilation_manager()
+    \t\telif (interface == 4):
+    \t\t\tconstruct_model()
     \t\telse:
     \t\t\tlog("Unsupported interface!")
     '''

File diff suppressed because it is too large
+ 21 - 26
integration/test_constructors_models_compiled.py


+ 0 - 2
interface/HUTN/hutn_compiler/model_visitor.py

@@ -29,10 +29,8 @@ class ModelVisitor(Visitor):
             raise AttributeError()
 
     def visit_start(self, tree):
-        self.constructors.append('"model"')
         for t in tree.get_tail():
             self.visit(t)
-        self.constructors.append('"exit"')
 
     def visit_include_files(self, tree):
         self.includes.append(tree.get_children("STRVALUE")[0].get_text())

File diff suppressed because it is too large
+ 1 - 1
interface/HUTN/test/modelling_language/expected/my_petrinet


File diff suppressed because it is too large
+ 1 - 1
interface/HUTN/test/modelling_language/expected/my_petrinet_with_MM


File diff suppressed because it is too large
+ 1 - 1
interface/HUTN/test/modelling_language/expected/petrinets


File diff suppressed because it is too large
+ 1 - 1
interface/HUTN/test/modelling_language/expected/petrinets_constraints


File diff suppressed because it is too large
+ 1 - 1
interface/HUTN/test/modelling_language/expected/simpleclassdiagrams


+ 2 - 2
scripts/compile.py

@@ -3,11 +3,11 @@ import os
 import urllib2
 import subprocess
 
-def do_compile(address, filename, username, modulename, mode, optionals=[]):
+def do_compile(address, filename, username, modulename, mode, optionals=[], grammar="grammars/actionlanguage.g"):
     filename = os.path.realpath(filename)
     try:
         urllib2.urlopen(urllib2.Request(address, 'op=set_input&username=user_manager&element_type=V&value="%s"' % username)).read()
-        subprocess.check_call([sys.executable, "hutn_compiler/compiler.py", filename, "grammars/actionlanguage.g", mode, username, modulename, filename, address] + optionals, cwd="interface/HUTN")
+        subprocess.check_call([sys.executable, "hutn_compiler/compiler.py", filename, grammar, mode, username, modulename, filename, address] + optionals, cwd="interface/HUTN")
     except urllib2.URLError:
         return 2
     except: