Exemple #1
0
 def report_ast_windows(self):
     global report_ast
     graficadora = GraficarAST()
     report = open('dot.txt', 'w')
     report.write(graficadora.generate_string(report_ast))
     report.close()
     os.system('dot -Tpdf dot.txt -o ast.pdf')
     os.startfile('ast.pdf')
Exemple #2
0
 def analizar_entrada(self):
     texto = self.entrada.get("1.0", END)
     parser = yacc.yacc()
     graficadora = GraficarAST()
     result = parser.parse(texto)
     report = open('test.txt', 'w')
     report.write(graficadora.generate_string(result))
     report.close()
     messagebox.showinfo("EXITO", "SE FINALIZO EL ANALISIS SINTACTICO")
Exemple #3
0
 def report_ast_ubuntu(self):
     global report_ast
     graficadora = GraficarAST()
     report = open('./team28/dot.txt', 'w')
     report.write(graficadora.generate_string(report_ast))
     report.close()
     os.system('dot -Tpdf ./team28/dot.txt -o ./team28/ast.pdf')
     # Si estan en ubuntu dejan esta linea si no la comentan y descomentan la otra para windows
     os.system('xdg-open ./team28/ast.pdf')
Exemple #4
0
 def analizar_entrada(self):
     texto = self.entrada.get("1.0", END)
     graficadora = GraficarAST()
     result = parse(texto)
     values = list_errors.head_value
     if values is not None:
         report_error = ReportError(list_errors)
         report = open('error.html', 'w')
         report.write(report_error.get_report())
         report.close()
         messagebox.showerror('ERRORES', 'Se encontraron errores')
     else:
         report = open('dot.txt', 'w')
         report.write(graficadora.generate_string(result))
         report.close()
         messagebox.showinfo("EXITO", "SE FINALIZO EL ANALISIS SINTACTICO")