Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: src/parser.h

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-visiting.h ('k') | src/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 &empty; 634 return &empty;
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
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_
OLDNEW
« no previous file with comments | « src/objects-visiting.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698