Compiling and loading the micro-ML evaluator and parser (README.TXT)
---------------------------------------------------------------------------


--------------------
Windows Instructions
--------------------

1. 
Move the whole folder containing this file (Fun) to a folder of 
your choice. Here we assume that you have put it on the Desktop.

2.
To generate and compile the lexer and parser for the micro-ML language, run
the Command Prompt application. At the prompt, enter the following commands,
one at time:

   cd H:\Desktop\Fun
   bin\fslex --unicode FunLex.fsl
   bin\fsyacc --module FunPar FunPar.fsy

This assumes that your Desktop folder is in drive H, which is the case for the
CS Windows server. If it is in another drive, use the name of that drive instead.

3. 
To use the parser inside F# interactive, enter the following at the prompt

   #r "H:\Desktop\Fun\\bin\FsLexYacc.Runtime.dll"
   #load "H:\Desktop\Fun\Absyn.fs" 
   #load "H:\Desktop\Fun\FunPar.fs"
   #load "H:\Desktop\Fun\FunLex.fs" 
   #load "H:\Desktop\Fun\Parse.fs" 
   #load "H:\Desktop\Fun\Fun.fs"

   open Parse
   open Fun
   fromString "2 + 3 * 4"   

The last line is just an example, you can find more in file main.fsx


-----------------
MacOS instructions
-----------------
1.
Move the whole folder containing this file (Fun) to a folder of 
your choice. Here we assume that you have put it on the Desktop.

2.
To generate and compile the lexer and parser for the mini-ML language, run
the Terminal application. Enter the following commands at the terminal prompt, 
one at time, replacing tinelli with your user name:

   cd /Users/tinelli/Desktop/Fun
   mono bin/fslex.exe --unicode FunLex.fsl
   mono bin/fsyacc.exe --module FunPar FunPar.fsy

3. 
To use the parser inside F# interactive, enter the following at its prompt,
replacing tinelli with your user name.

   #r "/Users/tinelli/Desktop/Fun/bin/FsLexYacc.Runtime.dll"
   #load "/Users/tinelli/Desktop/Fun/Absyn.fs" 
   #load "/Users/tinelli/Desktop/Fun/FunPar.fs"
   #load "/Users/tinelli/Desktop/Fun/FunLex.fs" 
   #load "/Users/tinelli/Desktop/Fun/Parse.fs" 
   #load "/Users/tinelli/Desktop/Fun/Fun.fs"

   open Parse
   open Fun
   fromString "2 + 3 * 4"   

The last line is just an example, you can find more in file main.fsx

