@classmethod
def parse(cls, parser, text, pos):
    """Checks if terminal token is a keyword after lower-casing it."""
    match = cls.regex.match(text)
    if match:
        if match.group(0).lower() not in cls.grammar:
            result = text, SyntaxError(repr(match.group(0)) +
                ' is not a member of ' + repr(cls.grammar))
        else:
            result = text[len(match.group(0)):], cls(match.group(0))
    else:
        result = text, SyntaxError('expecting ' + repr(cls.__name__))
    return result
