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.

相关推荐
LuminousCPP1 小时前
数据结构 - 线性表第四篇:C 语言通讯录优化升级全记录(踩坑 + 思考)
c语言·开发语言·数据结构·经验分享·笔记·学习
浩浩测试一下4 小时前
汇编 标志位寄存器 (逆向分析 )
c语言·汇编·逆向·windows编程·标志寄存器
SuperByteMaster5 小时前
uart中断发送和接收处理
c语言
小e说说6 小时前
主流活动策划工具特点比较
编辑器
社交怪人7 小时前
【浮点数相除的余】信息学奥赛一本通C语言解法(题号1029)
c语言·开发语言
辣椒思密达7 小时前
Python爬虫中如何正确配置住宅IP代理?新手避坑指南
c语言·python
winlife_7 小时前
把 Godot 编辑器接入 AI:Funplay MCP for Godot 介绍
人工智能·编辑器·godot·ai编程·游戏开发·mcp
番茄灭世神8 小时前
PN学堂GD32教程第21篇——WiFiIOT
c语言·stm32·单片机·嵌入式·gd32
我还记得那天8 小时前
C语言递归实现汉诺塔问题
c语言·开发语言
LuminousCPP10 小时前
数据结构 - 线性表第三篇:基于顺序表实现 C 语言通讯录(基础功能篇)
c语言·数据结构·经验分享·笔记·算法