def create_ref(self, node): """ Create a reference """ to_list = [str(x.text) for x in node.children] ref = Reference(to_list[-1], to_list[:-1]) if (ref.name in TYPES) and len(ref.namespace) == 0: ref.namespace = ["__types__"] return ref
def create_var_ref(self, node): """ Create a variable reference """ to_list = [str(x.text) for x in node.children[0].children] ref = Reference(str(node.children[1].text), to_list) ref.line = node.children[1].line if len(node.children[2].children) > 0: var = ref for attr in node.children[2].children: var = AttributeVariable.create(var, str(attr.text)) var.line = attr.line return var else: return ref