I have a Java project that uses some autogenerated source code. This source code is produced by a command-line tool --- Bison, actually --- from a special source file.
I
Right-click the Project, select Properties > Builders > New ... > Program
.
There you can select a command line tool that will be run whenever the project is built.
For completeness: this is an Eclipse-only solution. I would recommend you to use a build system instead of plain Eclipse. Both Maven and Ant integrate nicely with Eclipse (Maven through m2eclipse, Ant through the same Builder mechanism as above), possibly others as well.
With Maven, you would use exec:exec (usage).
With Ant you would use the <Exec> task.