Installing and Running Frag
Download Frag from the Frag sourceforge page.
To install Frag, you only need to place the Frag Java class files in your CLASSPATH.
To do so, typically, you just put the Frag jar file into the CLASSPATH.
Once, the installation is done, you can run Frag. You can run Frag by either running it
via the jar file:
java -jar frag-0.9.jar
or by running the class Shell in the package frag:
java frag.Shell
In either case, a prompt is presented, at which you can type Frag commands. For instance,
you can print Hello World like this:
> puts "Hello World"
Hello World
In Frag, you can use the Command source to load a program:
> source example.frag
This command loads the file example.frag and evaluates it.
Alternatively, you can load programs via the Shell by providing the
program name as an argument, such as:
java -jar frag-0.9.jar examples/Demo.frag
The same of course also works like this:
java frag.Shell examples/Demo.frag
The Frag distribution on the Frag sourceforge page
page includes two Eclipse Editor Plugins for editing Frag programs and Frag templates. At the moment, they support
syntax highlighting, outline views, and launching of Frag programs. To use them, simply copy the FragEditor_1.0.0.jar and
FragTemplateEditor_1.0.0.jar files into your eclipse/plugins directory, and restart Eclipse.
Eclipse now automatically edits files ending with .frag or .ft using the Frag editor plugins.
Frag comes with a unit test suite for all its features. If you want to test your installation,
run the file tests/TestAll.frag, e.g. like:
java -jar frag-0.9.jar tests/TestAll.frag
The unit test suite also contains code examples for all Frag features. It might be a
good idea to look at these examples to better understand some of Frag's features.
In the Frag source distribution, there is also an Ant file, which you can use to clean the
build using the target clean, to compile everything from source using the target build,
and to run the tests using the target test.