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.

相关推荐
人邮异步社区9 小时前
怎么把C语言学到精通?
c语言·开发语言
REST_302713 小时前
告别Excel孤岛:一款任务链路可视化工具带来的真实改变
大数据·微服务·云计算·编辑器·excel·动态规划
xiaobobo333014 小时前
C语言中宏定义宏名和宏值之间的关系
c语言·宏定义·语义型
a44931536218 小时前
MacBook USB-C不充电故障诊断:从PD握手到主板供电链路
c语言·开发语言·macos·电脑
a44931536219 小时前
iPhone 充电故障的全链路诊断——从 Lightning/USB-C 接口到 Tristar 充电 IC
c语言·macos·ios·电脑·硬件架构·iphone
qq_4480111619 小时前
C语言中的getchar()
c语言·开发语言
天空'之城19 小时前
C 语言工业级通用组件手写 15:累加和校验
c语言·嵌入式开发·工业级组件·累加和校验
●VON19 小时前
鸿蒙 PC Markdown 编辑器图片粘贴:从系统剪贴板到标准相对链接
华为·编辑器·harmonyos·鸿蒙
●VON19 小时前
鸿蒙 PC Markdown 编辑器外部修改检测:从文件指纹到冲突决策
华为·编辑器·harmonyos·鸿蒙
●VON19 小时前
鸿蒙 PC Markdown 编辑器十兆级大文档保护模式
华为·编辑器·harmonyos·鸿蒙