| 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 Parser(Handle<Script> script, | 418 Parser(Handle<Script> script, |
| 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 | 427 |
| 428 FunctionLiteral* ParseLazy(Handle<SharedFunctionInfo> info); | 428 FunctionLiteral* ParseLazy(CompilationInfo* info); |
| 429 | 429 |
| 430 void ReportMessageAt(Scanner::Location loc, | 430 void ReportMessageAt(Scanner::Location loc, |
| 431 const char* message, | 431 const char* message, |
| 432 Vector<const char*> args); | 432 Vector<const char*> args); |
| 433 void ReportMessageAt(Scanner::Location loc, | 433 void ReportMessageAt(Scanner::Location loc, |
| 434 const char* message, | 434 const char* message, |
| 435 Vector<Handle<String> > args); | 435 Vector<Handle<String> > args); |
| 436 | 436 |
| 437 protected: | 437 protected: |
| 438 // Limit on number of function parameters is chosen arbitrarily. | 438 // Limit on number of function parameters is chosen arbitrarily. |
| 439 // Code::Flags uses only the low 17 bits of num-parameters to | 439 // Code::Flags uses only the low 17 bits of num-parameters to |
| 440 // construct a hashable id, so if more than 2^17 are allowed, this | 440 // construct a hashable id, so if more than 2^17 are allowed, this |
| 441 // should be checked. | 441 // should be checked. |
| 442 static const int kMaxNumFunctionParameters = 32766; | 442 static const int kMaxNumFunctionParameters = 32766; |
| 443 FunctionLiteral* ParseLazy(Handle<SharedFunctionInfo> info, | 443 FunctionLiteral* ParseLazy(CompilationInfo* info, |
| 444 UC16CharacterStream* source, | 444 UC16CharacterStream* source, |
| 445 ZoneScope* zone_scope); | 445 ZoneScope* zone_scope); |
| 446 enum Mode { | 446 enum Mode { |
| 447 PARSE_LAZILY, | 447 PARSE_LAZILY, |
| 448 PARSE_EAGERLY | 448 PARSE_EAGERLY |
| 449 }; | 449 }; |
| 450 | 450 |
| 451 // Called by ParseProgram after setting up the scanner. | 451 // Called by ParseProgram after setting up the scanner. |
| 452 FunctionLiteral* DoParseProgram(Handle<String> source, | 452 FunctionLiteral* DoParseProgram(Handle<String> source, |
| 453 bool in_global_context, | 453 bool in_global_context, |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); } | 787 Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); } |
| 788 // Converts the currently parsed literal to a JavaScript String. | 788 // Converts the currently parsed literal to a JavaScript String. |
| 789 Handle<String> GetString(); | 789 Handle<String> GetString(); |
| 790 | 790 |
| 791 JsonScanner scanner_; | 791 JsonScanner scanner_; |
| 792 bool stack_overflow_; | 792 bool stack_overflow_; |
| 793 }; | 793 }; |
| 794 } } // namespace v8::internal | 794 } } // namespace v8::internal |
| 795 | 795 |
| 796 #endif // V8_PARSER_H_ | 796 #endif // V8_PARSER_H_ |
| OLD | NEW |