qapi.py: Decent syntax error reporting
[qemu/ar7.git] / tests / qapi-schema / test-qapi.py
blobb3d1e1dbce3e183cd8f0250e0f25f988d2ce47da
2 # QAPI parser test harness
4 # Copyright (c) 2013 Red Hat Inc.
6 # Authors:
7 # Markus Armbruster <armbru@redhat.com>
9 # This work is licensed under the terms of the GNU GPL, version 2 or later.
10 # See the COPYING file in the top-level directory.
13 from qapi import *
14 from pprint import pprint
15 import sys
17 try:
18 exprs = parse_schema(sys.stdin)
19 except SystemExit:
20 raise
21 except:
22 print >>sys.stderr, "Crashed:", sys.exc_info()[0]
23 exit(1)
25 pprint(exprs)
26 pprint(enum_types)
27 pprint(struct_types)