|
@@ -26,8 +26,10 @@ class ModelVisitor(Visitor):
|
|
raise AttributeError()
|
|
raise AttributeError()
|
|
|
|
|
|
def visit_start(self, tree):
|
|
def visit_start(self, tree):
|
|
|
|
+ self.constructors.append('"model"')
|
|
for t in tree.get_tail():
|
|
for t in tree.get_tail():
|
|
self.visit(t)
|
|
self.visit(t)
|
|
|
|
+ self.constructors.append('"exit"')
|
|
|
|
|
|
def visit_import(self, tree):
|
|
def visit_import(self, tree):
|
|
url = tree.get_children("MV_URL")[0]
|
|
url = tree.get_children("MV_URL")[0]
|
|
@@ -73,8 +75,8 @@ class ModelVisitor(Visitor):
|
|
# is definition
|
|
# is definition
|
|
attr_name = children[0].get_text()
|
|
attr_name = children[0].get_text()
|
|
attr_type = children[1].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)])
|
|
|
|
|
|
+ self.constructors.extend(['"instantiate_link"', jsonstr(self.current_model), jsonstr("Association"), jsonstr(self.current_element + "_" + attr_name), jsonstr(self.current_element), jsonstr(attr_type)])
|
|
|
|
+ self.constructors.extend(['"instantiate_attribute"', jsonstr(self.current_model), jsonstr(self.current_element + "_" + attr_name), jsonstr("name"), jsonstr(attr_name)])
|
|
else:
|
|
else:
|
|
# is assign
|
|
# is assign
|
|
attr_name = children[0].get_text()
|
|
attr_name = children[0].get_text()
|