<s> from core_types import ConcreteT <EOL> from scalar_types import IntT <EOL> class PtrT ( ConcreteT ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , elt_type ) : <EOL> self . elt_type = elt_type <EOL> self . _hash = hash ( elt_type ) <EOL> rank = <NUM_LIT:1> <EOL> def index_type ( self , idx ) : <EOL> assert isinstance ( idx , IntT ) , "<STR_LIT>" % ( idx ) <EOL> return self . elt_type <EOL> def children ( self ) : <EOL> return self . elt_type <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % self . elt_type <EOL> def __eq__ ( self , other ) : <EOL> return other . __class__ is PtrT and self . elt_type == other . elt_type <EOL> def __hash__ ( self ) : <EOL> return self . _hash <EOL> def __repr__ ( self ) : <EOL> return str ( self ) <EOL> @ property <EOL> def ctypes_repr ( self ) : <EOL> return self . _ctypes_repr <EOL> _ptr_types = { } <EOL> def ptr_type ( t ) : <EOL> if t in _ptr_types : <EOL> return _ptr_types [ t ] <EOL> else : <EOL> ptr_t = PtrT ( t ) <EOL> _ptr_types [ t ] = ptr_t <EOL> return ptr_t </s>
