|
@@ -95,10 +95,8 @@ class ModelVisitor(Visitor):
|
|
|
attr_name = children[0].get_text()
|
|
|
attr_optional = len(tree.get_children("OPTIONAL")) > 0
|
|
|
attr_type = children[1].get_text()
|
|
|
- self.constructors.extend(["instantiate_link", self.current_model, "Attribute", self.current_element[-1] + "_" + attr_name, self.current_element[-1], attr_type])
|
|
|
+ self.constructors.extend(["model_define_attribute", self.current_model, self.current_element[-1], attr_name, attr_optional, attr_type])
|
|
|
full_attribute_name = self.current_element[-1] + "_" + attr_name
|
|
|
- self.constructors.extend(["instantiate_attribute", self.current_model, full_attribute_name, "name", attr_name])
|
|
|
- self.constructors.extend(["instantiate_attribute", self.current_model, full_attribute_name, "optional", attr_optional])
|
|
|
|
|
|
if is_assign:
|
|
|
# There are also some attributes to set!
|
|
@@ -124,7 +122,7 @@ class ModelVisitor(Visitor):
|
|
|
f.flush()
|
|
|
directory = os.path.realpath(__file__).rsplit(os.sep, 1)[0]
|
|
|
compiled = do_compile(".constraint.alc", directory + "/../grammars/actionlanguage.g", "CS")
|
|
|
- self.constructors.extend(["add_constraint", self.current_model, self.current_element[-1]] + compiled)
|
|
|
+ self.constructors.extend(["instantiate_attribute_code", self.current_model, self.current_element[-1], "constraint"] + compiled)
|
|
|
elif is_nested:
|
|
|
if tree.get_children("MODEL_ID"):
|
|
|
contains_link = tree.get_children("MODEL_ID")[0].get_text()
|