OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2116 class RegExpEmpty: public RegExpTree { | 2116 class RegExpEmpty: public RegExpTree { |
2117 public: | 2117 public: |
2118 RegExpEmpty() { } | 2118 RegExpEmpty() { } |
2119 virtual void* Accept(RegExpVisitor* visitor, void* data); | 2119 virtual void* Accept(RegExpVisitor* visitor, void* data); |
2120 virtual RegExpNode* ToNode(RegExpCompiler* compiler, | 2120 virtual RegExpNode* ToNode(RegExpCompiler* compiler, |
2121 RegExpNode* on_success); | 2121 RegExpNode* on_success); |
2122 virtual RegExpEmpty* AsEmpty(); | 2122 virtual RegExpEmpty* AsEmpty(); |
2123 virtual bool IsEmpty(); | 2123 virtual bool IsEmpty(); |
2124 virtual int min_match() { return 0; } | 2124 virtual int min_match() { return 0; } |
2125 virtual int max_match() { return 0; } | 2125 virtual int max_match() { return 0; } |
2126 static RegExpEmpty* GetInstance() { return &kInstance; } | 2126 static RegExpEmpty* GetInstance() { |
2127 private: | 2127 static RegExpEmpty* instance = ::new RegExpEmpty(); |
2128 static RegExpEmpty kInstance; | 2128 return instance; |
| 2129 } |
2129 }; | 2130 }; |
2130 | 2131 |
2131 | 2132 |
2132 // ---------------------------------------------------------------------------- | 2133 // ---------------------------------------------------------------------------- |
2133 // Basic visitor | 2134 // Basic visitor |
2134 // - leaf node visitors are abstract. | 2135 // - leaf node visitors are abstract. |
2135 | 2136 |
2136 class AstVisitor BASE_EMBEDDED { | 2137 class AstVisitor BASE_EMBEDDED { |
2137 public: | 2138 public: |
2138 AstVisitor() : isolate_(Isolate::Current()), stack_overflow_(false) { } | 2139 AstVisitor() : isolate_(Isolate::Current()), stack_overflow_(false) { } |
(...skipping 28 matching lines...) Expand all Loading... |
2167 | 2168 |
2168 private: | 2169 private: |
2169 Isolate* isolate_; | 2170 Isolate* isolate_; |
2170 bool stack_overflow_; | 2171 bool stack_overflow_; |
2171 }; | 2172 }; |
2172 | 2173 |
2173 | 2174 |
2174 } } // namespace v8::internal | 2175 } } // namespace v8::internal |
2175 | 2176 |
2176 #endif // V8_AST_H_ | 2177 #endif // V8_AST_H_ |
OLD | NEW |