OLD | NEW |
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 sys | 6 import sys |
7 | 7 |
8 | 8 |
9 class IDLNode(object): | 9 class IDLNode(object): |
10 """Base class for all IDL elements. | 10 """Base class for all IDL elements. |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 self.operations = self._convert_all(ast, 'Operation', IDLOperation) | 371 self.operations = self._convert_all(ast, 'Operation', IDLOperation) |
372 self.attributes = self._convert_all(ast, 'Attribute', IDLAttribute) | 372 self.attributes = self._convert_all(ast, 'Attribute', IDLAttribute) |
373 self.constants = self._convert_all(ast, 'Const', IDLConstant) | 373 self.constants = self._convert_all(ast, 'Const', IDLConstant) |
374 self.is_supplemental = 'Supplemental' in self.ext_attrs | 374 self.is_supplemental = 'Supplemental' in self.ext_attrs |
375 self.is_no_interface_object = 'NoInterfaceObject' in self.ext_attrs | 375 self.is_no_interface_object = 'NoInterfaceObject' in self.ext_attrs |
376 self.is_fc_suppressed = 'Suppressed' in self.ext_attrs | 376 self.is_fc_suppressed = 'Suppressed' in self.ext_attrs |
377 self.javascript_binding_name = self.id | 377 self.javascript_binding_name = self.id |
378 | 378 |
379 def has_attribute(self, candidate): | 379 def has_attribute(self, candidate): |
380 for attribute in self.attributes: | 380 for attribute in self.attributes: |
381 if attribute.id == candidate.id and attribute.is_fc_getter == candidate.is
_fc_getter and attribute.is_fc_setter == candidate.is_fc_setter: | 381 if (attribute.id == candidate.id and |
| 382 attribute.is_fc_getter == candidate.is_fc_getter and |
| 383 attribute.is_fc_setter == candidate.is_fc_setter): |
382 return True | 384 return True |
383 return False | 385 return False |
384 | 386 |
385 | 387 |
386 class IDLParentInterface(IDLNode): | 388 class IDLParentInterface(IDLNode): |
387 """This IDLNode specialization is for 'Interface Child : Parent {}' | 389 """This IDLNode specialization is for 'Interface Child : Parent {}' |
388 declarations.""" | 390 declarations.""" |
389 def __init__(self, ast): | 391 def __init__(self, ast): |
390 IDLNode.__init__(self, ast) | 392 IDLNode.__init__(self, ast) |
391 self._convert_annotations(ast) | 393 self._convert_annotations(ast) |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 """IDLDictNode specialization for one annotation.""" | 486 """IDLDictNode specialization for one annotation.""" |
485 def __init__(self, ast=None): | 487 def __init__(self, ast=None): |
486 IDLDictNode.__init__(self, ast) | 488 IDLDictNode.__init__(self, ast) |
487 self.id = None | 489 self.id = None |
488 if not ast: | 490 if not ast: |
489 return | 491 return |
490 for arg in self._find_all(ast, 'AnnotationArg'): | 492 for arg in self._find_all(ast, 'AnnotationArg'): |
491 name = self._find_first(arg, 'Id') | 493 name = self._find_first(arg, 'Id') |
492 value = self._find_first(arg, 'AnnotationArgValue') | 494 value = self._find_first(arg, 'AnnotationArgValue') |
493 self[name] = value | 495 self[name] = value |
OLD | NEW |