To test your project, you will create a "debug configuration."
Select "Run -> Debug Configurations..." from the menu. Select "Scala
Application" from the list on the left-hand side of the "Debug
Configurations" dialog box and then press the "New" button, which is a
white box with a little yellow plus on it. Set the "Name" field to be
"Compiler Test", and make sure that "Project" is your compiler project
and the Main class is ic.Compiler.
Click on the "Arguments" tab and enter "test/file.ic
-printAST -printSymTab" (or whatever command line arguments you'd like
to use) in the "Program arguments" box.
If it says "Multiple launchers available" at the bottom of the
window, click "Select One", then "Change Workspace Settings...", and
then "[Debug]" under "Scala Application". Then click on the "Scala
JVM Launcher" and click "OK".
Now press the "Debug" button. It will show the output in the Console at the bottom but may run
To begin debugging you must typically first set one
or more breakpoints. Go to your ic.Compiler file and set a break
point at the beginning of your main method by double clicking in the
left margin. A little dot should appear there. (Or select a line of
code and use "Run -> Toggle Breakpoint".)
You can run the program again by selecting your configuration
from the "Debug -> Debug History" menu, or choosing it from the pop-up
list when you click next to the bug icon in the tool bar. This time
it will stop at the line with the breakpoint, and you can begin using
the debugging features, which I summarize in the following picture:
At any time you can switch back to the editor perspective by
clicking on the "Scala" perspective in the top right corner of the