obelisk/src/ast/function_ast.h

31 lines
746 B
C
Raw Normal View History

2022-10-17 22:26:36 -03:00
#ifndef OBELISK_AST_FUNCTION_AST_H
#define OBELISK_AST_FUNCTION_AST_H
#include "ast/expression_ast.h"
#include "ast/prototype_ast.h"
#include <memory>
namespace obelisk
{
class FunctionAST
{
private:
std::unique_ptr<PrototypeAST> prototype_;
std::unique_ptr<ExpressionAST> body_;
std::unique_ptr<PrototypeAST> getPrototype();
void setPrototype(std::unique_ptr<PrototypeAST> prototype);
public:
FunctionAST(std::unique_ptr<PrototypeAST> prototype,
std::unique_ptr<ExpressionAST> body) :
prototype_(std::move(prototype)),
body_(std::move(body))
{
}
};
} // namespace obelisk
#endif