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

Side by Side Diff: ppapi/generators/idl_parser.py

Issue 8538029: Cleanup IDL Generator (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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 | « ppapi/generators/idl_node.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/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # 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 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """ Parser for PPAPI IDL """ 7 """ Parser for PPAPI IDL """
8 8
9 # 9 #
10 # IDL Parser 10 # IDL Parser
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 if errs: 998 if errs:
999 ErrOut.Log("Failed namespace test.") 999 ErrOut.Log("Failed namespace test.")
1000 else: 1000 else:
1001 InfoOut.Log("Passed namespace test.") 1001 InfoOut.Log("Passed namespace test.")
1002 return errs 1002 return errs
1003 1003
1004 default_dirs = ['.', 'trusted', 'dev'] 1004 default_dirs = ['.', 'trusted', 'dev']
1005 def ParseFiles(filenames): 1005 def ParseFiles(filenames):
1006 parser = IDLParser() 1006 parser = IDLParser()
1007 filenodes = [] 1007 filenodes = []
1008 errors = 0
1009 1008
1010 if not filenames: 1009 if not filenames:
1011 filenames = [] 1010 filenames = []
1012 srcroot = GetOption('srcroot') 1011 srcroot = GetOption('srcroot')
1013 for dir in default_dirs: 1012 for dirname in default_dirs:
1014 srcdir = os.path.join(srcroot, dir, '*.idl') 1013 srcdir = os.path.join(srcroot, dirname, '*.idl')
1015 srcdir = os.path.normpath(srcdir) 1014 srcdir = os.path.normpath(srcdir)
1016 filenames += sorted(glob.glob(srcdir)) 1015 filenames += sorted(glob.glob(srcdir))
1017 1016
1018 for filename in filenames: 1017 for filename in filenames:
1019 filenode = parser.ParseFile(filename) 1018 filenode = parser.ParseFile(filename)
1020 filenodes.append(filenode) 1019 filenodes.append(filenode)
1021 1020
1022 ast = IDLAst(filenodes) 1021 ast = IDLAst(filenodes)
1023 if GetOption('dump_tree'): ast.Dump(0) 1022 if GetOption('dump_tree'): ast.Dump(0)
1024 1023
(...skipping 17 matching lines...) Expand all
1042 ast = ParseFiles(filenames) 1041 ast = ParseFiles(filenames)
1043 errs = ast.GetProperty('ERRORS') 1042 errs = ast.GetProperty('ERRORS')
1044 if errs: 1043 if errs:
1045 ErrOut.Log('Found %d error(s).' % errs); 1044 ErrOut.Log('Found %d error(s).' % errs);
1046 InfoOut.Log("%d files processed." % len(filenames)) 1045 InfoOut.Log("%d files processed." % len(filenames))
1047 return errs 1046 return errs
1048 1047
1049 if __name__ == '__main__': 1048 if __name__ == '__main__':
1050 sys.exit(Main(sys.argv[1:])) 1049 sys.exit(Main(sys.argv[1:]))
1051 1050
OLDNEW
« no previous file with comments | « ppapi/generators/idl_node.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698