OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 } | 514 } |
515 ~ParsingModeScope() { | 515 ~ParsingModeScope() { |
516 parser_->mode_ = old_mode_; | 516 parser_->mode_ = old_mode_; |
517 } | 517 } |
518 | 518 |
519 private: | 519 private: |
520 Parser* parser_; | 520 Parser* parser_; |
521 Mode old_mode_; | 521 Mode old_mode_; |
522 }; | 522 }; |
523 | 523 |
| 524 virtual bool is_classic_mode() { |
| 525 return top_scope_->is_classic_mode(); |
| 526 } |
| 527 |
524 // Returns NULL if parsing failed. | 528 // Returns NULL if parsing failed. |
525 FunctionLiteral* ParseProgram(); | 529 FunctionLiteral* ParseProgram(); |
526 | 530 |
527 FunctionLiteral* ParseLazy(); | 531 FunctionLiteral* ParseLazy(); |
528 FunctionLiteral* ParseLazy(Utf16CharacterStream* source); | 532 FunctionLiteral* ParseLazy(Utf16CharacterStream* source); |
529 | 533 |
530 Isolate* isolate() { return isolate_; } | 534 Isolate* isolate() { return isolate_; } |
531 Zone* zone() const { return zone_; } | 535 Zone* zone() const { return zone_; } |
532 CompilationInfo* info() const { return info_; } | 536 CompilationInfo* info() const { return info_; } |
533 | 537 |
534 // Called by ParseProgram after setting up the scanner. | 538 // Called by ParseProgram after setting up the scanner. |
535 FunctionLiteral* DoParseProgram(CompilationInfo* info, | 539 FunctionLiteral* DoParseProgram(CompilationInfo* info, |
536 Handle<String> source); | 540 Handle<String> source); |
537 | 541 |
538 // Report syntax error | 542 // Report syntax error |
539 void ReportUnexpectedToken(Token::Value token); | |
540 void ReportInvalidPreparseData(Handle<String> name, bool* ok); | 543 void ReportInvalidPreparseData(Handle<String> name, bool* ok); |
541 void ReportMessage(const char* message, Vector<const char*> args); | 544 void ReportMessage(const char* message, Vector<const char*> args); |
542 void ReportMessage(const char* message, Vector<Handle<String> > args); | 545 void ReportMessage(const char* message, Vector<Handle<String> > args); |
543 void ReportMessageAt(Scanner::Location location, const char* type) { | 546 void ReportMessageAt(Scanner::Location location, const char* type) { |
544 ReportMessageAt(location, type, Vector<const char*>::empty()); | 547 ReportMessageAt(location, type, Vector<const char*>::empty()); |
545 } | 548 } |
546 void ReportMessageAt(Scanner::Location loc, | 549 void ReportMessageAt(Scanner::Location loc, |
547 const char* message, | 550 const char* message, |
548 Vector<const char*> args); | 551 Vector<const char*> args); |
549 void ReportMessageAt(Scanner::Location loc, | 552 void ReportMessageAt(Scanner::Location loc, |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 private: | 816 private: |
814 static const int kLiteralTypeSlot = 0; | 817 static const int kLiteralTypeSlot = 0; |
815 static const int kElementsSlot = 1; | 818 static const int kElementsSlot = 1; |
816 | 819 |
817 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 820 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
818 }; | 821 }; |
819 | 822 |
820 } } // namespace v8::internal | 823 } } // namespace v8::internal |
821 | 824 |
822 #endif // V8_PARSER_H_ | 825 #endif // V8_PARSER_H_ |
OLD | NEW |