'Turn a token into a label.  (Internal)'

def classify(self, type, value, context):

    if (type == token.NAME):
        self.used_names.add(value)
        ilabel = self.grammar.keywords.get(value)
        if (ilabel is not None):
            return ilabel
    ilabel = self.grammar.tokens.get(type)
    if (ilabel is None):
        raise ParseError('bad    token', type, value, context)
    return ilabel
