summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/combine/libcombine.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/combine/libcombine.hh
add: added projectsHEADmain
Diffstat (limited to 'tiger-compiler/src/combine/libcombine.hh')
-rw-r--r--tiger-compiler/src/combine/libcombine.hh44
1 files changed, 44 insertions, 0 deletions
diff --git a/tiger-compiler/src/combine/libcombine.hh b/tiger-compiler/src/combine/libcombine.hh
new file mode 100644
index 0000000..66f3c4c
--- /dev/null
+++ b/tiger-compiler/src/combine/libcombine.hh
@@ -0,0 +1,44 @@
+/**
+ ** \file combine/libcombine.hh
+ ** \brief Declare functions and variables exported by combine module.
+ */
+
+#pragma once
+
+#include <ast/fwd.hh>
+#include <misc/error.hh>
+#include <overload/binder.hh>
+
+namespace combine
+{
+ /*-------.
+ | Bind. |
+ `-------*/
+
+ /** \brief Bind identifier uses to their definition, allowing
+ function overloading, and return a list of potential definition
+ sites for each function call.
+
+ \param tree AST to bind.
+
+ \return a pair whose first element is the potential function
+ bindings, and the second element the error status. */
+ std::pair<overload::overfun_bindings_type, misc::error>
+ combine_bind(ast::Ast& tree, bool overloads_enabled);
+
+ /*------------------------------.
+ | Compute types with overload. |
+ `------------------------------*/
+
+ /** \brief Check types allowing function overloading.
+
+ \param tree abstract syntax tree's root.
+ \param combine_bindings potential function bindings.
+
+ \return success of the type-checking. */
+ misc::error
+ combine_types_check(ast::Ast& tree,
+ const overload::overfun_bindings_type& combine_bindings,
+ bool overloads_enabled);
+
+} // namespace combine