| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """ Parser for PPAPI IDL """ | 6 """ Parser for PPAPI IDL """ |
| 7 | 7 |
| 8 # | 8 # |
| 9 # IDL Parser | 9 # IDL Parser |
| 10 # | 10 # |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 # in turn are children of the file object created from the results of top. | 214 # in turn are children of the file object created from the results of top. |
| 215 def p_top(self, p): | 215 def p_top(self, p): |
| 216 """top : COMMENT COMMENT ext_attr_block top_list""" | 216 """top : COMMENT COMMENT ext_attr_block top_list""" |
| 217 | 217 |
| 218 Copyright = self.BuildComment('Copyright', p, 1) | 218 Copyright = self.BuildComment('Copyright', p, 1) |
| 219 Filedoc = self.BuildComment('Comment', p, 2) | 219 Filedoc = self.BuildComment('Comment', p, 2) |
| 220 | 220 |
| 221 p[0] = ListFromConcat(Copyright, Filedoc, p[3], p[4]) | 221 p[0] = ListFromConcat(Copyright, Filedoc, p[3], p[4]) |
| 222 if self.parse_debug: DumpReduction('top', p) | 222 if self.parse_debug: DumpReduction('top', p) |
| 223 | 223 |
| 224 def p_top_short(self, p): |
| 225 """top : COMMENT ext_attr_block top_list""" |
| 226 Copyright = self.BuildComment('Copyright', p, 1) |
| 227 p[0] = ListFromConcat(Copyright, p[2], p[3]) |
| 228 if self.parse_debug: DumpReduction('top', p) |
| 229 |
| 224 # Build a list of top level items. | 230 # Build a list of top level items. |
| 225 def p_top_list(self, p): | 231 def p_top_list(self, p): |
| 226 """top_list : callback_decl top_list | 232 """top_list : callback_decl top_list |
| 227 | describe_block top_list | 233 | describe_block top_list |
| 228 | dictionary_block top_list | 234 | dictionary_block top_list |
| 229 | enum_block top_list | 235 | enum_block top_list |
| 230 | inline top_list | 236 | inline top_list |
| 231 | interface_block top_list | 237 | interface_block top_list |
| 232 | label_block top_list | 238 | label_block top_list |
| 233 | namespace top_list | 239 | namespace top_list |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 ast = ParseFiles(filenames) | 1123 ast = ParseFiles(filenames) |
| 1118 errs = ast.GetProperty('ERRORS') | 1124 errs = ast.GetProperty('ERRORS') |
| 1119 if errs: | 1125 if errs: |
| 1120 ErrOut.Log('Found %d error(s).' % errs); | 1126 ErrOut.Log('Found %d error(s).' % errs); |
| 1121 InfoOut.Log("%d files processed." % len(filenames)) | 1127 InfoOut.Log("%d files processed." % len(filenames)) |
| 1122 return errs | 1128 return errs |
| 1123 | 1129 |
| 1124 | 1130 |
| 1125 if __name__ == '__main__': | 1131 if __name__ == '__main__': |
| 1126 sys.exit(Main(sys.argv[1:])) | 1132 sys.exit(Main(sys.argv[1:])) |
| OLD | NEW |