summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/ast/call-exp.hh
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
commit967be9e750221ab2ab783f95df79bb26d290a45e (patch)
tree6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/src/ast/call-exp.hh
add: added projectsHEADmain
Diffstat (limited to 'tiger-compiler/src/ast/call-exp.hh')
-rw-r--r--tiger-compiler/src/ast/call-exp.hh64
1 files changed, 64 insertions, 0 deletions
diff --git a/tiger-compiler/src/ast/call-exp.hh b/tiger-compiler/src/ast/call-exp.hh
new file mode 100644
index 0000000..a4b6c90
--- /dev/null
+++ b/tiger-compiler/src/ast/call-exp.hh
@@ -0,0 +1,64 @@
+/**
+ ** \file ast/call-exp.hh
+ ** \brief Declaration of ast::CallExp.
+ */
+
+#pragma once
+
+#include <ast/exp.hh>
+#include <ast/function-dec.hh>
+#include <misc/symbol.hh>
+
+namespace ast
+{
+ /// CallExp.
+ class CallExp : public Exp
+ {
+ public:
+ /** \name Ctor & dtor.
+ ** \{ */
+ /// Construct a CallExp node.
+ CallExp(const Location& location, misc::symbol name, exps_type* args);
+ CallExp(const CallExp&) = delete;
+ CallExp& operator=(const CallExp&) = delete;
+ /// Destroy a CallExp node.
+ ~CallExp() override;
+ /** \} */
+
+ /// \name Visitors entry point.
+ /// \{ */
+ /// Accept a const visitor \a v.
+ void accept(ConstVisitor& v) const override;
+ /// Accept a non-const visitor \a v.
+ void accept(Visitor& v) override;
+ /// \}
+
+ /** \name Accessors.
+ ** \{ */
+ /// Return identifier of the called function.
+ misc::symbol name_get() const;
+ /// Set identifier of the called function.
+ void name_set(misc::symbol);
+ /// Return list of arguments passed to the function.
+ const exps_type& args_get() const;
+ /// Return list of arguments passed to the function.
+ exps_type& args_get();
+ // FIXME DONE: Some code was deleted here.
+ /// Return definition site.
+ const FunctionDec* def_get() const;
+ FunctionDec* def_get();
+ // FIXME DONE: Some code was deleted here.
+ /// Set definition site.
+ void def_set(FunctionDec*);
+ /** \} */
+
+ protected:
+ /// Identifier of the called function.
+ misc::symbol name_;
+ /// List of arguments passed to the function.
+ exps_type* args_;
+ /// Definition site.
+ FunctionDec* def_ = nullptr;
+ };
+} // namespace ast
+#include <ast/call-exp.hxx>