0

I am trying to develop a plagiarism detector for java source file (also developing in java language). The strategy i am following is :

  1. ANALYZING STEP: make tokens in the given java source file and generate AST tree of the source code using ANTLR and then store this AST in data base. and do this every file given for analyzing.
  2. COMPARING STEP: Now compare any two ASTs from database and find the similarities in them hence make decision whether there is plagiarism or not.

Now i am trying to make sense of ANTLR but i am failing to figure out that how it works or how to achieve my goal. I have found a simple step by step tutorial at this link: Generating an Abstract Syntax Tree for java source code using ANTLR I followed till step 2 but could not under stand what to do with step 3. Since i am using netbeans so i could't understand where to run these commands given in step 3. or how to follow these instructions in netbeans.

further more am i right about my strategy that i am following? is there any simple solution with ANTLR or without ANTLR?

Community
  • 1
  • 1
  • Why would you need an AST for plagiarism detection? Wouldn't a token stream be sufficient for this task? – Lucas Trzesniewski Dec 03 '15 at 13:15
  • Actually it is a university project and it is required(asked by supervisor) to make an AST and compare it with other program's AST. however if it is possible to compare two source files completely with out AST then may be implemented – Adnan Aslam Dec 04 '15 at 06:23

0 Answers0