public GrammarDanglingStateMessage( DecisionProbe probe,
                                    DFAState problemState )
     : base(ErrorManager.MSG_DANGLING_STATE)
 {
     this.probe = probe;
     this.problemState = problemState;
 }
예제 #2
0
 public GrammarDanglingStateMessage(DecisionProbe probe,
                                    DFAState problemState)
     : base(ErrorManager.MSG_DANGLING_STATE)
 {
     this.probe        = probe;
     this.problemState = problemState;
 }
예제 #3
0
        public static void Nondeterminism(DecisionProbe probe,
                                          DFAState d)
        {
            GetErrorState().warnings++;
            Message msg = new GrammarNonDeterminismMessage(probe, d);

            GetErrorState().warningMsgIDs.Add(msg.msgID);
            GetErrorListener().Warning(msg);
        }
예제 #4
0
        public static void InsufficientPredicates(DecisionProbe probe,
                                                  DFAState d,
                                                  IDictionary <int, ICollection <IToken> > altToUncoveredLocations)
        {
            GetErrorState().warnings++;
            Message msg = new GrammarInsufficientPredicatesMessage(probe, d, altToUncoveredLocations);

            GetErrorState().warningMsgIDs.Add(msg.msgID);
            GetErrorListener().Warning(msg);
        }
예제 #5
0
 public GrammarNonDeterminismMessage(DecisionProbe probe,
                                     DFAState problemState)
     : base(ErrorManager.MSG_GRAMMAR_NONDETERMINISM)
 {
     this.probe        = probe;
     this.problemState = problemState;
     // flip msg ID if alts are actually token refs in Tokens rule
     if (probe.dfa.IsTokensRuleDecision)
     {
         MessageID = ErrorManager.MSG_TOKEN_NONDETERMINISM;
     }
 }
 public GrammarNonDeterminismMessage( DecisionProbe probe,
                                     DFAState problemState )
     : base(ErrorManager.MSG_GRAMMAR_NONDETERMINISM)
 {
     this.probe = probe;
     this.problemState = problemState;
     // flip msg ID if alts are actually token refs in Tokens rule
     if ( probe.dfa.IsTokensRuleDecision )
     {
         MessageID = ErrorManager.MSG_TOKEN_NONDETERMINISM;
     }
 }
예제 #7
0
        public static void RecursionOverflow(DecisionProbe probe,
                                             DFAState sampleBadState,
                                             int alt,
                                             ICollection <string> targetRules,
                                             ICollection <ICollection <NFAState> > callSiteStates)
        {
            GetErrorState().errors++;
            Message msg = new RecursionOverflowMessage(probe, sampleBadState, alt,
                                                       targetRules, callSiteStates);

            GetErrorState().errorMsgIDs.Add(msg.msgID);
            GetErrorListener().Error(msg);
        }
예제 #8
0
        public static void DanglingState(DecisionProbe probe,
                                         DFAState d)
        {
            GetErrorState().errors++;
            Message msg = new GrammarDanglingStateMessage(probe, d);

            GetErrorState().errorMsgIDs.Add(msg.msgID);
            ICollection <object> seen = (ICollection <object>)emitSingleError.get("danglingState");

            if (!seen.Contains(d.dfa.decisionNumber + "|" + d.AltSet))
            {
                GetErrorListener().Error(msg);
                // we've seen this decision and this alt set; never again
                seen.Add(d.dfa.decisionNumber + "|" + d.AltSet);
            }
        }
예제 #9
0
 public static void RecursionOverflow( DecisionProbe probe,
                                      DFAState sampleBadState,
                                      int alt,
                                      ICollection<string> targetRules,
                                      ICollection<ICollection<NFAState>> callSiteStates )
 {
     GetErrorState().errors++;
     Message msg = new RecursionOverflowMessage( probe, sampleBadState, alt,
                                      targetRules, callSiteStates );
     GetErrorState().errorMsgIDs.Add( msg.msgID );
     GetErrorListener().Error( msg );
 }
예제 #10
0
 public static void Nondeterminism( DecisionProbe probe,
                                   DFAState d )
 {
     GetErrorState().warnings++;
     Message msg = new GrammarNonDeterminismMessage( probe, d );
     GetErrorState().warningMsgIDs.Add( msg.msgID );
     GetErrorListener().Warning( msg );
 }
예제 #11
0
 public static void InsufficientPredicates( DecisionProbe probe,
                                           DFAState d,
                                           IDictionary<int, ICollection<IToken>> altToUncoveredLocations )
 {
     GetErrorState().warnings++;
     Message msg = new GrammarInsufficientPredicatesMessage( probe, d, altToUncoveredLocations );
     GetErrorState().warningMsgIDs.Add( msg.msgID );
     GetErrorListener().Warning( msg );
 }
예제 #12
0
 public static void DanglingState( DecisionProbe probe,
                                  DFAState d )
 {
     GetErrorState().errors++;
     Message msg = new GrammarDanglingStateMessage( probe, d );
     GetErrorState().errorMsgIDs.Add( msg.msgID );
     ICollection<object> seen;
     emitSingleError.TryGetValue("danglingState", out seen);
     if ( !seen.Contains( d.Dfa.DecisionNumber + "|" + d.AltSet ) )
     {
         GetErrorListener().Error( msg );
         // we've seen this decision and this alt set; never again
         seen.Add( d.Dfa.DecisionNumber + "|" + d.AltSet );
     }
 }