def first_pass(self, grammar_parser, node, children):

        metamodel = grammar_parser.metamodel

        if 'Comment' in metamodel:
            comments_model = grammar_parser.metamodel['Comment']._tx_peg_rule
        else:
            comments_model = None

        root_rule = children[0]
        from .model import get_model_parser
        model_parser = get_model_parser(root_rule, comments_model,
                                        ignore_case=metamodel.ignore_case,
                                        skipws=metamodel.skipws,
                                        ws=metamodel.ws,
                                        autokwd=metamodel.autokwd,
                                        debug=metamodel.debug)

        model_parser.metamodel = metamodel

        return model_parser
dataset/ETHPy150Open igordejanovic/textX/textx/textx.py/TextXModelSA.first_pass/original