Index: main.cc =================================================================== --- main.cc (revision 805) +++ main.cc (working copy) @@ -24,6 +24,7 @@ bool bFlag = false; bool cFlag = false; +bool yFlag = false; bool dFlag = false; bool eFlag = false; bool fFlag = false; @@ -99,6 +100,7 @@ mbo_opt_struct('?', 0, "help"), mbo_opt_struct('b', 0, "bit-vectors"), mbo_opt_struct('c', 0, "start-conditions"), + mbo_opt_struct('y', 0, "yy-rule-setup"), mbo_opt_struct('d', 0, "debug-output"), mbo_opt_struct('e', 0, "ecb"), mbo_opt_struct('f', 0, "storable-state"), @@ -130,6 +132,8 @@ "\n" "-c --conditions Require start conditions.\n" "\n" + "-y --yy-rule-setup Emit a YY_RULE_SETUP macro before each rule code.\n" + "\n" "-d --debug-output Creates a parser that dumps information during\n" " about the current position and in which state the\n" " parser is.\n" @@ -201,6 +205,10 @@ cFlag = true; break; + case 'y': + yFlag = true; + break; + case 'e': xlat = asc2ebc; talx = ebc2asc; Index: code.cc =================================================================== --- code.cc (revision 805) +++ code.cc (working copy) @@ -684,6 +684,11 @@ RuleLine rl(*rule); + if (yFlag) + { + o << indent(ind) << "YY_RULE_SETUP\n"; + } + o << file_info(sourceFileInfo, &rl); o << indent(ind); if (rule->code->autogen) Index: globals.h =================================================================== --- globals.h (revision 805) +++ globals.h (working copy) @@ -18,6 +18,7 @@ extern bool bFlag; extern bool cFlag; +extern bool yFlag; extern bool dFlag; extern bool eFlag; extern bool fFlag;