tipc
A TIP to LLVM compiler
ASTBlockStmt.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ASTStmt.h"
4 
7 class ASTBlockStmt : public ASTStmt {
8  std::vector<std::shared_ptr<ASTStmt>> STMTS;
9 
10 public:
11  std::vector<std::shared_ptr<ASTNode>> getChildren() override;
12  ASTBlockStmt(std::vector<std::shared_ptr<ASTStmt>> STMTS);
13  std::vector<ASTStmt *> getStmts() const;
14  void accept(ASTVisitor *visitor) override;
15  llvm::Value *codegen() override;
16 
17 protected:
18  std::ostream &print(std::ostream &out) const override;
19 };
Class for block of statements.
Definition: ASTBlockStmt.h:7
std::vector< std::shared_ptr< ASTNode > > getChildren() override
Return all of the children for the node.
Definition: ASTBlockStmt.cpp:32
std::vector< ASTStmt * > getStmts() const
Definition: ASTBlockStmt.cpp:12
ASTBlockStmt(std::vector< std::shared_ptr< ASTStmt >> STMTS)
Definition: ASTBlockStmt.cpp:5
void accept(ASTVisitor *visitor) override
Visit the children of this node and apply the visitor.
Definition: ASTBlockStmt.cpp:14
llvm::Value * codegen() override
Perform code generation and return an LLVM value the code.
Definition: CodeGenFunctions.cpp:824
std::ostream & print(std::ostream &out) const override
Definition: ASTBlockStmt.cpp:23
Base class for all statement nodes.
Definition: ASTStmt.h:7
Base class for AST visitors.
Definition: ASTVisitor.h:23