| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, 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 """This module generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import emitter | 8 import emitter |
| 9 import idlnode | 9 import idlnode |
| 10 import logging | 10 import logging |
| 11 import multiemitter | 11 import multiemitter |
| 12 import os | 12 import os |
| 13 import re | 13 import re |
| 14 import shutil | 14 import shutil |
| 15 from generator import * | 15 from generator import * |
| 16 from systembase import * | 16 from systembase import * |
| 17 from systemfrog import * | 17 from systemfrog import * |
| 18 from systemhtml import * | 18 from systemhtml import * |
| 19 from systeminterface import * | 19 from systeminterface import * |
| 20 from systemnative import * | 20 from systemnative import * |
| 21 from systemwrapping import * | |
| 22 from templateloader import TemplateLoader | 21 from templateloader import TemplateLoader |
| 23 | 22 |
| 24 _logger = logging.getLogger('dartgenerator') | 23 _logger = logging.getLogger('dartgenerator') |
| 25 | 24 |
| 26 def MergeNodes(node, other): | 25 def MergeNodes(node, other): |
| 27 node.operations.extend(other.operations) | 26 node.operations.extend(other.operations) |
| 28 for attribute in other.attributes: | 27 for attribute in other.attributes: |
| 29 if not node.has_attribute(attribute): | 28 if not node.has_attribute(attribute): |
| 30 node.attributes.append(attribute) | 29 node.attributes.append(attribute) |
| 31 | 30 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 self._systems.append(interface_system) | 250 self._systems.append(interface_system) |
| 252 | 251 |
| 253 if 'native' in systems: | 252 if 'native' in systems: |
| 254 native_system = NativeImplementationSystem( | 253 native_system = NativeImplementationSystem( |
| 255 TemplateLoader(self._template_dir, ['dom/native', 'dom', '']), | 254 TemplateLoader(self._template_dir, ['dom/native', 'dom', '']), |
| 256 self._database, self._emitters, self._auxiliary_dir, | 255 self._database, self._emitters, self._auxiliary_dir, |
| 257 self._output_dir) | 256 self._output_dir) |
| 258 | 257 |
| 259 self._systems.append(native_system) | 258 self._systems.append(native_system) |
| 260 | 259 |
| 261 if 'wrapping' in systems: | |
| 262 wrapping_system = WrappingImplementationSystem( | |
| 263 TemplateLoader(self._template_dir, ['dom/wrapping', 'dom', '']), | |
| 264 self._database, self._emitters, self._output_dir) | |
| 265 | |
| 266 # Makes interface files available for listing in the library for the | |
| 267 # wrapping implementation. | |
| 268 wrapping_system._interface_system = interface_system | |
| 269 self._systems.append(wrapping_system) | |
| 270 | |
| 271 if 'dummy' in systems: | 260 if 'dummy' in systems: |
| 272 dummy_system = DummyImplementationSystem( | 261 dummy_system = DummyImplementationSystem( |
| 273 TemplateLoader(self._template_dir, ['dom/dummy', 'dom', '']), | 262 TemplateLoader(self._template_dir, ['dom/dummy', 'dom', '']), |
| 274 self._database, self._emitters, self._output_dir) | 263 self._database, self._emitters, self._output_dir) |
| 275 | 264 |
| 276 # Makes interface files available for listing in the library for the | 265 # Makes interface files available for listing in the library for the |
| 277 # dummy implementation. | 266 # dummy implementation. |
| 278 dummy_system._interface_system = interface_system | 267 dummy_system._interface_system = interface_system |
| 279 self._systems.append(dummy_system) | 268 self._systems.append(dummy_system) |
| 280 | 269 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 pass | 628 pass |
| 640 | 629 |
| 641 def AddOperation(self, info): | 630 def AddOperation(self, info): |
| 642 pass | 631 pass |
| 643 | 632 |
| 644 def AddStaticOperation(self, info): | 633 def AddStaticOperation(self, info): |
| 645 pass | 634 pass |
| 646 | 635 |
| 647 def AddEventAttributes(self, event_attrs): | 636 def AddEventAttributes(self, event_attrs): |
| 648 pass | 637 pass |
| OLD | NEW |