21 static void output_if (OutputFile & o, uint32_t ind,
bool & readCh,
const std::string & compare, uint32_t value);
22 static void output_goto (OutputFile & o, uint32_t ind,
bool & readCh, label_t to);
24 static std::string
output_hgo (OutputFile & o, uint32_t ind,
bool & readCh, SwitchIf * hgo);
39 void output_if (
OutputFile & o, uint32_t ind,
bool & readCh,
const std::string & compare, uint32_t value)
60 hgo->
emit (o, ind + 1, readCh);
73 for (uint32_t i = 0; i <
ranges.size (); ++i)
75 for (uint32_t b =
ranges[i].first; b <
ranges[i].second; ++b)
82 o.
ws(
" /* ").
wc(static_cast<char> (c)).
ws(
" */");
84 bool last_case = i ==
ranges.size () - 1 && b ==
ranges[i].second - 1;
104 o.
wind(ind).
ws(
"default:");
113 thn->
emit (o, ind + 1, readCh);
114 o.
wind(ind).
ws(
"} else {\n");
115 els->
emit (o, ind + 1, readCh);
121 for (uint32_t i = 0; i <
branches.size (); ++i)
140 info.binary->emit (o, ind, readCh);
143 info.linear->emit (o, ind, readCh);
153 info.cases->emit (o, ind, readCh);
156 info.ifs->emit (o, ind, readCh);
182 label_t CpgotoTable::max_label ()
const
187 if (max <
table[i]->label)
199 const uint32_t max_digits = max_label ().
width ();
203 if (i == TABLE_SIZE - 1)
214 o.
ws(
",").
wstring(std::string (padding,
' '));
238 for (uint32_t i = 0; i < n; ++i)
257 info.switchif->emit (o, ind, readCh);
260 info.bitmap->emit (o, ind, readCh);
263 info.cpgoto->emit (o, ind, readCh);
void emit(OutputFile &o, uint32_t ind, bool &readCh)
static const uint32_t TABLE_SIZE
void emit(OutputFile &o, uint32_t ind, bool &readCh)
OutputFile & ws(const char *s)
static std::string output_hgo(OutputFile &o, uint32_t ind, bool &readCh, SwitchIf *hgo)
OutputFile & wu32(uint32_t n)
void emit(OutputFile &o, uint32_t ind)
OutputFile & wind(uint32_t ind)
OutputFile & wlabel(label_t l)
enum re2c::SwitchIf::@1 type
void emit(OutputFile &o, uint32_t ind, bool &readCh)
OutputFile & wc_hex(uint32_t n)
OutputFile & wrange(uint32_t u, uint32_t l)
void emit(OutputFile &o, uint32_t ind, bool &readCh)
static std::string output_yych(bool &readCh)
void emit(OutputFile &o, uint32_t ind, bool &readCh)
bool is_print(uint32_t c)
void emit(OutputFile &o, uint32_t ind, bool &readCh)
void emit(OutputFile &o, uint32_t ind)
std::vector< std::pair< const Cond *, const State * > > branches
const State * bitmap_state
static void output_goto(OutputFile &o, uint32_t ind, bool &readCh, label_t to)
uint32_t decodeUnsafe(uint32_t c) const
OutputFile & wu32_hex(uint32_t n)
union re2c::SwitchIf::@2 info
void emit(OutputFile &o, uint32_t ind, bool &readCh)
enum re2c::If::type_t type
static void output_if(OutputFile &o, uint32_t ind, bool &readCh, const std::string &compare, uint32_t value)
std::vector< std::pair< uint32_t, uint32_t > > ranges
OutputFile & wstring(const std::string &s)
void emit(OutputFile &o, uint32_t ind, bool &readCh)