Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::RegExpLookaround::Builder Class Reference

#include <regexp_ast.h>

Inheritance diagram for dart::RegExpLookaround::Builder:
dart::ValueObject

Public Member Functions

 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)
 
RegExpNodeon_match_success ()
 
RegExpNodeForMatch (RegExpNode *match)
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 377 of file regexp_ast.h.

Constructor & Destructor Documentation

◆ Builder()

dart::RegExpLookaround::Builder::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 at line 4501 of file regexp.cc.

4507 : is_positive_(is_positive),
4508 on_success_(on_success),
4509 stack_pointer_register_(stack_pointer_register),
4510 position_register_(position_register) {
4511 if (is_positive_) {
4512 on_match_success_ = ActionNode::PositiveSubmatchSuccess(
4513 stack_pointer_register, position_register, capture_register_count,
4514 capture_register_start, on_success);
4515 } else {
4516 on_match_success_ = new (OZ) NegativeSubmatchSuccess(
4517 stack_pointer_register, position_register, capture_register_count,
4518 capture_register_start, OZ);
4519 }
4520}
static ActionNode * PositiveSubmatchSuccess(intptr_t stack_pointer_reg, intptr_t restore_reg, intptr_t clear_capture_count, intptr_t clear_capture_from, RegExpNode *on_success)
Definition regexp.cc:802
bool is_positive() const
Definition regexp_ast.h:369
#define OZ
Definition regexp.cc:3793

Member Function Documentation

◆ ForMatch()

RegExpNode * dart::RegExpLookaround::Builder::ForMatch ( RegExpNode match)

Definition at line 4522 of file regexp.cc.

4522 {
4523 if (is_positive_) {
4524 return ActionNode::BeginSubmatch(stack_pointer_register_,
4525 position_register_, match);
4526 } else {
4527 Zone* zone = on_success_->zone();
4528 // We use a ChoiceNode to represent the negative lookaround. The first
4529 // alternative is the negative match. On success, the end node backtracks.
4530 // On failure, the second alternative is tried and leads to success.
4531 // NegativeLookaroundChoiceNode is a special ChoiceNode that ignores the
4532 // first exit when calculating quick checks.
4533 ChoiceNode* choice_node = new (zone) NegativeLookaroundChoiceNode(
4534 GuardedAlternative(match), GuardedAlternative(on_success_), zone);
4535 return ActionNode::BeginSubmatch(stack_pointer_register_,
4536 position_register_, choice_node);
4537 }
4538}
static bool match(const char *needle, const char *haystack)
Definition DM.cpp:1132
static ActionNode * BeginSubmatch(intptr_t stack_pointer_reg, intptr_t position_reg, RegExpNode *on_success)
Definition regexp.cc:792
Zone * zone() const
Definition regexp.h:483

◆ on_match_success()

RegExpNode * dart::RegExpLookaround::Builder::on_match_success ( )
inline

Definition at line 385 of file regexp_ast.h.

385{ return on_match_success_; }

The documentation for this class was generated from the following files: