public void Analizar(List <Token> tokens) { //IMPRIMIENDO NUMERO DE TOKENS Console.WriteLine("NUMERO DE TOKENS: " + tokens.Count()); //AGREGANDO ESTADO FINAL EN LOS TOKENS tokens.Add(new Token(null, Lexema.ACEPTACION, null)); //PROBANDO pila.Reiniciar(); errores.Clear(); produccionActual = Produccion.MP; vuelta = 0; try { Console.WriteLine("TAMANO: " + tokens.Count()); Avanzar(tokens); } catch { SegundoAvanzar(tokens); } //MOSTRANDO SI HAY ERRORES SINTACTICOS if (pila.RecuperarSize() == 0 || errores.Count() == 0) { Console.WriteLine("\n\n\nNO HAY ERRORES SINTACTICOS"); } else { Console.WriteLine("\n\n\nHAY ERRORES SINTACTICOS"); } }
public void Analizar(List <Token> tokens) { //IMPRIMIENDO NUMERO DE TOKENS Console.WriteLine("NUMERO DE TOKENS: " + tokens.Count()); //AGREGANDO ESTADO FINAL EN LOS TOKENS tokens.Add(new Token(null, Lexema.ACEPTACION, null)); //PROBANDO pila.Reiniciar(); produccionActual = Produccion.MP; vuelta = 0; try { Console.WriteLine("TAMANO: " + tokens.Count()); while (vuelta < tokens.Count()) { Console.WriteLine("VUELTA: " + vuelta); SolicitarLexema(vuelta, tokens); VerificarAnulabilidad(); SolicitarProduccion(); } } catch { Console.WriteLine("CAYO EN ERROR"); } //MOSTRANDO SI HAY ERRORES SINTACTICOS if (pila.RecuperarSize() == 0) { Console.WriteLine("\n\n\nNO HAY ERRORES SINTACTICOS"); } else { Console.WriteLine("\n\n\nHAY ERRORES SINTACTICOS"); } }
public void Analizar(List <Token> tokens) { //AGREGANDO ESTADO FINAL EN LOS TOKENS tokens.Add(new Token(null, Lexema.ACEPTACION, null)); //PROBANDO pila.Reiniciar(arbol); errores.Clear(); produccionActual = Produccion.MP; vuelta = 0; try { Avanzar(tokens); } catch { SegundoAvanzar(tokens); } arbol.CerrarArbol(); }