Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Side by Side Diff: src/jsregexp.h

Issue 11350: Add back references. Since "back references" is two words... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 OutSet empty_; 390 OutSet empty_;
391 ZoneSplayTree<Config>* tree() { return &tree_; } 391 ZoneSplayTree<Config>* tree() { return &tree_; }
392 ZoneSplayTree<Config> tree_; 392 ZoneSplayTree<Config> tree_;
393 }; 393 };
394 394
395 395
396 #define FOR_EACH_NODE_TYPE(VISIT) \ 396 #define FOR_EACH_NODE_TYPE(VISIT) \
397 VISIT(End) \ 397 VISIT(End) \
398 VISIT(Action) \ 398 VISIT(Action) \
399 VISIT(Choice) \ 399 VISIT(Choice) \
400 VISIT(Backreference) \ 400 VISIT(BackReference) \
401 VISIT(Text) 401 VISIT(Text)
402 402
403 403
404 #define FOR_EACH_REG_EXP_TREE_TYPE(VISIT) \ 404 #define FOR_EACH_REG_EXP_TREE_TYPE(VISIT) \
405 VISIT(Disjunction) \ 405 VISIT(Disjunction) \
406 VISIT(Alternative) \ 406 VISIT(Alternative) \
407 VISIT(Assertion) \ 407 VISIT(Assertion) \
408 VISIT(CharacterClass) \ 408 VISIT(CharacterClass) \
409 VISIT(Atom) \ 409 VISIT(Atom) \
410 VISIT(Quantifier) \ 410 VISIT(Quantifier) \
411 VISIT(Capture) \ 411 VISIT(Capture) \
412 VISIT(Lookahead) \ 412 VISIT(Lookahead) \
413 VISIT(Backreference) \ 413 VISIT(BackReference) \
414 VISIT(Empty) \ 414 VISIT(Empty) \
415 VISIT(Text) 415 VISIT(Text)
416 416
417 417
418 #define FORWARD_DECLARE(Name) class RegExp##Name; 418 #define FORWARD_DECLARE(Name) class RegExp##Name;
419 FOR_EACH_REG_EXP_TREE_TYPE(FORWARD_DECLARE) 419 FOR_EACH_REG_EXP_TREE_TYPE(FORWARD_DECLARE)
420 #undef FORWARD_DECLARE 420 #undef FORWARD_DECLARE
421 421
422 422
423 class TextElement { 423 class TextElement {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 virtual RegExpNode* PropagateInterest(NodeInfo* info); 594 virtual RegExpNode* PropagateInterest(NodeInfo* info);
595 RegExpNode* on_failure() { return on_failure_; } 595 RegExpNode* on_failure() { return on_failure_; }
596 virtual bool Emit(RegExpCompiler* compiler); 596 virtual bool Emit(RegExpCompiler* compiler);
597 ZoneList<TextElement>* elements() { return elms_; } 597 ZoneList<TextElement>* elements() { return elms_; }
598 private: 598 private:
599 RegExpNode* on_failure_; 599 RegExpNode* on_failure_;
600 ZoneList<TextElement>* elms_; 600 ZoneList<TextElement>* elms_;
601 }; 601 };
602 602
603 603
604 class BackreferenceNode: public SeqRegExpNode { 604 class BackReferenceNode: public SeqRegExpNode {
605 public: 605 public:
606 BackreferenceNode(int start_reg, 606 BackReferenceNode(int start_reg,
607 int end_reg, 607 int end_reg,
608 RegExpNode* on_success, 608 RegExpNode* on_success,
609 RegExpNode* on_failure) 609 RegExpNode* on_failure)
610 : SeqRegExpNode(on_success), 610 : SeqRegExpNode(on_success),
611 on_failure_(on_failure), 611 on_failure_(on_failure),
612 start_reg_(start_reg), 612 start_reg_(start_reg),
613 end_reg_(end_reg) { } 613 end_reg_(end_reg) { }
614 virtual void Accept(NodeVisitor* visitor); 614 virtual void Accept(NodeVisitor* visitor);
615 RegExpNode* on_failure() { return on_failure_; } 615 RegExpNode* on_failure() { return on_failure_; }
616 int start_register() { return start_reg_; } 616 int start_register() { return start_reg_; }
617 int end_register() { return end_reg_; } 617 int end_register() { return end_reg_; }
618 virtual bool Emit(RegExpCompiler* compiler) { return false; } 618 virtual bool Emit(RegExpCompiler* compiler);
619 virtual RegExpNode* PropagateInterest(NodeInfo* info); 619 virtual RegExpNode* PropagateInterest(NodeInfo* info);
620 private: 620 private:
621 RegExpNode* on_failure_; 621 RegExpNode* on_failure_;
622 int start_reg_; 622 int start_reg_;
623 int end_reg_; 623 int end_reg_;
624 }; 624 };
625 625
626 626
627 class EndNode: public RegExpNode { 627 class EndNode: public RegExpNode {
628 public: 628 public:
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 static Handle<FixedArray> Compile(RegExpParseResult* input, 762 static Handle<FixedArray> Compile(RegExpParseResult* input,
763 RegExpNode** node_return, 763 RegExpNode** node_return,
764 bool ignore_case); 764 bool ignore_case);
765 static void DotPrint(const char* label, RegExpNode* node); 765 static void DotPrint(const char* label, RegExpNode* node);
766 }; 766 };
767 767
768 768
769 } } // namespace v8::internal 769 } } // namespace v8::internal
770 770
771 #endif // V8_JSREGEXP_H_ 771 #endif // V8_JSREGEXP_H_
OLDNEW
« no previous file with comments | « src/interpreter-re2k.cc ('k') | src/jsregexp.cc » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698