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.

相关推荐
Z9fish20 小时前
sse哈工大C语言编程练习47
c语言·数据结构·算法
本喵是FW20 小时前
C语言手记2
c语言·开发语言
计算机安禾20 小时前
【C语言程序设计】第34篇:文件的概念与文件指针
c语言·开发语言·数据结构·c++·算法·visual studio code·visual studio
wangjialelele21 小时前
C++11、C++14、C++17、C++20新特性解析(一)
linux·c语言·开发语言·c++·c++20·visual studio
Book思议-1 天前
【数据结构实战】链表找环入口的经典问题:快慢指针法
c语言·数据结构·算法·链表
Book思议-1 天前
【数据结构实战】判断链表是否有环:快慢指针法(Floyd 判圈算法)
c语言·数据结构·算法·链表
咬人喵喵1 天前
植树节主题核心 SVG 交互玩法 + 品牌 / 账号案例 + 组件 / 教程
前端·css·编辑器·svg·e2编辑器
qq_150841991 天前
用CVI写一个贪吃蛇小游戏
c语言
C羊驼1 天前
C 语言:哥德巴赫猜想
c语言·开发语言·人工智能·经验分享·笔记·算法·课程设计
季明洵1 天前
预处理详解(上)
linux·c语言·数据结构·预定义