aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include/function.hpp
blob: d608531b1c04213b33e5d2e3c37487639a82e64e (plain)
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
#ifndef AST_FUNCTION_HPP
#define AST_FUNCTION_HPP

#include "ast.hpp"


struct VarLocation {
    Type* type;
    int32_t stack_position;
};


class Function : public Node {
protected:
    Type* type;
    std::string id;
    Declaration* parameter_list;
    Statement* statement;
    
public:
    Function(const std::string& _id, Declaration* _parameter_list, Statement* _statement);

    virtual void print() const;
    virtual void printxml() const;
    virtual void printasm() const;
};


#endif