summaryrefslogtreecommitdiff
path: root/lib/codegen/include/code_gen/CG_stringRepr.h
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-09-19 21:14:58 +0000
committerTuowen Zhao <ztuowen@gmail.com>2016-09-19 21:14:58 +0000
commit210f77d2c32f14d2e99577fd3c9842bb19d47e50 (patch)
tree5edb327c919b8309e301c3440fb6668a0075c8ef /lib/codegen/include/code_gen/CG_stringRepr.h
parenta66ce5cd670c4d3c0dc449720f5bc45dd4c281b8 (diff)
downloadchill-210f77d2c32f14d2e99577fd3c9842bb19d47e50.tar.gz
chill-210f77d2c32f14d2e99577fd3c9842bb19d47e50.tar.bz2
chill-210f77d2c32f14d2e99577fd3c9842bb19d47e50.zip
Moved most modules into lib
Diffstat (limited to 'lib/codegen/include/code_gen/CG_stringRepr.h')
-rw-r--r--lib/codegen/include/code_gen/CG_stringRepr.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/codegen/include/code_gen/CG_stringRepr.h b/lib/codegen/include/code_gen/CG_stringRepr.h
new file mode 100644
index 0000000..a6df85d
--- /dev/null
+++ b/lib/codegen/include/code_gen/CG_stringRepr.h
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ Copyright (C) 1994-2000 the Omega Project Team
+ Copyright (C) 2005-2011 Chun Chen
+ All Rights Reserved.
+
+ Purpose:
+ pseudo string code wrapper
+
+ Notes:
+
+ History:
+ 04/17/96 - Lei Zhou - created
+*****************************************************************************/
+
+#ifndef _CG_STRINGREPR_H
+#define _CG_STRINGREPR_H
+
+#include <code_gen/CG_outputRepr.h>
+#include <string>
+#include <iostream>
+
+namespace omega {
+
+class CG_stringRepr: public CG_outputRepr {
+private:
+ std::string s_;
+
+public:
+ CG_stringRepr() {}
+ CG_stringRepr(const std::string &s) { s_ = s; }
+ ~CG_stringRepr() {}
+ CG_outputRepr *clone() const { return new CG_stringRepr(s_); }
+ void dump() const { std::cout << s_ << std::endl; }
+
+ //---------------------------------------------------------------------------
+ // basic operation
+ //---------------------------------------------------------------------------
+ std::string GetString() const { return s_; }
+};
+
+}
+
+#endif