Coder Social home page Coder Social logo

melchisedech333 / antlr4-experiments Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 387 KB

:wrench: My studies on context-free grammar, using ANTLR4 (C++) to generate the parser files. Some basics are developed, such as token processing, recursion, variable definition, array processing, Abstract Syntax Tree (AST) manipulation, UNICODE support, and error handling.

License: BSD 3-Clause "New" or "Revised" License

ANTLR 4.36% C++ 12.56% Shell 0.53% Java 82.55%
antlr4 grammar-parser grammars semantics syntax tokenizer antlr4-grammar grammar-checker grammar-parser-generator grammar-rules

antlr4-experiments's Introduction




Language: PT-BR

Here are my studies and experiments using ANTLR4 (for language analysis). The target code in this case is in C++, and for this a base project is used, which can be found here:

Just download the project and leave it in the same directory with the experiments.

Note: the base project directory name must be project, so that the test build scripts can work properly.

If my code has helped you, please consider sponsoring me ๐Ÿ’™


๐Ÿ“‘ Table of Contents



๐Ÿ› ๏ธ Instructions

To run a test, just run the script clean-and-build.sh or re-compile.sh followed by the name of the test directory, as in the example below.

./clean-and-build.sh "1 - processing tokens (through visitor)"
./re-compile.sh "1 - processing tokens (through visitor)"

After compiling, parsing is immediately executed, where the syntax file existing in the respective directory is passed as a parameter.

Thus, it is possible to change the test Lexer, Parser and Syntax files, as well as the main.cpp file in their respective directories.

Brief description of the scripts:

  • clean.sh - Cleans files from previous builds from the base project. Note: this script does not need parameters.
  • clean-and-build.sh - Recompiles 100% of the base project.
  • re-compile.sh - Compile the base project without having to compile 100% of the project.

Note: the file compiled by the base project is located inside the project directory, with the name parsing.


๐Ÿ˜ƒ 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-experiments's People

Contributors

melchisedech333 avatar

Stargazers

 avatar  avatar  avatar  avatar  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.