上一页 1 2 3 4 5 6 7 8 ··· 40 下一页
摘要: expr_1: IDENT /*yystack index 2*/ "=" /*yystack index 1*/ expr_1 /*yystack index 0*/ { $$ = new VarAssignAst($1, token::EQ, $3); } 阅读全文
posted @ 2021-06-08 11:09 Ajanuw 阅读(52) 评论(0) 推荐(0) 编辑
摘要: #include "llvm/ExecutionEngine/Orc/LLJIT.h" #include "llvm/IR/Function.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Module.h" #include "llvm/Su 阅读全文
posted @ 2021-06-07 15:34 Ajanuw 阅读(153) 评论(0) 推荐(0) 编辑
摘要: words demo lexer.l: %option noyywrap noline %{ #include <iostream> #include "parser.h" #define YY_DECL yy::parser::symbol_type yylex() #define yytermi 阅读全文
posted @ 2021-06-06 11:46 Ajanuw 阅读(69) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <format> int main(int argc, char* argv[]) { if (argc > 1) { char prefix; char* opt; int valIndex; char* val; for (size_t 阅读全文
posted @ 2021-06-06 00:44 Ajanuw 阅读(178) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> using namespace std; class Base { public: virtual ~Base() = default; /* 使其多态 */ }; class A : public Base { publi 阅读全文
posted @ 2021-06-05 20:55 Ajanuw 阅读(956) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include "lexer.h" #define yylex aaslex #define yy_scan_string aas_scan_string #define yy_delete_buffer aas_delete_buffer extern c 阅读全文
posted @ 2021-06-04 11:05 Ajanuw 阅读(42) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include "lexer.h" #define yylex aaslex #define yy_scan_string aas_scan_string #define yy_delete_buffer aas_delete_buffer int main 阅读全文
posted @ 2021-06-04 08:20 Ajanuw 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 想要什么: int fun(int p1) { int r = 0; for(int i = 0; i < p1; i++) { r = r + i + p1; } return r; } IR: define i32 @fun(i32 %p1) { entry: %r = alloca i32, 阅读全文
posted @ 2021-06-01 23:46 Ajanuw 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 想要什么: int fun(int p1) { if(p1 < 5) return 1; else return 2; } IR: define i32 @fun(i32 %p1) { entry: %cmp = icmp slt i32 %p1, 5 br i1 %cmp, label %then 阅读全文
posted @ 2021-06-01 22:08 Ajanuw 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 想要什么: int add1(int p1) { return 1 + p1; } IR: define i32 @add1(i32 %p1) { entry: %retVal = add i32 1, %p1 ret i32 %retVal } #include "llvm/ExecutionEn 阅读全文
posted @ 2021-06-01 20:50 Ajanuw 阅读(202) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 40 下一页