aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include/function.hpp
blob: 955420d8825ea11c4ca7fcb08079ac387b8a925b (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
30
31
#ifndef AST_FUNCTION_HPP
#define AST_FUNCTION_HPP

#include "ast.hpp"


class Function : public BaseNode {
protected:
    std::string id;
    
public:
    Function(const std::string& _id, const BaseList* _param_list, const BaseNode* _comp_statement)
	: BaseNode(_param_list, _comp_statement), id(_id) {}

    virtual void printxml() const override {
	std::cout << "<Function id=\"" << id << "\">" << std::endl;
        leftNode->printxml();
	rightNode->printxml();
	std::cout << "</Function>" << std::endl;
    }
};


class ParamList : public BaseList {
public:
    ParamList() : BaseList() {}
    ParamList(const Base* _param) : BaseList(_param) {}
};


#endif