| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 def p_CallbackRestOrInterface(self, p): | 222 def p_CallbackRestOrInterface(self, p): |
| 223 """CallbackRestOrInterface : CallbackRest | 223 """CallbackRestOrInterface : CallbackRest |
| 224 | Interface""" | 224 | Interface""" |
| 225 p[0] = p[1] | 225 p[0] = p[1] |
| 226 | 226 |
| 227 # [5] | 227 # [5] |
| 228 def p_Interface(self, p): | 228 def p_Interface(self, p): |
| 229 """Interface : INTERFACE identifier Inheritance '{' InterfaceMembers '}' ';'
""" | 229 """Interface : INTERFACE identifier Inheritance '{' InterfaceMembers '}' ';'
""" |
| 230 p[0] = self.BuildNamed('Interface', p, 2, ListFromConcat(p[3], p[5])) | 230 p[0] = self.BuildNamed('Interface', p, 2, ListFromConcat(p[3], p[5])) |
| 231 | 231 |
| 232 # [5.1] Error recovery for interface. |
| 233 def p_InterfaceError(self, p): |
| 234 """Interface : INTERFACE identifier Inheritance '{' error""" |
| 235 p[0] = self.BuildError(p, 'Interface') |
| 236 |
| 232 # [6] | 237 # [6] |
| 233 def p_Partial(self, p): | 238 def p_Partial(self, p): |
| 234 """Partial : PARTIAL PartialDefinition""" | 239 """Partial : PARTIAL PartialDefinition""" |
| 235 p[2].AddChildren(self.BuildTrue('Partial')) | 240 p[2].AddChildren(self.BuildTrue('Partial')) |
| 236 p[0] = p[2] | 241 p[0] = p[2] |
| 237 | 242 |
| 238 # [6.1] Error recovery for Partial | 243 # [6.1] Error recovery for Partial |
| 239 def p_PartialError(self, p): | 244 def p_PartialError(self, p): |
| 240 """Partial : PARTIAL error""" | 245 """Partial : PARTIAL error""" |
| 241 p[0] = self.BuildError(p, 'Partial') | 246 p[0] = self.BuildError(p, 'Partial') |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 | 1203 |
| 1199 print '\n'.join(ast.Tree(accept_props=['PROD'])) | 1204 print '\n'.join(ast.Tree(accept_props=['PROD'])) |
| 1200 if errors: | 1205 if errors: |
| 1201 print '\nFound %d errors.\n' % errors | 1206 print '\nFound %d errors.\n' % errors |
| 1202 | 1207 |
| 1203 return errors | 1208 return errors |
| 1204 | 1209 |
| 1205 | 1210 |
| 1206 if __name__ == '__main__': | 1211 if __name__ == '__main__': |
| 1207 sys.exit(main(sys.argv[1:])) | 1212 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |