import quex.engine.state_machine.index         as index

def __nice(SM_ID): 
    assert isinstance(SM_ID, (long, int))
    return repr(SM_ID).replace("L", "").replace("'", "")
    
db = {}

class AddressDB:
    #-----------------------------------------------------------------------
    #  Maps anything, such as a 'terminal' or anything else to an address.
    #  The address of a state machine state is the state's index. New
    #  addresses are generated using 'index.get()' which produces unique
    #  state indices.
    #-----------------------------------------------------------------------
    def __init__(self):
        self.__db = {}
        self.__special = set([
            "__RELOAD_FORWARD", 
            "__RELOAD_BACKWARD", 
            "__STATE_ROUTER", 
            "__TERMINAL_ROUTER",
            "INIT_STATE_TRANSITION_BLOCK",
            "__REENTRY_PREPARATION", 