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