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

#include <regexp.h>

Public Types

enum  TextType { ATOM , CHAR_CLASS }
 

Public Member Functions

intptr_t cp_offset () const
 
void set_cp_offset (intptr_t cp_offset)
 
intptr_t length () const
 
TextType text_type () const
 
RegExpTreetree () const
 
RegExpAtomatom () const
 
RegExpCharacterClasschar_class () const
 

Static Public Member Functions

static TextElement Atom (RegExpAtom *atom)
 
static TextElement CharClass (RegExpCharacterClass *char_class)
 

Detailed Description

Definition at line 235 of file regexp.h.

Member Enumeration Documentation

◆ TextType

Enumerator
ATOM 
CHAR_CLASS 

Definition at line 237 of file regexp.h.

Member Function Documentation

◆ atom()

RegExpAtom * dart::TextElement::atom ( ) const
inline

Definition at line 250 of file regexp.h.

250 {
251 ASSERT(text_type() == ATOM);
252 return reinterpret_cast<RegExpAtom*>(tree());
253 }
TextType text_type() const
Definition regexp.h:246
RegExpTree * tree() const
Definition regexp.h:248
#define ASSERT(E)
WORD ATOM

◆ Atom()

TextElement dart::TextElement::Atom ( RegExpAtom atom)
static

Definition at line 225 of file regexp.cc.

225 {
226 return TextElement(ATOM, atom);
227}
RegExpAtom * atom() const
Definition regexp.h:250

◆ char_class()

RegExpCharacterClass * dart::TextElement::char_class ( ) const
inline

Definition at line 255 of file regexp.h.

255 {
257 return reinterpret_cast<RegExpCharacterClass*>(tree());
258 }

◆ CharClass()

TextElement dart::TextElement::CharClass ( RegExpCharacterClass char_class)
static

Definition at line 229 of file regexp.cc.

229 {
230 return TextElement(CHAR_CLASS, char_class);
231}
RegExpCharacterClass * char_class() const
Definition regexp.h:255

◆ cp_offset()

intptr_t dart::TextElement::cp_offset ( ) const
inline

Definition at line 242 of file regexp.h.

242{ return cp_offset_; }

◆ length()

intptr_t dart::TextElement::length ( ) const

Definition at line 233 of file regexp.cc.

233 {
234 switch (text_type()) {
235 case ATOM:
236 return atom()->length();
237
238 case CHAR_CLASS:
239 return 1;
240 }
241 UNREACHABLE();
242 return 0;
243}
#define UNREACHABLE()
Definition assert.h:248
intptr_t length() const
Definition regexp_ast.h:232

◆ set_cp_offset()

void dart::TextElement::set_cp_offset ( intptr_t  cp_offset)
inline

Definition at line 243 of file regexp.h.

243{ cp_offset_ = cp_offset; }
intptr_t cp_offset() const
Definition regexp.h:242

◆ text_type()

TextType dart::TextElement::text_type ( ) const
inline

Definition at line 246 of file regexp.h.

246{ return text_type_; }

◆ tree()

RegExpTree * dart::TextElement::tree ( ) const
inline

Definition at line 248 of file regexp.h.

248{ return tree_; }

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