private void toolBoxCompilarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toolBoxCompilarActionPerformed
        TinyLexico tl;
        TinySintaxis ts;
        List listalex, listalexError;
        Token tok;
        DefaultMutableTreeNode node;
        try {
            textErrores.setText("");
            textErrores.setText("");
            textErrores.setText("");
            this.menuItemGuardarActionPerformed(evt);
            tl = new TinyLexico(currentFile);
            listalex = new ArrayList();
            listalexError = new ArrayList();
            do {
                tok = tl.next();
                if (tok.getTipoToken() == Token.TipoToken.ERROR) {
                    listalexError.add(tok);
                } else {
                    listalex.add(tok);
                }
            } while (tok.getTipoToken() != tiny.Token.TipoToken.EOF);
            
            if (!listalexError.isEmpty()) {
                
                textErrores.append("+++Errores Lexicos: \n\n");
                
                for (int i = 0; i < listalexError.size(); i++) {
                    textErrores.append(listalexError.get(i).toString() + "\n");
                }
            } else {
                
                for (int i = 0; i < listalex.size(); i++) {
                    textLexico.append(listalex.get(i).toString() + "\n");
                }
                ts = new TinySintaxis(listalex);
                ts.analize();
                node = ts.getRaiz();
                arbolSintactico.setModel(new DefaultTreeModel(node)); 
                if (!ts.getListaErrores().isEmpty()) {
                    
                    textErrores.append("+++Errores Sintacticos: \n\n");
                
                    for (int i = 0; i < ts.getListaErrores().size(); i++) {
                        textErrores.append(ts.getListaErrores().get(i).toString() + "\n");
                    }
                }
            }
            
            
            status.setText("Hecho");
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
            status.setText("Operación fallida");
        }
    }//GEN-LAST:event_toolBoxCompilarActionPerformed