Browse Source

Removed code from bootstrap as this depends on the HUTN service, which hasn't started yet

Yentl Van Tendeloo 7 years ago
parent
commit
67df0d26e7

+ 0 - 39
bootstrap/90_core_formalism.mvc

@@ -4,57 +4,18 @@ include "primitives.alh"
 SimpleClassDiagrams CoreFormalism {
     SimpleAttribute String {
         name = "String"
-        constraint = $
-            String function constraint(model : Element, name : String):
-                if (bool_not(is_physical_string(model["model"][name]))):
-                    return "String has no string value"!
-                else:
-                    return "OK"!
-            $
     }
 
     SimpleAttribute Permissions {
         name = "Permissions"
-        constraint = $
-            String function constraint(model : Element, name : String):
-                Element self
-                self = model["model"][name]
-                if (bool_not(is_physical_string(self))):
-                    return "Permissions has no string value"!
-                if (bool_not(string_len(self) == 3)):
-                    return "Permissions string is not of correct length"!
-                if (bool_or(cast_integer(string_get(self, 0)) < 0, cast_integer(string_get(self, 0)) > 2)):
-                    return "Owner permission is not in range [0, 2]"!
-                if (bool_or(cast_integer(string_get(self, 1)) < 0, cast_integer(string_get(self, 1)) > 2)):
-                    return "Group permission is not in range [0, 2]"!
-                if (bool_or(cast_integer(string_get(self, 2)) < 0, cast_integer(string_get(self, 2)) > 2)):
-                    return "Other permission is not in range [0, 2]"!
-                return "OK"!
-            $
     }
 
     SimpleAttribute Boolean {
         name = "Boolean"
-        constraint = $
-            String function constraint(model : Element, name : String):
-                if (bool_not(is_physical_boolean(model["model"][name]))):
-                    return "Boolean has no bool value"!
-                else:
-                    return "OK"!
-            $
     }
 
     SimpleAttribute Natural {
         name = "Natural"
-        constraint = $
-            String function constraint(model : Element, name : String):
-                if (bool_not(is_physical_int(model["model"][name]))):
-                    return "Natural has no integer value"!
-                elif (integer_lt(model["model"][name], 0)):
-                    return "Natural has negative value"!
-                else:
-                    return "OK"!
-            $
     }
 
     Class User {

+ 0 - 14
bootstrap/pm.mvc

@@ -8,13 +8,6 @@ SimpleClassDiagrams ProcessModel {
     }
     SimpleAttribute MvCName {
         name = "MvCName"
-        constraint = $
-            String function constraint(model : Element, name : String):
-                if (bool_not(is_physical_string(model["model"][name]))):
-                    return "MvCName has no string value"!
-                else:
-                    return "OK"!
-            $
     }
 
     Class Activity {
@@ -37,13 +30,6 @@ SimpleClassDiagrams ProcessModel {
     }
     Class Decision : Activity {
         name = "Decision"
-        constraint = $
-            String function constraint(model : Element, name : String):
-                if (read_nr_out(allOutgoingAssociationInstances(model, name, "Next")) == 0):
-                    return "OK"!
-                else:
-                    return "Decision node cannot have a normal 'Next' link"!
-            $
     }
 
     Class Exec : Activity {

+ 1 - 0
interface/HUTN/hutn_compiler/model_bootstrap_visitor.py

@@ -182,6 +182,7 @@ class ModelBootstrapVisitor(Visitor):
             self.code += '\tinstantiate_attribute(%s, "%s", "%s", %s)\n' % (self.current_model, self.current_element[-1], attr_name, attr_value)
         elif tree.get_children("DOLLAR"):
             # Coded attribute
+            raise Exception("Code is no longer allowed in bootstrap files, as the HUTN parser is not initialized yet")
             #self.constructors.extend(["instantiate_attribute_code", self.current_model, self.current_element[-1], attr_name])
             #self.constructors.extend(constructors_compile(tree.get_children("ANYTHING_EXCEPT_DOLLAR")[0].get_text()))
             code = tree.get_children("ANYTHING_EXCEPT_DOLLAR")[0].get_text()