Antlr.Runtime.BaseRecognizer.Memoize C# (CSharp) Method

Memoize() public method

* Record whether or not this rule parsed the input at this position * successfully. Use a standard java hashtable for now. *
public Memoize ( IIntStream input, int ruleIndex, int ruleStartIndex ) : void
input IIntStream
ruleIndex int
ruleStartIndex int
return void
        public virtual void Memoize( IIntStream input,
                            int ruleIndex,
                            int ruleStartIndex )
        {
            int stopTokenIndex = state.failed ? MemoRuleFailed : input.Index - 1;
            if ( state.ruleMemo == null )
            {
                if (TraceDestination != null)
                    TraceDestination.WriteLine( "!!!!!!!!! memo array is null for " + GrammarFileName );
            }
            if ( ruleIndex >= state.ruleMemo.Length )
            {
                if (TraceDestination != null)
                    TraceDestination.WriteLine("!!!!!!!!! memo size is " + state.ruleMemo.Length + ", but rule index is " + ruleIndex);
            }
            if ( state.ruleMemo[ruleIndex] != null )
            {
                state.ruleMemo[ruleIndex][ruleStartIndex] = stopTokenIndex;
            }
        }