| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 pass | 233 pass |
| 234 | 234 |
| 235 def p_null(self, p): | 235 def p_null(self, p): |
| 236 """ """ | 236 """ """ |
| 237 pass | 237 pass |
| 238 | 238 |
| 239 def p_PromiseType(self, p): | 239 def p_PromiseType(self, p): |
| 240 """ """ | 240 """ """ |
| 241 pass | 241 pass |
| 242 | 242 |
| 243 def p_EnumValueListComma(self, p): |
| 244 """ """ |
| 245 pass |
| 246 |
| 247 def p_EnumValueListString(self, p): |
| 248 """ """ |
| 249 pass |
| 250 |
| 243 # We only support: | 251 # We only support: |
| 244 # [ identifier ] | 252 # [ identifier ] |
| 245 # [ identifier ( ArgumentList )] | 253 # [ identifier ( ArgumentList )] |
| 246 # [ identifier ( ValueList )] | 254 # [ identifier ( ValueList )] |
| 247 # [ identifier = identifier ] | 255 # [ identifier = identifier ] |
| 248 # [ identifier = ( IdentifierList )] | 256 # [ identifier = ( IdentifierList )] |
| 249 # [ identifier = ConstValue ] | 257 # [ identifier = ConstValue ] |
| 250 # [ identifier = identifier ( ArgumentList )] | 258 # [ identifier = identifier ( ArgumentList )] |
| 251 # [51] map directly to 74-77 | 259 # [51] map directly to 74-77 |
| 252 # [52-54, 56] are unsupported | 260 # [52-54, 56] are unsupported |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 print '\n'.join(ast.Tree(accept_props=['PROD', 'TYPE', 'VALUE'])) | 308 print '\n'.join(ast.Tree(accept_props=['PROD', 'TYPE', 'VALUE'])) |
| 301 if errors: | 309 if errors: |
| 302 print '\nFound %d errors.\n' % errors | 310 print '\nFound %d errors.\n' % errors |
| 303 | 311 |
| 304 | 312 |
| 305 return errors | 313 return errors |
| 306 | 314 |
| 307 | 315 |
| 308 if __name__ == '__main__': | 316 if __name__ == '__main__': |
| 309 sys.exit(main(sys.argv[1:])) | 317 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |