public override void ConsumeToken(IToken token)
{
if (dump)
Console.WriteLine("consume token " + token);
if (!InDecision)
{
stats.numTokens++;
return;
}
if (lastRealTokenTouchedInDecision == null ||
lastRealTokenTouchedInDecision.TokenIndex < token.TokenIndex)
{
lastRealTokenTouchedInDecision = token;
}
DecisionEvent d = CurrentDecision();
// compute lookahead depth
int thisRefIndex = token.TokenIndex;
int numHidden = GetNumberOfHiddenTokens(d.startIndex, thisRefIndex);
int depth = thisRefIndex - d.startIndex - numHidden + 1; // +1 counts consuming start token as 1
//d.maxk = Math.max(d.maxk, depth);
if (dump)
{
Console.WriteLine("consume " + thisRefIndex + " " + depth + " tokens ahead in " +
d.decision.ruleName + "-" + d.decision.decision + " start index " + d.startIndex);
}
}