Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
dart::RegExpCapture Class Reference

#include <regexp_ast.h>

Inheritance diagram for dart::RegExpCapture:
dart::RegExpTree dart::ZoneAllocated

Public Member Functions

 RegExpCapture (intptr_t index)
 
virtual void * Accept (RegExpVisitor *visitor, void *data)
 
virtual RegExpNodeToNode (RegExpCompiler *compiler, RegExpNode *on_success)
 
virtual RegExpCaptureAsCapture ()
 
virtual bool IsAnchoredAtStart () const
 
virtual bool IsAnchoredAtEnd () const
 
virtual Interval CaptureRegisters () const
 
virtual bool IsCapture () const
 
virtual intptr_t min_match () const
 
virtual intptr_t max_match () const
 
RegExpTreebody () const
 
void set_body (RegExpTree *body)
 
intptr_t index () const
 
const ZoneGrowableArray< uint16_t > * name ()
 
void set_name (const ZoneGrowableArray< uint16_t > *name)
 
- Public Member Functions inherited from dart::RegExpTree
virtual ~RegExpTree ()
 
virtual void * Accept (RegExpVisitor *visitor, void *data)=0
 
virtual RegExpNodeToNode (RegExpCompiler *compiler, RegExpNode *on_success)=0
 
virtual bool IsTextElement () const
 
virtual bool IsAnchoredAtStart () const
 
virtual bool IsAnchoredAtEnd () const
 
virtual intptr_t min_match () const =0
 
virtual intptr_t max_match () const =0
 
virtual Interval CaptureRegisters () const
 
virtual void AppendToText (RegExpText *text)
 
void Print ()
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Static Public Member Functions

static RegExpNodeToNode (RegExpTree *body, intptr_t index, RegExpCompiler *compiler, RegExpNode *on_success)
 
static intptr_t StartRegister (intptr_t index)
 
static intptr_t EndRegister (intptr_t index)
 

Additional Inherited Members

- Static Public Attributes inherited from dart::RegExpTree
static constexpr intptr_t kInfinity = kMaxInt32
 

Detailed Description

Definition at line 311 of file regexp_ast.h.

Constructor & Destructor Documentation

◆ RegExpCapture()

dart::RegExpCapture::RegExpCapture ( intptr_t  index)
inlineexplicit

Definition at line 313 of file regexp_ast.h.

314 : body_(nullptr), index_(index), name_(nullptr) {}
intptr_t index() const
Definition: regexp_ast.h:334

Member Function Documentation

◆ Accept()

virtual void * dart::RegExpCapture::Accept ( RegExpVisitor visitor,
void *  data 
)
virtual

Implements dart::RegExpTree.

◆ AsCapture()

virtual RegExpCapture * dart::RegExpCapture::AsCapture ( )
virtual

◆ body()

RegExpTree * dart::RegExpCapture::body ( ) const
inline

Definition at line 328 of file regexp_ast.h.

328{ return body_; }

◆ CaptureRegisters()

Interval dart::RegExpCapture::CaptureRegisters ( ) const
virtual

Reimplemented from dart::RegExpTree.

Definition at line 58 of file regexp_ast.cc.

58 {
60 return self.Union(body()->CaptureRegisters());
61}
virtual Interval CaptureRegisters() const
Definition: regexp_ast.cc:58
RegExpTree * body() const
Definition: regexp_ast.h:328
static intptr_t EndRegister(intptr_t index)
Definition: regexp_ast.h:338
static intptr_t StartRegister(intptr_t index)
Definition: regexp_ast.h:337

◆ EndRegister()

static intptr_t dart::RegExpCapture::EndRegister ( intptr_t  index)
inlinestatic

Definition at line 338 of file regexp_ast.h.

338{ return index * 2 + 1; }

◆ index()

intptr_t dart::RegExpCapture::index ( ) const
inline

Definition at line 334 of file regexp_ast.h.

334{ return index_; }

◆ IsAnchoredAtEnd()

bool dart::RegExpCapture::IsAnchoredAtEnd ( ) const
virtual

Reimplemented from dart::RegExpTree.

Definition at line 127 of file regexp_ast.cc.

127 {
128 return body()->IsAnchoredAtEnd();
129}
virtual bool IsAnchoredAtEnd() const
Definition: regexp_ast.h:46

◆ IsAnchoredAtStart()

bool dart::RegExpCapture::IsAnchoredAtStart ( ) const
virtual

Reimplemented from dart::RegExpTree.

Definition at line 123 of file regexp_ast.cc.

123 {
124 return body()->IsAnchoredAtStart();
125}
virtual bool IsAnchoredAtStart() const
Definition: regexp_ast.h:45

◆ IsCapture()

virtual bool dart::RegExpCapture::IsCapture ( ) const
virtual

◆ max_match()

virtual intptr_t dart::RegExpCapture::max_match ( ) const
inlinevirtual

Implements dart::RegExpTree.

Definition at line 327 of file regexp_ast.h.

327{ return body_->max_match(); }
virtual intptr_t max_match() const =0

◆ min_match()

virtual intptr_t dart::RegExpCapture::min_match ( ) const
inlinevirtual

Implements dart::RegExpTree.

Definition at line 326 of file regexp_ast.h.

326{ return body_->min_match(); }
virtual intptr_t min_match() const =0

◆ name()

const ZoneGrowableArray< uint16_t > * dart::RegExpCapture::name ( )
inline

Definition at line 335 of file regexp_ast.h.

335{ return name_; }

◆ set_body()

void dart::RegExpCapture::set_body ( RegExpTree body)
inline

Definition at line 333 of file regexp_ast.h.

333{ body_ = body; }

◆ set_name()

void dart::RegExpCapture::set_name ( const ZoneGrowableArray< uint16_t > *  name)
inline

Definition at line 336 of file regexp_ast.h.

336{ name_ = name; }
const ZoneGrowableArray< uint16_t > * name()
Definition: regexp_ast.h:335

◆ StartRegister()

static intptr_t dart::RegExpCapture::StartRegister ( intptr_t  index)
inlinestatic

Definition at line 337 of file regexp_ast.h.

337{ return index * 2; }

◆ ToNode() [1/2]

RegExpNode * dart::RegExpCapture::ToNode ( RegExpCompiler compiler,
RegExpNode on_success 
)
virtual

Implements dart::RegExpTree.

Definition at line 4562 of file regexp.cc.

4563 {
4564 return ToNode(body(), index(), compiler, on_success);
4565}
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)
Definition: regexp.cc:4562

◆ ToNode() [2/2]

RegExpNode * dart::RegExpCapture::ToNode ( RegExpTree body,
intptr_t  index,
RegExpCompiler compiler,
RegExpNode on_success 
)
static

Definition at line 4567 of file regexp.cc.

4570 {
4571 ASSERT(body != nullptr);
4572 intptr_t start_reg = RegExpCapture::StartRegister(index);
4573 intptr_t end_reg = RegExpCapture::EndRegister(index);
4574 if (compiler->read_backward()) {
4575 intptr_t tmp = end_reg;
4576 end_reg = start_reg;
4577 start_reg = tmp;
4578 }
4579 RegExpNode* store_end = ActionNode::StorePosition(end_reg, true, on_success);
4580 RegExpNode* body_node = body->ToNode(compiler, store_end);
4581 return ActionNode::StorePosition(start_reg, true, body_node);
4582}
static ActionNode * StorePosition(intptr_t reg, bool is_capture, RegExpNode *on_success)
Definition: regexp.cc:774
virtual RegExpNode * ToNode(RegExpCompiler *compiler, RegExpNode *on_success)=0
#define ASSERT(E)

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