| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 # [2.1] Error recovery for definition | 207 # [2.1] Error recovery for definition |
| 208 def p_DefinitionError(self, p): | 208 def p_DefinitionError(self, p): |
| 209 """Definition : error ';'""" | 209 """Definition : error ';'""" |
| 210 p[0] = self.BuildError(p, 'Definition') | 210 p[0] = self.BuildError(p, 'Definition') |
| 211 | 211 |
| 212 # [3] | 212 # [3] |
| 213 def p_CallbackOrInterface(self, p): | 213 def p_CallbackOrInterface(self, p): |
| 214 """CallbackOrInterface : CALLBACK CallbackRestOrInterface | 214 """CallbackOrInterface : CALLBACK CallbackRestOrInterface |
| 215 | Interface""" | 215 | Interface""" |
| 216 if len(p) > 2: | 216 if len(p) > 2: |
| 217 p[2].AddChildren(self.BuildTrue('CALLBACK')) |
| 217 p[0] = p[2] | 218 p[0] = p[2] |
| 218 else: | 219 else: |
| 219 p[0] = p[1] | 220 p[0] = p[1] |
| 220 | 221 |
| 221 # [4] | 222 # [4] |
| 222 def p_CallbackRestOrInterface(self, p): | 223 def p_CallbackRestOrInterface(self, p): |
| 223 """CallbackRestOrInterface : CallbackRest | 224 """CallbackRestOrInterface : CallbackRest |
| 224 | Interface""" | 225 | Interface""" |
| 225 p[0] = p[1] | 226 p[0] = p[1] |
| 226 | 227 |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 | 1299 |
| 1299 print '\n'.join(ast.Tree(accept_props=['PROD'])) | 1300 print '\n'.join(ast.Tree(accept_props=['PROD'])) |
| 1300 if errors: | 1301 if errors: |
| 1301 print '\nFound %d errors.\n' % errors | 1302 print '\nFound %d errors.\n' % errors |
| 1302 | 1303 |
| 1303 return errors | 1304 return errors |
| 1304 | 1305 |
| 1305 | 1306 |
| 1306 if __name__ == '__main__': | 1307 if __name__ == '__main__': |
| 1307 sys.exit(main(sys.argv[1:])) | 1308 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |