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

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

Issue 47543003: Mojo: Add basic IDL parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A bit more object oriented. 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/__init__.py ('k') | mojo/public/bindings/parser/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
5
6 """The frontend for the Mojo bindings system."""
7
8
9 import sys
10 from optparse import OptionParser
11 from parser import mojo_parser
12 from parser import mojo_translate
13 from generators import mojom_data
14 from generators import mojom_cpp_generator
15
16
17 def Main():
18 parser = OptionParser(usage="usage: %prog [options] filename1 [filename2...]")
19 parser.add_option("-o", "--outdir", dest="outdir", default=".",
20 help="specify output directory")
21 (options, args) = parser.parse_args()
22
23 if len(args) < 1:
24 parser.print_help()
25 sys.exit(1)
26
27 for filename in args:
28 tree = mojo_parser.Parse(filename)
29 mojom = mojo_translate.Translate(tree)
30 module = mojom_data.ModuleFromData(mojom)
31 cpp = mojom_cpp_generator.CPPGenerator(module)
32 cpp.GenerateFiles(options.outdir)
33
34
35 if __name__ == '__main__':
36 Main()
OLDNEW
« no previous file with comments | « mojo/public/bindings/generators/__init__.py ('k') | mojo/public/bindings/parser/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698