Chromium Code Reviews| 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 | 397 |
| 398 | 398 |
| 399 class RegExpNode: public ZoneObject { | 399 class RegExpNode: public ZoneObject { |
| 400 public: | 400 public: |
| 401 virtual ~RegExpNode() { } | 401 virtual ~RegExpNode() { } |
| 402 virtual void Accept(NodeVisitor* visitor) = 0; | 402 virtual void Accept(NodeVisitor* visitor) = 0; |
| 403 // Generates a goto to this node or actually generates the code at this point. | 403 // Generates a goto to this node or actually generates the code at this point. |
| 404 // Until the implementation is complete we will return true for success and | 404 // Until the implementation is complete we will return true for success and |
| 405 // false for failure. | 405 // false for failure. |
| 406 bool GoTo(RegExpCompiler* compiler); | 406 bool GoTo(RegExpCompiler* compiler); |
| 407 void EmitAddress(RegExpCompiler* compiler); | 407 Label* GetLabel(); |
|
Christian Plesner Hansen
2008/11/14 13:28:34
Since this is a simple accessor you could just cal
| |
| 408 // Until the implementation is complete we will return true for success and | 408 // Until the implementation is complete we will return true for success and |
| 409 // false for failure. | 409 // false for failure. |
| 410 virtual bool Emit(RegExpCompiler* compiler) = 0; | 410 virtual bool Emit(RegExpCompiler* compiler) = 0; |
| 411 private: | 411 private: |
| 412 Label label; | 412 Label label; |
| 413 }; | 413 }; |
| 414 | 414 |
| 415 | 415 |
| 416 class SeqRegExpNode: public RegExpNode { | 416 class SeqRegExpNode: public RegExpNode { |
| 417 public: | 417 public: |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 582 visited_(false) { } | 582 visited_(false) { } |
| 583 virtual void Accept(NodeVisitor* visitor); | 583 virtual void Accept(NodeVisitor* visitor); |
| 584 void AddChild(GuardedAlternative node) { choices()->Add(node); } | 584 void AddChild(GuardedAlternative node) { choices()->Add(node); } |
| 585 ZoneList<GuardedAlternative>* choices() { return choices_; } | 585 ZoneList<GuardedAlternative>* choices() { return choices_; } |
| 586 DispatchTable* table() { return &table_; } | 586 DispatchTable* table() { return &table_; } |
| 587 RegExpNode* on_failure() { return on_failure_; } | 587 RegExpNode* on_failure() { return on_failure_; } |
| 588 virtual bool Emit(RegExpCompiler* compiler); | 588 virtual bool Emit(RegExpCompiler* compiler); |
| 589 bool visited() { return visited_; } | 589 bool visited() { return visited_; } |
| 590 void set_visited(bool value) { visited_ = value; } | 590 void set_visited(bool value) { visited_ = value; } |
| 591 private: | 591 private: |
| 592 void GenerateGuard(RegExpCompiler* compiler, | |
| 593 Guard *guard, | |
| 594 Label* on_failure); | |
| 592 RegExpNode* on_failure_; | 595 RegExpNode* on_failure_; |
| 593 ZoneList<GuardedAlternative>* choices_; | 596 ZoneList<GuardedAlternative>* choices_; |
| 594 DispatchTable table_; | 597 DispatchTable table_; |
| 595 bool visited_; | 598 bool visited_; |
| 596 }; | 599 }; |
| 597 | 600 |
| 598 | 601 |
| 599 struct RegExpParseResult { | 602 struct RegExpParseResult { |
| 600 RegExpTree* tree; | 603 RegExpTree* tree; |
| 601 bool has_character_escapes; | 604 bool has_character_escapes; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 612 static void DotPrint(const char* label, RegExpNode* node); | 615 static void DotPrint(const char* label, RegExpNode* node); |
| 613 }; | 616 }; |
| 614 | 617 |
| 615 | 618 |
| 616 class RegExpCompiler; | 619 class RegExpCompiler; |
| 617 | 620 |
| 618 | 621 |
| 619 } } // namespace v8::internal | 622 } } // namespace v8::internal |
| 620 | 623 |
| 621 #endif // V8_JSREGEXP_H_ | 624 #endif // V8_JSREGEXP_H_ |
| OLD | NEW |