protected internal virtual IToken SingleTokenDeletion(Parser recognizer)
{
int nextTokenType = ((ITokenStream)recognizer.InputStream).LA(2);
IntervalSet expecting = GetExpectedTokens(recognizer);
if (expecting.Contains(nextTokenType))
{
ReportUnwantedToken(recognizer);
recognizer.Consume();
// simply delete extra token
// we want to return the token we're actually matching
IToken matchedSymbol = recognizer.CurrentToken;
ReportMatch(recognizer);
// we know current token is correct
return matchedSymbol;
}
return null;
}