-/* Generated by re2c 0.16 on Tue Mar 7 18:15:59 2017 */
+/* Generated by re2c 0.16 on Tue Mar 7 18:21:50 2017 */
#line 1 "../src/ast/lex.re"
#include "src/util/c99_stdint.h"
#include <stddef.h>
-/* Generated by re2c 0.16 on Tue Mar 7 17:49:54 2017 */
+/* Generated by re2c 0.16 on Tue Mar 7 18:21:20 2017 */
#line 1 "../src/ast/lex_conf.re"
#include "src/util/c99_stdint.h"
#include <string>
yy92:
++cur;
#line 42 "../src/ast/lex_conf.re"
- { opts.set_target(opt_t::DOT); lex_conf_semicolon(); return; }
+ { opts.set_target(TARGET_DOT); lex_conf_semicolon(); return; }
#line 575 "src/ast/lex_conf.cc"
yy94:
++cur;
yy96:
++cur;
#line 43 "../src/ast/lex_conf.re"
- { opts.set_target(opt_t::SKELETON); lex_conf_semicolon(); return; }
+ { opts.set_target(TARGET_SKELETON); lex_conf_semicolon(); return; }
#line 585 "src/ast/lex_conf.cc"
yy98:
++cur;
o.new_block(opts);
o.wversion_time().wline_info(input.get_cline(), input.get_fname().c_str());
- if (opts->target == opt_t::SKELETON) {
+ if (opts->target == TARGET_SKELETON) {
emit_prolog(o);
}
o.wline_info (input.get_cline (), input.get_fname ().c_str ());
}
- if (opts->target == opt_t::SKELETON) {
+ if (opts->target == TARGET_SKELETON) {
emit_epilog (o, output.skeletons);
}
-/* Generated by re2c 0.16 on Tue Mar 7 17:52:30 2017 */
+/* Generated by re2c 0.16 on Tue Mar 7 18:22:57 2017 */
#line 1 "../src/conf/parse_opts.re"
#include "src/code/input_api.h"
#include "src/conf/msg.h"
yy212:
++YYCURSOR;
#line 103 "../src/conf/parse_opts.re"
- { opts.set_target (opt_t::DOT); goto opt_short; }
+ { opts.set_target (TARGET_DOT); goto opt_short; }
#line 956 "src/conf/parse_opts.cc"
yy214:
++YYCURSOR;
yy216:
++YYCURSOR;
#line 110 "../src/conf/parse_opts.re"
- { opts.set_target (opt_t::SKELETON); goto opt_short; }
+ { opts.set_target (TARGET_SKELETON); goto opt_short; }
#line 966 "src/conf/parse_opts.cc"
yy218:
++YYCURSOR;
yy513:
++YYCURSOR;
#line 137 "../src/conf/parse_opts.re"
- { opts.set_target (opt_t::DOT); goto opt; }
+ { opts.set_target (TARGET_DOT); goto opt; }
#line 2128 "src/conf/parse_opts.cc"
yy515:
yych = (YYCTYPE)*++YYCURSOR;
yy527:
++YYCURSOR;
#line 148 "../src/conf/parse_opts.re"
- { opts.set_target (opt_t::SKELETON); goto opt; }
+ { opts.set_target (TARGET_SKELETON); goto opt; }
#line 2178 "src/conf/parse_opts.cc"
yy529:
yych = (YYCTYPE)*++YYCURSOR;
/*!re2c
* { fatal(get_column() - tchar, "unrecognized configuration"); }
- "flags:" ("D" | "emit-dot") { opts.set_target(opt_t::DOT); lex_conf_semicolon(); return; }
- "flags:" ("S" | "skeleton") { opts.set_target(opt_t::SKELETON); lex_conf_semicolon(); return; }
+ "flags:" ("D" | "emit-dot") { opts.set_target(TARGET_DOT); lex_conf_semicolon(); return; }
+ "flags:" ("S" | "skeleton") { opts.set_target(TARGET_SKELETON); lex_conf_semicolon(); return; }
"flags:" ("b" | "bit-vectors") { opts.set_bFlag(lex_conf_bool()); return; }
"flags:" ("c" | "start-conditions") { opts.set_cFlag(lex_conf_bool()); return; }
o.new_block(opts);
o.wversion_time().wline_info(input.get_cline(), input.get_fname().c_str());
- if (opts->target == opt_t::SKELETON) {
+ if (opts->target == TARGET_SKELETON) {
emit_prolog(o);
}
o.wline_info (input.get_cline (), input.get_fname ().c_str ());
}
- if (opts->target == opt_t::SKELETON) {
+ if (opts->target == TARGET_SKELETON) {
emit_epilog (o, output.skeletons);
}
gen_fintags(o, ind, dfa, rule);
- if (opts->target == opt_t::SKELETON) {
+ if (opts->target == TARGET_SKELETON) {
emit_action(o, ind, dfa, rule_idx);
} else {
if (!cond.empty() && dfa.cond != cond) {
head->action.set_initial(initial_label);
- if (opts->target == opt_t::SKELETON) {
+ if (opts->target == TARGET_SKELETON) {
if (output.skeletons.insert (name).second)
{
emit_start(o, max_fill, name, key_size, def_rule, need_backup,
emit_body (o, i, used_labels, initial_label);
emit_end(o, name, need_backup, oldstyle_ctxmarker);
}
- } else if (opts->target == opt_t::DOT) {
+ } else if (opts->target == TARGET_DOT) {
emit_dot(o, isLastCond);
} else {
// Generate prolog
const uint32_t dSpans = nSpans - hSpans - nBitmaps;
const bool part_skip = opts->eager_skip && !skip;
- if (opts->target == opt_t::DOT)
+ if (opts->target == TARGET_DOT)
{
type = DOT;
info.dot = new Dot (span, nSpans, from);
OutputFile &OutputFile::wraw(const char *s, const char *e)
{
- if (block().opts->target == opt_t::CODE) {
+ if (block().opts->target == TARGET_CODE) {
insert_code();
stream().write(s, static_cast<std::streamsize>(e - s));
}
insert_code();
const opt_t *opts = block().opts;
const Enc &e = opts->encoding;
- prtChOrHex(stream(), n, e.szCodeUnit(), e.type() == Enc::EBCDIC, opts->target == opt_t::DOT);
+ prtChOrHex(stream(), n, e.szCodeUnit(), e.type() == Enc::EBCDIC, opts->target == TARGET_DOT);
return *this;
}
insert_code();
const opt_t *opts = block().opts;
const Enc &e = opts->encoding;
- printSpan(stream(), l, u, e.szCodeUnit(), e.type() == Enc::EBCDIC, opts->target == opt_t::DOT);
+ printSpan(stream(), l, u, e.szCodeUnit(), e.type() == Enc::EBCDIC, opts->target == TARGET_DOT);
return *this;
}
OutputFile &OutputFile::wdelay_tags(const ConfTags *cf)
{
- if (block().opts->target == opt_t::CODE) {
+ if (block().opts->target == TARGET_CODE) {
OutputFragment *frag = new OutputFragment(OutputFragment::TAGS, 0);
frag->tags = cf;
blocks.back()->fragments.push_back(frag);
OutputFile & OutputFile::wdelay_state_goto (uint32_t ind)
{
- if (block().opts->target == opt_t::CODE
+ if (block().opts->target == TARGET_CODE
&& block().opts->fFlag && !state_goto) {
block().fragments.push_back (new OutputFragment (OutputFragment::STATE_GOTO, ind));
state_goto = true;
OutputFile & OutputFile::wdelay_types ()
{
- if (block().opts->target == opt_t::CODE) {
+ if (block().opts->target == TARGET_CODE) {
warn_condition_order = false; // see note [condition order]
block().fragments.push_back (new OutputFragment (OutputFragment::TYPES, 0));
}
OutputFile & OutputFile::wdelay_yymaxfill ()
{
- if (block().opts->target == opt_t::CODE) {
+ if (block().opts->target == TARGET_CODE) {
block().fragments.push_back (new OutputFragment (OutputFragment::YYMAXFILL, 0));
}
return *this;
const size_t ncond = conds.size();
const std::string indstr = indent(ind, opts->indString);
- if (opts->target == opt_t::DOT) {
+ if (opts->target == TARGET_DOT) {
for (size_t i = 0; i < ncond; ++i) {
const std::string &cond = conds[i];
o << "0 -> " << cond << " [label=\"state=" << cond << "\"]\n";
// but prior to any other DFA transformations
Skeleton skeleton(dfa, opts, defrule, name, cond, line);
warn_undefined_control_flow(skeleton, warn);
- if (opts->target == opt_t::SKELETON) {
+ if (opts->target == TARGET_SKELETON) {
emit_data(skeleton);
}
// with current target: reset them to default
switch (target)
{
- case DOT:
+ case TARGET_DOT:
// default code generation options
sFlag = Opt::baseopt.sFlag;
bFlag = Opt::baseopt.bFlag;
// default environment-insensitive formatting
yybmHexTable = Opt::baseopt.yybmHexTable;
// fallthrough
- case SKELETON:
+ case TARGET_SKELETON:
// default line information
iFlag = Opt::baseopt.iFlag;
// default environment-sensitive formatting
// force individual options
switch (target)
{
- case DOT:
+ case TARGET_DOT:
iFlag = true;
break;
- case SKELETON:
+ case TARGET_SKELETON:
iFlag = true;
input_api = INPUT_CUSTOM;
indString = " ";
namespace re2c
{
+enum target_t
+{
+ TARGET_CODE,
+ TARGET_DOT,
+ TARGET_SKELETON
+};
+
#define RE2C_OPTS \
/* target */ \
- OPT1 (opt_t::target_t, target, CODE) \
+ OPT1 (target_t, target, TARGET_CODE) \
/* output file */ \
OPT (std::string, output_file, "") \
/* fingerprint */ \
struct opt_t
{
- enum target_t
- {
- CODE,
- DOT,
- SKELETON
- };
-
#define OPT1 OPT
#define OPT(type, name, value) type name;
RE2C_OPTS
"b" { opts.set_bFlag (true); goto opt_short; }
"c" { opts.set_cFlag (true); goto opt_short; }
"d" { opts.set_dFlag (true); goto opt_short; }
- "D" { opts.set_target (opt_t::DOT); goto opt_short; }
+ "D" { opts.set_target (TARGET_DOT); goto opt_short; }
"f" { opts.set_fFlag (true); goto opt_short; }
"F" { opts.set_FFlag (true); goto opt_short; }
"g" { opts.set_gFlag (true); goto opt_short; }
"i" { opts.set_iFlag (true); goto opt_short; }
"r" { opts.set_rFlag (true); goto opt_short; }
"s" { opts.set_sFlag (true); goto opt_short; }
- "S" { opts.set_target (opt_t::SKELETON); goto opt_short; }
+ "S" { opts.set_target (TARGET_SKELETON); goto opt_short; }
"T" { opts.set_tags (true); goto opt_short; }
"e" { opts.set_encoding(Enc::EBCDIC); goto opt_short; }
"u" { opts.set_encoding(Enc::UTF32); goto opt_short; }
"bit-vectors" end { opts.set_bFlag (true); goto opt; }
"start-conditions" end { opts.set_cFlag (true); goto opt; }
"debug-output" end { opts.set_dFlag (true); goto opt; }
- "emit-dot" end { opts.set_target (opt_t::DOT); goto opt; }
+ "emit-dot" end { opts.set_target (TARGET_DOT); goto opt; }
"storable-state" end { opts.set_fFlag (true); goto opt; }
"flex-syntax" end { opts.set_FFlag (true); goto opt; }
"computed-gotos" end { opts.set_gFlag (true); goto opt; }
"no-version" end { opts.set_version (false); goto opt; }
"case-insensitive" end { opts.set_bCaseInsensitive (true); goto opt; }
"case-inverted" end { opts.set_bCaseInverted (true); goto opt; }
- "skeleton" end { opts.set_target (opt_t::SKELETON); goto opt; }
+ "skeleton" end { opts.set_target (TARGET_SKELETON); goto opt; }
"tags" end { opts.set_tags (true); goto opt; }
"posix-captures" end { opts.set_posix_captures (true); goto opt; }
"no-lookahead" end { opts.set_lookahead(false); goto opt; }