예제 #1
0
        public DFA(ATNState atnStartState, int decision)
        {
            this.atnStartState = atnStartState;
            this.decision      = decision;
            if (this.atnStartState.atn.grammarType == ATNType.Lexer)
            {
                minDfaEdge = LexerATNSimulator.MinDfaEdge;
                maxDfaEdge = LexerATNSimulator.MaxDfaEdge;
            }
            else
            {
                minDfaEdge = TokenConstants.Eof;
                maxDfaEdge = atnStartState.atn.maxTokenType;
            }
            this.emptyEdgeMap        = new Antlr4.Runtime.Dfa.EmptyEdgeMap <DFAState>(minDfaEdge, maxDfaEdge);
            this.emptyContextEdgeMap = new Antlr4.Runtime.Dfa.EmptyEdgeMap <DFAState>(-1, atnStartState.atn.states.Count - 1);
            bool isPrecedenceDfa = false;

            if (atnStartState is StarLoopEntryState)
            {
                if (((StarLoopEntryState)atnStartState).precedenceRuleDecision)
                {
                    isPrecedenceDfa = true;
                    this.s0.Set(new DFAState(emptyPrecedenceEdges, EmptyContextEdgeMap, new ATNConfigSet()));
                    this.s0full.Set(new DFAState(emptyPrecedenceEdges, EmptyContextEdgeMap, new ATNConfigSet()));
                }
            }
            this.precedenceDfa = isPrecedenceDfa;
        }
예제 #2
0
 public DFA(ATNState atnStartState, int decision)
 {
     this.atnStartState = atnStartState;
     this.decision      = decision;
     if (this.atnStartState.atn.grammarType == ATNType.Lexer)
     {
         minDfaEdge = LexerATNSimulator.MinDfaEdge;
         maxDfaEdge = LexerATNSimulator.MaxDfaEdge;
     }
     else
     {
         minDfaEdge = TokenConstants.Eof;
         maxDfaEdge = atnStartState.atn.maxTokenType;
     }
     this.emptyEdgeMap        = new Antlr4.Runtime.Dfa.EmptyEdgeMap <DFAState>(minDfaEdge, maxDfaEdge);
     this.emptyContextEdgeMap = new Antlr4.Runtime.Dfa.EmptyEdgeMap <DFAState>(-1, atnStartState.atn.states.Count - 1);
 }
예제 #3
0
파일: DFA.cs 프로젝트: RainerBosch/antlr4
 public DFA(ATNState atnStartState, int decision)
 {
     this.atnStartState = atnStartState;
     this.decision = decision;
     if (this.atnStartState.atn.grammarType == ATNType.Lexer)
     {
         minDfaEdge = LexerATNSimulator.MinDfaEdge;
         maxDfaEdge = LexerATNSimulator.MaxDfaEdge;
     }
     else
     {
         minDfaEdge = TokenConstants.Eof;
         maxDfaEdge = atnStartState.atn.maxTokenType;
     }
     this.emptyEdgeMap = new Antlr4.Runtime.Dfa.EmptyEdgeMap<DFAState>(minDfaEdge, maxDfaEdge);
     this.emptyContextEdgeMap = new Antlr4.Runtime.Dfa.EmptyEdgeMap<DFAState>(-1, atnStartState.atn.states.Count - 1);
 }
예제 #4
0
파일: DFA.cs 프로젝트: EvgeniyKo/antlr4cs
 public DFA(ATNState atnStartState, int decision)
 {
     this.atnStartState = atnStartState;
     this.decision = decision;
     if (this.atnStartState.atn.grammarType == ATNType.Lexer)
     {
         minDfaEdge = LexerATNSimulator.MinDfaEdge;
         maxDfaEdge = LexerATNSimulator.MaxDfaEdge;
     }
     else
     {
         minDfaEdge = TokenConstants.Eof;
         maxDfaEdge = atnStartState.atn.maxTokenType;
     }
     this.emptyEdgeMap = new Antlr4.Runtime.Dfa.EmptyEdgeMap<DFAState>(minDfaEdge, maxDfaEdge);
     this.emptyContextEdgeMap = new Antlr4.Runtime.Dfa.EmptyEdgeMap<DFAState>(-1, atnStartState.atn.states.Count - 1);
     bool isPrecedenceDfa = false;
     if (atnStartState is StarLoopEntryState)
     {
         if (((StarLoopEntryState)atnStartState).precedenceRuleDecision)
         {
             isPrecedenceDfa = true;
             this.s0.Set(new DFAState(emptyPrecedenceEdges, EmptyContextEdgeMap, new ATNConfigSet()));
             this.s0full.Set(new DFAState(emptyPrecedenceEdges, EmptyContextEdgeMap, new ATNConfigSet()));
         }
     }
     this.precedenceDfa = isPrecedenceDfa;
 }