/// <summary> /// Creates a new instance of the <c>DfaState</c> class. /// </summary> /// <param name="index">Index in the DFA state table.</param> /// <param name="acceptSymbol">Symbol to accept.</param> /// <param name="transitionVector">Transition vector.</param> public DfaState(int index, Symbol acceptSymbol, ObjectMap transitionVector) { m_index = index; m_acceptSymbol = acceptSymbol; m_transitionVector = transitionVector; }
/// <summary> /// Creates the DFA state transition vector. /// </summary> /// <param name="edges">Array of automata edges.</param> /// <returns>Hashtable with the transition information.</returns> private ObjectMap CreateDfaTransitionVector(DfaEdge[] edges) { ObjectMap transitionVector = new ObjectMap(); for (int i = edges.Length; --i >= 0;) { string charSet = m_charSetTable[edges[i].CharSetIndex]; for (int j = 0; j < charSet.Length; j++) { transitionVector[charSet[j]] = edges[i].TargetIndex; } } return transitionVector; }
/// <summary> /// Creates the DFA state transition vector. /// </summary> /// <param name="edges">Array of automata edges.</param> /// <returns>Hashtable with the transition information.</returns> private ObjectMap CreateDfaTransitionVector(DfaEdge[] edges) { var transitionVector = new ObjectMap(); for (Int32 i = edges.Length - 1; i >= 0; i--) { String charSet = m_CharSetTable[edges[i].CharSetIndex]; foreach (Char ch in charSet) { transitionVector[ch] = edges[i].TargetIndex; } } return transitionVector; }
/// <summary> /// Creates a new instance of the <c>DfaState</c> class. /// </summary> /// <param name="index">Index in the DFA state table.</param> /// <param name="acceptSymbol">Symbol to accept.</param> /// <param name="transitionVector">Transition vector.</param> public DfaState(Int32 index, Symbol acceptSymbol, ObjectMap transitionVector) { m_Index = index; m_AcceptSymbol = acceptSymbol; m_TransitionVector = transitionVector; }