Flutter Engine
The Flutter Engine
regexp_ast.h
Go to the documentation of this file.
1// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_REGEXP_AST_H_
6#define RUNTIME_VM_REGEXP_AST_H_
7
8#include "platform/globals.h"
9#include "platform/utils.h"
10#include "vm/allocation.h"
11#include "vm/regexp.h"
12
13namespace dart {
14
15class RegExpAlternative;
16class RegExpAssertion;
17class RegExpAtom;
18class RegExpBackReference;
19class RegExpCapture;
20class RegExpCharacterClass;
21class RegExpCompiler;
22class RegExpDisjunction;
23class RegExpEmpty;
24class RegExpLookaround;
25class RegExpQuantifier;
26class RegExpText;
27
28class RegExpVisitor : public ValueObject {
29 public:
30 virtual ~RegExpVisitor() {}
31#define MAKE_CASE(Name) \
32 virtual void* Visit##Name(RegExp##Name*, void* data) = 0;
34#undef MAKE_CASE
35};
36
37class RegExpTree : public ZoneAllocated {
38 public:
39 static constexpr intptr_t kInfinity = kMaxInt32;
40 virtual ~RegExpTree() {}
41 virtual void* Accept(RegExpVisitor* visitor, void* data) = 0;
43 RegExpNode* on_success) = 0;
44 virtual bool IsTextElement() const { return false; }
45 virtual bool IsAnchoredAtStart() const { return false; }
46 virtual bool IsAnchoredAtEnd() const { return false; }
47 virtual intptr_t min_match() const = 0;
48 virtual intptr_t max_match() const = 0;
49 // Returns the interval of registers used for captures within this
50 // expression.
51 virtual Interval CaptureRegisters() const { return Interval::Empty(); }
52 virtual void AppendToText(RegExpText* text);
53 void Print();
54#define MAKE_ASTYPE(Name) \
55 virtual RegExp##Name* As##Name(); \
56 virtual bool Is##Name() const;
58#undef MAKE_ASTYPE
59};
60
62 public:
64 virtual void* Accept(RegExpVisitor* visitor, void* data);
65 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
67 virtual Interval CaptureRegisters() const;
68 virtual bool IsDisjunction() const;
69 virtual bool IsAnchoredAtStart() const;
70 virtual bool IsAnchoredAtEnd() const;
71 virtual intptr_t min_match() const { return min_match_; }
72 virtual intptr_t max_match() const { return max_match_; }
73 ZoneGrowableArray<RegExpTree*>* alternatives() const { return alternatives_; }
74
75 private:
76 ZoneGrowableArray<RegExpTree*>* alternatives_;
77 intptr_t min_match_;
78 intptr_t max_match_;
79};
80
82 public:
84 virtual void* Accept(RegExpVisitor* visitor, void* data);
85 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
87 virtual Interval CaptureRegisters() const;
88 virtual bool IsAlternative() const;
89 virtual bool IsAnchoredAtStart() const;
90 virtual bool IsAnchoredAtEnd() const;
91 virtual intptr_t min_match() const { return min_match_; }
92 virtual intptr_t max_match() const { return max_match_; }
93 ZoneGrowableArray<RegExpTree*>* nodes() const { return nodes_; }
94
95 private:
97 intptr_t min_match_;
98 intptr_t max_match_;
99};
100
102 public:
110 };
112 : assertion_type_(type), flags_(flags) {}
113 virtual void* Accept(RegExpVisitor* visitor, void* data);
114 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
116 virtual bool IsAssertion() const;
117 virtual bool IsAnchoredAtStart() const;
118 virtual bool IsAnchoredAtEnd() const;
119 virtual intptr_t min_match() const { return 0; }
120 virtual intptr_t max_match() const { return 0; }
121 AssertionType assertion_type() const { return assertion_type_; }
122
123 private:
124 AssertionType assertion_type_;
125 RegExpFlags flags_;
126};
127
128class CharacterSet : public ValueObject {
129 public:
131 : ranges_(nullptr), standard_set_type_(standard_set_type) {}
133 : ranges_(ranges), standard_set_type_(0) {}
135 : ValueObject(),
136 ranges_(that.ranges_),
137 standard_set_type_(that.standard_set_type_) {}
139 uint16_t standard_set_type() const { return standard_set_type_; }
140 void set_standard_set_type(uint16_t special_set_type) {
141 standard_set_type_ = special_set_type;
142 }
143 bool is_standard() { return standard_set_type_ != 0; }
144 void Canonicalize();
145
146 private:
148 // If non-zero, the value represents a standard set (e.g., all whitespace
149 // characters) without having to expand the ranges.
150 uint16_t standard_set_type_;
151};
152
154 public:
155 enum Flag {
156 // The character class is negated and should match everything but the
157 // specified ranges.
158 NEGATED = 1 << 0,
159 // The character class contains part of a split surrogate and should not
160 // be unicode-desugared.
162 };
163 using CharacterClassFlags = intptr_t;
164 static inline CharacterClassFlags DefaultFlags() { return 0; }
165
169 CharacterClassFlags character_class_flags = DefaultFlags())
170 : set_(ranges),
171 flags_(flags),
172 character_class_flags_(character_class_flags) {
173 // Convert the empty set of ranges to the negated Everything() range.
174 if (ranges->is_empty()) {
176 character_class_flags_ ^= NEGATED;
177 }
178 }
180 : set_(type), flags_(flags), character_class_flags_(0) {}
181 virtual void* Accept(RegExpVisitor* visitor, void* data);
182 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
184 virtual bool IsCharacterClass() const;
185 virtual bool IsTextElement() const { return true; }
186 virtual intptr_t min_match() const { return 1; }
187 // The character class may match two code units for unicode regexps.
188 virtual intptr_t max_match() const { return 2; }
189 virtual void AppendToText(RegExpText* text);
190 CharacterSet character_set() const { return set_; }
191 // TODO(lrn): Remove need for complex version if is_standard that
192 // recognizes a mangled standard set and just do { return set_.is_special(); }
193 bool is_standard();
194 // Returns a value representing the standard character set if is_standard()
195 // returns true.
196 // Currently used values are:
197 // s : unicode whitespace
198 // S : unicode non-whitespace
199 // w : ASCII word character (digit, letter, underscore)
200 // W : non-ASCII word character
201 // d : ASCII digit
202 // D : non-ASCII digit
203 // . : non-unicode non-newline
204 // * : All characters
205 uint16_t standard_type() const { return set_.standard_set_type(); }
207 bool is_negated() const { return (character_class_flags_ & NEGATED) != 0; }
208 RegExpFlags flags() const { return flags_; }
210 return (character_class_flags_ & CONTAINS_SPLIT_SURROGATE) != 0;
211 }
212
213 private:
214 CharacterSet set_;
215 RegExpFlags flags_;
216 CharacterClassFlags character_class_flags_;
217};
218
219class RegExpAtom : public RegExpTree {
220 public:
222 : data_(data), flags_(flags) {}
223 virtual void* Accept(RegExpVisitor* visitor, void* data);
224 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
225 virtual RegExpAtom* AsAtom();
226 virtual bool IsAtom() const;
227 virtual bool IsTextElement() const { return true; }
228 virtual intptr_t min_match() const { return data_->length(); }
229 virtual intptr_t max_match() const { return data_->length(); }
230 virtual void AppendToText(RegExpText* text);
231 ZoneGrowableArray<uint16_t>* data() const { return data_; }
232 intptr_t length() const { return data_->length(); }
233 RegExpFlags flags() const { return flags_; }
234 bool ignore_case() const { return flags_.IgnoreCase(); }
235
236 private:
238 const RegExpFlags flags_;
239};
240
241class RegExpText : public RegExpTree {
242 public:
243 RegExpText() : elements_(2), length_(0) {}
244 virtual void* Accept(RegExpVisitor* visitor, void* data);
245 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
246 virtual RegExpText* AsText();
247 virtual bool IsText() const;
248 virtual bool IsTextElement() const { return true; }
249 virtual intptr_t min_match() const { return length_; }
250 virtual intptr_t max_match() const { return length_; }
251 virtual void AppendToText(RegExpText* text);
253 elements_.Add(elm);
254 length_ += elm.length();
255 }
256 GrowableArray<TextElement>* elements() { return &elements_; }
257
258 private:
260 intptr_t length_;
261};
262
264 public:
267 intptr_t max,
270 : body_(body),
271 min_(min),
272 max_(max),
273 min_match_(min * body->min_match()),
274 quantifier_type_(type) {
275 if (max > 0 && body->max_match() > kInfinity / max) {
276 max_match_ = kInfinity;
277 } else {
278 max_match_ = max * body->max_match();
279 }
280 }
281 virtual void* Accept(RegExpVisitor* visitor, void* data);
282 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
283 static RegExpNode* ToNode(intptr_t min,
284 intptr_t max,
285 bool is_greedy,
288 RegExpNode* on_success,
289 bool not_at_start = false);
291 virtual Interval CaptureRegisters() const;
292 virtual bool IsQuantifier() const;
293 virtual intptr_t min_match() const { return min_match_; }
294 virtual intptr_t max_match() const { return max_match_; }
295 intptr_t min() const { return min_; }
296 intptr_t max() const { return max_; }
297 bool is_possessive() const { return quantifier_type_ == POSSESSIVE; }
298 bool is_non_greedy() const { return quantifier_type_ == NON_GREEDY; }
299 bool is_greedy() const { return quantifier_type_ == GREEDY; }
300 RegExpTree* body() const { return body_; }
301
302 private:
303 RegExpTree* body_;
304 intptr_t min_;
305 intptr_t max_;
306 intptr_t min_match_;
307 intptr_t max_match_;
308 QuantifierType quantifier_type_;
309};
310
311class RegExpCapture : public RegExpTree {
312 public:
313 explicit RegExpCapture(intptr_t index)
314 : body_(nullptr), index_(index), name_(nullptr) {}
315 virtual void* Accept(RegExpVisitor* visitor, void* data);
316 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
318 intptr_t index,
320 RegExpNode* on_success);
322 virtual bool IsAnchoredAtStart() const;
323 virtual bool IsAnchoredAtEnd() const;
324 virtual Interval CaptureRegisters() const;
325 virtual bool IsCapture() const;
326 virtual intptr_t min_match() const { return body_->min_match(); }
327 virtual intptr_t max_match() const { return body_->max_match(); }
328 RegExpTree* body() const { return body_; }
329 // When a backreference is parsed before the corresponding capture group,
330 // which can happen because of lookbehind, we create the capture object when
331 // we create the backreference, and fill in the body later when the actual
332 // capture group is parsed.
333 void set_body(RegExpTree* body) { body_ = body; }
334 intptr_t index() const { return index_; }
335 const ZoneGrowableArray<uint16_t>* name() { return name_; }
337 static intptr_t StartRegister(intptr_t index) { return index * 2; }
338 static intptr_t EndRegister(intptr_t index) { return index * 2 + 1; }
339
340 private:
341 RegExpTree* body_;
342 intptr_t index_;
343 const ZoneGrowableArray<uint16_t>* name_;
344};
345
347 public:
350 bool is_positive,
351 intptr_t capture_count,
352 intptr_t capture_from,
353 Type type)
354 : body_(body),
355 is_positive_(is_positive),
356 capture_count_(capture_count),
357 capture_from_(capture_from),
358 type_(type) {}
359
360 virtual void* Accept(RegExpVisitor* visitor, void* data);
361 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
363 virtual Interval CaptureRegisters() const;
364 virtual bool IsLookaround() const;
365 virtual bool IsAnchoredAtStart() const;
366 virtual intptr_t min_match() const { return 0; }
367 virtual intptr_t max_match() const { return 0; }
368 RegExpTree* body() const { return body_; }
369 bool is_positive() const { return is_positive_; }
370 intptr_t capture_count() const { return capture_count_; }
371 intptr_t capture_from() const { return capture_from_; }
372 Type type() const { return type_; }
373
374 // The RegExpLookaround::Builder class abstracts out the process of building
375 // the compiling a RegExpLookaround object by splitting it into two phases,
376 // represented by the provided methods.
377 class Builder : public ValueObject {
378 public:
379 Builder(bool is_positive,
380 RegExpNode* on_success,
381 intptr_t stack_pointer_register,
382 intptr_t position_register,
383 intptr_t capture_register_count = 0,
384 intptr_t capture_register_start = 0);
385 RegExpNode* on_match_success() { return on_match_success_; }
387
388 private:
389 bool is_positive_;
390 RegExpNode* on_match_success_;
391 RegExpNode* on_success_;
392 intptr_t stack_pointer_register_;
393 intptr_t position_register_;
394 };
395
396 private:
397 RegExpTree* body_;
398 bool is_positive_;
399 intptr_t capture_count_;
400 intptr_t capture_from_;
401 Type type_;
402};
403
405 public:
407 : capture_(nullptr), name_(nullptr), flags_(flags) {}
409 : capture_(capture), name_(nullptr), flags_(flags) {}
410 virtual void* Accept(RegExpVisitor* visitor, void* data);
411 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
413 virtual bool IsBackReference() const;
414 virtual intptr_t min_match() const { return 0; }
415 // The back reference may be recursive, e.g. /(\2)(\1)/. To avoid infinite
416 // recursion, we give up and just assume arbitrary length, which matches v8's
417 // behavior.
418 virtual intptr_t max_match() const { return kInfinity; }
419 intptr_t index() const { return capture_->index(); }
420 RegExpCapture* capture() const { return capture_; }
422 const ZoneGrowableArray<uint16_t>* name() { return name_; }
424
425 private:
426 RegExpCapture* capture_;
427 const ZoneGrowableArray<uint16_t>* name_;
428 RegExpFlags flags_;
429};
430
431class RegExpEmpty : public RegExpTree {
432 public:
434 virtual void* Accept(RegExpVisitor* visitor, void* data);
435 virtual RegExpNode* ToNode(RegExpCompiler* compiler, RegExpNode* on_success);
437 virtual bool IsEmpty() const;
438 virtual intptr_t min_match() const { return 0; }
439 virtual intptr_t max_match() const { return 0; }
441 static RegExpEmpty* instance = ::new RegExpEmpty();
442 return instance;
443 }
444};
445
446} // namespace dart
447
448#endif // RUNTIME_VM_REGEXP_AST_H_
GLenum type
intptr_t length() const
static CharacterRange Everything()
Definition: regexp.h:44
CharacterSet(ZoneGrowableArray< CharacterRange > *ranges)
Definition: regexp_ast.h:132
void set_standard_set_type(uint16_t special_set_type)
Definition: regexp_ast.h:140
ZoneGrowableArray< CharacterRange > * ranges()
Definition: regexp.cc:4785
void Canonicalize()
Definition: regexp.cc:4869
CharacterSet(const CharacterSet &that)
Definition: regexp_ast.h:134
uint16_t standard_set_type() const
Definition: regexp_ast.h:139
CharacterSet(uint16_t standard_set_type)
Definition: regexp_ast.h:130
static Interval Empty()
Definition: regexp.h:530
virtual Interval CaptureRegisters() const
Definition: regexp_ast.cc:46
virtual intptr_t max_match() const
Definition: regexp_ast.h:92
ZoneGrowableArray< RegExpTree * > * nodes() const
Definition: regexp_ast.h:93
virtual bool IsAnchoredAtStart() const
Definition: regexp_ast.cc:75
virtual bool IsAlternative() const
virtual bool IsAnchoredAtEnd() const
Definition: regexp_ast.cc:89
virtual RegExpAlternative * AsAlternative()
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4584
RegExpAlternative(ZoneGrowableArray< RegExpTree * > *nodes)
Definition: regexp_ast.cc:299
virtual void * Accept(RegExpVisitor *visitor, void *data)
virtual intptr_t min_match() const
Definition: regexp_ast.h:91
virtual void * Accept(RegExpVisitor *visitor, void *data)
virtual RegExpAssertion * AsAssertion()
RegExpAssertion(AssertionType type, RegExpFlags flags)
Definition: regexp_ast.h:111
virtual intptr_t max_match() const
Definition: regexp_ast.h:120
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4433
virtual bool IsAssertion() const
virtual bool IsAnchoredAtEnd() const
Definition: regexp_ast.cc:71
virtual intptr_t min_match() const
Definition: regexp_ast.h:119
virtual bool IsAnchoredAtStart() const
Definition: regexp_ast.cc:67
AssertionType assertion_type() const
Definition: regexp_ast.h:121
intptr_t length() const
Definition: regexp_ast.h:232
virtual bool IsAtom() const
virtual intptr_t max_match() const
Definition: regexp_ast.h:229
RegExpFlags flags() const
Definition: regexp_ast.h:233
RegExpAtom(ZoneGrowableArray< uint16_t > *data, RegExpFlags flags)
Definition: regexp_ast.h:221
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:3795
virtual bool IsTextElement() const
Definition: regexp_ast.h:227
virtual void AppendToText(RegExpText *text)
Definition: regexp.cc:212
virtual RegExpAtom * AsAtom()
ZoneGrowableArray< uint16_t > * data() const
Definition: regexp_ast.h:231
virtual intptr_t min_match() const
Definition: regexp_ast.h:228
bool ignore_case() const
Definition: regexp_ast.h:234
virtual void * Accept(RegExpVisitor *visitor, void *data)
void set_capture(RegExpCapture *capture)
Definition: regexp_ast.h:421
virtual void * Accept(RegExpVisitor *visitor, void *data)
void set_name(const ZoneGrowableArray< uint16_t > *name)
Definition: regexp_ast.h:423
virtual bool IsBackReference() const
virtual intptr_t min_match() const
Definition: regexp_ast.h:414
intptr_t index() const
Definition: regexp_ast.h:419
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4489
virtual intptr_t max_match() const
Definition: regexp_ast.h:418
RegExpBackReference(RegExpFlags flags)
Definition: regexp_ast.h:406
virtual RegExpBackReference * AsBackReference()
RegExpCapture * capture() const
Definition: regexp_ast.h:420
const ZoneGrowableArray< uint16_t > * name()
Definition: regexp_ast.h:422
RegExpBackReference(RegExpCapture *capture, RegExpFlags flags)
Definition: regexp_ast.h:408
RegExpCapture(intptr_t index)
Definition: regexp_ast.h:313
virtual intptr_t min_match() const
Definition: regexp_ast.h:326
virtual Interval CaptureRegisters() const
Definition: regexp_ast.cc:58
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4562
RegExpTree * body() const
Definition: regexp_ast.h:328
virtual RegExpCapture * AsCapture()
virtual bool IsAnchoredAtEnd() const
Definition: regexp_ast.cc:127
void set_name(const ZoneGrowableArray< uint16_t > *name)
Definition: regexp_ast.h:336
void set_body(RegExpTree *body)
Definition: regexp_ast.h:333
static intptr_t EndRegister(intptr_t index)
Definition: regexp_ast.h:338
virtual intptr_t max_match() const
Definition: regexp_ast.h:327
static intptr_t StartRegister(intptr_t index)
Definition: regexp_ast.h:337
const ZoneGrowableArray< uint16_t > * name()
Definition: regexp_ast.h:335
virtual bool IsAnchoredAtStart() const
Definition: regexp_ast.cc:123
virtual bool IsCapture() const
virtual void * Accept(RegExpVisitor *visitor, void *data)
intptr_t index() const
Definition: regexp_ast.h:334
uint16_t standard_type() const
Definition: regexp_ast.h:205
CharacterSet character_set() const
Definition: regexp_ast.h:190
RegExpCharacterClass(ZoneGrowableArray< CharacterRange > *ranges, RegExpFlags flags, CharacterClassFlags character_class_flags=DefaultFlags())
Definition: regexp_ast.h:166
virtual void AppendToText(RegExpText *text)
Definition: regexp.cc:216
RegExpFlags flags() const
Definition: regexp_ast.h:208
RegExpCharacterClass(uint16_t type, RegExpFlags flags)
Definition: regexp_ast.h:179
virtual RegExpCharacterClass * AsCharacterClass()
virtual intptr_t min_match() const
Definition: regexp_ast.h:186
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4166
virtual bool IsTextElement() const
Definition: regexp_ast.h:185
bool contains_split_surrogate() const
Definition: regexp_ast.h:209
ZoneGrowableArray< CharacterRange > * ranges()
Definition: regexp_ast.h:206
virtual intptr_t max_match() const
Definition: regexp_ast.h:188
static CharacterClassFlags DefaultFlags()
Definition: regexp_ast.h:164
virtual bool IsCharacterClass() const
virtual void * Accept(RegExpVisitor *visitor, void *data)
virtual intptr_t min_match() const
Definition: regexp_ast.h:71
RegExpDisjunction(ZoneGrowableArray< RegExpTree * > *alternatives)
Definition: regexp_ast.cc:277
virtual bool IsAnchoredAtStart() const
Definition: regexp_ast.cc:103
virtual intptr_t max_match() const
Definition: regexp_ast.h:72
ZoneGrowableArray< RegExpTree * > * alternatives() const
Definition: regexp_ast.h:73
virtual void * Accept(RegExpVisitor *visitor, void *data)
virtual bool IsDisjunction() const
virtual bool IsAnchoredAtEnd() const
Definition: regexp_ast.cc:111
virtual Interval CaptureRegisters() const
Definition: regexp_ast.cc:50
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4203
virtual RegExpDisjunction * AsDisjunction()
virtual bool IsEmpty() const
static RegExpEmpty * GetInstance()
Definition: regexp_ast.h:440
virtual RegExpEmpty * AsEmpty()
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4496
virtual void * Accept(RegExpVisitor *visitor, void *data)
virtual intptr_t max_match() const
Definition: regexp_ast.h:439
virtual intptr_t min_match() const
Definition: regexp_ast.h:438
bool IgnoreCase() const
Definition: object.h:12723
Builder(bool is_positive, RegExpNode *on_success, intptr_t stack_pointer_register, intptr_t position_register, intptr_t capture_register_count=0, intptr_t capture_register_start=0)
Definition: regexp.cc:4501
RegExpNode * ForMatch(RegExpNode *match)
Definition: regexp.cc:4522
virtual intptr_t max_match() const
Definition: regexp_ast.h:367
virtual bool IsAnchoredAtStart() const
Definition: regexp_ast.cc:119
RegExpLookaround(RegExpTree *body, bool is_positive, intptr_t capture_count, intptr_t capture_from, Type type)
Definition: regexp_ast.h:349
RegExpTree * body() const
Definition: regexp_ast.h:368
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4540
virtual RegExpLookaround * AsLookaround()
virtual bool IsLookaround() const
bool is_positive() const
Definition: regexp_ast.h:369
intptr_t capture_count() const
Definition: regexp_ast.h:370
virtual void * Accept(RegExpVisitor *visitor, void *data)
virtual Interval CaptureRegisters() const
Definition: regexp_ast.cc:54
intptr_t capture_from() const
Definition: regexp_ast.h:371
virtual intptr_t min_match() const
Definition: regexp_ast.h:366
intptr_t max() const
Definition: regexp_ast.h:296
intptr_t min() const
Definition: regexp_ast.h:295
virtual RegExpQuantifier * AsQuantifier()
RegExpTree * body() const
Definition: regexp_ast.h:300
bool is_non_greedy() const
Definition: regexp_ast.h:298
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4216
virtual Interval CaptureRegisters() const
Definition: regexp_ast.cc:63
bool is_possessive() const
Definition: regexp_ast.h:297
virtual bool IsQuantifier() const
virtual intptr_t min_match() const
Definition: regexp_ast.h:293
RegExpQuantifier(intptr_t min, intptr_t max, QuantifierType type, RegExpTree *body)
Definition: regexp_ast.h:266
virtual void * Accept(RegExpVisitor *visitor, void *data)
bool is_greedy() const
Definition: regexp_ast.h:299
virtual intptr_t max_match() const
Definition: regexp_ast.h:294
virtual RegExpText * AsText()
virtual void AppendToText(RegExpText *text)
Definition: regexp.cc:220
virtual void * Accept(RegExpVisitor *visitor, void *data)
GrowableArray< TextElement > * elements()
Definition: regexp_ast.h:256
void AddElement(TextElement elm)
Definition: regexp_ast.h:252
virtual bool IsText() const
virtual intptr_t min_match() const
Definition: regexp_ast.h:249
virtual bool IsTextElement() const
Definition: regexp_ast.h:248
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:3803
virtual intptr_t max_match() const
Definition: regexp_ast.h:250
virtual intptr_t min_match() const =0
virtual bool IsAnchoredAtEnd() const
Definition: regexp_ast.h:46
virtual Interval CaptureRegisters() const
Definition: regexp_ast.h:51
virtual void * Accept(RegExpVisitor *visitor, void *data)=0
virtual intptr_t max_match() const =0
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)=0
virtual ~RegExpTree()
Definition: regexp_ast.h:40
static constexpr intptr_t kInfinity
Definition: regexp_ast.h:39
virtual bool IsTextElement() const
Definition: regexp_ast.h:44
virtual void AppendToText(RegExpText *text)
Definition: regexp.cc:208
virtual bool IsAnchoredAtStart() const
Definition: regexp_ast.h:45
virtual ~RegExpVisitor()
Definition: regexp_ast.h:30
intptr_t length() const
Definition: regexp.cc:233
VkInstance instance
Definition: main.cc:48
FlutterSemanticsFlag flags
std::u16string text
def match(bench, filt)
Definition: benchmark.py:23
Definition: dart_vm.cc:33
constexpr int32_t kMaxInt32
Definition: globals.h:483
static int8_t data[kExtLength]
#define FOR_EACH_REG_EXP_TREE_TYPE(VISIT)
Definition: regexp.h:218
#define MAKE_CASE(Name)
Definition: regexp_ast.h:31
#define MAKE_ASTYPE(Name)
Definition: regexp_ast.h:54