OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (C) 2013 Google Inc. All rights reserved. | 2 # Copyright (C) 2013 Google Inc. All rights reserved. |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... |
32 import in_generator | 32 import in_generator |
33 import trie_builder | 33 import trie_builder |
34 import template_expander | 34 import template_expander |
35 | 35 |
36 | 36 |
37 class ElementLookupTrieWriter(in_generator.Writer): | 37 class ElementLookupTrieWriter(in_generator.Writer): |
38 # FIXME: Inherit all these from somewhere. | 38 # FIXME: Inherit all these from somewhere. |
39 defaults = { | 39 defaults = { |
40 'JSInterfaceName': None, | 40 'JSInterfaceName': None, |
41 'constructorNeedsCreatedByParser': None, | 41 'constructorNeedsCreatedByParser': None, |
42 'constructorNeedsFormElement': None, | |
43 'interfaceName': None, | 42 'interfaceName': None, |
44 'noConstructor': None, | 43 'noConstructor': None, |
45 'runtimeEnabled': None, | 44 'runtimeEnabled': None, |
46 } | 45 } |
47 default_parameters = { | 46 default_parameters = { |
48 'attrsNullNamespace': None, | 47 'attrsNullNamespace': None, |
49 'export': '', | 48 'export': '', |
50 'fallbackInterfaceName': '', | 49 'fallbackInterfaceName': '', |
51 'fallbackJSInterfaceName': '', | 50 'fallbackJSInterfaceName': '', |
52 'namespace': '', | 51 'namespace': '', |
(...skipping 21 matching lines...) Expand all Loading... |
74 @template_expander.use_jinja('ElementLookupTrie.cpp.tmpl') | 73 @template_expander.use_jinja('ElementLookupTrie.cpp.tmpl') |
75 def generate_implementation(self): | 74 def generate_implementation(self): |
76 return { | 75 return { |
77 'namespace': self._namespace, | 76 'namespace': self._namespace, |
78 'length_tries': trie_builder.trie_list_by_str_length(self._tags) | 77 'length_tries': trie_builder.trie_list_by_str_length(self._tags) |
79 } | 78 } |
80 | 79 |
81 | 80 |
82 if __name__ == '__main__': | 81 if __name__ == '__main__': |
83 in_generator.Maker(ElementLookupTrieWriter).main(sys.argv) | 82 in_generator.Maker(ElementLookupTrieWriter).main(sys.argv) |
OLD | NEW |