会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Ajanuw
做自己的King
博客园
首页
管理
上一页
1
2
3
4
5
6
7
8
···
40
下一页
2021年6月8日
Bison 命名位置
摘要: 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
阅读(65)
评论(0)
推荐(0)
2021年6月7日
llvm block
摘要: #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
阅读(198)
评论(0)
推荐(0)
2021年6月6日
Bison matching list
摘要: 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
阅读(97)
评论(0)
推荐(0)
c++ parse argv
摘要: #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
阅读(200)
评论(0)
推荐(0)
2021年6月5日
c++ 智能指针 shared_ptr 在多态上的使用
摘要: #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
阅读(1065)
评论(0)
推荐(0)
2021年6月4日
Flex 替换输入的字符串
摘要: #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
阅读(66)
评论(0)
推荐(0)
Flex 将输入设置为内存字符串
摘要: #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
阅读(132)
评论(0)
推荐(0)
2021年6月1日
llvm for expr
摘要: 想要什么: 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
阅读(166)
评论(0)
推荐(0)
llvm if expr
摘要: 想要什么: 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
阅读(172)
评论(0)
推荐(0)
llvm function expr
摘要: 想要什么: 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
阅读(227)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
40
下一页