Contains files in the form of algorithms and supporting methods in detecting source code using Java 8 Language and tool named ANTLR4. The method used in this program is the Abstract Syntax Tree and the Ratcliff/Obershelp algorithm.
If you want to use it, just replace the String contained in the main code.
Make sure that you have ANTLR4 in your device. ANTLR4 can be downloaded via the official website at https://www.antlr.org/. There is no need to download the entire file, its just a collection of compiled files. You just need to download Java.g4 as AST Grammar which will translate java language into AST form.
How to use :
- First, set CLASSPATH to the directory where your ANTLR files in. You can also edit it via "System Environment Variables" on your Windows.
- Open CMD then move your directory to where your .java file is
- Follow the syntax below:
- antlr4 Java.g4
- javac Java*.java
- grun Java compilationUnit fileName.java - gui // if you want to print the AST Form. Here the example result: