Exemple #1
0
 public GrammarDanglingStateMessage(DecisionProbe probe,
                                    DFAState problemState)
     : base(ErrorManager.MSG_DANGLING_STATE)
 {
     this.probe        = probe;
     this.problemState = problemState;
 }
 public GrammarDanglingStateMessage( DecisionProbe probe,
                                    DFAState problemState )
     : base(ErrorManager.MSG_DANGLING_STATE)
 {
     this.probe = probe;
     this.problemState = problemState;
 }
Exemple #3
0
        public static void AnalysisAborted(DecisionProbe probe)
        {
            GetErrorState().warnings++;
            Message msg = new GrammarAnalysisAbortedMessage(probe);

            GetErrorState().warningMsgIDs.Add(msg.msgID);
            GetErrorListener().Warning(msg);
        }
Exemple #4
0
        public static void NonLLStarDecision(DecisionProbe probe)
        {
            GetErrorState().errors++;
            Message msg = new NonRegularDecisionMessage(probe, probe.NonDeterministicAlts);

            GetErrorState().errorMsgIDs.Add(msg.msgID);
            GetErrorListener().Error(msg);
        }
Exemple #5
0
        public static void UnreachableAlts(DecisionProbe probe,
                                           IEnumerable <int> alts)
        {
            GetErrorState().errors++;
            Message msg = new GrammarUnreachableAltsMessage(probe, alts);

            GetErrorState().errorMsgIDs.Add(msg.msgID);
            GetErrorListener().Error(msg);
        }
Exemple #6
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);
        }
Exemple #7
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);
        }
Exemple #8
0
        // TODO: we can remove I think.  All detected now with cycles check.
        public static void LeftRecursion(DecisionProbe probe,
                                         int alt,
                                         ICollection targetRules,
                                         ICollection callSiteStates)
        {
            getErrorState().warnings++;
            Message msg = new LeftRecursionMessage(probe, alt, targetRules, callSiteStates);

            getErrorState().warningMsgIDs.add(msg.msgID);
            getErrorListener().Warning(msg);
        }
Exemple #9
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;
     }
 }
Exemple #10
0
 public GrammarUnreachableAltsMessage(DecisionProbe probe,
                                      IEnumerable <int> alts)
     : base(ErrorManager.MSG_UNREACHABLE_ALTS)
 {
     this.probe = probe;
     this.alts  = alts.ToArray();
     // flip msg ID if alts are actually token refs in Tokens rule
     if (probe.Dfa.IsTokensRuleDecision)
     {
         MessageID = ErrorManager.MSG_UNREACHABLE_TOKENS;
     }
 }
 public GrammarUnreachableAltsMessage( DecisionProbe probe,
                                      IEnumerable<int> alts )
     : base(ErrorManager.MSG_UNREACHABLE_ALTS)
 {
     this.probe = probe;
     this.alts = alts.ToArray();
     // flip msg ID if alts are actually token refs in Tokens rule
     if ( probe.Dfa.IsTokensRuleDecision )
     {
         MessageID = ErrorManager.MSG_UNREACHABLE_TOKENS;
     }
 }
 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;
     }
 }
Exemple #13
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);
        }
Exemple #14
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);
            }
        }
Exemple #15
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 );
 }
Exemple #16
0
 public NonRegularDecisionMessage(DecisionProbe probe, ICollection <int> altsWithRecursion)
     : base(ErrorManager.MSG_NONREGULAR_DECISION)
 {
     this.probe             = probe;
     this.altsWithRecursion = altsWithRecursion;
 }
Exemple #17
0
 public GrammarAnalysisAbortedMessage(DecisionProbe probe)
     : base(ErrorManager.MSG_ANALYSIS_ABORTED)
 {
     this.probe = probe;
 }
 public NonRegularDecisionMessage( DecisionProbe probe, ICollection<int> altsWithRecursion )
     : base(ErrorManager.MSG_NONREGULAR_DECISION)
 {
     this.probe = probe;
     this.altsWithRecursion = altsWithRecursion;
 }
 public GrammarAnalysisAbortedMessage( DecisionProbe probe )
     : base(ErrorManager.MSG_ANALYSIS_ABORTED)
 {
     this.probe = probe;
 }
Exemple #20
0
 // TODO: we can remove I think.  All detected now with cycles check.
 public static void LeftRecursion(DecisionProbe probe,
                                  int alt,
                                  ICollection targetRules,
                                  ICollection callSiteStates)
 {
     getErrorState().warnings++;
     Message msg = new LeftRecursionMessage(probe, alt, targetRules, callSiteStates);
     getErrorState().warningMsgIDs.add(msg.msgID);
     getErrorListener().Warning(msg);
 }
Exemple #21
0
 public static void AnalysisAborted( DecisionProbe probe )
 {
     GetErrorState().warnings++;
     Message msg = new GrammarAnalysisAbortedMessage( probe );
     GetErrorState().warningMsgIDs.Add( msg.msgID );
     GetErrorListener().Warning( msg );
 }
Exemple #22
0
 public static void UnreachableAlts( DecisionProbe probe,
                                    IEnumerable<int> alts )
 {
     GetErrorState().errors++;
     Message msg = new GrammarUnreachableAltsMessage( probe, alts );
     GetErrorState().errorMsgIDs.Add( msg.msgID );
     GetErrorListener().Error( msg );
 }
Exemple #23
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 );
 }
Exemple #24
0
 public static void NonLLStarDecision( DecisionProbe probe )
 {
     GetErrorState().errors++;
     Message msg = new NonRegularDecisionMessage( probe, probe.NonDeterministicAlts );
     GetErrorState().errorMsgIDs.Add( msg.msgID );
     GetErrorListener().Error( msg );
 }
Exemple #25
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 );
 }
Exemple #26
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 );
     }
 }