| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 pass | 241 pass |
| 242 | 242 |
| 243 def p_EnumValueListComma(self, p): | 243 def p_EnumValueListComma(self, p): |
| 244 """ """ | 244 """ """ |
| 245 pass | 245 pass |
| 246 | 246 |
| 247 def p_EnumValueListString(self, p): | 247 def p_EnumValueListString(self, p): |
| 248 """ """ | 248 """ """ |
| 249 pass | 249 pass |
| 250 | 250 |
| 251 def p_StringType(self, p): |
| 252 """ """ |
| 253 pass |
| 254 |
| 255 def p_RecordType(self, p): |
| 256 """ """ |
| 257 pass |
| 258 |
| 259 def p_RecordTypeError(self, p): |
| 260 """ """ |
| 261 pass |
| 262 |
| 251 # We only support: | 263 # We only support: |
| 252 # [ identifier ] | 264 # [ identifier ] |
| 253 # [ identifier ( ArgumentList )] | 265 # [ identifier ( ArgumentList )] |
| 254 # [ identifier ( ValueList )] | 266 # [ identifier ( ValueList )] |
| 255 # [ identifier = identifier ] | 267 # [ identifier = identifier ] |
| 256 # [ identifier = ( IdentifierList )] | 268 # [ identifier = ( IdentifierList )] |
| 257 # [ identifier = ConstValue ] | 269 # [ identifier = ConstValue ] |
| 258 # [ identifier = identifier ( ArgumentList )] | 270 # [ identifier = identifier ( ArgumentList )] |
| 259 # [51] map directly to 74-77 | 271 # [51] map directly to 74-77 |
| 260 # [52-54, 56] are unsupported | 272 # [52-54, 56] are unsupported |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 print '\n'.join(ast.Tree(accept_props=['PROD', 'TYPE', 'VALUE'])) | 320 print '\n'.join(ast.Tree(accept_props=['PROD', 'TYPE', 'VALUE'])) |
| 309 if errors: | 321 if errors: |
| 310 print '\nFound %d errors.\n' % errors | 322 print '\nFound %d errors.\n' % errors |
| 311 | 323 |
| 312 | 324 |
| 313 return errors | 325 return errors |
| 314 | 326 |
| 315 | 327 |
| 316 if __name__ == '__main__': | 328 if __name__ == '__main__': |
| 317 sys.exit(main(sys.argv[1:])) | 329 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |