summaryrefslogtreecommitdiff
path: root/graphics/asymptote/newexp.h
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/asymptote/newexp.h
Initial commit
Diffstat (limited to 'graphics/asymptote/newexp.h')
-rw-r--r--graphics/asymptote/newexp.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/graphics/asymptote/newexp.h b/graphics/asymptote/newexp.h
new file mode 100644
index 0000000000..dd64584a6a
--- /dev/null
+++ b/graphics/asymptote/newexp.h
@@ -0,0 +1,60 @@
+/*****
+ * newexp.h
+ * Andy Hammerlindl 2003/07/28
+ *
+ * Handles the abstract syntax for expressions the create new objects,
+ * such as record, array, and function constructors.
+ *****/
+
+#ifndef NEWEXP_H
+#define NEWEXP_H
+
+#include "exp.h"
+#include "dec.h"
+#include "fundec.h"
+#include "entry.h"
+
+namespace absyntax {
+
+typedef fundef newFunctionExp;
+
+class newRecordExp : public exp {
+ ty *result;
+
+ static bool encodeLevel(position pos, coenv &e, trans::tyEntry *ent);
+public:
+ newRecordExp(position pos, ty *result)
+ : exp(pos), result(result) {}
+
+ void prettyprint(ostream &out, Int indent);
+
+ static types::ty *transFromTyEntry(position pos, coenv &e,
+ trans::tyEntry *ent);
+
+ types::ty *trans(coenv &e);
+ types::ty *getType(coenv &e);
+};
+
+class newArrayExp : public exp {
+ ty *celltype;
+ explist *dimexps;
+ dimensions *dims;
+ arrayinit *ai;
+
+public:
+ newArrayExp(position pos,
+ ty *celltype,
+ explist *dimexps,
+ dimensions *dims,
+ arrayinit *ai)
+ : exp(pos), celltype(celltype), dimexps(dimexps), dims(dims), ai(ai) {}
+
+ void prettyprint(ostream &out, Int indent);
+
+ types::ty *trans(coenv &e);
+ types::ty *getType(coenv &e);
+};
+
+} // namespace absyntax
+
+#endif