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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 RegExpBuilder(Zone* zone, bool ignore_case, bool unicode); | 102 RegExpBuilder(Zone* zone, bool ignore_case, bool unicode); |
103 void AddCharacter(uc16 character); | 103 void AddCharacter(uc16 character); |
104 void AddUnicodeCharacter(uc32 character); | 104 void AddUnicodeCharacter(uc32 character); |
| 105 void AddEscapedUnicodeCharacter(uc32 character); |
105 // "Adds" an empty expression. Does nothing except consume a | 106 // "Adds" an empty expression. Does nothing except consume a |
106 // following quantifier | 107 // following quantifier |
107 void AddEmpty(); | 108 void AddEmpty(); |
108 void AddCharacterClass(RegExpCharacterClass* cc); | 109 void AddCharacterClass(RegExpCharacterClass* cc); |
109 void AddCharacterClassForDesugaring(uc32 c); | 110 void AddCharacterClassForDesugaring(uc32 c); |
110 void AddAtom(RegExpTree* tree); | 111 void AddAtom(RegExpTree* tree); |
111 void AddTerm(RegExpTree* tree); | 112 void AddTerm(RegExpTree* tree); |
112 void AddAssertion(RegExpTree* tree); | 113 void AddAssertion(RegExpTree* tree); |
113 void NewAlternative(); // '|' | 114 void NewAlternative(); // '|' |
114 bool AddQuantifierToAtom(int min, int max, | 115 bool AddQuantifierToAtom(int min, int max, |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 bool simple_; | 290 bool simple_; |
290 bool contains_anchor_; | 291 bool contains_anchor_; |
291 bool is_scanned_for_captures_; | 292 bool is_scanned_for_captures_; |
292 bool failed_; | 293 bool failed_; |
293 }; | 294 }; |
294 | 295 |
295 } // namespace internal | 296 } // namespace internal |
296 } // namespace v8 | 297 } // namespace v8 |
297 | 298 |
298 #endif // V8_REGEXP_REGEXP_PARSER_H_ | 299 #endif // V8_REGEXP_REGEXP_PARSER_H_ |
OLD | NEW |