Lines Matching refs:expr
44 from .expr import check_exprs
1209 def _def_include(self, expr: QAPIExpression) -> None:
1210 include = expr['include']
1211 assert expr.doc is None
1213 QAPISchemaInclude(self._make_module(include), expr.info))
1315 def _def_enum_type(self, expr: QAPIExpression) -> None:
1316 name = expr['enum']
1317 data = expr['data']
1318 prefix = expr.get('prefix')
1319 ifcond = QAPISchemaIfCond(expr.get('if'))
1320 info = expr.info
1321 features = self._make_features(expr.get('features'), info)
1323 name, info, expr.doc, ifcond, features,
1354 def _def_struct_type(self, expr: QAPIExpression) -> None:
1355 name = expr['struct']
1356 base = expr.get('base')
1357 data = expr['data']
1358 info = expr.info
1359 ifcond = QAPISchemaIfCond(expr.get('if'))
1360 features = self._make_features(expr.get('features'), info)
1362 name, info, expr.doc, ifcond, features, base,
1378 def _def_union_type(self, expr: QAPIExpression) -> None:
1379 name = expr['union']
1380 base = expr['base']
1381 tag_name = expr['discriminator']
1382 data = expr['data']
1384 info = expr.info
1385 ifcond = QAPISchemaIfCond(expr.get('if'))
1386 features = self._make_features(expr.get('features'), info)
1398 QAPISchemaObjectType(name, info, expr.doc, ifcond, features,
1403 def _def_alternate_type(self, expr: QAPIExpression) -> None:
1404 name = expr['alternate']
1405 data = expr['data']
1407 ifcond = QAPISchemaIfCond(expr.get('if'))
1408 info = expr.info
1409 features = self._make_features(expr.get('features'), info)
1418 name, info, expr.doc, ifcond, features,
1421 def _def_command(self, expr: QAPIExpression) -> None:
1422 name = expr['command']
1423 data = expr.get('data')
1424 rets = expr.get('returns')
1425 gen = expr.get('gen', True)
1426 success_response = expr.get('success-response', True)
1427 boxed = expr.get('boxed', False)
1428 allow_oob = expr.get('allow-oob', False)
1429 allow_preconfig = expr.get('allow-preconfig', False)
1430 coroutine = expr.get('coroutine', False)
1431 ifcond = QAPISchemaIfCond(expr.get('if'))
1432 info = expr.info
1433 features = self._make_features(expr.get('features'), info)
1442 QAPISchemaCommand(name, info, expr.doc, ifcond, features, data,
1446 def _def_event(self, expr: QAPIExpression) -> None:
1447 name = expr['event']
1448 data = expr.get('data')
1449 boxed = expr.get('boxed', False)
1450 ifcond = QAPISchemaIfCond(expr.get('if'))
1451 info = expr.info
1452 features = self._make_features(expr.get('features'), info)
1457 self._def_definition(QAPISchemaEvent(name, info, expr.doc, ifcond,
1461 for expr in exprs:
1462 if 'enum' in expr:
1463 self._def_enum_type(expr)
1464 elif 'struct' in expr:
1465 self._def_struct_type(expr)
1466 elif 'union' in expr:
1467 self._def_union_type(expr)
1468 elif 'alternate' in expr:
1469 self._def_alternate_type(expr)
1470 elif 'command' in expr:
1471 self._def_command(expr)
1472 elif 'event' in expr:
1473 self._def_event(expr)
1474 elif 'include' in expr:
1475 self._def_include(expr)