OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // See preparse-data-format.h for the data format. | 211 // See preparse-data-format.h for the data format. |
212 | 212 |
213 // The PreParser checks that the syntax follows the grammar for JavaScript, | 213 // The PreParser checks that the syntax follows the grammar for JavaScript, |
214 // and collects some information about the program along the way. | 214 // and collects some information about the program along the way. |
215 // The grammar check is only performed in order to understand the program | 215 // The grammar check is only performed in order to understand the program |
216 // sufficiently to deduce some information about it, that can be used | 216 // sufficiently to deduce some information about it, that can be used |
217 // to speed up later parsing. Finding errors is not the goal of pre-parsing, | 217 // to speed up later parsing. Finding errors is not the goal of pre-parsing, |
218 // rather it is to speed up properly written and correct programs. | 218 // rather it is to speed up properly written and correct programs. |
219 // That means that contextual checks (like a label being declared where | 219 // That means that contextual checks (like a label being declared where |
220 // it is used) are generally omitted. | 220 // it is used) are generally omitted. |
221 | |
222 typedef uint8_t byte; | |
223 namespace i = v8::internal; | |
224 | |
225 class PreParser : public ParserBase { | 221 class PreParser : public ParserBase { |
226 public: | 222 public: |
227 enum PreParseResult { | 223 enum PreParseResult { |
228 kPreParseStackOverflow, | 224 kPreParseStackOverflow, |
229 kPreParseSuccess | 225 kPreParseSuccess |
230 }; | 226 }; |
231 | 227 |
232 PreParser(Scanner* scanner, | 228 PreParser(Scanner* scanner, |
233 ParserRecorder* log, | 229 ParserRecorder* log, |
234 uintptr_t stack_limit) | 230 uintptr_t stack_limit) |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 ParserRecorder* log_; | 683 ParserRecorder* log_; |
688 Scope* scope_; | 684 Scope* scope_; |
689 Scanner::Location strict_mode_violation_location_; | 685 Scanner::Location strict_mode_violation_location_; |
690 const char* strict_mode_violation_type_; | 686 const char* strict_mode_violation_type_; |
691 bool parenthesized_function_; | 687 bool parenthesized_function_; |
692 }; | 688 }; |
693 | 689 |
694 } } // v8::internal | 690 } } // v8::internal |
695 | 691 |
696 #endif // V8_PREPARSER_H | 692 #endif // V8_PREPARSER_H |
OLD | NEW |