Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            TransitionInput ti = (TransitionInput)obj;

            return(s.Equals(ti.s) && c == ti.c);
        }
Esempio n. 2
0
        public Builder addTransition(State i, char c, State o)
        {
            i = validateState(i);
            o = validateState(o);
            if (Regex.Matches(char.ToString(c), "0-9a-z").Count == 0)
            {
                throw new Exception("Failed to add transition");
            }
            TransitionInput tInput  = new TransitionInput(i, c);
            HashSet <State> tOutput = transitions[tInput];

            if (tOutput == null)
            {
                tOutput = new HashSet <State>();
            }

            tOutput.Add(o);
            alphabet.Add(c);
            transitions.Add(tInput, tOutput);
            return(this);
        }