#include <regexp_ast.h>
Definition at line 81 of file regexp_ast.h.
◆ RegExpAlternative()
Definition at line 299 of file regexp_ast.cc.
302 min_match_ = 0;
303 max_match_ = 0;
304 for (intptr_t
i = 0;
i <
nodes->length();
i++) {
305 RegExpTree* node =
nodes->At(
i);
306 intptr_t node_min_match = node->min_match();
307 min_match_ =
IncreaseBy(min_match_, node_min_match);
308 intptr_t node_max_match = node->max_match();
309 max_match_ =
IncreaseBy(max_match_, node_max_match);
310 }
311}
ZoneGrowableArray< RegExpTree * > * nodes() const
static intptr_t IncreaseBy(intptr_t previous, intptr_t increase)
◆ Accept()
virtual void * dart::RegExpAlternative::Accept |
( |
RegExpVisitor * |
visitor, |
|
|
void * |
data |
|
) |
| |
|
virtual |
◆ AsAlternative()
◆ CaptureRegisters()
Interval dart::RegExpAlternative::CaptureRegisters |
( |
| ) |
const |
|
virtual |
Reimplemented from dart::RegExpTree.
Definition at line 46 of file regexp_ast.cc.
46 {
48}
static Interval ListCaptureRegisters(ZoneGrowableArray< RegExpTree * > *children)
◆ IsAlternative()
virtual bool dart::RegExpAlternative::IsAlternative |
( |
| ) |
const |
|
virtual |
◆ IsAnchoredAtEnd()
bool dart::RegExpAlternative::IsAnchoredAtEnd |
( |
| ) |
const |
|
virtual |
Reimplemented from dart::RegExpTree.
Definition at line 89 of file regexp_ast.cc.
89 {
90 ZoneGrowableArray<RegExpTree*>*
nodes = this->
nodes();
91 for (intptr_t
i =
nodes->length() - 1;
i >= 0;
i--) {
92 RegExpTree* node =
nodes->At(
i);
93 if (node->IsAnchoredAtEnd()) {
94 return true;
95 }
96 if (node->max_match() > 0) {
97 return false;
98 }
99 }
100 return false;
101}
◆ IsAnchoredAtStart()
bool dart::RegExpAlternative::IsAnchoredAtStart |
( |
| ) |
const |
|
virtual |
Reimplemented from dart::RegExpTree.
Definition at line 75 of file regexp_ast.cc.
75 {
76 ZoneGrowableArray<RegExpTree*>*
nodes = this->
nodes();
77 for (intptr_t
i = 0;
i <
nodes->length();
i++) {
78 RegExpTree* node =
nodes->At(
i);
79 if (node->IsAnchoredAtStart()) {
80 return true;
81 }
82 if (node->max_match() > 0) {
83 return false;
84 }
85 }
86 return false;
87}
◆ max_match()
virtual intptr_t dart::RegExpAlternative::max_match |
( |
| ) |
const |
|
inlinevirtual |
◆ min_match()
virtual intptr_t dart::RegExpAlternative::min_match |
( |
| ) |
const |
|
inlinevirtual |
◆ nodes()
◆ ToNode()
Implements dart::RegExpTree.
Definition at line 4584 of file regexp.cc.
4585 {
4586 ZoneGrowableArray<RegExpTree*>* children =
nodes();
4587 RegExpNode* current = on_success;
4589 for (intptr_t
i = 0;
i < children->length();
i++) {
4590 current = children->At(
i)->ToNode(
compiler, current);
4591 }
4592 } else {
4593 for (intptr_t
i = children->length() - 1;
i >= 0;
i--) {
4594 current = children->At(
i)->ToNode(
compiler, current);
4595 }
4596 }
4597 return current;
4598}
The documentation for this class was generated from the following files: