Example #1
0
 private void TransitionBetweenStates( NFAState a, NFAState b, int label )
 {
     Transition e = new Transition( label, b );
     a.AddTransition( e );
 }
Example #2
0
 /** set up an NFA NFAState that will yield eof tokens or,
  *  in the case of a lexer grammar, an EOT token when the conversion
  *  hits the end of a rule.
  */
 private void BuildEofState( NFAState endNFAState )
 {
     NFAState end = NewState();
     int label = Label.EOF;
     if ( _nfa.Grammar.type == GrammarType.Lexer )
     {
         label = Label.EOT;
         end.IsEOTTargetState = true;
     }
     //System.Console.Out.WriteLine( "build " + nfa.grammar.getTokenDisplayName( label ) +
     //                              " loop on end of state " + endNFAState.Description +
     //                              " to state " + end.stateNumber );
     Transition toEnd = new Transition( label, end );
     endNFAState.AddTransition( toEnd );
 }