internal void AddEmptyEdgeTo(NFAState targetState) { CodeContract.RequiresArgumentNotNull(targetState, "targetState"); m_outEdges.Add(new NFAEdge(targetState)); }
private void ConvertLexcionToNFA() { //Compact transition char set CompactCharSetManager = m_lexicon.CreateCompactCharSetManager(); NFAConverter converter = new NFAConverter(CompactCharSetManager); NFAState entryState = new NFAState(); NFAModel lexerNFA = new NFAModel(); lexerNFA.AddState(entryState); foreach (var token in m_lexicon.GetTokens()) { NFAModel tokenNFA = token.CreateFiniteAutomatonModel(converter); entryState.AddEdge(tokenNFA.EntryEdge); lexerNFA.AddStates(tokenNFA.States); } lexerNFA.EntryEdge = new NFAEdge(entryState); m_nfa = lexerNFA; }
public NFAEdge(int symbol, NFAState targetState) : this() { Symbol = symbol; TargetState = targetState; }
public NFAEdge(NFAState targetState) : this() { TargetState = targetState; }
internal void AddState(NFAState state) { m_states.Add(state); state.Index = m_states.Count - 1; }