Exemple #1
0
        /// <summary>Track memoization</summary>
        /// <remarks>
        /// This is not part of standard debug interface but is triggered by
        /// profiling.  Code gen inserts an override for this method in the
        /// recognizer, which triggers this method.
        /// </remarks>
        public void ExamineRuleMemoization(IIntStream input, int ruleIndex, string ruleName)
        {
            int stopIndex = parser.GetRuleMemoization(ruleIndex, input.Index());

            if (stopIndex == BaseRecognizer.MEMO_RULE_UNKNOWN)
            {
                numMemoizationCacheMisses++;
                numGuessingRuleInvocations++;                 // we'll have to enter
            }
            else
            {
                // regardless of rule success/failure, if in cache, we have a cache hit
                numMemoizationCacheHits++;
            }
        }
 public v4ParserException(string msg, IIntStream input)
     : base(input)
 {
     this.msg = msg;
 }
Exemple #3
0
 public void Memoize(IIntStream input, int ruleIndex, int ruleStartIndex, string ruleName)
 {
     // count how many entries go into table
     numMemoizationCacheEntries++;
 }
Exemple #4
0
 public void Memoize(IIntStream input, int ruleIndex, int ruleStartIndex, string ruleName)
 {
     // count how many entries go into table
     numMemoizationCacheEntries++;
 }
Exemple #5
0
 /// <summary>Track memoization</summary>
 /// <remarks>
 /// This is not part of standard debug interface but is triggered by 
 /// profiling.  Code gen inserts an override for this method in the 
 /// recognizer, which triggers this method.
 /// </remarks>
 public void ExamineRuleMemoization(IIntStream input, int ruleIndex, string ruleName)
 {
     int stopIndex = parser.GetRuleMemoization(ruleIndex, input.Index());
     if (stopIndex == BaseRecognizer.MEMO_RULE_UNKNOWN)
     {
         numMemoizationCacheMisses++;
         numGuessingRuleInvocations++; // we'll have to enter
     }
     else
     {
         // regardless of rule success/failure, if in cache, we have a cache hit
         numMemoizationCacheHits++;
     }
 }
Exemple #6
0
 public virtual int Predict( IIntStream input )
 {
     Interpreter interp = new Interpreter( Nfa.Grammar, input );
     return interp.Predict( this );
 }
 public MyNoViableAltException(string grammarDecisionDescription, int decisionNumber, int stateNumber, Antlr.Runtime.IIntStream input)
 {
 }
 public MyEarlyExitException(int decisionNumber, Antlr.Runtime.IIntStream input)
 {
 }
 public v4ParserException(string msg, IIntStream input)
     : base(input)
 {
     this.msg = msg;
 }