コード例 #1
0
        public LexicalMachineState GetNext(AtomType command)
        {
            LexicalMachineState    nextState  = this.CurrentState;
            LexicalStateTransition transition = new LexicalStateTransition(CurrentState, command);

            if (!transitions.TryGetValue(transition, out nextState))
            {
                throw new Exception("Lexical: Invalid transition: " + CurrentState + " -> " + command);
            }

            Console.WriteLine("Lexical :" + this.CurrentState + " -> " + nextState + " : " + command.ToString());

            return(nextState);
        }