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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 423 |
424 class Parser { | 424 class Parser { |
425 public: | 425 public: |
426 Parser(Handle<Script> script, | 426 Parser(Handle<Script> script, |
427 bool allow_natives_syntax, | 427 bool allow_natives_syntax, |
428 v8::Extension* extension, | 428 v8::Extension* extension, |
429 ScriptDataImpl* pre_data); | 429 ScriptDataImpl* pre_data); |
430 virtual ~Parser() { } | 430 virtual ~Parser() { } |
431 | 431 |
432 // Returns NULL if parsing failed. | 432 // Returns NULL if parsing failed. |
433 FunctionLiteral* ParseProgram(Handle<String> source, | 433 FunctionLiteral* ParseProgram(CompilationInfo* info); |
434 bool in_global_context, | |
435 StrictModeFlag strict_mode); | |
436 | |
437 FunctionLiteral* ParseLazy(CompilationInfo* info); | 434 FunctionLiteral* ParseLazy(CompilationInfo* info); |
438 | 435 |
439 void ReportMessageAt(Scanner::Location loc, | 436 void ReportMessageAt(Scanner::Location loc, |
440 const char* message, | 437 const char* message, |
441 Vector<const char*> args); | 438 Vector<const char*> args); |
442 void ReportMessageAt(Scanner::Location loc, | 439 void ReportMessageAt(Scanner::Location loc, |
443 const char* message, | 440 const char* message, |
444 Vector<Handle<String> > args); | 441 Vector<Handle<String> > args); |
445 void SetHarmonyScoping(bool block_scoping); | 442 void SetHarmonyScoping(bool block_scoping); |
446 | 443 |
(...skipping 26 matching lines...) Expand all Loading... |
473 class FunctionState; | 470 class FunctionState; |
474 | 471 |
475 FunctionLiteral* ParseLazy(CompilationInfo* info, | 472 FunctionLiteral* ParseLazy(CompilationInfo* info, |
476 UC16CharacterStream* source, | 473 UC16CharacterStream* source, |
477 ZoneScope* zone_scope); | 474 ZoneScope* zone_scope); |
478 | 475 |
479 Isolate* isolate() { return isolate_; } | 476 Isolate* isolate() { return isolate_; } |
480 Zone* zone() { return isolate_->zone(); } | 477 Zone* zone() { return isolate_->zone(); } |
481 | 478 |
482 // Called by ParseProgram after setting up the scanner. | 479 // Called by ParseProgram after setting up the scanner. |
483 FunctionLiteral* DoParseProgram(Handle<String> source, | 480 FunctionLiteral* DoParseProgram(CompilationInfo* info, |
484 bool in_global_context, | 481 Handle<String> source, |
485 StrictModeFlag strict_mode, | |
486 ZoneScope* zone_scope); | 482 ZoneScope* zone_scope); |
487 | 483 |
488 // Report syntax error | 484 // Report syntax error |
489 void ReportUnexpectedToken(Token::Value token); | 485 void ReportUnexpectedToken(Token::Value token); |
490 void ReportInvalidPreparseData(Handle<String> name, bool* ok); | 486 void ReportInvalidPreparseData(Handle<String> name, bool* ok); |
491 void ReportMessage(const char* message, Vector<const char*> args); | 487 void ReportMessage(const char* message, Vector<const char*> args); |
492 | 488 |
493 bool inside_with() const { return top_scope_->inside_with(); } | 489 bool inside_with() const { return top_scope_->inside_with(); } |
494 Scanner& scanner() { return scanner_; } | 490 Scanner& scanner() { return scanner_; } |
495 Mode mode() const { return mode_; } | 491 Mode mode() const { return mode_; } |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 private: | 779 private: |
784 static const int kTypeSlot = 0; | 780 static const int kTypeSlot = 0; |
785 static const int kElementsSlot = 1; | 781 static const int kElementsSlot = 1; |
786 | 782 |
787 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 783 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
788 }; | 784 }; |
789 | 785 |
790 } } // namespace v8::internal | 786 } } // namespace v8::internal |
791 | 787 |
792 #endif // V8_PARSER_H_ | 788 #endif // V8_PARSER_H_ |
OLD | NEW |