def match(data): parameters = [] assert data[0] == '(' index = 1 while True: descriptor, offset = ParameterDescriptor.match(data[index:]) if offset == 0: break parameters.append(descriptor) index += offset assert data[index] == ')', 'data[%s] is actually: %s, full: %s' % (index, data[index], data) return_descriptor, offset = ReturnDescriptor.match(data[index+1:]) return '%s %%s(%s)' % ( javaify(return_descriptor), ', '.join(javaify(p) for p in parameters) if parameters else 'void'), index+1+offset
def match(data): parameters = [] assert data[0] == '(' index = 1 while True: descriptor, offset = ParameterDescriptor.match(data[index:]) if offset == 0: break parameters.append(descriptor) index += offset assert data[index] == ')', 'data[%s] is actually: %s, full: %s' % ( index, data[index], data) return_descriptor, offset = ReturnDescriptor.match(data[index + 1:]) return '%s %%s(%s)' % (javaify(return_descriptor), ', '.join( javaify(p) for p in parameters) if parameters else 'void'), index + 1 + offset
def __str__(self): base = '%s %s %s' % (self._access_flags, util.javaify(self._parsed_descriptor), self._name) if self._attributes: for attr in self._attributes: base += '\n %s: %s' % (attr.name(), attr) base += '\n' return base
def __str__(self): base = '%s %s %s' % ( self._access_flags, util.javaify(self._parsed_descriptor), self._name) if self._attributes: for attr in self._attributes: base += '\n %s: %s' % (attr.name(), attr) base += '\n' return base
def __call__(self, constants): return '%s' % javaify(constants[self._name_index].bytes())