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.

相关推荐
qq_339554821 天前
英飞凌ModusToolbox环境搭建
c语言·eclipse
张張4081 天前
(域格)环境搭建和编译
c语言·开发语言·python·ai
༾冬瓜大侠༿1 天前
vector
c语言·开发语言·数据结构·c++·算法
独小乐1 天前
009.中断实践之实现按键测试|千篇笔记实现嵌入式全栈/裸机篇
linux·c语言·驱动开发·笔记·嵌入式硬件·arm
Proxy_ZZ01 天前
从零实现LDPC比特翻转译码器:C语言实战与底层逻辑解析
c语言·算法
追风20191 天前
PowerShell 7 解决 Codex 中文乱码:完整经验总结(VsCode 背景)
ide·vscode·编辑器
ambition202421 天前
斐波那契取模问题的深入分析:为什么提前取模是关键的
c语言·数据结构·c++·算法·图论
艾莉丝努力练剑1 天前
C++ 核心编程练习:从基础语法到递归、重载与宏定义
linux·运维·服务器·c语言·c++·学习
Curtain_Gin1 天前
windows vim 配置
linux·编辑器·vim
Ghost Face...1 天前
Linux USB 全栈解析:OTG + Type-C + PD 内核架构(架构师级)
linux·c语言·架构