summaryrefslogtreecommitdiff
path: root/graphics/asymptote/absyn.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/absyn.h
Initial commit
Diffstat (limited to 'graphics/asymptote/absyn.h')
-rw-r--r--graphics/asymptote/absyn.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/graphics/asymptote/absyn.h b/graphics/asymptote/absyn.h
new file mode 100644
index 0000000000..c8b85009ec
--- /dev/null
+++ b/graphics/asymptote/absyn.h
@@ -0,0 +1,65 @@
+/****
+ * absyn.h
+ * Andy Hammerlindl 2002/07/14
+ *
+ * Defines the basic types of abstract syntax objects using forward
+ * class declarations.
+ *****/
+
+#ifndef ABSYN_H
+#define ABSYN_H
+
+#include "common.h"
+#include "errormsg.h" // For position
+
+// Forward declaration for markPos.
+namespace trans {
+class coenv;
+}
+
+namespace absyntax {
+
+class absyn : public gc {
+protected:
+ const position pos;
+
+ void markPos(trans::coenv& c);
+
+public:
+ absyn(position pos)
+ : pos(pos) {}
+
+ virtual ~absyn();
+
+ position getPos() const
+ {
+ return pos;
+ }
+
+ virtual void prettyprint(ostream &out, Int indent) = 0;
+private: // Non-copyable
+ void operator=(const absyn&);
+ absyn(const absyn&);
+};
+
+void prettyindent(ostream &out, Int indent);
+void prettyname(ostream &out, string name, Int indent);
+
+class name;
+class ty;
+class varinit;
+class exp;
+class runnable;
+class stm;
+class dec;
+class block;
+
+typedef block file;
+
+// This is the abstract syntax tree of a file, assigned to when running
+// yyparse.
+extern file *root;
+
+}
+
+#endif