Nuo-Math-Compiler-en
- Repository Link: Nuo-Math-Compiler
- Chinese README file: 中文版 README
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
- Clone this repository
git clone git@gitee.com:nuo534202/nuo-math-compiler.git
cd Nuo-Math-Compiler
- Build and Run
-
Use
Makefilemake ./nuo-math-compiler sample -
Use
CMakeLists.txtmkdir build && cd build cmake .. make ./nuo-math-compiler sampleThe builder will automatically copy the
parsing_table.csvandsamplefiles fromlib/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
Contributing
License
Nuo-Math-Compiler is for learning and practice purpose, so it is under MIT License.

浙公网安备 33010602011771号