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.

相关推荐
xskukuku6 小时前
使用VSCode配置C语言运行环境
c语言·ide·vscode
小王C语言12 小时前
vscode智能提示问题、跳转问题
ide·vscode·编辑器
努力努力再努力wz14 小时前
【内存管理与高并发内存池系列】从 mmap 到 malloc:文件映射、匿名映射与 glibc 内存分配机制详解
linux·c语言·数据结构·数据库·c++·qt·链表
J2虾虾14 小时前
C 语言 void 完全用法
c语言·开发语言
wu_ye_m15 小时前
学习c语言第35天 函数声明和定义
c语言·开发语言·学习
J2虾虾18 小时前
C语言 typedef 用法
c语言·数据结构·算法
郝亚军18 小时前
如何在vscode上运行python程序
ide·vscode·编辑器
Arvin.Angela18 小时前
VsCode 安装文档
ide·vscode·编辑器
WL学习笔记19 小时前
顺序表详解
c语言·数据结构
c++之路19 小时前
CMake 系列教程(一):CMake 基础知识
c语言·开发语言·c++