/java-language-parser

A simple compiler for parsing java codes and get syntax errors with CYK algorithm for context free grammars (CFG)

Primary LanguageJavaMIT LicenseMIT

java-language-parser

A simple compiler for parsing java codes and get syntax errors with CYK algorithm for context free grammars (CFG)

Documentations

This project were created for a course project. course of Theory of Language and Automaton.

This is a very simple parser for Java Language resolves by CYK Algorithm for CFGs (Context-Free-Grammars) or better to say, CNFs

This consists of two parsing sections:

  1. Syntax validation : Success or Wrong
  2. Opening and Closing parenthesis - curly braces - brackets

And no more stuffs.

But it's good to say that it says the location of error, I mean in which line

For more information about the codes, revert to the codes and read the comments!

This project has been built with net beans IDE.

So if you want, you can easily clone this repository and import it on net beans.

Note that The main file is under src directory, named: JavaParser.java


grammar 1

grammar 2

image 1 - java code

image 2 - results


Authors

Org.

Team

  • ASCK TEAM

License

This project is licensed under the MIT License - see the LICENSE file for details