Skip to content

🔧 Demonstration of using ANTLR4 (with runtime for C++) in projects for context-free grammar processing. The ANTLR4 (Java) package is included, and the project is configured to compile on Linux.

License

Notifications You must be signed in to change notification settings

melchisedech333/antlr4-demonstration-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation





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 💙


📑 Table of Contents



🛠️ Installation

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.

🔗 References and Links


😃 Author

Sponsor: melchisedech333
Twitter: Melchisedech333
LinkedIn: Melchisedech Rex
Blog: melchisedech333.github.io


📜 License

BSD-3-Clause license



Remember to give me
a beautiful little star 🤩