| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // to use Extend instead to ensure that only one instance exists | 280 // to use Extend instead to ensure that only one instance exists |
| 281 // that contains the same values. | 281 // that contains the same values. |
| 282 void Set(unsigned value); | 282 void Set(unsigned value); |
| 283 | 283 |
| 284 // The successors are a list of sets that contain the same values | 284 // The successors are a list of sets that contain the same values |
| 285 // as this set and the one more value that is not present in this | 285 // as this set and the one more value that is not present in this |
| 286 // set. | 286 // set. |
| 287 ZoneList<OutSet*>* successors() { return successors_; } | 287 ZoneList<OutSet*>* successors() { return successors_; } |
| 288 | 288 |
| 289 OutSet(uint32_t first, ZoneList<unsigned>* remaining) | 289 OutSet(uint32_t first, ZoneList<unsigned>* remaining) |
| 290 : first_(first), remaining_(remaining) { } | 290 : first_(first), remaining_(remaining), successors_(NULL) { } |
| 291 uint32_t first_; | 291 uint32_t first_; |
| 292 ZoneList<unsigned>* remaining_; | 292 ZoneList<unsigned>* remaining_; |
| 293 ZoneList<OutSet*>* successors_; | 293 ZoneList<OutSet*>* successors_; |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 | 296 |
| 297 // A mapping from integers, specified as ranges, to a set of integers. | 297 // A mapping from integers, specified as ranges, to a set of integers. |
| 298 // Used for mapping character ranges to choices. | 298 // Used for mapping character ranges to choices. |
| 299 class DispatchTable { | 299 class DispatchTable { |
| 300 public: | 300 public: |
| 301 class Entry { | 301 class Entry { |
| 302 public: | 302 public: |
| 303 Entry() | 303 Entry() |
| 304 : from_(0), to_(0) { } | 304 : from_(0), to_(0), out_set_(NULL) { } |
| 305 Entry(uc16 from, uc16 to, OutSet* out_set) | 305 Entry(uc16 from, uc16 to, OutSet* out_set) |
| 306 : from_(from), to_(to), out_set_(out_set) { } | 306 : from_(from), to_(to), out_set_(out_set) { } |
| 307 uc16 from() { return from_; } | 307 uc16 from() { return from_; } |
| 308 uc16 to() { return to_; } | 308 uc16 to() { return to_; } |
| 309 void set_to(uc16 value) { to_ = value; } | 309 void set_to(uc16 value) { to_ = value; } |
| 310 void AddValue(int value) { out_set_ = out_set_->Extend(value); } | 310 void AddValue(int value) { out_set_ = out_set_->Extend(value); } |
| 311 OutSet* out_set() { return out_set_; } | 311 OutSet* out_set() { return out_set_; } |
| 312 private: | 312 private: |
| 313 uc16 from_; | 313 uc16 from_; |
| 314 uc16 to_; | 314 uc16 to_; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 class RegExpEngine: public AllStatic { | 358 class RegExpEngine: public AllStatic { |
| 359 public: | 359 public: |
| 360 static RegExpNode* Compile(RegExpParseResult* input); | 360 static RegExpNode* Compile(RegExpParseResult* input); |
| 361 static void DotPrint(const char* label, RegExpNode* node); | 361 static void DotPrint(const char* label, RegExpNode* node); |
| 362 }; | 362 }; |
| 363 | 363 |
| 364 | 364 |
| 365 } } // namespace v8::internal | 365 } } // namespace v8::internal |
| 366 | 366 |
| 367 #endif // V8_JSREGEXP_H_ | 367 #endif // V8_JSREGEXP_H_ |
| OLD | NEW |