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.

相关推荐
csdn_aspnet7 小时前
C 语言的优雅回归:从零手造数据结构
c语言·数据结构
浅念-7 小时前
C语言小知识——指针(3)
c语言·开发语言·c++·经验分享·笔记·学习·算法
想放学的刺客8 小时前
单片机嵌入式嵌入式试题(第16期):硬件可靠性设计与复杂状态机架构设计
c语言·stm32·单片机·嵌入式硬件·物联网
巨大八爪鱼9 小时前
C语言纯软件计算任意多项式CRC7、CRC8、CRC16和CRC32的代码
c语言·开发语言·stm32·crc
浅念-10 小时前
链表经典面试题目
c语言·数据结构·经验分享·笔记·学习·算法
方便面不加香菜11 小时前
数据结构--栈和队列
c语言·数据结构
切糕师学AI12 小时前
ARM 中的 SVC 监管调用(Supervisor Call)
linux·c语言·汇编·arm开发
移幻漂流13 小时前
C/C++并发编程详解:如何写出优秀的并发程序
c语言·开发语言·c++
Jia shuheng14 小时前
#ifdef __cplusplus extern “C“ #endif的作用
c语言·嵌入式硬件
进击的小头14 小时前
创建型模式:简单工厂模式(C语言实现)
c语言·开发语言·简单工厂模式