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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 # | 304 # |
305 # Dictionary | 305 # Dictionary |
306 # | 306 # |
307 # A dictionary is a named list of optional and required members. | 307 # A dictionary is a named list of optional and required members. |
308 # | 308 # |
309 def p_dictionary_block(self, p): | 309 def p_dictionary_block(self, p): |
310 """dictionary_block : modifiers DICTIONARY SYMBOL '{' struct_list '}' ';'""" | 310 """dictionary_block : modifiers DICTIONARY SYMBOL '{' struct_list '}' ';'""" |
311 p[0] = self.BuildNamed('Dictionary', p, 3, ListFromConcat(p[1], p[5])) | 311 p[0] = self.BuildNamed('Dictionary', p, 3, ListFromConcat(p[1], p[5])) |
312 | 312 |
| 313 def p_dictionary_errorA(self, p): |
| 314 """dictionary_block : modifiers DICTIONARY error ';'""" |
| 315 p[0] = [] |
| 316 |
| 317 def p_dictionary_errorB(self, p): |
| 318 """dictionary_block : modifiers DICTIONARY error '{' struct_list '}' ';'""" |
| 319 p[0] = [] |
| 320 |
313 # | 321 # |
314 # Callback | 322 # Callback |
315 # | 323 # |
316 # A callback is essentially a single function declaration (outside of an | 324 # A callback is essentially a single function declaration (outside of an |
317 # Interface). | 325 # Interface). |
318 # | 326 # |
319 def p_callback_decl(self, p): | 327 def p_callback_decl(self, p): |
320 """callback_decl : modifiers CALLBACK SYMBOL '=' SYMBOL param_list ';'""" | 328 """callback_decl : modifiers CALLBACK SYMBOL '=' SYMBOL param_list ';'""" |
321 children = ListFromConcat(p[1], p[6]) | 329 children = ListFromConcat(p[1], p[6]) |
322 p[0] = self.BuildNamed('Callback', p, 3, children) | 330 p[0] = self.BuildNamed('Callback', p, 3, children) |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 errs = ast.GetProperty('ERRORS') | 1227 errs = ast.GetProperty('ERRORS') |
1220 if errs: | 1228 if errs: |
1221 ErrOut.Log('Found %d error(s).' % errs); | 1229 ErrOut.Log('Found %d error(s).' % errs); |
1222 InfoOut.Log("%d files processed." % len(filenames)) | 1230 InfoOut.Log("%d files processed." % len(filenames)) |
1223 return errs | 1231 return errs |
1224 | 1232 |
1225 | 1233 |
1226 if __name__ == '__main__': | 1234 if __name__ == '__main__': |
1227 sys.exit(Main(sys.argv[1:])) | 1235 sys.exit(Main(sys.argv[1:])) |
1228 | 1236 |
OLD | NEW |