| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 bool allow_natives_syntax, | 419 bool allow_natives_syntax, |
| 420 v8::Extension* extension, | 420 v8::Extension* extension, |
| 421 ScriptDataImpl* pre_data); | 421 ScriptDataImpl* pre_data); |
| 422 virtual ~Parser() { } | 422 virtual ~Parser() { } |
| 423 | 423 |
| 424 // Returns NULL if parsing failed. | 424 // Returns NULL if parsing failed. |
| 425 FunctionLiteral* ParseProgram(Handle<String> source, | 425 FunctionLiteral* ParseProgram(Handle<String> source, |
| 426 bool in_global_context, | 426 bool in_global_context, |
| 427 StrictModeFlag strict_mode); | 427 StrictModeFlag strict_mode); |
| 428 | 428 |
| 429 FunctionLiteral* ParseLazy(Handle<SharedFunctionInfo> info); | 429 FunctionLiteral* ParseLazy(CompilationInfo* info); |
| 430 | 430 |
| 431 void ReportMessageAt(Scanner::Location loc, | 431 void ReportMessageAt(Scanner::Location loc, |
| 432 const char* message, | 432 const char* message, |
| 433 Vector<const char*> args); | 433 Vector<const char*> args); |
| 434 void ReportMessageAt(Scanner::Location loc, | 434 void ReportMessageAt(Scanner::Location loc, |
| 435 const char* message, | 435 const char* message, |
| 436 Vector<Handle<String> > args); | 436 Vector<Handle<String> > args); |
| 437 | 437 |
| 438 protected: | 438 protected: |
| 439 // Limit on number of function parameters is chosen arbitrarily. | 439 // Limit on number of function parameters is chosen arbitrarily. |
| 440 // Code::Flags uses only the low 17 bits of num-parameters to | 440 // Code::Flags uses only the low 17 bits of num-parameters to |
| 441 // construct a hashable id, so if more than 2^17 are allowed, this | 441 // construct a hashable id, so if more than 2^17 are allowed, this |
| 442 // should be checked. | 442 // should be checked. |
| 443 static const int kMaxNumFunctionParameters = 32766; | 443 static const int kMaxNumFunctionParameters = 32766; |
| 444 FunctionLiteral* ParseLazy(Handle<SharedFunctionInfo> info, | 444 FunctionLiteral* ParseLazy(CompilationInfo* info, |
| 445 UC16CharacterStream* source, | 445 UC16CharacterStream* source, |
| 446 ZoneScope* zone_scope); | 446 ZoneScope* zone_scope); |
| 447 enum Mode { | 447 enum Mode { |
| 448 PARSE_LAZILY, | 448 PARSE_LAZILY, |
| 449 PARSE_EAGERLY | 449 PARSE_EAGERLY |
| 450 }; | 450 }; |
| 451 | 451 |
| 452 // Called by ParseProgram after setting up the scanner. | 452 // Called by ParseProgram after setting up the scanner. |
| 453 FunctionLiteral* DoParseProgram(Handle<String> source, | 453 FunctionLiteral* DoParseProgram(Handle<String> source, |
| 454 bool in_global_context, | 454 bool in_global_context, |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); } | 793 Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); } |
| 794 // Converts the currently parsed literal to a JavaScript String. | 794 // Converts the currently parsed literal to a JavaScript String. |
| 795 Handle<String> GetString(); | 795 Handle<String> GetString(); |
| 796 | 796 |
| 797 JsonScanner scanner_; | 797 JsonScanner scanner_; |
| 798 bool stack_overflow_; | 798 bool stack_overflow_; |
| 799 }; | 799 }; |
| 800 } } // namespace v8::internal | 800 } } // namespace v8::internal |
| 801 | 801 |
| 802 #endif // V8_PARSER_H_ | 802 #endif // V8_PARSER_H_ |
| OLD | NEW |