Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Introduzca la direccion del archivo: ");
            String     x   = Console.ReadLine();
            Lexico     lex = new Lexico(x);
            Sintactico sin = new Sintactico(lex);

            sin.imprimir();
            Console.ReadLine();
        } //Main
Esempio n. 2
0
 public Sintactico(Lexico lexico)
 {
     lex    = lexico;
     tokens = lex.getTokens();
     validarProgramaComienzaLlave();
     validarCochineroLlaves();
     for (int i = 0; i < tokens.Count; i++)
     {
         getTipo(tokens.ElementAt(i), i);
     }
 }
Esempio n. 3
0
 public Sintatico(Lexico lx)
 {
     this.inVar    = false;
     this.inConst  = false;
     this.tempVars = new List <string>();
     this.Sem      = new Semantico();
     this.Lex      = lx;
     this.tk       = lx.NextToken();
     if (tk == null)
     {
         Console.WriteLine("Arquivo vazio");
     }
 }
Esempio n. 4
0
        static void Main(string[] args)
        {
            lexico    = new Lexico(entrada);
            sintatico = new Sintatico(lexico);
            Token t;

            sintatico.PROG();

            /*
             * do
             * {
             *  t = lexico.NextToken();
             *  if (t == null)
             *      break;  //Erro Léxico
             *  //Console.WriteLine("Linha: "+ t.Linha + "\tLexema: " + t.Lexograma + "\tDescricao: " + t.Descricao );
             * } while (t.Lexograma != "EOF");
             */
            Console.Read();
        }