|
@@ -70,11 +70,13 @@ class ModelVisitor(Visitor):
|
|
|
is_definition = bool(tree.get_children("COLON"))
|
|
|
|
|
|
if is_definition:
|
|
|
+ # is definition
|
|
|
attr_name = children[0].get_text()
|
|
|
attr_type = children[1].get_text()
|
|
|
self.constructors.extend(['"instantiate_link"', jsonstr("Association"), jsonstr(self.current_element + "_" + attr_name), jsonstr(self.current_element), jsonstr(attr_type)])
|
|
|
self.constructors.extend(['"instantiate_attribute"', jsonstr(self.current_element + "_" + attr_name), jsonstr("name"), jsonstr(attr_name)])
|
|
|
else:
|
|
|
+ # is assign
|
|
|
attr_name = children[0].get_text()
|
|
|
attr_value = children[1]
|
|
|
self.constructors.extend(['"instantiate_attribute"', jsonstr(self.current_element), jsonstr(attr_name), jsonstr(attr_value.get_text()) if attr_value.head == "STRVALUE" else attr_value.get_text()])
|