| 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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 : min_(min), | 1291 : min_(min), |
| 1292 max_(max), | 1292 max_(max), |
| 1293 is_greedy_(is_greedy), | 1293 is_greedy_(is_greedy), |
| 1294 body_(body) { } | 1294 body_(body) { } |
| 1295 virtual void* Accept(RegExpVisitor* visitor, void* data); | 1295 virtual void* Accept(RegExpVisitor* visitor, void* data); |
| 1296 virtual RegExpQuantifier* AsQuantifier(); | 1296 virtual RegExpQuantifier* AsQuantifier(); |
| 1297 int min() { return min_; } | 1297 int min() { return min_; } |
| 1298 int max() { return max_; } | 1298 int max() { return max_; } |
| 1299 bool is_greedy() { return is_greedy_; } | 1299 bool is_greedy() { return is_greedy_; } |
| 1300 RegExpTree* body() { return body_; } | 1300 RegExpTree* body() { return body_; } |
| 1301 // We just use a very large integer value as infinity because 1^31 | 1301 // We just use a very large integer value as infinity because 2^30 |
| 1302 // is infinite in practice. | 1302 // is infinite in practice. |
| 1303 static const int kInfinity = (1 << 31); | 1303 static const int kInfinity = (1 << 30); |
| 1304 private: | 1304 private: |
| 1305 int min_; | 1305 int min_; |
| 1306 int max_; | 1306 int max_; |
| 1307 bool is_greedy_; | 1307 bool is_greedy_; |
| 1308 RegExpTree* body_; | 1308 RegExpTree* body_; |
| 1309 }; | 1309 }; |
| 1310 | 1310 |
| 1311 | 1311 |
| 1312 class RegExpCapture: public RegExpTree { | 1312 class RegExpCapture: public RegExpTree { |
| 1313 public: | 1313 public: |
| 1314 explicit RegExpCapture(RegExpTree* body) | 1314 explicit RegExpCapture(RegExpTree* body, int index) |
| 1315 : body_(body) { } | 1315 : body_(body), index_(index) { } |
| 1316 virtual void* Accept(RegExpVisitor* visitor, void* data); | 1316 virtual void* Accept(RegExpVisitor* visitor, void* data); |
| 1317 virtual RegExpCapture* AsCapture(); | 1317 virtual RegExpCapture* AsCapture(); |
| 1318 RegExpTree* body() { return body_; } | 1318 RegExpTree* body() { return body_; } |
| 1319 int index() { return index_; } |
| 1319 private: | 1320 private: |
| 1320 RegExpTree* body_; | 1321 RegExpTree* body_; |
| 1322 int index_; |
| 1321 }; | 1323 }; |
| 1322 | 1324 |
| 1323 | 1325 |
| 1324 class RegExpLookahead: public RegExpTree { | 1326 class RegExpLookahead: public RegExpTree { |
| 1325 public: | 1327 public: |
| 1326 RegExpLookahead(RegExpTree* body, bool is_positive) | 1328 RegExpLookahead(RegExpTree* body, bool is_positive) |
| 1327 : body_(body), | 1329 : body_(body), |
| 1328 is_positive_(is_positive) { } | 1330 is_positive_(is_positive) { } |
| 1329 virtual void* Accept(RegExpVisitor* visitor, void* data); | 1331 virtual void* Accept(RegExpVisitor* visitor, void* data); |
| 1330 virtual RegExpLookahead* AsLookahead(); | 1332 virtual RegExpLookahead* AsLookahead(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 #undef DEF_VISIT | 1408 #undef DEF_VISIT |
| 1407 | 1409 |
| 1408 private: | 1410 private: |
| 1409 bool stack_overflow_; | 1411 bool stack_overflow_; |
| 1410 }; | 1412 }; |
| 1411 | 1413 |
| 1412 | 1414 |
| 1413 } } // namespace v8::internal | 1415 } } // namespace v8::internal |
| 1414 | 1416 |
| 1415 #endif // V8_AST_H_ | 1417 #endif // V8_AST_H_ |
| OLD | NEW |