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

#include <regexp_ast.h>

Inheritance diagram for dart::RegExpText:
dart::RegExpTree dart::ZoneAllocated

Public Member Functions

 RegExpText ()
 
virtual void * Accept (RegExpVisitor *visitor, void *data)
 
virtual RegExpNodeToNode (RegExpCompiler *compiler, RegExpNode *on_success)
 
virtual RegExpTextAsText ()
 
virtual bool IsText () const
 
virtual bool IsTextElement () const
 
virtual intptr_t min_match () const
 
virtual intptr_t max_match () const
 
virtual void AppendToText (RegExpText *text)
 
void AddElement (TextElement elm)
 
GrowableArray< TextElement > * elements ()
 
- 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)
 

Additional Inherited Members

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

Detailed Description

Definition at line 241 of file regexp_ast.h.

Constructor & Destructor Documentation

◆ RegExpText()

dart::RegExpText::RegExpText ( )
inline

Definition at line 243 of file regexp_ast.h.

243: elements_(2), length_(0) {}

Member Function Documentation

◆ Accept()

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

Implements dart::RegExpTree.

◆ AddElement()

void dart::RegExpText::AddElement ( TextElement  elm)
inline

Definition at line 252 of file regexp_ast.h.

252 {
253 elements_.Add(elm);
254 length_ += elm.length();
255 }

◆ AppendToText()

void dart::RegExpText::AppendToText ( RegExpText text)
virtual

Reimplemented from dart::RegExpTree.

Definition at line 220 of file regexp.cc.

220 {
221 for (intptr_t i = 0; i < elements()->length(); i++)
222 text->AddElement((*elements())[i]);
223}
GrowableArray< TextElement > * elements()
Definition: regexp_ast.h:256
std::u16string text

◆ AsText()

virtual RegExpText * dart::RegExpText::AsText ( )
virtual

◆ elements()

GrowableArray< TextElement > * dart::RegExpText::elements ( )
inline

Definition at line 256 of file regexp_ast.h.

256{ return &elements_; }

◆ IsText()

virtual bool dart::RegExpText::IsText ( ) const
virtual

◆ IsTextElement()

virtual bool dart::RegExpText::IsTextElement ( ) const
inlinevirtual

Reimplemented from dart::RegExpTree.

Definition at line 248 of file regexp_ast.h.

248{ return true; }

◆ max_match()

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

Implements dart::RegExpTree.

Definition at line 250 of file regexp_ast.h.

250{ return length_; }

◆ min_match()

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

Implements dart::RegExpTree.

Definition at line 249 of file regexp_ast.h.

249{ return length_; }

◆ ToNode()

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

Implements dart::RegExpTree.

Definition at line 3803 of file regexp.cc.

3804 {
3805 ZoneGrowableArray<TextElement>* elms =
3806 new (OZ) ZoneGrowableArray<TextElement>(1);
3807 for (intptr_t i = 0; i < elements()->length(); i++) {
3808 elms->Add(elements()->At(i));
3809 }
3810 return new (OZ) TextNode(elms, compiler->read_backward(), on_success);
3811}
#define OZ
Definition: regexp.cc:3793

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