Exemplo n.º 1
0
    def parsing(self):
        '''
        Lleva a cabo el análisis sintáctico.
        '''
        self.parser = Parser(lexer=self.lexer)
        self.ast = self.parser(self.code)
        Utils.Write(self.debug_path, '.parser', '\n'.join(
            repr(rule)
            for rule in Utils.GetRulesParsing())) if self.debug else None

        if len(self.parser.errors) > 0:
            print(self.parser.errors[0])
            exit(1)