[A-Za-z]\w*|\"char\"

def t_NAME(self,t):
    '[A-Za-z]\w*|\"char\"'
    # warning: this allows stuff like SeLeCt with mixed case. who cares.
    t.type = KEYWORDS[t.value.lower()] if t.value.lower() in KEYWORDS else 'BOOL' if t.value.lower() in ('is','not') else 'NAME'
    return t