MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / DumpState

Method DumpState

extern/re2/re2/dfa.cc:505–529  ·  view source on GitHub ↗

For debugging, returns a string representation of the state.

Source from the content-addressed store, hash-verified

503
504// For debugging, returns a string representation of the state.
505std::string DFA::DumpState(State* state) {
506 if (state == NULL)
507 return "_";
508 if (state == DeadState)
509 return "X";
510 if (state == FullMatchState)
511 return "*";
512 std::string s;
513 const char* sep = "";
514 s += StringPrintf("(%p)", state);
515 for (int i = 0; i < state->ninst_; i++) {
516 if (state->inst_[i] == Mark) {
517 s += "|";
518 sep = "";
519 } else if (state->inst_[i] == MatchSep) {
520 s += "||";
521 sep = "";
522 } else {
523 s += StringPrintf("%s%d", sep, state->inst_[i]);
524 sep = ",";
525 }
526 }
527 s += StringPrintf(" flag=%#x", state->flag_);
528 return s;
529}
530
531//////////////////////////////////////////////////////////////////////
532//

Callers

nothing calls this directly

Calls 1

StringPrintfFunction · 0.85

Tested by

no test coverage detected