# compilation-rev **Repository Path**: fortherepublic-cpp/compilation-rev ## Basic Information - **Project Name**: compilation-rev - **Description**: No description available - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-15 - **Last Updated**: 2025-09-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # compilation-rev 编译教程 (仅提供 GCC 编译过程. MSVC 请自行配置cmake命令.): - GNU/Linux ```shell $ git clone https://gitee.com/fortherepublic-cpp/compilation-rev.git $ cd compilation-rev $ mkdir build && cd build $ cmake .. # use cmake build (both windows and gnu/linux) $ cmake --build . [-t target] [-- -j4] # e.g. `cmake --build .` # or just use make build $ make [target] [-j4] # e.g. `make lexical -j4` ``` - MinGW in Windows Windows下MinGW编译套件下载地址:[GCC and MinGW-w64 for Windows](https://winlibs.com/) ```shell $ git clone https://gitee.com/fortherepublic-cpp/compilation-rev.git $ cd compilation-rev $ mkdir build && cd build # use 'md' command in cmd instead of 'mkdir', 'mkdir' only in PowerShell. $ cmake -G "MinGW Makefiles" .. $ cmake --build . [-t target] [-- -j4] # or use 'mingw32-make [target]' ``` ## 1. 运行词法分析测试程序 ```shell $ cd lexer # lexical usage example in GNU/Linux $ ./lexical [file_path] # must input a source code file (path). e.g. `./lexical ./test.txt` # lexical usage example in Windows $ .\lexical.exe [file_path] # e.g. `.\lexical.exe .\test.txt` ``` ## 2. 运行语法分析测试程序 暂时仅支持预测分析法。测试用例嵌入在`parser_example.cc`文件当中。 ```shell $ cd parser # parser usage example in GNU/Linux $ ./parser ```