/// <summary> /// /// </summary> /// <param name="input">Tuple<finalType, regexp></param> /// <returns></returns> public static StateMachine Build(List <Tuple <string, string> > input) { StateMachine result; StateMachine temp; List <StateMachine> machines = new List <StateMachine>(); List <string> finalTypes = GetFinalTypes(input); result = Build(input[0].Item2); result.FinalTypesDirty = finalTypes; result.SetAllFinalAs(0); for (int i = 1; i < input.Count; i++) { Tuple <string, string> tuple = input[i]; temp = Build(tuple.Item2); temp.FinalTypesDirty = finalTypes; temp.SetAllFinalAs(i); temp = Determiner.Determined(temp); result |= temp; } result = Determiner.Determined(result); return(result); }
public Executor(StateMachine inputMachine, string inputText) { _stateMachine = inputMachine; if (!inputMachine.IsDetermined) { Determiner.Determined(_stateMachine); } _text = inputText; _defaultNoIndex = _stateMachine.DefaultNoIndex; _currentTextPosition = 0; _result = new List <Tuple <string, string> >(); }