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

Unified Diff: client/dom/scripts/dartgenerator.py

Issue 9350030: Generate dummy dom to replace wrapping dom for dartc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: x Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/dom/scripts/dartdomgenerator.py ('k') | client/dom/src/dummy_FactoryProviders.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/dartgenerator.py
diff --git a/client/dom/scripts/dartgenerator.py b/client/dom/scripts/dartgenerator.py
index ec35f61a12fb2608a1a7f2af2296b932d8b738e8..7bd6f92aa814579737afe2a1f44aeb4598564cff 100755
--- a/client/dom/scripts/dartgenerator.py
+++ b/client/dom/scripts/dartgenerator.py
@@ -382,12 +382,12 @@ class DartGenerator(object):
self._systems.append(interface_system)
if 'native' in systems:
- native_system = NativeImplementationSystem(
- TemplateLoader(self._template_dir, ['dom/native', 'dom', '']),
- self._database, self._emitters, self._auxiliary_dir,
- self._output_dir)
+ native_system = NativeImplementationSystem(
+ TemplateLoader(self._template_dir, ['dom/native', 'dom', '']),
+ self._database, self._emitters, self._auxiliary_dir,
+ self._output_dir)
- self._systems.append(native_system)
+ self._systems.append(native_system)
if 'wrapping' in systems:
wrapping_system = WrappingImplementationSystem(
@@ -399,6 +399,16 @@ class DartGenerator(object):
wrapping_system._interface_system = interface_system
self._systems.append(wrapping_system)
+ if 'dummy' in systems:
+ dummy_system = DummyImplementationSystem(
+ TemplateLoader(self._template_dir, ['dom/dummy', 'dom', '']),
+ self._database, self._emitters, self._output_dir)
+
+ # Makes interface files available for listing in the library for the
+ # dummy implementation.
+ dummy_system._interface_system = interface_system
+ self._systems.append(dummy_system)
+
if 'frog' in systems:
frog_system = FrogSystem(
TemplateLoader(self._template_dir, ['dom/frog', 'dom', '']),
@@ -972,6 +982,40 @@ class InterfacesSystem(System):
# ------------------------------------------------------------------------------
+class DummyImplementationSystem(System):
+ """Generates a dummy implementation for use by the editor analysis.
+
+ All the code comes from hand-written library files.
+ """
+
+ def __init__(self, templates, database, emitters, output_dir):
+ super(DummyImplementationSystem, self).__init__(
+ templates, database, emitters, output_dir)
+
+ def InterfaceGenerator(self,
+ interface,
+ common_prefix,
+ super_interface_name,
+ source_filter):
+ return DummyInterfaceGenerator(self, interface)
+
+ def ProcessCallback(self, interface, info):
+ pass
+
+ def GenerateLibraries(self, lib_dir):
+ # Library generated for implementation.
+ self._GenerateLibFile(
+ 'dom_dummy.darttemplate',
+ os.path.join(lib_dir, 'dom_dummy.dart'),
+ (self._interface_system._dart_interface_file_paths +
+ self._interface_system._dart_callback_file_paths +
+ []
+ # FIXME: Move the implementation to a separate library.
+ # self._dart_wrapping_file_paths
+ ))
+
+# ------------------------------------------------------------------------------
+
class WrappingImplementationSystem(System):
def __init__(self, templates, database, emitters, output_dir):
@@ -1280,6 +1324,41 @@ def TypeName(typeIds, interface):
# ------------------------------------------------------------------------------
+class DummyInterfaceGenerator(object):
+ """Generates nothing."""
+
+ def __init__(self, system, interface):
+ pass
+
+ def StartInterface(self):
+ pass
+
+ def FinishInterface(self):
+ pass
+
+ def AddConstant(self, constant):
+ pass
+
+ def AddAttribute(self, getter, setter):
+ pass
+
+ def AddSecondaryAttribute(self, interface, getter, setter):
+ pass
+
+ def AddSecondaryOperation(self, interface, info):
+ pass
+
+ def AddIndexer(self, element_type):
+ pass
+
+ def AddTypedArrayConstructors(self, element_type):
+ pass
+
+ def AddOperation(self, info):
+ pass
+
+# ------------------------------------------------------------------------------
+
class WrappingInterfaceGenerator(object):
"""Generates Dart and JS implementation for one DOM IDL interface."""
« no previous file with comments | « client/dom/scripts/dartdomgenerator.py ('k') | client/dom/src/dummy_FactoryProviders.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698