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

Side by Side Diff: src/parser.h

Issue 5136002: Extract scanner base/JS/JSON and move base and JS to scanner-base. (Closed)
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « src/conversions.cc ('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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name, 675 FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name,
676 int function_token_position, 676 int function_token_position,
677 FunctionLiteralType type, 677 FunctionLiteralType type,
678 bool* ok); 678 bool* ok);
679 679
680 680
681 // Magical syntax support. 681 // Magical syntax support.
682 Expression* ParseV8Intrinsic(bool* ok); 682 Expression* ParseV8Intrinsic(bool* ok);
683 683
684 INLINE(Token::Value peek()) { return scanner_.peek(); } 684 INLINE(Token::Value peek()) { return scanner_.peek(); }
685 INLINE(Token::Value Next()) { return scanner_.Next(); } 685 INLINE(Token::Value Next()) { return scanner_.NextCheckStack(); }
686 INLINE(void Consume(Token::Value token)); 686 INLINE(void Consume(Token::Value token));
687 void Expect(Token::Value token, bool* ok); 687 void Expect(Token::Value token, bool* ok);
688 bool Check(Token::Value token); 688 bool Check(Token::Value token);
689 void ExpectSemicolon(bool* ok); 689 void ExpectSemicolon(bool* ok);
690 690
691 Handle<String> GetSymbol(bool* ok); 691 Handle<String> GetSymbol(bool* ok);
692 692
693 // Get odd-ball literals. 693 // Get odd-ball literals.
694 Literal* GetLiteralUndefined(); 694 Literal* GetLiteralUndefined();
695 Literal* GetLiteralTheHole(); 695 Literal* GetLiteralTheHole();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 Handle<Object> second); 753 Handle<Object> second);
754 754
755 // Generic AST generator for throwing errors from compiled code. 755 // Generic AST generator for throwing errors from compiled code.
756 Expression* NewThrowError(Handle<String> constructor, 756 Expression* NewThrowError(Handle<String> constructor,
757 Handle<String> type, 757 Handle<String> type,
758 Vector< Handle<Object> > arguments); 758 Vector< Handle<Object> > arguments);
759 759
760 ZoneList<Handle<String> > symbol_cache_; 760 ZoneList<Handle<String> > symbol_cache_;
761 761
762 Handle<Script> script_; 762 Handle<Script> script_;
763 Scanner scanner_; 763 V8JavaScriptScanner scanner_;
764 764
765 Scope* top_scope_; 765 Scope* top_scope_;
766 int with_nesting_level_; 766 int with_nesting_level_;
767 767
768 TemporaryScope* temp_scope_; 768 TemporaryScope* temp_scope_;
769 Mode mode_; 769 Mode mode_;
770 770
771 Target* target_stack_; // for break, continue statements 771 Target* target_stack_; // for break, continue statements
772 bool allow_natives_syntax_; 772 bool allow_natives_syntax_;
773 v8::Extension* extension_; 773 v8::Extension* extension_;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 // A JSON array doesn't allow leaving out values from the sequence, nor does 845 // A JSON array doesn't allow leaving out values from the sequence, nor does
846 // it allow a terminal comma, like a JavaScript array does. 846 // it allow a terminal comma, like a JavaScript array does.
847 Handle<Object> ParseJsonArray(); 847 Handle<Object> ParseJsonArray();
848 848
849 // Mark that a parsing error has happened at the current token, and 849 // Mark that a parsing error has happened at the current token, and
850 // return a null handle. Primarily for readability. 850 // return a null handle. Primarily for readability.
851 Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); } 851 Handle<Object> ReportUnexpectedToken() { return Handle<Object>::null(); }
852 // Converts the currently parsed literal to a JavaScript String. 852 // Converts the currently parsed literal to a JavaScript String.
853 Handle<String> GetString(); 853 Handle<String> GetString();
854 854
855 Scanner scanner_; 855 JsonScanner scanner_;
856 }; 856 };
857 } } // namespace v8::internal 857 } } // namespace v8::internal
858 858
859 #endif // V8_PARSER_H_ 859 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « src/conversions.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698