OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_REGEXP_REGEXP_PARSER_H_ | 5 #ifndef V8_REGEXP_REGEXP_PARSER_H_ |
6 #define V8_REGEXP_REGEXP_PARSER_H_ | 6 #define V8_REGEXP_REGEXP_PARSER_H_ |
7 | 7 |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 #include "src/regexp/regexp-ast.h" | 9 #include "src/regexp/regexp-ast.h" |
10 #include "src/zone.h" | 10 #include "src/zone.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 ZoneList<T*>* list_; | 94 ZoneList<T*>* list_; |
95 T* last_; | 95 T* last_; |
96 }; | 96 }; |
97 | 97 |
98 | 98 |
99 // Accumulates RegExp atoms and assertions into lists of terms and alternatives. | 99 // Accumulates RegExp atoms and assertions into lists of terms and alternatives. |
100 class RegExpBuilder : public ZoneObject { | 100 class RegExpBuilder : public ZoneObject { |
101 public: | 101 public: |
102 explicit RegExpBuilder(Zone* zone); | 102 explicit RegExpBuilder(Zone* zone); |
103 void AddCharacter(uc16 character); | 103 void AddCharacter(uc16 character); |
| 104 void AddUnicodeCharacter(uc32 character); |
104 // "Adds" an empty expression. Does nothing except consume a | 105 // "Adds" an empty expression. Does nothing except consume a |
105 // following quantifier | 106 // following quantifier |
106 void AddEmpty(); | 107 void AddEmpty(); |
107 void AddAtom(RegExpTree* tree); | 108 void AddAtom(RegExpTree* tree); |
108 void AddAssertion(RegExpTree* tree); | 109 void AddAssertion(RegExpTree* tree); |
109 void NewAlternative(); // '|' | 110 void NewAlternative(); // '|' |
110 void AddQuantifierToAtom(int min, int max, | 111 void AddQuantifierToAtom(int min, int max, |
111 RegExpQuantifier::QuantifierType type); | 112 RegExpQuantifier::QuantifierType type); |
112 RegExpTree* ToRegExp(); | 113 RegExpTree* ToRegExp(); |
113 | 114 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 bool simple_; | 268 bool simple_; |
268 bool contains_anchor_; | 269 bool contains_anchor_; |
269 bool is_scanned_for_captures_; | 270 bool is_scanned_for_captures_; |
270 bool failed_; | 271 bool failed_; |
271 }; | 272 }; |
272 | 273 |
273 } // namespace internal | 274 } // namespace internal |
274 } // namespace v8 | 275 } // namespace v8 |
275 | 276 |
276 #endif // V8_REGEXP_REGEXP_PARSER_H_ | 277 #endif // V8_REGEXP_REGEXP_PARSER_H_ |
OLD | NEW |