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

Side by Side Diff: lib/dom/scripts/fremontcutbuilder.py

Issue 10533064: Support custom constructors with signature declaration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/dom/scripts/generator.py » ('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) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 import database 6 import database
7 import databasebuilder 7 import databasebuilder
8 import idlparser 8 import idlparser
9 import logging.config 9 import logging.config
10 import os.path 10 import os.path
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 'ENABLE_WEBGL', 78 'ENABLE_WEBGL',
79 'ENABLE_WEB_AUDIO', 79 'ENABLE_WEB_AUDIO',
80 'ENABLE_WEB_INTENTS', 80 'ENABLE_WEB_INTENTS',
81 'ENABLE_WEB_SOCKETS', 81 'ENABLE_WEB_SOCKETS',
82 'ENABLE_WEB_TIMING', 82 'ENABLE_WEB_TIMING',
83 'ENABLE_WORKERS', 83 'ENABLE_WORKERS',
84 'ENABLE_XHR_RESPONSE_BLOB', 84 'ENABLE_XHR_RESPONSE_BLOB',
85 'ENABLE_XSLT', 85 'ENABLE_XSLT',
86 ] 86 ]
87 87
88 # TODO(antonm): Remove this filter.
89 UNSUPPORTED_FEATURES = [ 'ENABLE_WEB_INTENTS' ]
90
91 def build_database(idl_files, database_dir, feature_defines = None): 88 def build_database(idl_files, database_dir, feature_defines = None):
92 """This code reconstructs the FremontCut IDL database from W3C, 89 """This code reconstructs the FremontCut IDL database from W3C,
93 WebKit and Dart IDL files.""" 90 WebKit and Dart IDL files."""
94 current_dir = os.path.dirname(__file__) 91 current_dir = os.path.dirname(__file__)
95 logging.config.fileConfig(os.path.join(current_dir, "logging.conf")) 92 logging.config.fileConfig(os.path.join(current_dir, "logging.conf"))
96 93
97 db = database.Database(database_dir) 94 db = database.Database(database_dir)
98 95
99 # Delete all existing IDLs in the DB. 96 # Delete all existing IDLs in the DB.
100 db.Delete() 97 db.Delete()
101 98
102 builder = databasebuilder.DatabaseBuilder(db) 99 builder = databasebuilder.DatabaseBuilder(db)
103 100
104 # TODO(vsm): Move this to a README. 101 # TODO(vsm): Move this to a README.
105 # This is the Dart SVN revision. 102 # This is the Dart SVN revision.
106 webkit_revision = '1060' 103 webkit_revision = '1060'
107 104
108 # TODO(vsm): Reconcile what is exposed here and inside WebKit code 105 # TODO(vsm): Reconcile what is exposed here and inside WebKit code
109 # generation. We need to recheck this periodically for now. 106 # generation. We need to recheck this periodically for now.
110 webkit_defines = [ 'LANGUAGE_DART', 'LANGUAGE_JAVASCRIPT' ] 107 webkit_defines = [ 'LANGUAGE_DART', 'LANGUAGE_JAVASCRIPT' ]
111 if feature_defines is None: 108 if feature_defines is None:
112 feature_defines = DEFAULT_FEATURE_DEFINES 109 feature_defines = DEFAULT_FEATURE_DEFINES
113 110
114 webkit_options = databasebuilder.DatabaseBuilderOptions( 111 webkit_options = databasebuilder.DatabaseBuilderOptions(
115 idl_syntax=idlparser.WEBKIT_SYNTAX, 112 idl_syntax=idlparser.WEBKIT_SYNTAX,
116 # TODO(vsm): What else should we define as on when processing IDL? 113 # TODO(vsm): What else should we define as on when processing IDL?
117 idl_defines=[define for define in webkit_defines + feature_defines if defi ne not in UNSUPPORTED_FEATURES], 114 idl_defines=webkit_defines + feature_defines,
118 source='WebKit', 115 source='WebKit',
119 source_attributes={'revision': webkit_revision}, 116 source_attributes={'revision': webkit_revision},
120 type_rename_map={ 117 type_rename_map={
121 'BarInfo': 'BarProp', 118 'BarInfo': 'BarProp',
122 'DedicatedWorkerContext': 'DedicatedWorkerGlobalScope', 119 'DedicatedWorkerContext': 'DedicatedWorkerGlobalScope',
123 'DOMApplicationCache': 'ApplicationCache', 120 'DOMApplicationCache': 'ApplicationCache',
124 'DOMCoreException': 'DOMException', 121 'DOMCoreException': 'DOMException',
125 'DOMFormData': 'FormData', 122 'DOMFormData': 'FormData',
126 'DOMSelection': 'Selection', 123 'DOMSelection': 'Selection',
127 'DOMWindow': 'Window', 124 'DOMWindow': 'Window',
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 204
208 for dir_name in webkit_dirs: 205 for dir_name in webkit_dirs:
209 dir_path = os.path.join(webcore_dir, dir_name) 206 dir_path = os.path.join(webcore_dir, dir_name)
210 os.path.walk(dir_path, visitor, None) 207 os.path.walk(dir_path, visitor, None)
211 208
212 database_dir = os.path.join(current_dir, '..', 'database') 209 database_dir = os.path.join(current_dir, '..', 'database')
213 return build_database(idl_files, database_dir) 210 return build_database(idl_files, database_dir)
214 211
215 if __name__ == '__main__': 212 if __name__ == '__main__':
216 sys.exit(main()) 213 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | lib/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698