Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 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
Пример #5
0
 def __call__(self, constants):
   return '%s' % javaify(constants[self._name_index].bytes())