# ast-interpreter **Repository Path**: reiholdchen/ast-interpreter ## Basic Information - **Project Name**: ast-interpreter - **Description**: clang ast 解释执行器 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-11-02 - **Last Updated**: 2025-08-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 构建 ``` bash cmake -DLLVM_DIR=/usr/local/llvm10ra/ -DCMAKE_BUILD_TYPE=Debug .. ``` # 开发过程中常用命令 ``` bash clang -c -Xclang -ast-dump ./test/test01.c ``` # 测试 ``` bash ./build/ast-interpreter "`cat test/test01.c`" ``` # 测试 test12 test15 test17 test18 指针相关 问题回顾 - decl语句忘记visitstamt - std::map mVars; std::map mExprs; 用了int类型,导致地址被截断 11.4 未过 ~~test15~~: test17~25 ~~test17~~: 添加对指针的处理:UnaryExprOrTypeTraitExpr(处理sizeof())、UnaryOperator解引用运算符*,指针地址赋值,ImplicitCastExpr指针内容引用 ~~test18~~: 添加 ParenExpr ~~test19~~:直接通过 ~~test20~~:没有正常return,问题在于return语句可能在body里面出现,~~~暂不清楚为什么加了throw exception就能正常~~~ ~~test21~~: print1 print2 调用异常