| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 """IntegerLiteral : integer""" | 233 """IntegerLiteral : integer""" |
| 234 p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'integer'), | 234 p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'integer'), |
| 235 self.BuildAttribute('NAME', p[1])) | 235 self.BuildAttribute('NAME', p[1])) |
| 236 | 236 |
| 237 # [b27.2] | 237 # [b27.2] |
| 238 def p_StringLiteral(self, p): | 238 def p_StringLiteral(self, p): |
| 239 """StringLiteral : string""" | 239 """StringLiteral : string""" |
| 240 p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'DOMString'), | 240 p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'DOMString'), |
| 241 self.BuildAttribute('NAME', p[1])) | 241 self.BuildAttribute('NAME', p[1])) |
| 242 | 242 |
| 243 # [b30] Add StaticAttribute | |
| 244 def p_AttributeOrOperation(self, p): | |
| 245 """AttributeOrOperation : STRINGIFIER StringifierAttributeOrOperation | |
| 246 | Attribute | |
| 247 | StaticAttribute | |
| 248 | Operation""" | |
| 249 # Standard is (no StaticAttribute): | |
| 250 # AttributeOrOperation : STRINGIFIER StringifierAttributeOrOperation | |
| 251 # | Attribute | |
| 252 # | Operation | |
| 253 if len(p) > 2: | |
| 254 # FIXME: Clearer to add stringifier property here, as: | |
| 255 # p[2].AddChildren(self.BuildTrue('STRINGIFIER')) | |
| 256 # Fix when actually implementing stringifiers. | |
| 257 p[0] = p[2] | |
| 258 else: | |
| 259 p[0] = p[1] | |
| 260 | |
| 261 # [b30.1] | |
| 262 def p_StaticAttribute(self, p): | |
| 263 """StaticAttribute : STATIC Attribute""" | |
| 264 p[2].AddChildren(self.BuildTrue('STATIC')) | |
| 265 p[0] = p[2] | |
| 266 | |
| 267 # [b47] | 243 # [b47] |
| 268 def p_ExceptionMember(self, p): | 244 def p_ExceptionMember(self, p): |
| 269 """ExceptionMember : Const | 245 """ExceptionMember : Const |
| 270 | ExceptionField | 246 | ExceptionField |
| 271 | Attribute | 247 | Attribute |
| 272 | ExceptionOperation""" | 248 | ExceptionOperation""" |
| 273 # Standard is (no Attribute, no ExceptionOperation): | 249 # Standard is (no Attribute, no ExceptionOperation): |
| 274 # ExceptionMember : Const | 250 # ExceptionMember : Const |
| 275 # | ExceptionField | 251 # | ExceptionField |
| 276 # FIXME: In DOMException.idl, Attributes should be changed to | 252 # FIXME: In DOMException.idl, Attributes should be changed to |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 try: | 437 try: |
| 462 outputdir = argv[1] | 438 outputdir = argv[1] |
| 463 except IndexError as err: | 439 except IndexError as err: |
| 464 print 'Usage: %s OUTPUT_DIR' % argv[0] | 440 print 'Usage: %s OUTPUT_DIR' % argv[0] |
| 465 return 1 | 441 return 1 |
| 466 parser = BlinkIDLParser(outputdir=outputdir) | 442 parser = BlinkIDLParser(outputdir=outputdir) |
| 467 | 443 |
| 468 | 444 |
| 469 if __name__ == '__main__': | 445 if __name__ == '__main__': |
| 470 sys.exit(main(sys.argv)) | 446 sys.exit(main(sys.argv)) |
| OLD | NEW |