Antlr3.Analysis.DFAState.AddTransition C# (CSharp) Method

AddTransition() public method

public AddTransition ( DFAState target, Antlr3.Analysis.Label label ) : int
target DFAState
label Antlr3.Analysis.Label
return int
        public virtual int AddTransition( DFAState target, Label label )
        {
            _transitions.Add( new Transition( label, target ) );
            return _transitions.Count - 1;
        }

Same methods

DFAState::AddTransition ( Transition t ) : void

Usage Example

Beispiel #1
0
        /** From list of lookahead sets (one per alt in decision), create
         *  an LL(1) DFA.  One edge per set.
         *
         *  s0-{alt1}->:o=>1
         *  | \
         *  |  -{alt2}->:o=>2
         *  |
         *  ...
         */
        public LL1DFA(int decisionNumber, NFAState decisionStartState, LookaheadSet[] altLook)
            : base(decisionNumber, decisionStartState)
        {
            DFAState s0 = NewState();

            StartState = s0;
            UnreachableAlts.Clear();
            for (int alt = 1; alt < altLook.Length; alt++)
            {
                DFAState acceptAltState = NewState();
                acceptAltState.IsAcceptState = true;
                SetAcceptState(alt, acceptAltState);
                acceptAltState.LookaheadDepth = 1;
                acceptAltState.CachedUniquelyPredicatedAlt = alt;
                Label e = GetLabelForSet(altLook[alt].TokenTypeSet);
                s0.AddTransition(acceptAltState, e);
            }
        }
All Usage Examples Of Antlr3.Analysis.DFAState::AddTransition