From 0d499c6a682b95557c72136cf8c5b02e7822aff2 Mon Sep 17 00:00:00 2001 From: uebian Date: Sat, 20 Feb 2021 08:32:38 +0800 Subject: [PATCH 1/2] Add WhileExprAST --- src/Makefile.am | 2 +- src/ast/WhileExprAST.cpp | 23 +++++++++++++++++++++++ src/ast/WhileExprAST.h | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/ast/WhileExprAST.cpp create mode 100644 src/ast/WhileExprAST.h diff --git a/src/Makefile.am b/src/Makefile.am index dc1f9b8..4193a27 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS = aloc aloc_SOURCES = aloc.cpp CompileUnit.cpp preprocessor.cpp Token.cpp utils.cpp\ ast/AssignmentAST.cpp ast/BaseAST.cpp ast/BinaryExprAST.cpp ast/BoolExprAST.cpp ast/CallExprAST.cpp ast/CodeBlockAST.cpp\ ast/ExprAST.cpp ast/ExternAST.cpp ast/FunctionAST.cpp ast/IntExprAST.cpp ast/IfExprAST.cpp ast/PrototypeAST.cpp\ - ast/TypeAST.cpp ast/VariableExprAST.cpp yacc_stuff/tokenizer.lpp + ast/TypeAST.cpp ast/VariableExprAST.cpp ast/WhileExprAST.cpp yacc_stuff/tokenizer.lpp AM_LFLAGS = -o lex.yy.c diff --git a/src/ast/WhileExprAST.cpp b/src/ast/WhileExprAST.cpp new file mode 100644 index 0000000..bad61c2 --- /dev/null +++ b/src/ast/WhileExprAST.cpp @@ -0,0 +1,23 @@ +/* + * WhileExprAST.cpp + * + * Created on: Feb 20, 2021 + * Author: zbc + */ + +#include "WhileExprAST.h" + +WhileExprAST::WhileExprAST(CompileUnit *unit, CodeBlockAST *codeblock) + : ExprAST(unit) +{ +} + +WhileExprAST::~WhileExprAST() +{ + // TODO Auto-generated destructor stub +} + +llvm::Value *WhileExprAST::Codegen(llvm::IRBuilder<> *builder) +{ + return nullptr; +} diff --git a/src/ast/WhileExprAST.h b/src/ast/WhileExprAST.h new file mode 100644 index 0000000..a6a4e2a --- /dev/null +++ b/src/ast/WhileExprAST.h @@ -0,0 +1,21 @@ +/* + * WhileExprAST.h + * + * Created on: Feb 20, 2021 + * Author: zbc + */ + +#ifndef SRC_AST_WHILEEXPRAST_H_ +#define SRC_AST_WHILEEXPRAST_H_ + +#include "ExprAST.h" + +class WhileExprAST : public ExprAST +{ + public: + WhileExprAST(CompileUnit *unit, CodeBlockAST *codeblock); + virtual ~WhileExprAST(); + llvm::Value *Codegen(llvm::IRBuilder<> *builder); +}; + +#endif /* SRC_AST_WHILEEXPRAST_H_ */ -- Gitee From d4f50533037a9c696a7a12a5628d3b7eb13bd3e5 Mon Sep 17 00:00:00 2001 From: NaiveTomcat Date: Sat, 20 Feb 2021 08:46:15 +0800 Subject: [PATCH 2/2] updated README --- README | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README b/README index a559c2a..bc556dc 100644 --- a/README +++ b/README @@ -1,7 +1,22 @@ AloLang Compiler Readme +AloLang语言编译器自述文档 + Distributed under the Lesser General Public License V3 +以LGPLv3许可证发布 + +Project Description: + +Compiler for the novel programming language AloLang. For description of AloLang, +visit https://doc.alolang.org.cn/ + +项目简介 + +新型程序语言AloLang的编译器。获取AloLang介绍,请访问https://doc.alolang.org.cn/ + +Compile Instructions: + To compile, we suggest that you have the project made in a dedicated directory. Use the following commands. -- Gitee