コード例 #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);
        }
コード例 #2
0
            public override bool Equals(object obj)
            {
                LexicalStateTransition other = obj as LexicalStateTransition;

                return(other != null && this.CurrentState == other.CurrentState && this.Command == other.Command);
            }