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

Side by Side Diff: mojo/public/bindings/mojo_idl.py

Issue 52973003: mojo: break struct headers into headers and source (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add constant for header size Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « mojo/public/bindings/generators/run_cpp_generator.py ('k') | no next file » | 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/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """The frontend for the Mojo bindings system.""" 6 """The frontend for the Mojo bindings system."""
7 7
8 8
9 import sys 9 import sys
10 from optparse import OptionParser 10 from optparse import OptionParser
11 from parser import mojo_parser 11 from parser import mojo_parser
12 from parser import mojo_translate 12 from parser import mojo_translate
13 from generators import mojom_data 13 from generators import mojom_data
14 from generators import mojom_cpp_generator 14 from generators import mojom_cpp_generator
15 15
16 16
17 def Main(): 17 def Main():
18 parser = OptionParser(usage="usage: %prog [options] filename1 [filename2...]") 18 parser = OptionParser(usage="usage: %prog [options] filename1 [filename2...]")
19 parser.add_option("-o", "--outdir", dest="outdir", default=".", 19 parser.add_option("-i", "--include_dir", dest="include_dir", default=".",
20 help="specify directory for #includes")
21 parser.add_option("-o", "--output_dir", dest="output_dir", default=".",
20 help="specify output directory") 22 help="specify output directory")
21 (options, args) = parser.parse_args() 23 (options, args) = parser.parse_args()
22 24
23 if len(args) < 1: 25 if len(args) < 1:
24 parser.print_help() 26 parser.print_help()
25 sys.exit(1) 27 sys.exit(1)
26 28
27 for filename in args: 29 for filename in args:
28 # TODO(darin): There's clearly too many layers of translation here! We can 30 # TODO(darin): There's clearly too many layers of translation here! We can
29 # at least avoid generating the serialized Mojom IR. 31 # at least avoid generating the serialized Mojom IR.
30 tree = mojo_parser.Parse(filename) 32 tree = mojo_parser.Parse(filename)
31 mojom = mojo_translate.Translate(tree) 33 mojom = mojo_translate.Translate(tree)
32 module = mojom_data.ModuleFromData(mojom) 34 module = mojom_data.ModuleFromData(mojom)
33 cpp = mojom_cpp_generator.CPPGenerator(module) 35 cpp = mojom_cpp_generator.CPPGenerator(
34 cpp.GenerateFiles(options.outdir) 36 module, options.include_dir, options.output_dir)
37 cpp.GenerateFiles()
35 38
36 39
37 if __name__ == '__main__': 40 if __name__ == '__main__':
38 Main() 41 Main()
OLDNEW
« no previous file with comments | « mojo/public/bindings/generators/run_cpp_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698