'Consume tokens until one matches the given token or token set
tokenTypes can be a single token type or a set of token types'

def consumeUntil(self, input, tokenTypes):

    if (not isinstance(tokenTypes, (set, frozenset))):
        tokenTypes = frozenset([tokenTypes])
    ttype = input.LA(1)
    while ((ttype != EOF) and (ttype not in tokenTypes)):
        input.consume()
        ttype = input.LA(1)
