DownloadClick the following link to download the latest release of j-- up-to-date with bug fixes (recommended): http://www.cs.umb.edu/j--/j--.zip Click the following link to download the original release of j-- published with the book in December 2012: http://www.cs.umb.edu/j--/orig-j--.zip InstallationSetting Up j-- for Command-Line Execution
You are now ready to work with j-- compiler. To compile and test the compiler using Ant, execute the appropriate Ant target as follows: $j/j--> ant <target> If no target is specified, the default (runCompilerTests) target is executed. To obtain a list of available Ant targets, execute the following command: $j/j--> ant help The j-- compiler can be executed directly on the command line using the script $j/j--/bin/j--. For example $j/j--/tests/pass/HelloWorld.java can be compiled using j– as follows: $j/j--> j-- tests/pass/HelloWorld.java The class file HelloWorld.class produced under $j/j--/pass/ can be run as follows: $j/j--> java pass.HelloWorld The full command-line syntax for the j-- script is as follows: Usage: j-- <options> <source file> where possible options include: -t Only tokenize input and print tokens to STDOUT -p Only parse input and print AST to STDOUT -pa Only parse and pre-analyze input and print AST to STDOUT -a Only parse, pre-analyze, and analyze input and print AST to STDOUT -s <naive|linear|graph> Generate SPIM code -r <num> Max. physical registers (1-18) available for allocation; default = 8 -d <dir> Specify where to place output files; default = . Setting Up j-- in Eclipse
To build the j-- project manually, select the project in the Project Explorer window and click the Project → Build Project menu. This runs the default (runCompilerTests) target in the Ant file $j/j--/build.xml. To run a different target, edit the following line in the Ant file: <project default="runCompilerTests"> and change the value of the default attribute to the desired target. In order to run and debug the compiler within Eclipse, a Launch Configuration has to be created, which can be done as follows:
LicenseEach software made available here is free; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |