From be31c941418c20757e505047b2f548862eb72896 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 23 Feb 2015 12:04:38 +0000 Subject: [PATCH] Renamed YYEOI -> YYLESSTHAN --- re2c/code.cc | 6 +++--- re2c/examples/input_custom/simple/README | 2 +- re2c/examples/input_custom/simple/default.re | 2 +- re2c/examples/input_custom/simple/fgetc.re | 2 +- re2c/examples/input_custom/simple/istringstream.re | 2 +- re2c/input_api.cc | 8 ++++---- re2c/input_api.h | 4 ++-- re2c/test/input_custom_default.--input(custom).c | 6 +++--- re2c/test/input_custom_default.--input(custom).re | 2 +- re2c/test/input_custom_fgetc.--input(custom).c | 6 +++--- re2c/test/input_custom_fgetc.--input(custom).re | 2 +- re2c/test/input_custom_istringstream.--input(custom).c | 6 +++--- re2c/test/input_custom_istringstream.--input(custom).re | 2 +- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/re2c/code.cc b/re2c/code.cc index 52b28efc..bc05fd6d 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -408,7 +408,7 @@ static void need(std::ostream &o, uint ind, uint n, bool & readCh, bool bSetMark { if (bUseYYFillCheck) { - o << "if (" << input_api.expr_eoi_one () << ") "; + o << "if (" << input_api.expr_lessthan_one () << ") "; } genYYFill(o, ind, n); } @@ -416,7 +416,7 @@ static void need(std::ostream &o, uint ind, uint n, bool & readCh, bool bSetMark { if (bUseYYFillCheck) { - o << "if (" << input_api.expr_eoi (n) << ") "; + o << "if (" << input_api.expr_lessthan (n) << ") "; } genYYFill(o, ind, n); } @@ -2318,7 +2318,7 @@ void Scanner::config(const Str& cfg, const Str& val) mapDefineKeys.insert("define:YYFILL"); mapDefineKeys.insert("define:YYGETCONDITION"); mapDefineKeys.insert("define:YYGETSTATE"); - mapDefineKeys.insert("define:YYEOI"); + mapDefineKeys.insert("define:YYLESSTHAN"); mapDefineKeys.insert("define:YYLIMIT"); mapDefineKeys.insert("define:YYMARKER"); mapDefineKeys.insert("define:YYPEEK"); diff --git a/re2c/examples/input_custom/simple/README b/re2c/examples/input_custom/simple/README index 60e5948e..c0c4d955 100644 --- a/re2c/examples/input_custom/simple/README +++ b/re2c/examples/input_custom/simple/README @@ -13,7 +13,7 @@ These are three examples of "--input custom" usage: Note that these examples are very simple and don't need to implement YYFILL; the only reason they don't use -"re2c:yyfill:enable = 0;" is to keep YYEOI and YYLIMIT +"re2c:yyfill:enable = 0;" is to keep YYLESSTHAN and YYLIMIT (for the sake of example). In real-life programs one will need to care for correct diff --git a/re2c/examples/input_custom/simple/default.re b/re2c/examples/input_custom/simple/default.re index 90781642..94cde7cd 100644 --- a/re2c/examples/input_custom/simple/default.re +++ b/re2c/examples/input_custom/simple/default.re @@ -9,7 +9,7 @@ bool lex (const char * cursor, const char * const limit) # define YYBACKUPCTX() ctxmarker = cursor # define YYRESTORE() cursor = marker # define YYRESTORECTX() cursor = ctxmarker -# define YYEOI(n) limit - cursor < n +# define YYLESSTHAN(n) limit - cursor < n # define YYFILL(n) {} /*!re2c "int buffer " / "[" [0-9]+ "]" { return true; } diff --git a/re2c/examples/input_custom/simple/fgetc.re b/re2c/examples/input_custom/simple/fgetc.re index b6c3ef1d..d2dffd9a 100644 --- a/re2c/examples/input_custom/simple/fgetc.re +++ b/re2c/examples/input_custom/simple/fgetc.re @@ -18,7 +18,7 @@ bool lex (FILE * f, const long limit) # define YYBACKUPCTX() ctxmarker = ftell (f) # define YYRESTORE() fseek (f, marker, SEEK_SET) # define YYRESTORECTX() fseek (f, ctxmarker, SEEK_SET) -# define YYEOI(n) limit - ftell (f) < n +# define YYLESSTHAN(n) limit - ftell (f) < n # define YYFILL(n) {} /*!re2c "int buffer " / "[" [0-9]+ "]" { return true; } diff --git a/re2c/examples/input_custom/simple/istringstream.re b/re2c/examples/input_custom/simple/istringstream.re index 35f4b002..5d702291 100644 --- a/re2c/examples/input_custom/simple/istringstream.re +++ b/re2c/examples/input_custom/simple/istringstream.re @@ -11,7 +11,7 @@ bool lex (std::istringstream & is, const std::streampos limit) # define YYBACKUPCTX() ctxmarker = is.tellg () # define YYRESTORE() is.seekg (marker) # define YYRESTORECTX() is.seekg (ctxmarker) -# define YYEOI(n) limit - is.tellg () < n +# define YYLESSTHAN(n) limit - is.tellg () < n # define YYFILL(n) {} /*!re2c "int buffer " / "[" [0-9]+ "]" { return true; } diff --git a/re2c/input_api.cc b/re2c/input_api.cc index 0053f216..3fe20dbc 100644 --- a/re2c/input_api.cc +++ b/re2c/input_api.cc @@ -142,14 +142,14 @@ std::string InputAPI::stmt_skip_backup_peek (uint ind) : stmt_skip (ind) + stmt_backup (ind) + stmt_peek (ind); } -std::string InputAPI::expr_eoi_one () +std::string InputAPI::expr_lessthan_one () { return type == DEFAULT ? mapCodeName["YYLIMIT"] + " <= " + mapCodeName["YYCURSOR"] - : expr_eoi (1); + : expr_lessthan (1); } -std::string InputAPI::expr_eoi (uint n) +std::string InputAPI::expr_lessthan (uint n) { std::ostringstream s; switch (type) @@ -158,7 +158,7 @@ std::string InputAPI::expr_eoi (uint n) s << "(" << mapCodeName["YYLIMIT"] << " - " << mapCodeName["YYCURSOR"] << ") < " << n; break; case CUSTOM: - s << mapCodeName["YYEOI"] << " (" << n << ")"; + s << mapCodeName["YYLESSTHAN"] << " (" << n << ")"; break; } return s.str (); diff --git a/re2c/input_api.h b/re2c/input_api.h index 428f5b4a..2db31269 100644 --- a/re2c/input_api.h +++ b/re2c/input_api.h @@ -34,8 +34,8 @@ public: std::string stmt_skip_backup (uint ind); std::string stmt_backup_peek (uint ind); std::string stmt_skip_backup_peek (uint ind); - std::string expr_eoi_one (); - std::string expr_eoi (uint n); + std::string expr_lessthan_one (); + std::string expr_lessthan (uint n); }; } // end namespace re2c diff --git a/re2c/test/input_custom_default.--input(custom).c b/re2c/test/input_custom_default.--input(custom).c index fb6e2755..7c438f86 100644 --- a/re2c/test/input_custom_default.--input(custom).c +++ b/re2c/test/input_custom_default.--input(custom).c @@ -11,14 +11,14 @@ bool lex (const char * cursor, const char * const limit) # define YYBACKUPCTX() ctxmarker = cursor # define YYRESTORE() cursor = marker # define YYRESTORECTX() cursor = ctxmarker -# define YYEOI(n) limit - cursor < n +# define YYLESSTHAN(n) limit - cursor < n # define YYFILL(n) {} #line 18 "" { YYCTYPE yych; - if (YYEOI (13)) YYFILL(13); + if (YYLESSTHAN (13)) YYFILL(13); yych = YYPEEK (); switch (yych) { case 'i': goto yy4; @@ -130,7 +130,7 @@ yy16: } yy17: YYSKIP (); - if (YYEOI (1)) YYFILL(1); + if (YYLESSTHAN (1)) YYFILL(1); yych = YYPEEK (); switch (yych) { case '0': diff --git a/re2c/test/input_custom_default.--input(custom).re b/re2c/test/input_custom_default.--input(custom).re index 90781642..94cde7cd 100644 --- a/re2c/test/input_custom_default.--input(custom).re +++ b/re2c/test/input_custom_default.--input(custom).re @@ -9,7 +9,7 @@ bool lex (const char * cursor, const char * const limit) # define YYBACKUPCTX() ctxmarker = cursor # define YYRESTORE() cursor = marker # define YYRESTORECTX() cursor = ctxmarker -# define YYEOI(n) limit - cursor < n +# define YYLESSTHAN(n) limit - cursor < n # define YYFILL(n) {} /*!re2c "int buffer " / "[" [0-9]+ "]" { return true; } diff --git a/re2c/test/input_custom_fgetc.--input(custom).c b/re2c/test/input_custom_fgetc.--input(custom).c index e9ce4b0d..5528cfc4 100644 --- a/re2c/test/input_custom_fgetc.--input(custom).c +++ b/re2c/test/input_custom_fgetc.--input(custom).c @@ -20,14 +20,14 @@ bool lex (FILE * f, const long limit) # define YYBACKUPCTX() ctxmarker = ftell (f) # define YYRESTORE() fseek (f, marker, SEEK_SET) # define YYRESTORECTX() fseek (f, ctxmarker, SEEK_SET) -# define YYEOI(n) limit - ftell (f) < n +# define YYLESSTHAN(n) limit - ftell (f) < n # define YYFILL(n) {} #line 27 "" { YYCTYPE yych; - if (YYEOI (13)) YYFILL(13); + if (YYLESSTHAN (13)) YYFILL(13); yych = YYPEEK (); switch (yych) { case 'i': goto yy4; @@ -139,7 +139,7 @@ yy16: } yy17: YYSKIP (); - if (YYEOI (1)) YYFILL(1); + if (YYLESSTHAN (1)) YYFILL(1); yych = YYPEEK (); switch (yych) { case '0': diff --git a/re2c/test/input_custom_fgetc.--input(custom).re b/re2c/test/input_custom_fgetc.--input(custom).re index b6c3ef1d..d2dffd9a 100644 --- a/re2c/test/input_custom_fgetc.--input(custom).re +++ b/re2c/test/input_custom_fgetc.--input(custom).re @@ -18,7 +18,7 @@ bool lex (FILE * f, const long limit) # define YYBACKUPCTX() ctxmarker = ftell (f) # define YYRESTORE() fseek (f, marker, SEEK_SET) # define YYRESTORECTX() fseek (f, ctxmarker, SEEK_SET) -# define YYEOI(n) limit - ftell (f) < n +# define YYLESSTHAN(n) limit - ftell (f) < n # define YYFILL(n) {} /*!re2c "int buffer " / "[" [0-9]+ "]" { return true; } diff --git a/re2c/test/input_custom_istringstream.--input(custom).c b/re2c/test/input_custom_istringstream.--input(custom).c index 0bf59a3d..955c05f7 100644 --- a/re2c/test/input_custom_istringstream.--input(custom).c +++ b/re2c/test/input_custom_istringstream.--input(custom).c @@ -13,14 +13,14 @@ bool lex (std::istringstream & is, const std::streampos limit) # define YYBACKUPCTX() ctxmarker = is.tellg () # define YYRESTORE() is.seekg (marker) # define YYRESTORECTX() is.seekg (ctxmarker) -# define YYEOI(n) limit - is.tellg () < n +# define YYLESSTHAN(n) limit - is.tellg () < n # define YYFILL(n) {} #line 20 "" { YYCTYPE yych; - if (YYEOI (13)) YYFILL(13); + if (YYLESSTHAN (13)) YYFILL(13); yych = YYPEEK (); switch (yych) { case 'i': goto yy4; @@ -132,7 +132,7 @@ yy16: } yy17: YYSKIP (); - if (YYEOI (1)) YYFILL(1); + if (YYLESSTHAN (1)) YYFILL(1); yych = YYPEEK (); switch (yych) { case '0': diff --git a/re2c/test/input_custom_istringstream.--input(custom).re b/re2c/test/input_custom_istringstream.--input(custom).re index 35f4b002..5d702291 100644 --- a/re2c/test/input_custom_istringstream.--input(custom).re +++ b/re2c/test/input_custom_istringstream.--input(custom).re @@ -11,7 +11,7 @@ bool lex (std::istringstream & is, const std::streampos limit) # define YYBACKUPCTX() ctxmarker = is.tellg () # define YYRESTORE() is.seekg (marker) # define YYRESTORECTX() is.seekg (ctxmarker) -# define YYEOI(n) limit - is.tellg () < n +# define YYLESSTHAN(n) limit - is.tellg () < n # define YYFILL(n) {} /*!re2c "int buffer " / "[" [0-9]+ "]" { return true; } -- 2.40.0