From 37f7c8a7846b49c22518f035e34fccf19628fa99 Mon Sep 17 00:00:00 2001 From: helly Date: Sat, 15 Apr 2006 18:44:20 +0000 Subject: [PATCH] - Fixed -i switch. - Added configuration 'yyfill:enable' to allow suppression of YYFILL() blocks. --- CHANGELOG | 4 +- code.cc | 21 ++- globals.h | 1 + htdocs/index.html | 4 +- htdocs/manual.html | 4 + lessons/001_upn_calculator/calc_005.c | 2 +- lessons/001_upn_calculator/calc_005.re | 2 +- lessons/001_upn_calculator/calc_006.s.c | 201 +++++++++++++++++++++++ lessons/001_upn_calculator/calc_006.s.re | 162 ++++++++++++++++++ lessons/001_upn_calculator/readme.txt | 8 + main.cc | 2 + re2c.1.in | 5 + test/{input13.c => config5.c} | 8 +- test/{input13.re => config5.re} | 0 test/config6.c | 139 ++++++++++++++++ test/config6.re | 40 +++++ 16 files changed, 588 insertions(+), 15 deletions(-) create mode 100755 lessons/001_upn_calculator/calc_006.s.c create mode 100755 lessons/001_upn_calculator/calc_006.s.re rename test/{input13.c => config5.c} (90%) rename test/{input13.re => config5.re} (100%) create mode 100755 test/config6.c create mode 100755 test/config6.re diff --git a/CHANGELOG b/CHANGELOG index a01a7355..6852abfa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ -Version 0.10.2 (2006-04-13) +Version 0.10.2 (2006-??-??) --------------------------- +- Fixed -i switch. +- Added configuration 'yyfill:enable' to allow suppression of YYFILL() blocks. - Added tutorial like lessons to re2c. - Added /*!ignore!re2c */ to support documenting of re2c source. - Fixed issue with multiline re2c comments (/*!max:re2c ... */ and alike). diff --git a/code.cc b/code.cc index 382c3897..ec826ac8 100644 --- a/code.cc +++ b/code.cc @@ -301,13 +301,16 @@ static void need(std::ostream &o, uint ind, uint n, bool & readCh, bool bSetMark o << indent(ind) << "YYSETSTATE(" << fillIndex << ");\n"; } - if (n == 1) + if (bUseYYFill) { - o << indent(ind) << "if(YYLIMIT == YYCURSOR) YYFILL(1);\n"; - } - else - { - o << indent(ind) << "if((YYLIMIT - YYCURSOR) < " << n << ") YYFILL(" << n << ");\n"; + if (n == 1) + { + o << indent(ind) << "if(YYLIMIT == YYCURSOR) YYFILL(1);\n"; + } + else + { + o << indent(ind) << "if((YYLIMIT - YYCURSOR) < " << n << ") YYFILL(" << n << ");\n"; + } } if (fFlag) @@ -1461,7 +1464,7 @@ void genGetState(std::ostream &o, uint& ind, uint start_label) std::ostream& operator << (std::ostream& o, const file_info& li) { - if (li.ln) + if (li.ln && !iFlag) { o << "#line " << li.ln->get_line() << " \"" << li.fname << "\"\n"; } @@ -1500,6 +1503,10 @@ void Scanner::config(const Str& cfg, int num) { bUseStateNext = num != 0; } + else if (cfg.to_string() == "yyfill:enable") + { + bUseYYFill = num != 0; + } else { fatal("unrecognized configuration name or illegal integer value"); diff --git a/globals.h b/globals.h index 59103965..7ca83829 100644 --- a/globals.h +++ b/globals.h @@ -35,6 +35,7 @@ extern bool yybmHexTable; extern bool bUseStateAbort; extern bool bUseStateNext; extern bool bWroteGetState; +extern bool bUseYYFill; extern uint asc2ebc[256]; extern uint ebc2asc[256]; diff --git a/htdocs/index.html b/htdocs/index.html index cb638897..ca954398 100755 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -76,8 +76,10 @@ provide re2c packages.

Changelog

-

2006-04-13: 0.10.2

+

2006-??-??: 0.10.2