| OLD | NEW |
| 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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 RegExpNode* on_failure) = 0; | 1218 RegExpNode* on_failure) = 0; |
| 1219 SmartPointer<const char> ToString(); | 1219 SmartPointer<const char> ToString(); |
| 1220 #define MAKE_ASTYPE(Name) virtual RegExp##Name* As##Name(); | 1220 #define MAKE_ASTYPE(Name) virtual RegExp##Name* As##Name(); |
| 1221 FOR_EACH_REG_EXP_NODE_TYPE(MAKE_ASTYPE) | 1221 FOR_EACH_REG_EXP_NODE_TYPE(MAKE_ASTYPE) |
| 1222 #undef MAKE_ASTYPE | 1222 #undef MAKE_ASTYPE |
| 1223 }; | 1223 }; |
| 1224 | 1224 |
| 1225 | 1225 |
| 1226 class RegExpDisjunction: public RegExpTree { | 1226 class RegExpDisjunction: public RegExpTree { |
| 1227 public: | 1227 public: |
| 1228 explicit RegExpDisjunction(ZoneList<RegExpTree*>* nodes) : nodes_(nodes) { } | 1228 explicit RegExpDisjunction(ZoneList<RegExpTree*>* alternatives) |
| 1229 : alternatives_(alternatives) { } |
| 1229 virtual void* Accept(RegExpVisitor* visitor, void* data); | 1230 virtual void* Accept(RegExpVisitor* visitor, void* data); |
| 1230 virtual RegExpNode* ToNode(RegExpCompiler* compiler, | 1231 virtual RegExpNode* ToNode(RegExpCompiler* compiler, |
| 1231 RegExpNode* on_success, | 1232 RegExpNode* on_success, |
| 1232 RegExpNode* on_failure); | 1233 RegExpNode* on_failure); |
| 1233 virtual RegExpDisjunction* AsDisjunction(); | 1234 virtual RegExpDisjunction* AsDisjunction(); |
| 1234 ZoneList<RegExpTree*>* nodes() { return nodes_; } | 1235 ZoneList<RegExpTree*>* alternatives() { return alternatives_; } |
| 1235 private: | 1236 private: |
| 1236 ZoneList<RegExpTree*>* nodes_; | 1237 ZoneList<RegExpTree*>* alternatives_; |
| 1237 }; | 1238 }; |
| 1238 | 1239 |
| 1239 | 1240 |
| 1240 class RegExpAlternative: public RegExpTree { | 1241 class RegExpAlternative: public RegExpTree { |
| 1241 public: | 1242 public: |
| 1242 explicit RegExpAlternative(ZoneList<RegExpTree*>* nodes) : nodes_(nodes) { } | 1243 explicit RegExpAlternative(ZoneList<RegExpTree*>* nodes) : nodes_(nodes) { } |
| 1243 virtual void* Accept(RegExpVisitor* visitor, void* data); | 1244 virtual void* Accept(RegExpVisitor* visitor, void* data); |
| 1244 virtual RegExpNode* ToNode(RegExpCompiler* compiler, | 1245 virtual RegExpNode* ToNode(RegExpCompiler* compiler, |
| 1245 RegExpNode* on_success, | 1246 RegExpNode* on_success, |
| 1246 RegExpNode* on_failure); | 1247 RegExpNode* on_failure); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 #undef DEF_VISIT | 1459 #undef DEF_VISIT |
| 1459 | 1460 |
| 1460 private: | 1461 private: |
| 1461 bool stack_overflow_; | 1462 bool stack_overflow_; |
| 1462 }; | 1463 }; |
| 1463 | 1464 |
| 1464 | 1465 |
| 1465 } } // namespace v8::internal | 1466 } } // namespace v8::internal |
| 1466 | 1467 |
| 1467 #endif // V8_AST_H_ | 1468 #endif // V8_AST_H_ |
| OLD | NEW |