Exemplo n.º 1
0
    protected void OnEjecutarSemantico(object sender, EventArgs e)
    {
        if (arbolCompilador == null)
        {
            return;
        }


        Semantico.fnResetRun(); //Se resetea diccionario y String de errores semanticos

        Semantico semantico = new Semantico(arbolCompilador);

        semantico.mainSintactico();

        removeAllColumns(nodeview1);
        buildHashTable();

        removeAllColumns(treeview2);

        //Dibujamos el arbol semantico
        Gtk.TreeViewColumn columna = new Gtk.TreeViewColumn();
        columna.Title = "Arbol";


        Gtk.CellRendererText celda = new Gtk.CellRendererText();
        columna.PackStart(celda, true);


        treeview2.AppendColumn(columna);
        columna.AddAttribute(celda, "text", 0);
        Gtk.TreeStore lista = new Gtk.TreeStore(typeof(string));
        verArbolSemantico(semantico.getArbol(), lista);
        treeview2.ExpandAll(); //Propiedad para expandir el arbol

        arbolCompilador = semantico.getArbol();
    }