Lines Matching refs:expr
44 from .expr import check_exprs
1228 def _def_include(self, expr: QAPIExpression) -> None:
1229 include = expr['include']
1230 assert expr.doc is None
1232 QAPISchemaInclude(self._make_module(include), expr.info))
1340 def _def_enum_type(self, expr: QAPIExpression) -> None:
1341 name = expr['enum']
1342 data = expr['data']
1343 prefix = expr.get('prefix')
1344 ifcond = QAPISchemaIfCond(expr.get('if'))
1345 info = expr.info
1346 features = self._make_features(expr.get('features'), info)
1348 name, info, expr.doc, ifcond, features,
1379 def _def_struct_type(self, expr: QAPIExpression) -> None:
1380 name = expr['struct']
1381 base = expr.get('base')
1382 data = expr['data']
1383 info = expr.info
1384 ifcond = QAPISchemaIfCond(expr.get('if'))
1385 features = self._make_features(expr.get('features'), info)
1387 name, info, expr.doc, ifcond, features, base,
1403 def _def_union_type(self, expr: QAPIExpression) -> None:
1404 name = expr['union']
1405 base = expr['base']
1406 tag_name = expr['discriminator']
1407 data = expr['data']
1409 info = expr.info
1410 ifcond = QAPISchemaIfCond(expr.get('if'))
1411 features = self._make_features(expr.get('features'), info)
1423 QAPISchemaObjectType(name, info, expr.doc, ifcond, features,
1428 def _def_alternate_type(self, expr: QAPIExpression) -> None:
1429 name = expr['alternate']
1430 data = expr['data']
1432 ifcond = QAPISchemaIfCond(expr.get('if'))
1433 info = expr.info
1434 features = self._make_features(expr.get('features'), info)
1443 name, info, expr.doc, ifcond, features,
1446 def _def_command(self, expr: QAPIExpression) -> None:
1447 name = expr['command']
1448 data = expr.get('data')
1449 rets = expr.get('returns')
1450 gen = expr.get('gen', True)
1451 success_response = expr.get('success-response', True)
1452 boxed = expr.get('boxed', False)
1453 allow_oob = expr.get('allow-oob', False)
1454 allow_preconfig = expr.get('allow-preconfig', False)
1455 coroutine = expr.get('coroutine', False)
1456 ifcond = QAPISchemaIfCond(expr.get('if'))
1457 info = expr.info
1458 features = self._make_features(expr.get('features'), info)
1467 QAPISchemaCommand(name, info, expr.doc, ifcond, features, data,
1471 def _def_event(self, expr: QAPIExpression) -> None:
1472 name = expr['event']
1473 data = expr.get('data')
1474 boxed = expr.get('boxed', False)
1475 ifcond = QAPISchemaIfCond(expr.get('if'))
1476 info = expr.info
1477 features = self._make_features(expr.get('features'), info)
1482 self._def_definition(QAPISchemaEvent(name, info, expr.doc, ifcond,
1486 for expr in exprs:
1487 if 'enum' in expr:
1488 self._def_enum_type(expr)
1489 elif 'struct' in expr:
1490 self._def_struct_type(expr)
1491 elif 'union' in expr:
1492 self._def_union_type(expr)
1493 elif 'alternate' in expr:
1494 self._def_alternate_type(expr)
1495 elif 'command' in expr:
1496 self._def_command(expr)
1497 elif 'event' in expr:
1498 self._def_event(expr)
1499 elif 'include' in expr:
1500 self._def_include(expr)