| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 15 matching lines...) Expand all Loading... |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 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 "preparse-data-format.h" | 33 #include "preparse-data-format.h" |
| 34 #include "preparse-data.h" | 34 #include "preparse-data.h" |
| 35 #include "scopes.h" | 35 #include "scopes.h" |
| 36 #include "preparser.h" |
| 36 | 37 |
| 37 namespace v8 { | 38 namespace v8 { |
| 38 namespace internal { | 39 namespace internal { |
| 39 | 40 |
| 40 class CompilationInfo; | 41 class CompilationInfo; |
| 41 class FuncNameInferrer; | 42 class FuncNameInferrer; |
| 42 class ParserLog; | 43 class ParserLog; |
| 43 class PositionStack; | 44 class PositionStack; |
| 44 class Target; | 45 class Target; |
| 45 class LexicalScope; | 46 class LexicalScope; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 class ParserApi { | 159 class ParserApi { |
| 159 public: | 160 public: |
| 160 // Parses the source code represented by the compilation info and sets its | 161 // Parses the source code represented by the compilation info and sets its |
| 161 // function literal. Returns false (and deallocates any allocated AST | 162 // function literal. Returns false (and deallocates any allocated AST |
| 162 // nodes) if parsing failed. | 163 // nodes) if parsing failed. |
| 163 static bool Parse(CompilationInfo* info); | 164 static bool Parse(CompilationInfo* info); |
| 164 | 165 |
| 165 // Generic preparser generating full preparse data. | 166 // Generic preparser generating full preparse data. |
| 166 static ScriptDataImpl* PreParse(UC16CharacterStream* source, | 167 static ScriptDataImpl* PreParse(UC16CharacterStream* source, |
| 167 v8::Extension* extension, | 168 v8::Extension* extension, |
| 168 bool harmony_scoping); | 169 int flags); |
| 169 | 170 |
| 170 // Preparser that only does preprocessing that makes sense if only used | 171 // Preparser that only does preprocessing that makes sense if only used |
| 171 // immediately after. | 172 // immediately after. |
| 172 static ScriptDataImpl* PartialPreParse(UC16CharacterStream* source, | 173 static ScriptDataImpl* PartialPreParse(UC16CharacterStream* source, |
| 173 v8::Extension* extension, | 174 v8::Extension* extension, |
| 174 bool harmony_scoping); | 175 int flags); |
| 175 }; | 176 }; |
| 176 | 177 |
| 177 // ---------------------------------------------------------------------------- | 178 // ---------------------------------------------------------------------------- |
| 178 // REGEXP PARSING | 179 // REGEXP PARSING |
| 179 | 180 |
| 180 // A BuffferedZoneList is an automatically growing list, just like (and backed | 181 // A BuffferedZoneList is an automatically growing list, just like (and backed |
| 181 // by) a ZoneList, that is optimized for the case of adding and removing | 182 // by) a ZoneList, that is optimized for the case of adding and removing |
| 182 // a single element. The last element added is stored outside the backing list, | 183 // a single element. The last element added is stored outside the backing list, |
| 183 // and if no more than one element is ever added, the ZoneList isn't even | 184 // and if no more than one element is ever added, the ZoneList isn't even |
| 184 // allocated. | 185 // allocated. |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 private: | 765 private: |
| 765 static const int kTypeSlot = 0; | 766 static const int kTypeSlot = 0; |
| 766 static const int kElementsSlot = 1; | 767 static const int kElementsSlot = 1; |
| 767 | 768 |
| 768 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 769 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 769 }; | 770 }; |
| 770 | 771 |
| 771 } } // namespace v8::internal | 772 } } // namespace v8::internal |
| 772 | 773 |
| 773 #endif // V8_PARSER_H_ | 774 #endif // V8_PARSER_H_ |
| OLD | NEW |