blob: 38e18986ec2ea1f4b25f8a4d8686935dc1c2b00a (
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
32
33
34
35
36
37
38
|
#ifndef AST_FUNCTION_HPP
#define AST_FUNCTION_HPP
#include "bindings.hpp"
#include "declaration.hpp"
#include "node.hpp"
#include "statement.hpp"
#include "type.hpp"
#include <memory>
#include <string>
class Function;
typedef std::shared_ptr<Function> FunctionPtr;
class Function : public Node {
protected:
TypePtr type_;
std::string id_;
StatementPtr statement_;
DeclarationPtr parameter_list_;
public:
Function(const std::string& id, Statement* statement, DeclarationPtr parameter_list = nullptr);
virtual void print() const;
virtual void printXml() const;
virtual VariableStackBindings printAsm(VariableStackBindings bindings, unsigned& label_count) const;
void printParameterAsm(VariableStackBindings& bindings, unsigned& stack_offset,
unsigned& frame_offset) const;
void countParameters(unsigned& parameter_count) const;
};
#endif
|