本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139768986
AST语法树

BNF抽象
1 | expr = equality |
AST构建
1 |
|
代码生成
1 |
|
1 |
|
1 | ./chibicc "1 + -2* 3 -(4+5/6) > tmp.s |
创作不易,小小的支持一下吧!


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139768986

1 | expr = equality |
1 | #include "chibicc.h" |
1 | #include "chibicc.h" |
1 | #include "chibicc.h" |
1 | ./chibicc "1 + -2* 3 -(4+5/6) > tmp.s |


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139754435
https://github.com/r35382/bnflite
1 | #include "bnflite/bnflite.h" |


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139724486
1 | #include<iostream> |
冒泡排序_相邻交换
1 | #include <stdio.h> |
1.建立set集合,每次遍历存储元素,当集合大小不变,但循环仍在继续时说明存在循环,并得出该位置
2.定义双指针遍历:一个指针每次移动一个节点,一个指针每次移动2个节点,当2个节点指针在一个节点指针后面时,此链表存在循环。
3.链表反向
4.构造双向链表
a:1001
b:1100
a=a^b; a:0101
b=a^b; b:1001
a=a^b; a:1100
a = a + b;
b = a - b;
a = a - b;
1 | #include <stdio.h> |
1 | #include <stdio.h> |
https://github.com/sashafierce/100-days-of-Algorithm-Challenge
GitHub - hackerkid/LightOJ-Solutions: :sparkles: LightOJ Solutions with hints
GitHub - mmc-maodun/Data-Structure-And-Algorithm: Data Structure And Algorithm(常用数据结构与算法C/C++实现)
Codewars - Achieve mastery through coding practice and developer mentorship
Khan Academy | Free Online Courses, Lessons & Practice
https://github.com/sashafierce/Algo_Ds_Notes
https://www.cnblogs.com/findumars/p/5180528.html


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139706646
1 | #include <ctype.h> |
1 | cc -o test test.c |
./test “1 + 2 * +3” > tmp.s
1 + 2 * +3
^ invalid token


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139705499
1 | int main() { |
1 | cc -o test test.c |
int plus(int x, int y) {
return x + y;
}int main() {
return plus(3, 4);
}.intel_syntax noprefix
.globl plus, mainplus:
add rsi, rdi
mov rax, rsi
retmain:
mov rdi, 3
mov rsi, 4
call plus
ret
call原理
1 | #include <stdio.h> |
1 | cc -o test test.c |
1 | #include <stdio.h> |
1 | cc -o test test.c |
1 | #!/bin/bash |
参考


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139691122
GitHub - abumq/qmllogging: Lightweight advanced QML Logging (unmaintained)
1 | #include "easylogging++.h" |


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139690240
1 |
|



本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139664297
strUtil.h
1 | #pragma once |
1 | #include "strUtil.h" |
std::optional
if (/* some condition */) {
return 42;
}
return std::nullopt;
}
s.substr(0, str.size()) == str
s.substr(str.size()) == str
std::stoi/stof/stod
// 随机字符串生成
inline std::string randomStringGenerator(const int len)
{
std::string res;
static const char alphanum[] = “0123456789”
“ABCDEFGHIJKLMNOPQRSTUVWXYZ”
“abcdefghijklmnopqrstuvwxyz”;
for (int i = 0; i < len; ++i)
res += alphanum[((size_t)std::rand() % (sizeof(alphanum) - 1))];
return res;
}
1 | inline bool replace(std::string & input_str, const std::string & from, const std::string & to) |


本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/139664082
LRU.h
1 | #pragma once |
1 | #include "LRU.h" |
注意:此LRU只实现了最近访问优先缓存,LFU高频访问时需自行扩展list的访问次数


tag:
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true