Search code examples
javaeclipsebatch-filejavacc

How to compile javacc files everytime before running project in eclipse


I have an eclipse project which uses javacc files (jjt and jj) and i would like to know how i can configure the run option on my project, so that it automatically does the following (in order):

  • Compile jjt file using javacc (jjtree command)
  • Compile jj file using javacc which was created in the compilation above (javacc command)
  • Compile java files (created from the jj file) using javac command
  • Run project?

I have a working .bat file which executes correctly from the command line, but i needed to run in it eclipse for faster development and easier code correction.

Any help would be greatly appreciated!


Solution

  • If you use the JavaCC eclipse plugin, then it should run jjt, javacc, and compile each time you save your .jjt file. Get it at http://eclipse-javacc.sourceforge.net/