tipc
A TIP to LLVM compiler
ASTFunAppExpr.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ASTExpr.h"
4 
7 class ASTFunAppExpr : public ASTExpr {
8  std::shared_ptr<ASTExpr> FUN;
9  std::vector<std::shared_ptr<ASTExpr>> ACTUALS;
10 
11 public:
12  std::vector<std::shared_ptr<ASTNode>> getChildren() override;
13  ASTFunAppExpr(std::shared_ptr<ASTExpr> FUN,
14  std::vector<std::shared_ptr<ASTExpr>> ACTUALS);
15  ASTExpr *getFunction() const { return FUN.get(); }
16  std::vector<ASTExpr *> getActuals() const;
17  void accept(ASTVisitor *visitor) override;
18  llvm::Value *codegen() override;
19 
20 protected:
21  std::ostream &print(std::ostream &out) const override;
22 };
Abstract class for all expression subtypes.
Definition: ASTExpr.h:7
Class for function call expressions.
Definition: ASTFunAppExpr.h:7
void accept(ASTVisitor *visitor) override
Visit the children of this node and apply the visitor.
Definition: ASTFunAppExpr.cpp:19
std::vector< ASTExpr * > getActuals() const
Definition: ASTFunAppExpr.cpp:15
std::vector< std::shared_ptr< ASTNode > > getChildren() override
Return all of the children for the node.
Definition: ASTFunAppExpr.cpp:44
ASTExpr * getFunction() const
Definition: ASTFunAppExpr.h:15
std::ostream & print(std::ostream &out) const override
Definition: ASTFunAppExpr.cpp:29
ASTFunAppExpr(std::shared_ptr< ASTExpr > FUN, std::vector< std::shared_ptr< ASTExpr >> ACTUALS)
Definition: ASTFunAppExpr.cpp:5
llvm::Value * codegen() override
Perform code generation and return an LLVM value the code.
Definition: CodeGenFunctions.cpp:511
Base class for AST visitors.
Definition: ASTVisitor.h:23