private void TransitionBetweenStates( NFAState a, NFAState b, int label ) { Transition e = new Transition( label, b ); a.AddTransition( e ); }
/** 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 ); }