
How to use NICE.
================

You start by renaming your favourite variant NICE_*.EXE to NICE.EXE.

On VMS you define NICE as a foreign command:

    $ nice :== $disk:[dir]nice.exe

On DOS and UNIX you include the location of NICE in your path.

The syntax for calling NICE is:

    $ nice input-file output-file [ directives ]

where:

    - input-file is the PASCAL source-code to be formatted
    - output-file is the resulting PASCAL source-code
    - directives controling the "programming style" (see next sections)

On VMS you define NCALL/NDEF/NDOCU as:

    $ ncall:==@disk:[dir]ncall.com
    $ ndefine:==@disk:[dir]ndefine.com
    $ ndocu:==@disk:[dir]ndocu.com

On DOS and UNIX you include the location of the scripts in your path.
(be sure not to have the VMS COM-files in the path !)

The command "$ ncall *.pas" will create two files NCALL.LIS and
NCALL_IX.LIS containing information about all procedure/
function calls in all PASCAL programs matching "*.pas".

The command "$ ndef *.pas" will create two files NDEF.LIS and
NDEF_IX.LIS containing information about all procedure/
function definitionss in all PASCAL programs matching "*.pas".

The command "$ ndocu *.pas" will create a file NDOCU.DOC
containing a skeleton of documentative pseudo-code for all PASCAL
programs matching "*.pas".


Directives.
===========

NICE recognize the follwing directives:


    FORCE            : Make forced comments some places.

    NOFORCE          : Not make forced comments some places.

    COMM1            : Use "{" and "}" for comments.

    COMM2            : Use "(*" and "*)" for comments.

    BEGINBREAK       : Makes linebreaks after BEGIN's.

                       Example:

                           IF A>B THEN BEGIN
                              C:=1;
                              D:=2;
                           END;
                       
    BREAKBEGIN       : Makes linebreaks before BEGIN's.

                       Example:

                           IF A>B THEN
                           BEGIN
                              C:=1;
                              D:=2;
                           END;
                       
    ENDINDENT        : Make indention of END.

                       Example:

                           IF A>B THEN BEGIN
                              C:=1;
                              D:=2;
                              END;

    NOENDINDENT      : Not make indention of END.

                       Example:

                           IF A>B THEN BEGIN
                              C:=1;
                              D:=2;
                           END;

    DEFINITION       : Write all procedure/function definitions to file.

    NODEFINITION     : Not write all procedure/function definitions to file.

    CALLING          : Write all procedure/function calls to file.

    NOCALLING        : Not write all procedure/function calls to file.

    TRANSLATE        : Perform translation (VMS PASCAL <-> TURBO PASCAL).

                       Translated:

                          VARYING OF CHAR       <->  STRING
                          FILE OF CHAR          <-   FILE
                          OTHERWISE             <->  ELSE
                          OPEN                  <->  ASSIGN
                          X**Y                   ->  EXP(Y*LN(X))
                          IADDRESS              <->  @
                          CHR                   <-   #
                          16#                   <->  $
                          X=X+1                 <-   INC(X)
                          X=X-1                 <-   DEC(X)
                          WRITEV                <->  STR
                          READV                 <->  VAL

                       Warnings:

                          All other except ofcourse predeclared routines
                          not present.

    NOTRANSLATE      : Not perform translation (VMS PASCAL <-> TURBO PASCAL).

    DOCUMENT         : Write documentative pseudo-code to file.

                       The following program elements are documented:

                         PROGRAM/PROCEDURE/FUNCTION start/end
                         IF/CASE/WHILE/FOR/REPEAT-UNTIL statements
                         procedure-call (special treatment of input/output)
                         block statements

    NODOCUMENT       : Not write documentative pseudo-code to file.

    ASSIGNSPACE      : Use " := " for assignments.

    NOASSIGNSPACE    : Use ":=" for assignments.

    IDLOWER          : Converts all identifiers to lower-case.

    IDUPPER          : Converts all identifiers to upper-case.

    IDMIXED/
    IDCAP            : Converts all identifiers to lower-case, but
                       with the first character in upper-case
                       (capitalize).

    KEYWORDLOWER/
    KWLOWER          : Converts all keywords to lower-case.

    KEYWORDUPPER/
    KWUPPER          : Converts all keywords to upper-case.

    KEYWORDMIXED/
    KWMIXED/
    KEYWORDCAP/
    KWCAP            : Converts all keywords to lower-case, but
                       with the first character in upper-case
                       (capitalize).

    INDENTTAB/
    INDTAB           : Makes indentation in multipla of tabs.

    INDENT0/
    IND0             : Makes indentation in multipla of 0 spaces.

    INDENT1/
    IND1             : Makes indentation in multipla of 1 spaces.

    INDENT2/
    IND2             : Makes indentation in multipla of 2 spaces.

    INDENT3/
    IND3             : Makes indentation in multipla of 3 spaces.

    INDENT4/
    IND4             : Makes indentation in multipla of 4 spaces.

    INDENT5/
    IND5             : Makes indentation in multipla of 5 spaces.

    INDENT6/
    IND6             : Makes indentation in multipla of 6 spaces.

    INDENT7/
    IND7             : Makes indentation in multipla of 7 spaces.

    INDENT8/
    IND8             : Makes indentation in multipla of 8 spaces.


How to use directives.
======================

Directives are ordered the following way (the first override the last):

    1)  Directives specified at the command-line.

    2)  Directives in the file NICECTRL. On VMS you can define a logical
        to point to the file. On other operating systems it must reside
        in current directory.

    3)  The default directives (BEGINBREAK,IDLOWER,KEYWORDLOWER,INDENT3,COMM2
        and NOFORCE).

