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

Side by Side Diff: src/jsregexp.h

Issue 11319: * Add support for positive lookahead assertions and negative... (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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 RegExpNode* on_success_; 536 RegExpNode* on_success_;
537 }; 537 };
538 538
539 539
540 class ActionNode: public SeqRegExpNode { 540 class ActionNode: public SeqRegExpNode {
541 public: 541 public:
542 enum Type { 542 enum Type {
543 STORE_REGISTER, 543 STORE_REGISTER,
544 INCREMENT_REGISTER, 544 INCREMENT_REGISTER,
545 STORE_POSITION, 545 STORE_POSITION,
546 SAVE_POSITION,
546 RESTORE_POSITION, 547 RESTORE_POSITION,
547 BEGIN_SUBMATCH, 548 BEGIN_SUBMATCH,
548 ESCAPE_SUBMATCH, 549 ESCAPE_SUBMATCH
549 END_SUBMATCH
550 }; 550 };
551 static ActionNode* StoreRegister(int reg, int val, RegExpNode* on_success); 551 static ActionNode* StoreRegister(int reg, int val, RegExpNode* on_success);
552 static ActionNode* IncrementRegister(int reg, RegExpNode* on_success); 552 static ActionNode* IncrementRegister(int reg, RegExpNode* on_success);
553 static ActionNode* StorePosition(int reg, RegExpNode* on_success); 553 static ActionNode* StorePosition(int reg, RegExpNode* on_success);
554 static ActionNode* SavePosition(int reg, RegExpNode* on_success);
554 static ActionNode* RestorePosition(int reg, RegExpNode* on_success); 555 static ActionNode* RestorePosition(int reg, RegExpNode* on_success);
555 static ActionNode* BeginSubmatch(RegExpNode* on_success); 556 static ActionNode* BeginSubmatch(int reg, RegExpNode* on_success);
556 static ActionNode* EscapeSubmatch(RegExpNode* on_success); 557 static ActionNode* EscapeSubmatch(int reg, RegExpNode* on_success);
557 static ActionNode* EndSubmatch(RegExpNode* on_success);
558 virtual void Accept(NodeVisitor* visitor); 558 virtual void Accept(NodeVisitor* visitor);
559 virtual bool Emit(RegExpCompiler* compiler); 559 virtual bool Emit(RegExpCompiler* compiler);
560 virtual RegExpNode* PropagateInterest(NodeInfo* info); 560 virtual RegExpNode* PropagateInterest(NodeInfo* info);
561 private: 561 private:
562 union { 562 union {
563 struct { 563 struct {
564 int reg; 564 int reg;
565 int value; 565 int value;
566 } u_store_register; 566 } u_store_register;
567 struct { 567 struct {
568 int reg; 568 int reg;
569 } u_increment_register; 569 } u_increment_register;
570 struct { 570 struct {
571 int reg; 571 int reg;
572 } u_position_register; 572 } u_position_register;
573 struct {
574 int reg;
575 } u_submatch_stack_pointer_register;
573 } data_; 576 } data_;
574 ActionNode(Type type, RegExpNode* on_success) 577 ActionNode(Type type, RegExpNode* on_success)
575 : SeqRegExpNode(on_success), 578 : SeqRegExpNode(on_success),
576 type_(type) { } 579 type_(type) { }
577 Type type_; 580 Type type_;
578 friend class DotPrinter; 581 friend class DotPrinter;
579 }; 582 };
580 583
581 584
582 class TextNode: public SeqRegExpNode { 585 class TextNode: public SeqRegExpNode {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 static Handle<FixedArray> Compile(RegExpParseResult* input, 762 static Handle<FixedArray> Compile(RegExpParseResult* input,
760 RegExpNode** node_return, 763 RegExpNode** node_return,
761 bool ignore_case); 764 bool ignore_case);
762 static void DotPrint(const char* label, RegExpNode* node); 765 static void DotPrint(const char* label, RegExpNode* node);
763 }; 766 };
764 767
765 768
766 } } // namespace v8::internal 769 } } // namespace v8::internal
767 770
768 #endif // V8_JSREGEXP_H_ 771 #endif // V8_JSREGEXP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698