Chromium Code Reviews| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 attributes = ListFromConcat(p[1], p[2]) | 547 attributes = ListFromConcat(p[1], p[2]) |
| 548 p[0].AddChildren(self.BuildAttribute('ATTRIBUTES', attributes)) | 548 p[0].AddChildren(self.BuildAttribute('ATTRIBUTES', attributes)) |
| 549 | 549 |
| 550 # [35] | 550 # [35] |
| 551 def p_Stringifier(self, p): | 551 def p_Stringifier(self, p): |
| 552 """Stringifier : STRINGIFIER StringifierRest""" | 552 """Stringifier : STRINGIFIER StringifierRest""" |
| 553 p[0] = self.BuildProduction('Stringifier', p, 1, p[2]) | 553 p[0] = self.BuildProduction('Stringifier', p, 1, p[2]) |
| 554 | 554 |
| 555 # [36] | 555 # [36] |
| 556 def p_StringifierRest(self, p): | 556 def p_StringifierRest(self, p): |
| 557 """StringifierRest : AttributeRest | 557 """StringifierRest : ReadOnly AttributeRest |
| 558 | ReturnType OperationRest | 558 | ReturnType OperationRest |
| 559 | ';'""" | 559 | ';'""" |
| 560 if len(p) == 3: | 560 if len(p) == 3: |
| 561 p[2].AddChildren(p[1]) | 561 p[2].AddChildren(p[1]) |
| 562 p[0] = p[2] | 562 p[0] = p[2] |
| 563 elif p[1] != ';': | 563 elif p[1] != ';': |
|
Jens Widell
2016/04/20 08:32:07
BTW, this ought to be dead code now; len(p) will b
sof
2016/04/20 08:49:27
i wondered about that, but didn't take it further
| |
| 564 p[0] = p[1] | 564 p[0] = p[1] |
| 565 | 565 |
| 566 # [37] | 566 # [37] |
| 567 def p_StaticMember(self, p): | 567 def p_StaticMember(self, p): |
| 568 """StaticMember : STATIC StaticMemberRest""" | 568 """StaticMember : STATIC StaticMemberRest""" |
| 569 p[2].AddChildren(self.BuildTrue('STATIC')) | 569 p[2].AddChildren(self.BuildTrue('STATIC')) |
| 570 p[0] = p[2] | 570 p[0] = p[2] |
| 571 | 571 |
| 572 # [38] | 572 # [38] |
| 573 def p_StaticMemberRest(self, p): | 573 def p_StaticMemberRest(self, p): |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1288 | 1288 |
| 1289 print '\n'.join(ast.Tree(accept_props=['PROD'])) | 1289 print '\n'.join(ast.Tree(accept_props=['PROD'])) |
| 1290 if errors: | 1290 if errors: |
| 1291 print '\nFound %d errors.\n' % errors | 1291 print '\nFound %d errors.\n' % errors |
| 1292 | 1292 |
| 1293 return errors | 1293 return errors |
| 1294 | 1294 |
| 1295 | 1295 |
| 1296 if __name__ == '__main__': | 1296 if __name__ == '__main__': |
| 1297 sys.exit(main(sys.argv[1:])) | 1297 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |