摘要: 1. 要编译的测试代码: int plus(int x, int y) { return x + y; } int main(void) { return plus(3, 4); } 2. main中return语句语法分析 if (equal(tok, "return")) { Node *nod 阅读全文
posted @ 2021-11-25 11:07 Just_4_fun 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 1. 要编译的测试代码: int main(void) { 2+3*4; } 2. 词法分析 词法分析将字符变成token,其中很重要的是token的类型,如字符2的token类型为TK_NUM,这在后面的语法分析阶段有用。 3. 语法分析 3.1 解析字符"2" if (tok->kind == 阅读全文
posted @ 2021-11-24 09:34 Just_4_fun 阅读(798) 评论(0) 推荐(0) 编辑
摘要: 1. 要编译的测试代码: int a; int b = 3; int main(void) { if (3) a = 4; else b = 5; } 2. 词法分析 词法分析将c源代码解析成一个个的token。 关键的,将if两个字符解析成一个if token,后续语法分析的输入就从两个字符减少为 阅读全文
posted @ 2021-11-23 13:24 Just_4_fun 阅读(972) 评论(0) 推荐(0) 编辑
摘要: 一. littlevgl有几个线程,作用是什么? 三个,主线程一个,和在主线程的hal_init函数中创建的另两个sdl线程。 主线程完成一系列初始化工作后,循环每10ms调用在lv_init函数中注册的三个任务,indev_proc_task,lv_refr_task,anim_task,重点关注 阅读全文
posted @ 2019-03-21 10:07 Just_4_fun 阅读(6675) 评论(0) 推荐(1) 编辑