'Has this rule already parsed input at the current index in the
input stream?  Return the stop token index or MEMO_RULE_UNKNOWN.
If we attempted but failed to parse properly before, return
MEMO_RULE_FAILED.
This method has a side-effect: if we have seen this input for
this rule and successfully parsed before, then seek ahead to
1 past the stop token matched for this rule last time.'

def alreadyParsedRule(self, input, ruleIndex):

    stopIndex = self.getRuleMemoization(ruleIndex, input.index())
    if (stopIndex == self.MEMO_RULE_UNKNOWN):
        return False
    if (stopIndex == self.MEMO_RULE_FAILED):
        raise BacktrackingFailed
    else:
        input.seek((stopIndex + 1))
    return True
