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

#include <regexp.h>

Inheritance diagram for dart::Analysis:
dart::NodeVisitor dart::ValueObject

Public Member Functions

 Analysis (bool is_one_byte)
 
void EnsureAnalyzed (RegExpNode *node)
 
virtual void VisitLoopChoice (LoopChoiceNode *that)
 
bool has_failed ()
 
const char * error_message ()
 
void fail (const char *error_message)
 
- Public Member Functions inherited from dart::NodeVisitor
virtual ~NodeVisitor ()
 
virtual void VisitLoopChoice (LoopChoiceNode *that)
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 1405 of file regexp.h.

Constructor & Destructor Documentation

◆ Analysis()

dart::Analysis::Analysis ( bool  is_one_byte)
inlineexplicit

Definition at line 1407 of file regexp.h.

1408 : is_one_byte_(is_one_byte), error_message_(nullptr) {}

Member Function Documentation

◆ EnsureAnalyzed()

void dart::Analysis::EnsureAnalyzed ( RegExpNode node)

Definition at line 5092 of file regexp.cc.

5092 {
5093 if (that->info()->been_analyzed || that->info()->being_analyzed) return;
5094 that->info()->being_analyzed = true;
5095 that->Accept(this);
5096 that->info()->being_analyzed = false;
5097 that->info()->been_analyzed = true;
5098}

◆ error_message()

const char * dart::Analysis::error_message ( )
inline

Definition at line 1417 of file regexp.h.

1417 {
1418 ASSERT(error_message_ != nullptr);
1419 return error_message_;
1420 }
#define ASSERT(E)

◆ fail()

void dart::Analysis::fail ( const char *  error_message)
inline

Definition at line 1421 of file regexp.h.

1421{ error_message_ = error_message; }
const char * error_message()
Definition: regexp.h:1417

◆ has_failed()

bool dart::Analysis::has_failed ( )
inline

Definition at line 1416 of file regexp.h.

1416{ return error_message_ != nullptr; }

◆ VisitLoopChoice()

void dart::Analysis::VisitLoopChoice ( LoopChoiceNode that)
virtual

Reimplemented from dart::NodeVisitor.

Definition at line 5146 of file regexp.cc.

5146 {
5147 NodeInfo* info = that->info();
5148 for (intptr_t i = 0; i < that->alternatives()->length(); i++) {
5149 RegExpNode* node = (*that->alternatives())[i].node();
5150 if (node != that->loop_node()) {
5151 EnsureAnalyzed(node);
5152 if (has_failed()) return;
5153 info->AddFromFollowing(node->info());
5154 }
5155 }
5156 // Check the loop last since it may need the value of this node
5157 // to get a correct result.
5158 EnsureAnalyzed(that->loop_node());
5159 if (!has_failed()) {
5160 info->AddFromFollowing(that->loop_node()->info());
5161 }
5162}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
void EnsureAnalyzed(RegExpNode *node)
Definition: regexp.cc:5092
bool has_failed()
Definition: regexp.h:1416
size_t length

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