From 00b14f309b5da3917d62f7d98a727290eaee6ea2 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Thu, 14 May 2015 16:37:54 +0100 Subject: [PATCH] Removed obsolete 're2c::Str' stuff. --- re2c/src/codegen/output.cc | 7 ------- re2c/src/codegen/output.h | 3 --- re2c/src/util/substr.cc | 28 ---------------------------- re2c/src/util/substr.h | 9 --------- 4 files changed, 47 deletions(-) diff --git a/re2c/src/codegen/output.cc b/re2c/src/codegen/output.cc index b5992918..9d50ad8c 100644 --- a/re2c/src/codegen/output.cc +++ b/re2c/src/codegen/output.cc @@ -6,7 +6,6 @@ #include "src/codegen/output.h" #include "src/codegen/print.h" #include "src/globals.h" -#include "src/util/substr.h" // operator << for Str namespace re2c { @@ -140,12 +139,6 @@ OutputFile & operator << (OutputFile & u, const char * s) return u; } -OutputFile & operator << (OutputFile & u, const Str & s) -{ - u.stream () << s; - return u; -} - void OutputFile::insert_code () { blocks.back ()->fragments.push_back (new OutputFragment (OutputFragment::CODE, 0)); diff --git a/re2c/src/codegen/output.h b/re2c/src/codegen/output.h index e7358821..860bae25 100644 --- a/re2c/src/codegen/output.h +++ b/re2c/src/codegen/output.h @@ -12,8 +12,6 @@ namespace re2c { -class Str; - struct OutputFragment { enum type_t @@ -69,7 +67,6 @@ struct OutputFile friend OutputFile & operator << (OutputFile & o, uint32_t n); friend OutputFile & operator << (OutputFile & o, const std::string & s); friend OutputFile & operator << (OutputFile & o, const char * s); - friend OutputFile & operator << (OutputFile & o, const Str & s); void insert_line_info (); void insert_state_goto (uint32_t ind, uint32_t start_label); diff --git a/re2c/src/util/substr.cc b/re2c/src/util/substr.cc index b2cbc094..9bf4a41d 100644 --- a/re2c/src/util/substr.cc +++ b/re2c/src/util/substr.cc @@ -31,32 +31,4 @@ bool operator==(const SubStr &s1, const SubStr &s2) return (bool) (s1.len == s2.len && memcmp(s1.str, s2.str, s1.len) == 0); } -Str::Str(const SubStr& s) - : SubStr(strndup(s.str, s.len), s.len) -{ - ; -} - -Str::Str(const char *s) - : SubStr(strdup(s), strlen(s)) -{ - ; -} - -Str::Str() - : SubStr((char*) NULL, 0) -{ - ; -} - - -Str::~Str() -{ - if (str) { - free((void*)str); - } - str = NULL; - len = 0; -} - } // end namespace re2c diff --git a/re2c/src/util/substr.h b/re2c/src/util/substr.h index c9e9aedb..4f6f5683 100644 --- a/re2c/src/util/substr.h +++ b/re2c/src/util/substr.h @@ -34,15 +34,6 @@ private: SubStr & operator = (const SubStr &); }; -class Str: public SubStr -{ -public: - explicit Str(const char*); - Str(const SubStr&); - Str(); - virtual ~Str(); -}; - inline std::ostream& operator<<(std::ostream& o, const SubStr &s) { s.out(o); -- 2.40.0