Exemplo n.º 1
0
        public void cargarArchivo(string ruta)
        {
            //Lexico_tk l = new Lexico_tk();

            Lexico_tk.getRuta_alfabeto(ruta);
            GenerarTabla.generarTablaAlfabeto(tbl_tabla, Lexico_tk.listAlfabeto);
        }
Exemplo n.º 2
0
 public FrmEditor(FrmPrincipal p)
 {
     InitializeComponent();
     // timer1.Interval = 10;
     //timer1.Start();
     frmPri    = p;
     listaCode = new List <Form3>();
     Crearnuevapestaña();
     //Form3.r1.Text = Lexico_tk.enviarCodeEditor();
     f3.rich_Editor.Text = Lexico_tk.enviarCodeEditor();
 }
Exemplo n.º 3
0
        private void pictureBox5_Click(object sender, EventArgs e)
        {
            rich_consola.Text = "";
            //string txt_code = Form3.r1.Text;
            //string txt_code = f3.rich_Editor.Text;

            // indice de la ventana seleccionada para ejecutar codigo generado
            indiceCode = tabControl1.SelectedIndex;
            string txt_code = listaCode[indiceCode].rich_Editor.Text;

            if (!"".Equals(txt_code))
            {
                // ---- Ejecutar programa -----------
                // LEXICO
                Lexico_tk.getIniciarTokensReconocidos(txt_code.Split('\n'));
                //txtl_consola.Text = Lexico_tk.erroresEjecucion;

                // SINTACTICO
                // si el lexico tiene 0 errores puedo seguir continuando con el sintactico
                if (Lexico_tk.claseErroresReconocidos.list_erroresReconocidos.Count == 0)
                {
                    Sintactico_srl.inicializarAnalizadorSRL();
                }

                // SEMANTICO
                if (Lexico_tk.claseErroresReconocidos.list_erroresReconocidos.Count == 0)
                {
                    principalSemantico.iniciarSemamntico(this);
                    principalSemantico.claseSemantica.generar_codigoCuadruplo();
                }

                string   res             = Lexico_tk.claseErroresReconocidos.imprimir_erroresConsola();
                string[] imprimirconsola = res.Split('\n');
                for (int i = 0; i < imprimirconsola.Length; i++)
                {
                    PrintSemantico(2, imprimirconsola[i]);
                }


                //Semantico_srl s = new Semantico_srl();
                //pruebaSemantico s = new pruebaSemantico();
                //s.generar_codigoCuadruplo();
                // -------------------------------
                //abrirforms(new FrmTDS());
                imprimir("indiceCode ---->  " + indiceCode);
                //frmPri.abrirformsecundarios(new FrmReglasReconocidas());
                //frmPri.abrirReglas();
                frmPri.ejecutarVentanaResultado();
            }
            PrintSemantico(3, "Ejecucion Terminada");
        }
Exemplo n.º 4
0
        /* string rutaAFD = @"C:\Users\WGPROOT\Desktop\xml\automata_wcl.xml";
         * string rutaAlfabeto = @"C:\Users\WGPROOT\Desktop\xml\Alfabeto.xml";
         * string ruta_error = @"C:\Users\WGPROOT\Desktop\xml\Error.xml";*/
        //string rutaAFD = CargarData("automata_wcl.xml");


        public Logo()
        {
            InitializeComponent();
            timer1.Enabled = true;
            //Console.WriteLine("---> " + @CargarRuta("\\..\\..\\automata_wcl.xml"));
            // --- LEXICO ----
            Lexico_tk.getRuta_afd(@CargarRuta("automata_wcl.xml"));
            Lexico_tk.getRuta_alfabeto(@CargarRuta("Alfabeto.xml"));
            Lexico_tk.inicializarError(@CargarRuta("Error.xml"));

            // --- SINTACTICO ---
            Sintactico_srl.inicializarCargarSLR("Gramatica_SLR2.xml");

            Console.WriteLine("FICHEROS CARGADOS");
        }