| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/env python |
| 2 # | |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # 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 |
| 5 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 6 | 5 |
| 7 import sys | 6 import sys |
| 8 | 7 |
| 9 # Note: some of these files are imported to register cmdline options. | 8 # Note: some of these files are imported to register cmdline options. |
| 10 from idl_generator import Generator | 9 from idl_generator import Generator |
| 11 from idl_option import ParseOptions | 10 from idl_option import ParseOptions |
| 12 from idl_outfile import IDLOutFile | 11 from idl_outfile import IDLOutFile |
| 13 from idl_parser import ParseFiles | 12 from idl_parser import ParseFiles |
| 14 from idl_c_header import HGen | 13 from idl_c_header import HGen |
| 15 from idl_gen_pnacl import PnaclGen | 14 from idl_gen_pnacl import PnaclGen |
| 16 | 15 |
| 17 | 16 |
| 18 def Main(args): | 17 def Main(): |
| 18 args = sys.argv[1:] |
| 19 # If no arguments are provided, assume we are tring to rebuild the |
| 20 # C headers with warnings off. |
| 21 if not args: |
| 22 args = ['--wnone', '--cgen', '--range=start,end'] |
| 23 |
| 19 filenames = ParseOptions(args) | 24 filenames = ParseOptions(args) |
| 20 ast = ParseFiles(filenames) | 25 ast = ParseFiles(filenames) |
| 21 return Generator.Run(ast) | 26 return Generator.Run(ast) |
| 22 | 27 |
| 28 |
| 23 if __name__ == '__main__': | 29 if __name__ == '__main__': |
| 24 args = sys.argv[1:] | 30 sys.exit(Main()) |
| 25 | |
| 26 # If no arguments are provided, assume we are tring to rebuild the | |
| 27 # C headers with warnings off. | |
| 28 if not args: args = ['--wnone', '--cgen', '--range=start,end'] | |
| 29 | |
| 30 sys.exit(Main(args)) | |
| OLD | NEW |