Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: Source/bindings/scripts/idl_compiler.py

Issue 19607011: Generate binding code for VoidCallback.idl with code generator in python (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: nits Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.py ('k') | Source/bindings/templates/callback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (C) 2013 Google Inc. All rights reserved. 2 # Copyright (C) 2013 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 idl_filename = options.idl_filename 97 idl_filename = options.idl_filename
98 basename = os.path.basename(idl_filename) 98 basename = os.path.basename(idl_filename)
99 interface_name, _ = os.path.splitext(basename) 99 interface_name, _ = os.path.splitext(basename)
100 output_directory = options.output_directory 100 output_directory = options.output_directory
101 verbose = options.verbose 101 verbose = options.verbose
102 if verbose: 102 if verbose:
103 print idl_filename 103 print idl_filename
104 104
105 reader = idl_reader.IdlReader(options.interface_dependencies_file, options.a dditional_idl_files, options.idl_attributes_file, output_directory, verbose) 105 reader = idl_reader.IdlReader(options.interface_dependencies_file, options.a dditional_idl_files, options.idl_attributes_file, output_directory, verbose)
106 definitions = reader.read_idl_definitions(idl_filename) 106 definitions = reader.read_idl_definitions(idl_filename)
107 code_generator = code_generator_v8.CodeGeneratorV8(definitions, interface_na me, options.output_directory, options.idl_directories, verbose)
107 if not definitions: 108 if not definitions:
108 # We generate dummy .h and .cpp files just to tell build scripts 109 # We generate dummy .h and .cpp files just to tell build scripts
109 # that outputs have been created. 110 # that outputs have been created.
110 code_generator_v8.generate_dummy_header_and_cpp(interface_name, output_d irectory) 111 code_generator.write_dummy_header_and_cpp()
111 return 112 return
112 if options.dump_json_and_pickle: 113 if options.dump_json_and_pickle:
113 write_json_and_pickle(definitions, interface_name, output_directory) 114 write_json_and_pickle(definitions, interface_name, output_directory)
114 return 115 return
115 # FIXME: turn on code generator 116 code_generator.write_header_and_cpp()
116 # Currently definitions must be None (so dummy .h and .cpp files are
117 # generated), or --dump-json-and-pickle selected, as actual code generator
118 # not present yet.
119 # code_generator_v8.write_interface(definitions, interface_name, options.out put_directory)
120 raise RuntimeError('Stub: code generator not implemented yet')
121 117
122 118
123 if __name__ == '__main__': 119 if __name__ == '__main__':
124 sys.exit(main()) 120 sys.exit(main())
OLDNEW
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.py ('k') | Source/bindings/templates/callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698