def offset(self):
        """ If this is a constant access (e.g. A(1))
        return the offset in bytes from the beginning of the
        variable in memory.

        Otherwise, if it's not constant (e.g. A(i))
        returns None
        """
        offset = 0
        # Now we must typecast each argument to a u16 (POINTER) type
        # i is the dimension ith index, b is the bound
        for i, b in zip(self.arglist, self.entry.bounds):
            tmp = i.children[0]
            if is_number(tmp) or is_const(tmp):
                if offset is not None:
                    offset = offset * b.count + tmp.value
            else:
                offset = None
                break

        if offset is not None:
            offset = TYPE.size(gl.SIZE_TYPE) + TYPE.size(gl.BOUND_TYPE) * len(self.arglist) + offset * self.type_.size

        return offset
def offset ( self ) : offset = 0 for i , b in zip ( self . arglist , self . entry . bounds ) : tmp = i . children [ 0 ] if is_number ( tmp ) or is_const ( tmp ) : if offset is not None : offset = offset * b . count + tmp . value else : offset = None break if offset is not None : offset = TYPE . size ( gl . SIZE_TYPE ) + TYPE . size ( gl . BOUND_TYPE ) * len ( self . arglist ) + offset * self . type_ . size return offset
If this is a constant access (e.g. A(1))
        return the offset in bytes from the beginning of the
        variable in memory.

        Otherwise, if it's not constant (e.g. A(i))
        returns None