| Index: regexp2000/src/ast.h
|
| diff --git a/regexp2000/src/ast.h b/regexp2000/src/ast.h
|
| index 00004791153fd48ed84085d2514dd620f3295dac..ef372574d4f7fc883b3b7c2203af6254a82bbfc3 100644
|
| --- a/regexp2000/src/ast.h
|
| +++ b/regexp2000/src/ast.h
|
| @@ -1209,6 +1209,9 @@ class RegExpTree: public ZoneObject {
|
| virtual ~RegExpTree() { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data) = 0;
|
| SmartPointer<char> ToString();
|
| +#define MAKE_ASTYPE(Name) virtual RegExp##Name* As##Name();
|
| + FOR_EACH_REG_EXP_NODE_TYPE(MAKE_ASTYPE)
|
| +#undef MAKE_ASTYPE
|
| };
|
|
|
|
|
| @@ -1216,6 +1219,7 @@ class RegExpDisjunction: public RegExpTree {
|
| public:
|
| explicit RegExpDisjunction(ZoneList<RegExpTree*>* nodes) : nodes_(nodes) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpDisjunction* AsDisjunction();
|
| ZoneList<RegExpTree*>* nodes() { return nodes_; }
|
| private:
|
| ZoneList<RegExpTree*>* nodes_;
|
| @@ -1226,6 +1230,7 @@ class RegExpAlternative: public RegExpTree {
|
| public:
|
| explicit RegExpAlternative(ZoneList<RegExpTree*>* nodes) : nodes_(nodes) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpAlternative* AsAlternative();
|
| ZoneList<RegExpTree*>* nodes() { return nodes_; }
|
| private:
|
| ZoneList<RegExpTree*>* nodes_;
|
| @@ -1240,6 +1245,7 @@ class RegExpAssertion: public RegExpTree {
|
| };
|
| explicit RegExpAssertion(Type type) : type_(type) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpAssertion* AsAssertion();
|
| Type type() { return type_; }
|
| private:
|
| Type type_;
|
| @@ -1292,6 +1298,7 @@ class RegExpCharacterClass: public RegExpTree {
|
| : ranges_(ranges),
|
| is_negated_(is_negated) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpCharacterClass* AsCharacterClass();
|
| ZoneList<CharacterRange>* ranges() { return ranges_; }
|
| bool is_negated() { return is_negated_; }
|
| private:
|
| @@ -1304,6 +1311,7 @@ class RegExpAtom: public RegExpTree {
|
| public:
|
| explicit RegExpAtom(Vector<const uc16> data) : data_(data) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpAtom* AsAtom();
|
| Vector<const uc16> data() { return data_; }
|
| private:
|
| Vector<const uc16> data_;
|
| @@ -1318,6 +1326,7 @@ class RegExpQuantifier: public RegExpTree {
|
| is_greedy_(is_greedy),
|
| body_(body) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpQuantifier* AsQuantifier();
|
| int min() { return min_; }
|
| int max() { return max_; }
|
| bool is_greedy() { return is_greedy_; }
|
| @@ -1338,6 +1347,7 @@ class RegExpCapture: public RegExpTree {
|
| explicit RegExpCapture(RegExpTree* body)
|
| : body_(body) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpCapture* AsCapture();
|
| RegExpTree* body() { return body_; }
|
| private:
|
| RegExpTree* body_;
|
| @@ -1350,6 +1360,7 @@ class RegExpLookahead: public RegExpTree {
|
| : body_(body),
|
| is_positive_(is_positive) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpLookahead* AsLookahead();
|
| RegExpTree* body() { return body_; }
|
| bool is_positive() { return is_positive_; }
|
| private:
|
| @@ -1362,6 +1373,7 @@ class RegExpBackreference: public RegExpTree {
|
| public:
|
| explicit RegExpBackreference(int index) : index_(index) { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpBackreference* AsBackreference();
|
| int index() { return index_; }
|
| private:
|
| int index_;
|
| @@ -1372,6 +1384,7 @@ class RegExpEmpty: public RegExpTree {
|
| public:
|
| RegExpEmpty() { }
|
| virtual void* Accept(RegExpVisitor* visitor, void* data);
|
| + virtual RegExpEmpty* AsEmpty();
|
| static RegExpEmpty* GetInstance() { return &kInstance; }
|
| private:
|
| static RegExpEmpty kInstance;
|
|
|