Esempio n. 1
0
 SaidaRotina Reset(Evento evento)
 {
     Acumulador = new List <CaracterClassificado>();
     Cabecote   = new Cabecote(AutomatoFinito.EstadoInicial);
     return(new SaidaRotina(
                new List <Evento>(),
                new List <Evento>(),
                new List <Evento>()
                ));
 }
 SaidaRotina Reset(Evento evento)
 {
     Acumulador      = new List <TokenLexico>();
     Cabecote        = new Cabecote(AutomatoFinito.EstadoInicial);
     Cabecote.Aceito = AutomatoFinito.ConfereEstadoFinal(Cabecote.EstadoAtual);
     return(new SaidaRotina(
                new List <Evento>(),
                new List <Evento>(),
                new List <Evento>()
                ));
 }
Esempio n. 3
0
        public ExtratorTokens()
        {
            AutomatoFinito = InstanciaAutomato();
            Acumulador     = new List <CaracterClassificado>();
            Cabecote       = new Cabecote(AutomatoFinito.EstadoInicial);

            Rotinas.Add(TipoEvento.ASCII, new Func <Evento, SaidaRotina>(ReceberCaracter));
            Rotinas.Add(TipoEvento.RESET, new Func <Evento, SaidaRotina>(Reset));
            Rotinas.Add(TipoEvento.EOL, new Func <Evento, SaidaRotina>(Eol));
            Rotinas.Add(TipoEvento.EOF, new Func <Evento, SaidaRotina>(Eof));
        }
        public RecategorizadorLexico()
        {
            AutomatoFinito  = InstanciaAutomato();
            Acumulador      = new List <TokenLexico>();
            Cabecote        = new Cabecote(AutomatoFinito.EstadoInicial);
            Cabecote.Aceito = AutomatoFinito.ConfereEstadoFinal(Cabecote.EstadoAtual);

            Rotinas.Add(TipoEvento.TOKEN_LEXICO, new Func <Evento, SaidaRotina>(ReceberToken));
            Rotinas.Add(TipoEvento.RESET, new Func <Evento, SaidaRotina>(Reset));
            Rotinas.Add(TipoEvento.EOL, new Func <Evento, SaidaRotina>(Eol));
            Rotinas.Add(TipoEvento.EOF, new Func <Evento, SaidaRotina>(Eof));
        }