Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/Tools/nowhere/README
ViewVC logotype

View of /sml/trunk/src/MLRISC/Tools/nowhere/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1038 - (download) (annotate)
Mon Jan 28 00:18:03 2002 UTC (17 years, 7 months ago) by leunga
File size: 1284 byte(s)
     The 'nowhere' program generator (which translates programs
     with where clauses into legal SML) is now an installation target.
What is in this directory
------------------------
This directory contains the source to 'nowhere'.
This is a simple source to source translation tool that expands out 
case expressions with conditional patterns.
Conditional patterns use the "where" keyword.  For example:

    case l of
      [x,y,z] where x=1 => 1
    | _ => 2

means the same as:

    case l of
      [1,y,z] => 1
    | _ => 2
   
   Currently, the input file must be of the following form:

   local
        <definitions>
   in
       <body>
   end

<definitions> should include all datatypes definitions that are used inside the 
<body>.  It is only for the tool's benefit and does not appear in the output.
Only <body> appears at the output.  You can use the special declaration 

     include "filename"

to import extra definitions.

The tool translates all case expressions with guards into the appropriate code.  
How to compile the tool
-----------------------

   In sml (version 110.30+), type

     use "build.sml"

   This will create an image named:

     nowhere.<arch>

How to run it
-------------

    To run it, type:

       sml @SMLload=nowhere infile

    on the Unix command line

    The output will be written to a file with suffix 'sml'.
    The input file should have a different suffix.


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0