| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 """Read an IDL file or complete IDL interface, producing an IdlDefinitions objec
t.""" | 29 """Read an IDL file or complete IDL interface, producing an IdlDefinitions objec
t.""" |
| 30 | 30 |
| 31 import os.path | 31 import os.path |
| 32 | 32 |
| 33 import blink_idl_parser | 33 import blink_idl_parser |
| 34 import idl_definitions_builder | 34 import idl_definitions_builder |
| 35 import idl_validator | 35 import idl_validator |
| 36 import interface_dependency_resolver | 36 import interface_dependency_resolver |
| 37 | 37 |
| 38 | 38 |
| 39 class IdlReader: | 39 class IdlReader(object): |
| 40 def __init__(self, interfaces_info=None, idl_attributes_filename=None, outpu
tdir=''): | 40 def __init__(self, interfaces_info=None, idl_attributes_filename=None, outpu
tdir=''): |
| 41 if idl_attributes_filename: | 41 if idl_attributes_filename: |
| 42 self.extended_attribute_validator = idl_validator.IDLExtendedAttribu
teValidator(idl_attributes_filename) | 42 self.extended_attribute_validator = idl_validator.IDLExtendedAttribu
teValidator(idl_attributes_filename) |
| 43 else: | 43 else: |
| 44 self.extended_attribute_validator = None | 44 self.extended_attribute_validator = None |
| 45 | 45 |
| 46 if interfaces_info: | 46 if interfaces_info: |
| 47 self.interface_dependency_resolver = interface_dependency_resolver.I
nterfaceDependencyResolver(interfaces_info, self) | 47 self.interface_dependency_resolver = interface_dependency_resolver.I
nterfaceDependencyResolver(interfaces_info, self) |
| 48 else: | 48 else: |
| 49 self.interface_dependency_resolver = None | 49 self.interface_dependency_resolver = None |
| (...skipping 23 matching lines...) Expand all Loading... |
| 73 except idl_validator.IDLInvalidExtendedAttributeError as error: | 73 except idl_validator.IDLInvalidExtendedAttributeError as error: |
| 74 raise idl_validator.IDLInvalidExtendedAttributeError("""IDL ATTRIBUT
E ERROR in file %s: | 74 raise idl_validator.IDLInvalidExtendedAttributeError("""IDL ATTRIBUT
E ERROR in file %s: |
| 75 %s | 75 %s |
| 76 If you want to add a new IDL extended attribute, please add it to | 76 If you want to add a new IDL extended attribute, please add it to |
| 77 bindings/IDLExtendedAttributes.txt | 77 bindings/IDLExtendedAttributes.txt |
| 78 and add an explanation to the Blink IDL documentation at: | 78 and add an explanation to the Blink IDL documentation at: |
| 79 http://www.chromium.org/blink/webidl/blink-idl-extended-attributes | 79 http://www.chromium.org/blink/webidl/blink-idl-extended-attributes |
| 80 """ % (idl_filename, str(error))) | 80 """ % (idl_filename, str(error))) |
| 81 | 81 |
| 82 return definitions | 82 return definitions |
| OLD | NEW |