Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ItemCompilar_Click(object sender, EventArgs e)
        {
            //Limpia el grid
            Main.GridVariables.Rows.Clear();
            //Limpia el output
            txtoutput.Text = String.Empty;
            //Limpia los mensajes
            ERRHtml.Log = String.Empty;
            Parser    p     = new Parser(new LanguageData(new Sintactico()));
            ParseTree arbol = p.Parse(((FastColoredTextBox)TabInput.SelectedTab.Controls[0]).Text);

            if (arbol.Root != null)
            {
                var ASTGraph = new ASTHtml(arbol.Root);

                this.SaveFile("ASTGraph.html", ASTGraph.GenerarHTML());
                var recorrido = new Recorrido();
                recorrido.CrearClase(arbol.Root);
                Operar.Clases = Recorrido.Clases;
                foreach (var clases in Recorrido.Clases)
                {
                    if (clases.Value.Ejecutar())
                    {
                        break;
                    }
                }

                /*
                 * Console.WriteLine(a.Equals(b));
                 * Console.WriteLine(a.Equals(c));
                 * Console.WriteLine(c.Equals(b));
                 */
            }
            try
            {
                this.SaveFile("MessageParser.html", ERRHtml.ParserMessageHTML(arbol.ParserMessages));
            }
            catch (Exception)
            {
            }
        }