| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 p[0] = self.BuildError(p, 'Dictionary') | 300 p[0] = self.BuildError(p, 'Dictionary') |
| 301 | 301 |
| 302 # [12] | 302 # [12] |
| 303 def p_DictionaryMembers(self, p): | 303 def p_DictionaryMembers(self, p): |
| 304 """DictionaryMembers : ExtendedAttributeList DictionaryMember DictionaryMemb
ers | 304 """DictionaryMembers : ExtendedAttributeList DictionaryMember DictionaryMemb
ers |
| 305 |""" | 305 |""" |
| 306 if len(p) > 1: | 306 if len(p) > 1: |
| 307 p[2].AddChildren(p[1]) | 307 p[2].AddChildren(p[1]) |
| 308 p[0] = ListFromConcat(p[2], p[3]) | 308 p[0] = ListFromConcat(p[2], p[3]) |
| 309 | 309 |
| 310 # [12.1] Error recovery for DictionaryMembers |
| 311 def p_DictionaryMembersError(self, p): |
| 312 """DictionaryMembers : ExtendedAttributeList error""" |
| 313 p[0] = self.BuildError(p, 'DictionaryMembers') |
| 314 |
| 310 # [13] | 315 # [13] |
| 311 def p_DictionaryMember(self, p): | 316 def p_DictionaryMember(self, p): |
| 312 """DictionaryMember : Required Type identifier Default ';'""" | 317 """DictionaryMember : Required Type identifier Default ';'""" |
| 313 p[0] = self.BuildNamed('Key', p, 3, ListFromConcat(p[1], p[2], p[4])) | 318 p[0] = self.BuildNamed('Key', p, 3, ListFromConcat(p[1], p[2], p[4])) |
| 314 | 319 |
| 315 # [14] | 320 # [14] |
| 316 def p_Required(self, p): | 321 def p_Required(self, p): |
| 317 """Required : REQUIRED | 322 """Required : REQUIRED |
| 318 |""" | 323 |""" |
| 319 if len(p) > 1: | 324 if len(p) > 1: |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 | 1288 |
| 1284 print '\n'.join(ast.Tree(accept_props=['PROD'])) | 1289 print '\n'.join(ast.Tree(accept_props=['PROD'])) |
| 1285 if errors: | 1290 if errors: |
| 1286 print '\nFound %d errors.\n' % errors | 1291 print '\nFound %d errors.\n' % errors |
| 1287 | 1292 |
| 1288 return errors | 1293 return errors |
| 1289 | 1294 |
| 1290 | 1295 |
| 1291 if __name__ == '__main__': | 1296 if __name__ == '__main__': |
| 1292 sys.exit(main(sys.argv[1:])) | 1297 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |