def find_types_in_func(self, node): assert(type(node) == ProcedureImplDecl) path = [ Many, NestedDeclBlock, Many, TypeSection, Any, TypeDecl, ] ns = self.find(node, path) ns = map(self.select_in_type_decl, ns) ns = util.flatten(ns) return ns
def find_variables_in_class(self, node): assert(type(node) == ClassType) path = [ Many, ClassBody, Many, ClassMember, Any, VarDecl, ] ns = self.find(node, path) ns = map(self.select_in_var_decl, ns) ns = util.flatten(ns) return ns
def find_params_in_func(self, node): assert(type(node) in [ProcedureImplDecl, ProcedureIntfDecl]) path = [ Many, ProcedureIntfDecl, ProcedureSignature, Many, FormalParameters, FormalParameter, ] ns = self.find(node, path) ns = map(self.select_in_formal_parameter, ns) ns = util.flatten(ns) return ns
def find_types_in_unit(self, node): assert(type(node) in [InterfaceSection, ImplementationSection]) path = [ Any, Any, Any, Any, TypeSection, Any, TypeDecl, ] ns = self.find(node, path) ns = map(self.select_in_type_decl, ns) ns = util.flatten(ns) return ns