Code Monkey home page Code Monkey logo

melchisedech333 / antlr4-demonstration-project Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.86 MB

:wrench: 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: BSD 3-Clause "New" or "Revised" License

Shell 0.90% CMake 3.13% C++ 91.79% Objective-C++ 2.55% ANTLR 0.67% Batchfile 0.30% Objective-C 0.04% C 0.49% Makefile 0.14%
grammar-parser grammar-checker grammar-rules grammars language-processors semantic-analysis syntax syntax-analysis syntax-analyzer language-development

antlr4-demonstration-project's Introduction





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 ๐Ÿคฉ

antlr4-demonstration-project's People

Contributors

melchisedech333 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.