OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 PARSE_LAZILY, | 453 PARSE_LAZILY, |
454 PARSE_EAGERLY | 454 PARSE_EAGERLY |
455 }; | 455 }; |
456 | 456 |
457 enum VariableDeclarationContext { | 457 enum VariableDeclarationContext { |
458 kSourceElement, | 458 kSourceElement, |
459 kStatement, | 459 kStatement, |
460 kForStatement | 460 kForStatement |
461 }; | 461 }; |
462 | 462 |
| 463 // If a list of variable declarations includes any initializers. |
| 464 enum VariableDeclarationProperties { |
| 465 kHasInitializers, |
| 466 kHasNoInitializers |
| 467 }; |
| 468 |
463 Isolate* isolate() { return isolate_; } | 469 Isolate* isolate() { return isolate_; } |
464 Zone* zone() { return isolate_->zone(); } | 470 Zone* zone() { return isolate_->zone(); } |
465 | 471 |
466 // Called by ParseProgram after setting up the scanner. | 472 // Called by ParseProgram after setting up the scanner. |
467 FunctionLiteral* DoParseProgram(Handle<String> source, | 473 FunctionLiteral* DoParseProgram(Handle<String> source, |
468 bool in_global_context, | 474 bool in_global_context, |
469 StrictModeFlag strict_mode, | 475 StrictModeFlag strict_mode, |
470 ZoneScope* zone_scope); | 476 ZoneScope* zone_scope); |
471 | 477 |
472 // Report syntax error | 478 // Report syntax error |
(...skipping 17 matching lines...) Expand all Loading... |
490 int end_token, bool* ok); | 496 int end_token, bool* ok); |
491 Statement* ParseSourceElement(ZoneStringList* labels, bool* ok); | 497 Statement* ParseSourceElement(ZoneStringList* labels, bool* ok); |
492 Statement* ParseStatement(ZoneStringList* labels, bool* ok); | 498 Statement* ParseStatement(ZoneStringList* labels, bool* ok); |
493 Statement* ParseFunctionDeclaration(bool* ok); | 499 Statement* ParseFunctionDeclaration(bool* ok); |
494 Statement* ParseNativeDeclaration(bool* ok); | 500 Statement* ParseNativeDeclaration(bool* ok); |
495 Block* ParseBlock(ZoneStringList* labels, bool* ok); | 501 Block* ParseBlock(ZoneStringList* labels, bool* ok); |
496 Block* ParseScopedBlock(ZoneStringList* labels, bool* ok); | 502 Block* ParseScopedBlock(ZoneStringList* labels, bool* ok); |
497 Block* ParseVariableStatement(VariableDeclarationContext var_context, | 503 Block* ParseVariableStatement(VariableDeclarationContext var_context, |
498 bool* ok); | 504 bool* ok); |
499 Block* ParseVariableDeclarations(VariableDeclarationContext var_context, | 505 Block* ParseVariableDeclarations(VariableDeclarationContext var_context, |
| 506 VariableDeclarationProperties* decl_props, |
500 Handle<String>* out, | 507 Handle<String>* out, |
501 bool* ok); | 508 bool* ok); |
502 Statement* ParseExpressionOrLabelledStatement(ZoneStringList* labels, | 509 Statement* ParseExpressionOrLabelledStatement(ZoneStringList* labels, |
503 bool* ok); | 510 bool* ok); |
504 IfStatement* ParseIfStatement(ZoneStringList* labels, bool* ok); | 511 IfStatement* ParseIfStatement(ZoneStringList* labels, bool* ok); |
505 Statement* ParseContinueStatement(bool* ok); | 512 Statement* ParseContinueStatement(bool* ok); |
506 Statement* ParseBreakStatement(ZoneStringList* labels, bool* ok); | 513 Statement* ParseBreakStatement(ZoneStringList* labels, bool* ok); |
507 Statement* ParseReturnStatement(bool* ok); | 514 Statement* ParseReturnStatement(bool* ok); |
508 Statement* ParseWithStatement(ZoneStringList* labels, bool* ok); | 515 Statement* ParseWithStatement(ZoneStringList* labels, bool* ok); |
509 CaseClause* ParseCaseClause(bool* default_seen_ptr, bool* ok); | 516 CaseClause* ParseCaseClause(bool* default_seen_ptr, bool* ok); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 private: | 771 private: |
765 static const int kTypeSlot = 0; | 772 static const int kTypeSlot = 0; |
766 static const int kElementsSlot = 1; | 773 static const int kElementsSlot = 1; |
767 | 774 |
768 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 775 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
769 }; | 776 }; |
770 | 777 |
771 } } // namespace v8::internal | 778 } } // namespace v8::internal |
772 | 779 |
773 #endif // V8_PARSER_H_ | 780 #endif // V8_PARSER_H_ |
OLD | NEW |