Hello :) So I'm doing a project based on semantic analysis of Java code whereby my program (hopefully a plug-in) will prompt the user with solutions to his/her compiler errors with the option to auto-fix. What sets my project apart from a program like Eclipse is that it's targeted for first year students and so errors like:
for (int k = 0; k < 10; k++);
will be flagged as a possible semantic error. Of course there are quite a few other errors that I check for and for those errors I have no prescribed solution for, I hope to use a neural network to 'learn' how those errors are fixed.
I was wondering, can anyone point me in the direction of reference material, or has anyone dealt with anything like this in the past? Any information would be greatly appreciated!
This is what I have in mind so far:
A compiler tool designed to identify and possibly correct logic errors in source code. Its application shall be intended to aid first year Java programmers. The following logic errors shall be preprogrammed into the code:
- Semicolons at the end of looping and decision constructs, e.g. if(a > 1);
- Variable declaration and identifier naming rules (includes class name matches file name as well as variable scope)
- Ill structured Boolean expressions (using pseudo-code instead of legal Java code and using = instead of ==)
- Misspelling of method/variable names (hopefully will also lead to correct class being used; simpler to spell check but using Java as then target language)
- Enforcement of Java conventions e.g. capital letters for constant names
- Differences between int and double mathematical operators
- Mathematical analysis of user formulas (to alert programmer of possible outcome). For example pi*r would be flagged as possibly incorrect with pi*r^2 as a possible correction.
- Structural Errors (placement of the import keyword; method body placement)
The tool will provide a detailed description of why these errors have occurred and how they are fixed. It is thus in essence a learning tool. Explanations will not be provided for learnt rules.
It will not be restricted to pre-programmed checks, but will have the ability to learn how errors are corrected by the programmer and so in future analysis, these suggestions will be included. This is useful if a tutor corrects the student’s error. This process could be implemented in a number of ways, but a neural network shall be used whereby the compiler error (network input) is mapped to a change in source code (network output). As this process is dynamic, this means network will somehow determine the best solution for the error. Of course the network will be pre-trained will the errors mentioned above.
We shall attempt to allow the neural network used in map between the input and output space to be selected and so a new ‘personality’ as such will be used so that it meets the needs of the programmer. This depends on the performance of the tested network architectures – should there only be one solution, user selection will not be applicable.
So I know that I have to work on my implementation of a Neural Network and I have, but for now I need to dig up information about it. I know that it's been done in Fortran, just can't find any information on it -sigh-
So any thoughts?