| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 bool ParseIntervalQuantifier(int* min_out, int* max_out); | 314 bool ParseIntervalQuantifier(int* min_out, int* max_out); |
| 315 | 315 |
| 316 // Parses and returns a single escaped character. The character | 316 // Parses and returns a single escaped character. The character |
| 317 // must not be 'b' or 'B' since they are usually handle specially. | 317 // must not be 'b' or 'B' since they are usually handle specially. |
| 318 uc32 ParseClassCharacterEscape(); | 318 uc32 ParseClassCharacterEscape(); |
| 319 | 319 |
| 320 // Checks whether the following is a length-digit hexadecimal number, | 320 // Checks whether the following is a length-digit hexadecimal number, |
| 321 // and sets the value if it is. | 321 // and sets the value if it is. |
| 322 bool ParseHexEscape(int length, uc32* value); | 322 bool ParseHexEscape(int length, uc32* value); |
| 323 | 323 |
| 324 uc32 ParseControlLetterEscape(); | |
| 325 uc32 ParseOctalLiteral(); | 324 uc32 ParseOctalLiteral(); |
| 326 | 325 |
| 327 // Tries to parse the input as a back reference. If successful it | 326 // Tries to parse the input as a back reference. If successful it |
| 328 // stores the result in the output parameter and returns true. If | 327 // stores the result in the output parameter and returns true. If |
| 329 // it fails it will push back the characters read so the same characters | 328 // it fails it will push back the characters read so the same characters |
| 330 // can be reparsed. | 329 // can be reparsed. |
| 331 bool ParseBackReferenceIndex(int* index_out); | 330 bool ParseBackReferenceIndex(int* index_out); |
| 332 | 331 |
| 333 CharacterRange ParseClassAtom(uc16* char_class); | 332 CharacterRange ParseClassAtom(uc16* char_class); |
| 334 RegExpTree* ReportError(Vector<const char> message); | 333 RegExpTree* ReportError(Vector<const char> message); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 stack_overflow_ = true; | 575 stack_overflow_ = true; |
| 577 } | 576 } |
| 578 return scanner().Next(); | 577 return scanner().Next(); |
| 579 } | 578 } |
| 580 | 579 |
| 581 INLINE(void Consume(Token::Value token)); | 580 INLINE(void Consume(Token::Value token)); |
| 582 void Expect(Token::Value token, bool* ok); | 581 void Expect(Token::Value token, bool* ok); |
| 583 bool Check(Token::Value token); | 582 bool Check(Token::Value token); |
| 584 void ExpectSemicolon(bool* ok); | 583 void ExpectSemicolon(bool* ok); |
| 585 | 584 |
| 585 Handle<String> LiteralString(PretenureFlag tenured) { |
| 586 if (scanner().is_literal_ascii()) { |
| 587 return isolate_->factory()->NewStringFromAscii( |
| 588 scanner().literal_ascii_string(), tenured); |
| 589 } else { |
| 590 return isolate_->factory()->NewStringFromTwoByte( |
| 591 scanner().literal_uc16_string(), tenured); |
| 592 } |
| 593 } |
| 594 |
| 595 Handle<String> NextLiteralString(PretenureFlag tenured) { |
| 596 if (scanner().is_next_literal_ascii()) { |
| 597 return isolate_->factory()->NewStringFromAscii( |
| 598 scanner().next_literal_ascii_string(), tenured); |
| 599 } else { |
| 600 return isolate_->factory()->NewStringFromTwoByte( |
| 601 scanner().next_literal_uc16_string(), tenured); |
| 602 } |
| 603 } |
| 604 |
| 586 Handle<String> GetSymbol(bool* ok); | 605 Handle<String> GetSymbol(bool* ok); |
| 587 | 606 |
| 588 // Get odd-ball literals. | 607 // Get odd-ball literals. |
| 589 Literal* GetLiteralUndefined(); | 608 Literal* GetLiteralUndefined(); |
| 590 Literal* GetLiteralTheHole(); | 609 Literal* GetLiteralTheHole(); |
| 591 Literal* GetLiteralNumber(double value); | 610 Literal* GetLiteralNumber(double value); |
| 592 | 611 |
| 593 Handle<String> ParseIdentifier(bool* ok); | 612 Handle<String> ParseIdentifier(bool* ok); |
| 594 Handle<String> ParseIdentifierName(bool* ok); | 613 Handle<String> ParseIdentifierName(bool* ok); |
| 595 Handle<String> ParseIdentifierOrGetOrSet(bool* is_get, | 614 Handle<String> ParseIdentifierOrGetOrSet(bool* is_get, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 610 | 629 |
| 611 // Factory methods. | 630 // Factory methods. |
| 612 | 631 |
| 613 Statement* EmptyStatement() { | 632 Statement* EmptyStatement() { |
| 614 static v8::internal::EmptyStatement empty; | 633 static v8::internal::EmptyStatement empty; |
| 615 return ∅ | 634 return ∅ |
| 616 } | 635 } |
| 617 | 636 |
| 618 Scope* NewScope(Scope* parent, Scope::Type type, bool inside_with); | 637 Scope* NewScope(Scope* parent, Scope::Type type, bool inside_with); |
| 619 | 638 |
| 620 Handle<String> LookupSymbol(int symbol_id, | 639 Handle<String> LookupSymbol(int symbol_id); |
| 621 Vector<const char> string); | |
| 622 | 640 |
| 623 Handle<String> LookupCachedSymbol(int symbol_id, | 641 Handle<String> LookupCachedSymbol(int symbol_id); |
| 624 Vector<const char> string); | |
| 625 | 642 |
| 626 Expression* NewCall(Expression* expression, | 643 Expression* NewCall(Expression* expression, |
| 627 ZoneList<Expression*>* arguments, | 644 ZoneList<Expression*>* arguments, |
| 628 int pos) { | 645 int pos) { |
| 629 return new Call(expression, arguments, pos); | 646 return new Call(expression, arguments, pos); |
| 630 } | 647 } |
| 631 | 648 |
| 632 | 649 |
| 633 // Create a number literal. | 650 // Create a number literal. |
| 634 Literal* NewNumberLiteral(double value); | 651 Literal* NewNumberLiteral(double value); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // Converts the currently parsed literal to a JavaScript String. | 775 // Converts the currently parsed literal to a JavaScript String. |
| 759 Handle<String> GetString(); | 776 Handle<String> GetString(); |
| 760 | 777 |
| 761 Isolate* isolate_; | 778 Isolate* isolate_; |
| 762 JsonScanner scanner_; | 779 JsonScanner scanner_; |
| 763 bool stack_overflow_; | 780 bool stack_overflow_; |
| 764 }; | 781 }; |
| 765 } } // namespace v8::internal | 782 } } // namespace v8::internal |
| 766 | 783 |
| 767 #endif // V8_PARSER_H_ | 784 #endif // V8_PARSER_H_ |
| OLD | NEW |