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.

相关推荐
weixin_3954489126 分钟前
mult_yolov5_post_copy.c_cursor_0205
c语言·python·yolo
Z9fish1 小时前
sse哈工大C语言编程练习20
c语言·开发语言·算法
晓13131 小时前
第六章 【C语言篇:结构体&位运算】 结构体、位运算全面解析
c语言·算法
梵刹古音1 小时前
【C语言】 指针与数据结构操作
c语言·数据结构·算法
刘琦沛在进步2 小时前
【C / C++】引用和函数重载的介绍
c语言·开发语言·c++
VekiSon3 小时前
Linux内核驱动——杂项设备驱动与内核模块编译
linux·c语言·arm开发·嵌入式硬件
2的n次方_3 小时前
CANN Ascend C 编程语言深度解析:异构并行架构、显式存储层级与指令级精细化控制机制
c语言·开发语言·架构
_F_y4 小时前
C语言重点知识总结(含KMP详细讲解)
c语言·开发语言
徐小夕@趣谈前端5 小时前
拒绝重复造轮子?我们偏偏花365天,用Vue3写了款AI协同的Word编辑器
人工智能·编辑器·word
风一样的航哥5 小时前
标题:从卡顿到流畅:深度剖析 Word 2013 与 Word 2021 处理高清图片文档的性能鸿沟
编辑器