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;
}
}