# Nuo-Math-Compiler **Repository Path**: nuo534202/nuo-math-compiler ## Basic Information - **Project Name**: Nuo-Math-Compiler - **Description**: A compiler of self-defined mathematical expression language - **Primary Language**: C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-09 - **Last Updated**: 2025-12-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: Compiler, C语言 ## README # Nuo-Math-Compiler Nuo-Math-Compiler 是一个用于小型自定义数学表达式语言的简单编译器。它对输入表达式进行词法分析、语法分析和语义分析,并输出每个阶段的 json 文件。您可以查看 [项目要求](docs/project_requirement.md) 以了解更多详细信息。 我们在 `sample/` 文件夹中提供了一个示例实现供您参考,而 `test/` 文件夹则包含各种测试用例。 ## Set Up 1. 克隆这个仓库 ``` git clone git@gitee.com:nuo534202/nuo-math-compiler.git cd Nuo-Math-Compiler ``` 2. 构建并运行 - 使用 `Makefile` ``` make ./nuo-math-compiler sample ``` - 使用 `CMakeLists.txt` ``` mkdir build && cd build cmake .. make ./nuo-math-compiler sample ``` 构建器会自动将 `parsing_table.csv` 和 `sample` 文件从 `lib/` 文件夹复制到构建文件夹目录下。 `nuo-math-compiler` 是编译器的可执行文件。您可以使用上面示例中的输入文件 `sample` 运行它。建议输入文件命名时不带后缀,输出文件分别为 `sample_lexer.json`、`sample_parser.json`、`sample_ast.json` 和 `sample_type.json`。 ## 行为准则 [行为准则](CODE_OF_CONDUCT.md) ## 贡献 [贡献指南](CONTRIBUTING.md) ## 许可证 Nuo-Math-Compiler 是为了学习和练习,所以遵循的是 [MIT 许可证](LICENSE)。