********************************************************************
N E V E R L A N G
********************************************************************
Name: Neverlang Tool
Author: Davide Poletti <dav.poletti@gmail.com>
********************************************************************


DESCRIPTION:

This package contains Neverlang framework and Rats! parser generetor library.

The framework basically provides: a language for writing the building blocks and a mechanism for composing the blocks
together and for generating the compiler/interpreter.

The basic units composing a programming language developed by using Neverlang are ``modules``.Each module encapsulates
a specific feature of the language, e.g., a module can encapsulate the syntactically aspect of a loop, the type
checking code of a comparison, or the code generation for a method call.
Roles define how modules composing together forming the compiler/interpreter.  ``syntax``, ``type-checking`` and
``evaluation`` are examples of roles.
Finally, modules regarding the same language structure but with different roles are grouped together in ``slices``.

********************************************************************
REQUIREMENTS:

In order to run the package needs 

- Java SDK 6.0

- AspectJ 1.6

- some common bash command: dirname, which.

Optionally

- astyle (http://astyle.sourceforge.net/astyle.html) in order to format the generated source code 

********************************************************************
INSTALLATION:

There is no need to specific installation just unpack the tar.gz and optionally add to the path 
<unpack_dir>/Neverlang/bin/ where <unpack_dir> is the directory where the package has been unpacked.

********************************************************************
USAGE

In order to use the tool we provide two bash script: the first ``nlgc`` reads the modules and generate the interpreter; the second 
``nlg`` use the generated interpreter  given as first argument to execute  the code contained in the second and further arguments.

Launching the command below neverlang produced the compiler as a package of class in IfLess directory.

.. raw:: html

   <pre class="execution">
   <b>[12:44]cazzola@thor:~></b>nlgc -d IfLess if_less/*.nl
   </pre>

Now with the ``nlg`` command is possible use the compiler created to interpreter the simple source code contained in if_less_01.txt 

.. raw:: html
   <pre class="execution">
   <b>[12:45]cazzola@thor:~></b>nlg IfLess if_less_01.txt
   <OUT> ok
   </pre>

Other option can be specified in order to use external classes.

 Usage: nlgc -d <destDir> [-j <jar packages>] [ -a <suppPackDir> ] [-k] <file>+
	 
	   <file>
	    the file composing the grammar 
	 
	  -d <destDir>  
	    Directory of where the interpreter will be created. The directory will be overwritten if it already exists 	
	    	
	  -a <suppPackDir> 	
	    specify the directory containing the java sources that need to be compiled with the 
	 	 generated source code in order to create the interpreter 	
	 	
	  -j <jar packages>
	    specify the needed java packages not contained in the classpath.
	 
	  -k 
	 	 Keep the soure code generated, the cade will be intended if the astyle tool is present in the system
	    Multiple jar files are separated with ':'
	 

Usage: nlg  [-j jars] <dir> <file>+ [-a <args>*]

   <dir>
       the directory created by NeverLangC containing
       the interpreter to be executed.
   <file>
       the file containing the source to be executed
       by the interpreter.
   -a <args>
 	    The arguments that will be pass to the interpreter	



********************************************************************

