| 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 class IDLArgument(IDLNode): | 456 class IDLArgument(IDLNode): |
| 457 """IDLNode specialization for operation arguments.""" | 457 """IDLNode specialization for operation arguments.""" |
| 458 def __init__(self, ast): | 458 def __init__(self, ast): |
| 459 IDLNode.__init__(self, ast) | 459 IDLNode.__init__(self, ast) |
| 460 self.type = self._convert_first(ast, 'Type', IDLType) | 460 self.type = self._convert_first(ast, 'Type', IDLType) |
| 461 self._convert_ext_attrs(ast) | 461 self._convert_ext_attrs(ast) |
| 462 # WebKit and Web IDL differ in how Optional is declared: | 462 # WebKit and Web IDL differ in how Optional is declared: |
| 463 self.is_optional = self._has(ast, 'Optional') \ | 463 self.is_optional = self._has(ast, 'Optional') \ |
| 464 or ('Optional' in self.ext_attrs) | 464 or ('Optional' in self.ext_attrs) |
| 465 | 465 |
| 466 def __repr__(self): |
| 467 return '<IDLArgument(type = %s, id = %s)>' % (self.type, self.id) |
| 468 |
| 466 | 469 |
| 467 class IDLImplementsStatement(IDLNode): | 470 class IDLImplementsStatement(IDLNode): |
| 468 """IDLNode specialization for 'X implements Y' declarations.""" | 471 """IDLNode specialization for 'X implements Y' declarations.""" |
| 469 def __init__(self, ast): | 472 def __init__(self, ast): |
| 470 IDLNode.__init__(self, ast) | 473 IDLNode.__init__(self, ast) |
| 471 self.implementor = self._convert_first(ast, 'ImplStmtImplementor', | 474 self.implementor = self._convert_first(ast, 'ImplStmtImplementor', |
| 472 IDLType) | 475 IDLType) |
| 473 self.implemented = self._convert_first(ast, 'ImplStmtImplemented', | 476 self.implemented = self._convert_first(ast, 'ImplStmtImplemented', |
| 474 IDLType) | 477 IDLType) |
| 475 | 478 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 491 """IDLDictNode specialization for one annotation.""" | 494 """IDLDictNode specialization for one annotation.""" |
| 492 def __init__(self, ast=None): | 495 def __init__(self, ast=None): |
| 493 IDLDictNode.__init__(self, ast) | 496 IDLDictNode.__init__(self, ast) |
| 494 self.id = None | 497 self.id = None |
| 495 if not ast: | 498 if not ast: |
| 496 return | 499 return |
| 497 for arg in self._find_all(ast, 'AnnotationArg'): | 500 for arg in self._find_all(ast, 'AnnotationArg'): |
| 498 name = self._find_first(arg, 'Id') | 501 name = self._find_first(arg, 'Id') |
| 499 value = self._find_first(arg, 'AnnotationArgValue') | 502 value = self._find_first(arg, 'AnnotationArgValue') |
| 500 self[name] = value | 503 self[name] = value |
| OLD | NEW |