Esempio n. 1
0
        internal void AddEmptyEdgeTo(NFAState targetState)
        {
            CodeContract.RequiresArgumentNotNull(targetState, "targetState");

            m_outEdges.Add(new NFAEdge(targetState));
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 public NFAEdge(int symbol, NFAState targetState)
     : this()
 {
     Symbol = symbol;
     TargetState = targetState;
 }
Esempio n. 4
0
 public NFAEdge(NFAState targetState)
     : this()
 {
     TargetState = targetState;
 }
Esempio n. 5
0
 internal void AddState(NFAState state)
 {
     m_states.Add(state);
     state.Index = m_states.Count - 1;
 }
Esempio n. 6
0
 public NFAEdge(NFAState targetState)
     : this()
 {
     TargetState = targetState;
 }
Esempio n. 7
0
 public NFAEdge(int symbol, NFAState targetState)
     : this()
 {
     Symbol      = symbol;
     TargetState = targetState;
 }
Esempio n. 8
0
 internal void AddState(NFAState state)
 {
     m_states.Add(state);
     state.Index = m_states.Count - 1;
 }
Esempio n. 9
0
        internal void AddEmptyEdgeTo(NFAState targetState)
        {
            CodeContract.RequiresArgumentNotNull(targetState, "targetState");

            m_outEdges.Add(new NFAEdge(targetState));
        }