aboutsummaryrefslogtreecommitdiff
path: root/model.h
diff options
context:
space:
mode:
Diffstat (limited to 'model.h')
-rw-r--r--model.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/model.h b/model.h
index d402b2b..f883032 100644
--- a/model.h
+++ b/model.h
@@ -259,6 +259,10 @@ class BoolObj: public EvalObj {
BoolObj(bool); /**< Converts a C bool value to a BoolObj*/
bool is_true(); /**< Override EvalObj `is_true()` */
string ext_repr();
+ /** Try to construct an BoolObj object
+ * @return NULL if failed
+ */
+ static BoolObj *from_string(string repr);
};
/** @class NumObj
@@ -290,6 +294,23 @@ class NumObj: public EvalObj {
virtual bool eq(NumObj *r) = 0;
};
+/** @class StrObj
+ * String support
+ */
+class StrObj: public EvalObj {
+ public:
+ string str;
+
+ /** Construct a string object */
+ StrObj(string str);
+ /** Try to construct an StrObj object
+ * @return NULL if failed
+ */
+ static StrObj *from_string(string repr);
+ string ext_repr();
+};
+
+
typedef map<string, EvalObj*> Str2EvalObj;
/** @class Environment
* The environment of current evaluation, i.e. the local variable binding