(self, type, value, context)
return ilabel
Turn a token into a label.  (Internal)
Turn a token into a label.  (Internal)
Turn a token into a label . ( Internal )
def classify(self, type, value, context):
        """Turn a token into a label.  (Internal)"""
        if type == token.NAME:
            # Keep a listing of all used names
            self.used_names.add(value)
            # Check for reserved words
            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
def classify ( self , type , value , context ) : if type == token . NAME : # Keep a listing of all used names self . used_names . add ( value ) # Check for reserved words 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