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); }
public override bool Equals(object obj) { LexicalStateTransition other = obj as LexicalStateTransition; return(other != null && this.CurrentState == other.CurrentState && this.Command == other.Command); }