-
Notifications
You must be signed in to change notification settings - Fork 0
/
FunctionSymbol.hpp
41 lines (37 loc) · 1.12 KB
/
FunctionSymbol.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "Symbol.hpp"
/**
* @brief This is the symbol representation of Function, what its inputs are and what it returns
*/
class FunctionSymbol : public Symbol
{
private:
std::vector<Symbol> m_args;
Symbol m_return;
public:
/**
* @brief constructor of FunctionSymbol
* @param name
* @param mArgs
* @param mReturn
* @param variable
* @param exported
*/
explicit FunctionSymbol(std::string name, std::string moduleName, std::vector<Symbol> &&mArgs,
Symbol &&mReturn, bool variable, bool exported);
/**
* @brief returns the vector containing the argument symbols of the function
* @return std::vector<Symbol> representing of the arguments of the function
*/
std::vector<Symbol> const& args() const;
/**
* @brief return value of the function
* @return
*/
Symbol returnValue() const;
/**
* @brief returns the string representation of the function signature with types only
* @return std::string representing the function signature with types in the form (f : I -> O)
*/
std::string functionSignature() const;
};