| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 BufferedZoneList<RegExpTree, 2> alternatives_; | 286 BufferedZoneList<RegExpTree, 2> alternatives_; |
| 287 #ifdef DEBUG | 287 #ifdef DEBUG |
| 288 enum {ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM} last_added_; | 288 enum {ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM} last_added_; |
| 289 #define LAST(x) last_added_ = x; | 289 #define LAST(x) last_added_ = x; |
| 290 #else | 290 #else |
| 291 #define LAST(x) | 291 #define LAST(x) |
| 292 #endif | 292 #endif |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 | 295 |
| 296 class RegExpParser { | 296 class RegExpParser BASE_EMBEDDED { |
| 297 public: | 297 public: |
| 298 RegExpParser(FlatStringReader* in, | 298 RegExpParser(FlatStringReader* in, |
| 299 Handle<String>* error, | 299 Handle<String>* error, |
| 300 bool multiline_mode, | 300 bool multiline_mode, |
| 301 Zone* zone); | 301 Zone* zone); |
| 302 | 302 |
| 303 static bool ParseRegExp(FlatStringReader* input, | 303 static bool ParseRegExp(FlatStringReader* input, |
| 304 bool multiline, | 304 bool multiline, |
| 305 RegExpCompileData* result, | 305 RegExpCompileData* result, |
| 306 Zone* zone); | 306 Zone* zone); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 bool is_scanned_for_captures_; | 416 bool is_scanned_for_captures_; |
| 417 bool failed_; | 417 bool failed_; |
| 418 }; | 418 }; |
| 419 | 419 |
| 420 // ---------------------------------------------------------------------------- | 420 // ---------------------------------------------------------------------------- |
| 421 // JAVASCRIPT PARSING | 421 // JAVASCRIPT PARSING |
| 422 | 422 |
| 423 // Forward declaration. | 423 // Forward declaration. |
| 424 class SingletonLogger; | 424 class SingletonLogger; |
| 425 | 425 |
| 426 class Parser { | 426 class Parser BASE_EMBEDDED { |
| 427 public: | 427 public: |
| 428 Parser(CompilationInfo* info, | 428 Parser(CompilationInfo* info, |
| 429 int parsing_flags, // Combination of ParsingFlags | 429 int parsing_flags, // Combination of ParsingFlags |
| 430 v8::Extension* extension, | 430 v8::Extension* extension, |
| 431 ScriptDataImpl* pre_data); | 431 ScriptDataImpl* pre_data); |
| 432 virtual ~Parser() { | 432 ~Parser() { |
| 433 delete reusable_preparser_; | 433 delete reusable_preparser_; |
| 434 reusable_preparser_ = NULL; | 434 reusable_preparser_ = NULL; |
| 435 } | 435 } |
| 436 | 436 |
| 437 // Returns NULL if parsing failed. | 437 // Returns NULL if parsing failed. |
| 438 FunctionLiteral* ParseProgram(); | 438 FunctionLiteral* ParseProgram(); |
| 439 FunctionLiteral* ParseLazy(); | 439 FunctionLiteral* ParseLazy(); |
| 440 | 440 |
| 441 void ReportMessageAt(Scanner::Location loc, | 441 void ReportMessageAt(Scanner::Location loc, |
| 442 const char* message, | 442 const char* message, |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 private: | 880 private: |
| 881 static const int kTypeSlot = 0; | 881 static const int kTypeSlot = 0; |
| 882 static const int kElementsSlot = 1; | 882 static const int kElementsSlot = 1; |
| 883 | 883 |
| 884 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 884 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 885 }; | 885 }; |
| 886 | 886 |
| 887 } } // namespace v8::internal | 887 } } // namespace v8::internal |
| 888 | 888 |
| 889 #endif // V8_PARSER_H_ | 889 #endif // V8_PARSER_H_ |
| OLD | NEW |