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

Unified Diff: src/ast.h

Issue 18096: Experimental: merge from bleeding_edge. Merge up to and including... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/assembler-ia32-inl.h ('k') | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
===================================================================
--- src/ast.h (revision 1085)
+++ src/ast.h (working copy)
@@ -1220,6 +1220,16 @@
// Regular expressions
+class RegExpVisitor BASE_EMBEDDED {
+ public:
+ virtual ~RegExpVisitor() { }
+#define MAKE_CASE(Name) \
+ virtual void* Visit##Name(RegExp##Name*, void* data) = 0;
+ FOR_EACH_REG_EXP_TREE_TYPE(MAKE_CASE)
+#undef MAKE_CASE
+};
+
+
class RegExpTree: public ZoneObject {
public:
static const int kInfinity = kMaxInt;
@@ -1230,6 +1240,9 @@
virtual bool IsTextElement() { return false; }
virtual int min_match() = 0;
virtual int max_match() = 0;
+ // Returns the interval of registers used for captures within this
+ // expression.
+ virtual Interval CaptureRegisters() { return Interval::Empty(); }
virtual void AppendToText(RegExpText* text);
SmartPointer<const char> ToString();
#define MAKE_ASTYPE(Name) \
@@ -1247,6 +1260,7 @@
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpDisjunction* AsDisjunction();
+ virtual Interval CaptureRegisters();
virtual bool IsDisjunction();
virtual int min_match() { return min_match_; }
virtual int max_match() { return max_match_; }
@@ -1265,6 +1279,7 @@
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpAlternative* AsAlternative();
+ virtual Interval CaptureRegisters();
virtual bool IsAlternative();
virtual int min_match() { return min_match_; }
virtual int max_match() { return max_match_; }
@@ -1429,6 +1444,7 @@
RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpQuantifier* AsQuantifier();
+ virtual Interval CaptureRegisters();
virtual bool IsQuantifier();
virtual int min_match() { return min_match_; }
virtual int max_match() { return max_match_; }
@@ -1464,6 +1480,7 @@
RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpCapture* AsCapture();
+ virtual Interval CaptureRegisters();
virtual bool IsCapture();
virtual int min_match() { return body_->min_match(); }
virtual int max_match() { return body_->max_match(); }
@@ -1491,6 +1508,7 @@
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpLookahead* AsLookahead();
+ virtual Interval CaptureRegisters();
virtual bool IsLookahead();
virtual int min_match() { return 0; }
virtual int max_match() { return 0; }
@@ -1511,7 +1529,7 @@
RegExpNode* on_success);
virtual RegExpBackReference* AsBackReference();
virtual bool IsBackReference();
- virtual int min_match() { return capture_->min_match(); }
+ virtual int min_match() { return 0; }
virtual int max_match() { return capture_->max_match(); }
int index() { return capture_->index(); }
RegExpCapture* capture() { return capture_; }
@@ -1536,16 +1554,6 @@
};
-class RegExpVisitor BASE_EMBEDDED {
- public:
- virtual ~RegExpVisitor() { }
-#define MAKE_CASE(Name) \
- virtual void* Visit##Name(RegExp##Name*, void* data) = 0;
- FOR_EACH_REG_EXP_TREE_TYPE(MAKE_CASE)
-#undef MAKE_CASE
-};
-
-
// ----------------------------------------------------------------------------
// Basic visitor
// - leaf node visitors are abstract.
« no previous file with comments | « src/assembler-ia32-inl.h ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698