+ parser = VPPAPI(debug=args.debug, filename=filename, logger=log,
+ revision=args.git_revision)
+
+ try:
+ if not args.input:
+ parsed_objects = parser.parse_fd(sys.stdin, log)
+ else:
+ parsed_objects = parser.parse_filename(args.input, log)
+ except ParseError as e:
+ print('Parse error: ', e, file=sys.stderr)
+ sys.exit(1)
+
+ # Build a list of objects. Hash of lists.
+ result = []
+
+ # if the variable is not set in the plugin, assume it to be false.
+ try:
+ plugin.process_imports
+ except AttributeError:
+ plugin.process_imports = False
+
+ if plugin.process_imports:
+ result = parser.process_imports(parsed_objects, False, result)
+ s = parser.process(result)
+ else:
+ s = parser.process(parsed_objects)
+
+ # Add msg_id field
+ s['Define'] = add_msg_id(s['Define'])
+
+ # Fold up CRCs
+ foldup_crcs(s['Define'])
+
+ #
+ # Debug
+ if args.debug:
+ import pprint
+ pp = pprint.PrettyPrinter(indent=4, stream=sys.stderr)
+ for t in s['Define']:
+ pp.pprint([t.name, t.flags, t.block])
+ for t in s['types']:
+ pp.pprint([t.name, t.block])
+