summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/ast/for-exp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tiger-compiler/src/ast/for-exp.cc')
-rw-r--r--tiger-compiler/src/ast/for-exp.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/tiger-compiler/src/ast/for-exp.cc b/tiger-compiler/src/ast/for-exp.cc
new file mode 100644
index 0000000..2ed51e1
--- /dev/null
+++ b/tiger-compiler/src/ast/for-exp.cc
@@ -0,0 +1,28 @@
+/**
+ ** \file ast/for-exp.cc
+ ** \brief Implementation of ast::ForExp.
+ */
+
+#include <ast/for-exp.hh>
+#include <ast/visitor.hh>
+
+namespace ast
+{
+ ForExp::ForExp(const Location& location, VarDec* vardec, Exp* hi, Exp* body)
+ : Exp(location)
+ , vardec_(vardec)
+ , hi_(hi)
+ , body_(body)
+ {}
+
+ ForExp::~ForExp()
+ {
+ delete vardec_;
+ delete hi_;
+ delete body_;
+ }
+
+ void ForExp::accept(ConstVisitor& v) const { v(*this); }
+
+ void ForExp::accept(Visitor& v) { v(*this); }
+} // namespace ast