def _load_implementation(self, implementation_filename, reserved_token_names=None): """ Parses a file with the required implementation and replaces the reserved token names with user-innaccesible names """ implementation_program = gbs_parser.parse_file(os.path.join(GbsMacrosDir, implementation_filename)) for token_name in reserved_token_names: defhelper.recursive_replace_token(implementation_program, token_name, "_" + token_name) return implementation_program
def parse_tree(self, module_name): if module_name not in self._parse_trees: self._parse_trees[module_name] = gbs_parser.parse_file( self.filename_for(module_name) ) return self._parse_trees[module_name]