MCPcopy Create free account
hub / github.com/apitrace/apitrace / parse_interface

Method parse_interface

specs/scripts/c2api.py:218–242  ·  view source on GitHub ↗
(self, ref_token)

Source from the content-addressed store, hash-verified

216 return members
217
218 def parse_interface(self, ref_token):
219 self.consume(ref_token)
220 name = self.consume()
221 if self.match(';'):
222 return
223 self.consume(':')
224 if self.lookahead() in ('public', 'protected'):
225 self.consume()
226 base = self.consume()
227 self.consume('{')
228
229 print('%s = Interface("%s", %s)' % (name, name, base))
230 print('%s.methods += [' % (name,))
231
232 while self.lookahead() != '}':
233 if self.lookahead() in ('public', 'private'):
234 self.consume()
235 self.consume(':')
236 else:
237 self.parse_prototype('Method')
238 self.consume(';')
239 self.consume('}')
240
241 print(']')
242 print()
243
244 def parse_prototype(self, creator = 'Function'):
245 if self.match('extern', 'virtual'):

Callers 1

parse_declarationMethod · 0.95

Calls 4

consumeMethod · 0.95
matchMethod · 0.95
lookaheadMethod · 0.95
parse_prototypeMethod · 0.95

Tested by

no test coverage detected