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

Side by Side Diff: src/parser.h

Issue 3586006: Begin a more aggressive refactoring of the Compiler interface. (Closed)
Patch Set: Always return false on a parse failure. Created 10 years, 2 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
« no previous file with comments | « src/liveedit.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 17 matching lines...) Expand all
28 #ifndef V8_PARSER_H_ 28 #ifndef V8_PARSER_H_
29 #define V8_PARSER_H_ 29 #define V8_PARSER_H_
30 30
31 #include "allocation.h" 31 #include "allocation.h"
32 #include "ast.h" 32 #include "ast.h"
33 #include "scanner.h" 33 #include "scanner.h"
34 34
35 namespace v8 { 35 namespace v8 {
36 namespace internal { 36 namespace internal {
37 37
38 class CompilationInfo;
38 class FuncNameInferrer; 39 class FuncNameInferrer;
39 class ParserFactory; 40 class ParserFactory;
40 class ParserLog; 41 class ParserLog;
41 class PositionStack; 42 class PositionStack;
42 class Target; 43 class Target;
43 class TemporaryScope; 44 class TemporaryScope;
44 45
45 template <typename T> class ZoneListWrapper; 46 template <typename T> class ZoneListWrapper;
46 47
47 48
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 }; 177 };
177 178
178 179
179 class Parser { 180 class Parser {
180 public: 181 public:
181 Parser(Handle<Script> script, bool allow_natives_syntax, 182 Parser(Handle<Script> script, bool allow_natives_syntax,
182 v8::Extension* extension, ParserMode is_pre_parsing, 183 v8::Extension* extension, ParserMode is_pre_parsing,
183 ParserFactory* factory, ParserLog* log, ScriptDataImpl* pre_data); 184 ParserFactory* factory, ParserLog* log, ScriptDataImpl* pre_data);
184 virtual ~Parser() { } 185 virtual ~Parser() { }
185 186
186 // Takes a script and and context information, and builds a 187 // Parses the source code represented by the compilation info and sets its
187 // FunctionLiteral AST node. Returns NULL and deallocates any allocated 188 // function literal. Returns false (and deallocates any allocated AST
188 // AST nodes if parsing failed. 189 // nodes) if parsing failed.
189 static FunctionLiteral* MakeAST(bool compile_in_global_context, 190 static bool Parse(CompilationInfo* info);
190 Handle<Script> script,
191 v8::Extension* extension,
192 ScriptDataImpl* pre_data,
193 bool is_json = false);
194
195 // Support for doing lazy compilation.
196 static FunctionLiteral* MakeLazyAST(Handle<SharedFunctionInfo> info);
197 191
198 // Generic preparser generating full preparse data. 192 // Generic preparser generating full preparse data.
199 static ScriptDataImpl* PreParse(Handle<String> source, 193 static ScriptDataImpl* PreParse(Handle<String> source,
200 unibrow::CharacterStream* stream, 194 unibrow::CharacterStream* stream,
201 v8::Extension* extension); 195 v8::Extension* extension);
202 196
203 // Preparser that only does preprocessing that makes sense if only used 197 // Preparser that only does preprocessing that makes sense if only used
204 // immediately after. 198 // immediately after.
205 static ScriptDataImpl* PartialPreParse(Handle<String> source, 199 static ScriptDataImpl* PartialPreParse(Handle<String> source,
206 unibrow::CharacterStream* stream, 200 unibrow::CharacterStream* stream,
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 static const int kTypeSlot = 0; 468 static const int kTypeSlot = 0;
475 static const int kElementsSlot = 1; 469 static const int kElementsSlot = 1;
476 470
477 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); 471 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
478 }; 472 };
479 473
480 474
481 } } // namespace v8::internal 475 } } // namespace v8::internal
482 476
483 #endif // V8_PARSER_H_ 477 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698