From 7a2558c1fa37e9e948e99cbe95a3b06fe5d6bf61 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 12 May 2015 12:51:30 +0100 Subject: [PATCH] Merged 'src/codegen/translate.cc' into 'src/codegen/print.cc'. --- re2c/Makefile.am | 1 - re2c/src/codegen/print.cc | 11 +++++++++++ re2c/src/codegen/print.h | 2 ++ re2c/src/codegen/translate.cc | 19 ------------------- re2c/src/globals.h | 3 --- 5 files changed, 13 insertions(+), 23 deletions(-) delete mode 100644 re2c/src/codegen/translate.cc diff --git a/re2c/Makefile.am b/re2c/Makefile.am index c3efd9d0..fcb52133 100644 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -74,7 +74,6 @@ SRC = \ $(srcdir)/src/codegen/print.cc \ $(srcdir)/src/codegen/scc.cc \ $(srcdir)/src/codegen/skeleton/skeleton.cc \ - $(srcdir)/src/codegen/translate.cc \ $(srcdir)/src/dfa/encoding/enc.cc \ $(srcdir)/src/dfa/encoding/range_suffix.cc \ $(srcdir)/src/dfa/encoding/utf16/utf16.cc \ diff --git a/re2c/src/codegen/print.cc b/re2c/src/codegen/print.cc index 15362349..09d0a1a8 100644 --- a/re2c/src/codegen/print.cc +++ b/re2c/src/codegen/print.cc @@ -6,6 +6,17 @@ namespace re2c { +char octCh(uint32_t c) +{ + return '0' + c % 8; +} + +char hexCh(uint32_t c) +{ + static const char * sHex = "0123456789ABCDEF"; + return sHex[c & 0x0F]; +} + void prtChOrHex(std::ostream& o, uint32_t c) { if (!encoding.is(Enc::EBCDIC) && (c < 256u) && (isprint(c) || isspace(c))) diff --git a/re2c/src/codegen/print.h b/re2c/src/codegen/print.h index 4d3a5a61..53c0a28a 100644 --- a/re2c/src/codegen/print.h +++ b/re2c/src/codegen/print.h @@ -8,6 +8,8 @@ namespace re2c { +char octCh(uint32_t c); +char hexCh(uint32_t c); void prtCh(std::ostream&, uint32_t); void prtHex(std::ostream&, uint32_t); void prtChOrHex(std::ostream&, uint32_t); diff --git a/re2c/src/codegen/translate.cc b/re2c/src/codegen/translate.cc deleted file mode 100644 index f4110efd..00000000 --- a/re2c/src/codegen/translate.cc +++ /dev/null @@ -1,19 +0,0 @@ -/* $Id$ */ -#include "src/globals.h" - -namespace re2c -{ - -char octCh(uint32_t c) -{ - return '0' + c % 8; -} - -static const char * sHex = "0123456789ABCDEF"; - -char hexCh(uint32_t c) -{ - return sHex[c & 0x0F]; -} - -} // end namespace re2c diff --git a/re2c/src/globals.h b/re2c/src/globals.h index dbaf3d58..8c8d038e 100644 --- a/re2c/src/globals.h +++ b/re2c/src/globals.h @@ -83,9 +83,6 @@ extern CodeNames mapCodeName; extern Enc encoding; extern InputAPI input_api; -extern char octCh(uint32_t c); -extern char hexCh(uint32_t c); - } // end namespace re2c #endif -- 2.40.0