Nuo-Math-Compiler

The Nuo-Math-Compiler is a simple compiler for a small self-defined mathematical expression language. It performs lexical analysis, syntax analysis, and semantic analysis on input expressions, and output the json files of each phase. You can see the project requirement for more details.

We provide a sample implementation in sample/ folder for your reference, and test/ folder with various test cases.

Set Up

  1. Clone this repository

    git clone git@gitee.com:nuo534202/nuo-math-compiler.git
    cd Nuo-Math-Compiler

  2. Build and Run

  • Use Makefile

    复制代码
    make
    ./nuo-math-compiler sample
  • Use CMakeLists.txt

    复制代码
    mkdir build && cd build
    cmake ..
    make
    ./nuo-math-compiler sample

    The builder will automatically copy the parsing_table.csv and sample files from lib/ folder to the build folder.

nuo-math-compiler is the executable file for the compiler. You can run it with the sample input file sample as shown above. The input file is recommended to name with no suffix, and output files are sample_lexer.json, sample_parser.json, sample_ast.json, and sample_type.json.

Code of Conduct

Code of Conduct

Contributing

Contributing Guidelines

License

Nuo-Math-Compiler is for learning and practice purpose, so it is under MIT License.

相关推荐
是隼人3 小时前
buuctf-pwn mrctf2020_easy_equation(64位fmt)题解(学习过程持续更新)
c语言·学习·安全·pwn入门·ctf入门
AC赳赳老秦3 小时前
文旅市场公开数据分析:基于 OpenClaw 采集景区客流与门票公示数据,生成区域文旅热度监测报告
java·c语言·python·php·symfony·deepseek·openclaw
HRTOS3 小时前
HRTOS应用示例:信号量机制详解
c语言·人工智能·嵌入式硬件·51单片机
从零开始的嵌入式之旅3 小时前
day36
linux·c语言·经验分享·笔记·嵌入式硬件
HRTOS4 小时前
HRTOS应用示例:Mutex互斥锁机制详解
c语言·单片机·嵌入式硬件·51单片机
Sumerking4 小时前
llc_control.c 专项评审(v3 更新版)
c语言·开发语言·算法·obc
一叶龙洲5 小时前
Ubuntu24.04 Cursor导入vscode配置
vscode·编辑器
繁星蓝雨5 小时前
C++设计原理———重载(extern “C“的由来、顺序依赖、语义依赖、overload、名称修饰符、对象操作、运算符重载、新增运算符、枚举和布尔类型)
c语言·c++·extern c·overload·重载·语义依赖·顺序依赖
SuperByteMaster6 小时前
编译器将unsigned short 整体提升int和unsigned short 在内存中的分配2byte的理解
c语言
XiaoQiao6669997 小时前
C 语言常用头文件及里面核心函数
c语言·开发语言