MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / _GetBases

Method _GetBases

tests/external/gmock-1.7.0/scripts/generator/cpp/ast.py:1447–1477  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1445 return self._GetClass(Class, VISIBILITY_PRIVATE, None)
1446
1447 def _GetBases(self):
1448 # Get base classes.
1449 bases = []
1450 while 1:
1451 token = self._GetNextToken()
1452 assert token.token_type == tokenize.NAME, token
1453 # TODO(nnorwitz): store kind of inheritance...maybe.
1454 if token.name not in ('public', 'protected', 'private'):
1455 # If inheritance type is not specified, it is private.
1456 # Just put the token back so we can form a name.
1457 # TODO(nnorwitz): it would be good to warn about this.
1458 self._AddBackToken(token)
1459 else:
1460 # Check for virtual inheritance.
1461 token = self._GetNextToken()
1462 if token.name != 'virtual':
1463 self._AddBackToken(token)
1464 else:
1465 # TODO(nnorwitz): store that we got virtual for this base.
1466 pass
1467 base, next_token = self.GetName()
1468 bases_ast = self.converter.ToType(base)
1469 assert len(bases_ast) == 1, bases_ast
1470 bases.append(bases_ast[0])
1471 assert next_token.token_type == tokenize.SYNTAX, next_token
1472 if next_token.name == '{':
1473 token = next_token
1474 break
1475 # Support multiple inheritance.
1476 assert next_token.name == ',', next_token
1477 return bases, token
1478
1479 def _GetClass(self, class_type, visibility, templated_types):
1480 class_name = None

Callers 1

_GetClassMethod · 0.95

Calls 4

_GetNextTokenMethod · 0.95
_AddBackTokenMethod · 0.95
GetNameMethod · 0.95
ToTypeMethod · 0.45

Tested by

no test coverage detected