Language: PT-BR
This is the demo project for ANTLR4, using the C++ runtime.
The project files are the same as those available in the official ANTLR4 project, in its demo directory. And also compiling with the respective demo Lexer and Parser files.
The project is configured to be used on GNU/Linux operating systems.
Note: your parsing control file in C++ is at: project/demo/Linux/main.cpp
If my code has helped you, please consider sponsoring me 💙
Requirements:
- Java installed, version used in tests: openjdk 11.0.13 2021-10-19
- Have the ANTLR4 Java package (it is already included inside the demo directory, file: antlr-4.9.2-complete.jar)
- Have CMAKE installed, version used: 3.16.3
Instructions for compiling the project:
- Give permissions to files:
chmod +x clean.sh
chmod +x clean-and-compile.sh
chmod +x re-compile.sh
- Run the clean-and-compile.sh file:
./clean-and-compile.sh
After the compilation is successful, the binary file will be generated in: project/build/demo/antlr4-demo. However the script always copies the final binary to the directory in question, renaming it to parsing.
Description of files:
- clean.sh - Clears all temporary files and build files.
- clean-and-compile.sh - Cleans all files and rebuilds project binaries.
- re-compile.sh - Clean up temporary files and rebuild the project without having to recompile it as a whole.
- project/ - directory containing all project files.
- project/demo/TLexer.g4 - Lexer file.
- project/demo/TParser.g4 - Parser file.
- project/demo/Linux/main.cpp - C++ parser control file.
- https://github.com/antlr/antlr4/blob/master/doc/cpp-target.md
- https://github.com/antlr/antlr4/blob/master/runtime/Cpp/demo/README.md
- https://github.com/antlr/antlr4/blob/master/runtime/Cpp/README.md
Sponsor: melchisedech333
Twitter: Melchisedech333
LinkedIn: Melchisedech Rex
Blog: melchisedech333.github.io