jjrun 1.0d1

Download Latest Version: http://tomazos.com/jjrun/jjrun-latest.tar.gz

Copyright (C) 2006 Andrew Tomazos <andrew@tomazos.com>

This program is free software; 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 2 of the License, or (at your option) any later version.

Firstly

The following documentation uses Foo.jj as a hypothetical example of a JavaCC grammar file. Read it by substituting Foo for the actual name of your parser.

Summary

jjrun allows you to execute a JavaCC .jj grammar file with a single command:

    $ jjrun Foo.jj < file_to_be_parsed

Standard input to jjrun is passed through to the resulting parser.

jjrun is useful for quick prototyping of new grammars, as a build tool and as a building block for a testing harnass.

Installation

This assumes you already have javacc and java installed into your path.

  1. Download jjrun-latest.tar.gz from tomazos.com

        $ wget http://tomazos.com/jjrun/jjrun-latest.tar.gz

  2. Unpack it

        $ tar zxvf jjrun-latest.tar.gz

  3. Enter directory

        $ cd jjrun-latest

  4. Read the README

        $ less README

  5. Run the tests

        $ make test

  6. Install jjrun (defaults to /usr/bin)

        $ make install

Manual Installation

Take the src/jjrun script from the archive, make it executable and place it in your path somewhere.

How does it work?

Under the hood jjrun is a standard Bourne Shell script that is installed in your path.

When executed on Foo.jj it does the following things:

  1. jjrun generates a makefile called Foo.mk
  2. If jjrun (the program itself) changes - Foo.mk will be automatically regenerated
  3. The makefile is executed and the following steps are run as needed if intermediate files do not exist or have been modified
  4. javacc is executed on Foo.jj to generate the source files
  5. javac is executed on the source files to generate class files
  6. A jar manifest called Foo.mf is generated if it does not exist
  7. The class files and manifest are packed up with into Foo.jar
  8. Foo.jar is executed (passed through standard input from jjrun)
  9. jjrun returns the exit status of Foo.jar (passed through)

Change Log