public LetStateMachine(VariableTable variables, FileManager fileManager)
        {
            CurrentState = LetMachineState.START;
            transitions  = new Dictionary <LetStateTransition, LetMachineState>
            {
                { new LetStateTransition(LetMachineState.START, TokenType.END), LetMachineState.START },
                { new LetStateTransition(LetMachineState.START, TokenType.LET), LetMachineState.LET },

                { new LetStateTransition(LetMachineState.LET, TokenType.VAR), LetMachineState.VAR_FROM_INDEX },
                { new LetStateTransition(LetMachineState.LET, TokenType.ARRAY_ELEMENT), LetMachineState.VAR_FROM_INDEX },

                { new LetStateTransition(LetMachineState.VAR_FROM_INDEX, TokenType.EQUALS), LetMachineState.EQUALS },

                { new LetStateTransition(LetMachineState.EQUALS, TokenType.END), LetMachineState.START },
            };
            this.variables = variables;
            this.command   = new LetCommand(fileManager);
            this.exp       = new ArithmeticStateMachine(variables, fileManager);
        }
        public IfStateMachine(VariableTable variables, FileManager fileManager)
        {
            CurrentState = IfMachineState.START;
            transitions  = new Dictionary <IfStateTransition, IfMachineState>
            {
                { new IfStateTransition(IfMachineState.START, TokenType.END), IfMachineState.START },
                { new IfStateTransition(IfMachineState.START, TokenType.IF), IfMachineState.IF_FIRST_EXP },

                { new IfStateTransition(IfMachineState.IF_FIRST_EXP, TokenType.EQUALS), IfMachineState.COMPARISON },
                { new IfStateTransition(IfMachineState.IF_FIRST_EXP, TokenType.NOT_EQUAL), IfMachineState.COMPARISON },
                { new IfStateTransition(IfMachineState.IF_FIRST_EXP, TokenType.GREATER), IfMachineState.COMPARISON },
                { new IfStateTransition(IfMachineState.IF_FIRST_EXP, TokenType.GREATER_OR_EQUAL), IfMachineState.COMPARISON },
                { new IfStateTransition(IfMachineState.IF_FIRST_EXP, TokenType.LESS), IfMachineState.COMPARISON },
                { new IfStateTransition(IfMachineState.IF_FIRST_EXP, TokenType.LESS_OR_EQUAL), IfMachineState.COMPARISON },

                { new IfStateTransition(IfMachineState.COMPARISON, TokenType.THEN), IfMachineState.DESTINATION },

                { new IfStateTransition(IfMachineState.DESTINATION, TokenType.INT), IfMachineState.START }
            };

            this.command = new IfCommand(variables, fileManager);
            this.exp     = new ArithmeticStateMachine(variables, fileManager);
        }
 public ForStateMachine(VariableTable variables, FileManager fileManager)
 {
     CurrentState = ForMachineState.START;
     transitions  = new Dictionary <ForStateTransition, ForMachineState>
     {
         { new ForStateTransition(ForMachineState.START, TokenType.END), ForMachineState.START },
         { new ForStateTransition(ForMachineState.START, TokenType.FOR), ForMachineState.FOR },
         // guarda variavel a ser loopada
         { new ForStateTransition(ForMachineState.FOR, TokenType.VAR), ForMachineState.VAR },
         { new ForStateTransition(ForMachineState.FOR, TokenType.ARRAY), ForMachineState.VAR },
         // recebe token que indica a atribuicao do valor a seguir a variavel recebida
         { new ForStateTransition(ForMachineState.VAR, TokenType.EQUALS), ForMachineState.EQUALS },
         // calcula valor da expressao a ser usada como valor inicial -> atribui a variavel a ser loopada armazenada anteriormente (guarda na memoria)
         { new ForStateTransition(ForMachineState.EQUALS, TokenType.TO), ForMachineState.TO },
         // calcula valor da expressao a ser usada como valor final -> guarda na memoria esse valor para futuras comparacoes
         { new ForStateTransition(ForMachineState.TO, TokenType.STEP), ForMachineState.STEP },
         // calcula valor da expressao a ser usada como passo -> guarda na memoria esse valor para futuro uso na hora de executar o passo
         { new ForStateTransition(ForMachineState.STEP, TokenType.END), ForMachineState.START },
     };
     this.variables = variables;
     this.command   = new ForCommand(variables, fileManager);
     this.exp       = new ArithmeticStateMachine(variables, fileManager);
 }