Sig/M   volume 39       Updated IBM 3740 Disk Utility
                       Language Analyzer

       -CATALOG.039    contents of Sig/M volume 39
       ACKLIST.039     acknowledgement file
       CRCKLIST.039    checksum file of Sig/M volume 39

index   name            size    description

39.01   3740UTIL.SUB     1K     Updated 3740 Disk Utility
39.02   3740UTIL.DOC     8K          /
39.03   3740UTIL.ASM    67K         /
39.04   3740UTIL.COM    13K        /
39.05   MACS3740.LIB    17K       /
39.06   EGRAMMAR.GMR     1K     Language Analyzer
39.07   EXAMPLE.GMR      1K                       /
39.08   EXAMPLE2         1K                      /
39.09   GRAMMA           1K                     /
39.10   LL1ANL.DOC       6K                    /
39.11   LL1ANL.PLI       3K                   /
39.12   LL1ANL.SUB       1K                  /
39.13   LL1LNK.SUB       1K                 /
39.14   LL1P00.PLI       3K                /
39.15   LL1P10.PLI      18K               /
39.16   LL1P1O.PLI      19K              /
39.17   LL1P20.PLI       7K             /
39.18   LL1P30.PLI      10K            /
39.19   LL1P40.PLI       6K           /
39.20   LL1P50.PLI       5K          /
39.21   LL1P60.PLI       4K         /
39.22   LL1P70.PLI       4K        /
39.23   LL1P80.PLI       6K       /
39.24   LL1PRC.PLI      13K      /

HE     * * *  INDEX  * * *
                         INTRODUCTION


    Th� followin� manua� describe� th� us� an� functio� o� th�
CP/͠ - IB͠ dis� utility��  I� i� designe� t� allo� th� use� t�
easily transfer data between CP/M and IBM disk formats.








CP/� i� � registere� trademar� o� Digita� Research� Garde� Grove�
CA��  IB͠ i� � registere� trademar� o� Internationa� Busines�
Machines, Poughkeepsie, NY.

pa �.he TABLE OF CONTENTS
INTRODUCTION ................................................   1
INITIALIZE AN IBM DISKETTE ..................................   2
CHANGE AN IBM VOLUME SERIAL NUMBER ..........................   3
CHANGE AN IBM DATASET'S DIRECTORY ENTRY .....................   4
DELETE AN IBM DATASET'S DIRECTORY ENTRY .....................   5
LIST AN IBM DATASET'S DIRECTORY .............................   6
TRANSFER CP/M TO IBM DATASET (BLOCK FORMAT) .................   7
TRANSFER IBM TO CP/M DATASET (BLOCK FORMAT) .................   8
TRANSFER CP/M TO IBM DATASET (SOURCE FORMAT) ................   9
TRANSFER IBM TO CP/M DATASET (SOURCE FORMAT) ................  10
DISPLAY AN IBM DATASET ......................................  11
HARDWARE/SOFTWARE REQUIREMENTS ..............................  12
MAINTENANCE POLICIES ........................................  13
PROGRAM ERROR REPORT ........................................  14
PA �.HE INTRODUCTION
                         Introduction

    Thi� progra� wa� develope� s� tha� developemen� coul� b� �
performe� o� � smal� compute� utilizin� CP/� fo� larg� IB� site�  �
Th� dat� o� program� wer� code� usin� th� smal� computer�� an� �
the� transfere� t� th� IB� compute� utilizin� thi� program�  �
Also�� certai� dat� wer� transferre� bac� t� th� smal� compute� �
fo� updatin� an� agai� transferre� bac� t� th� IB͠ computer�  �
Thus�� th� tim� involve� fo� codin� an� keypunchin� wer� absorbe� �
o� th� smal� machine��  All transfers were performed by diskette.
    Thi� manua� assume� tha� th� reade� ha� � workin� knowledg� �
o� bot� CP/� an� IB� operatin� systems��  I� particular� th� use� �
shoul� full� understan� th� basi� dis� layou� fo� IB͠ Standar� �
Interchang� Format��  Thi� progra� assume� th� SI� throughou� an� �
wa� writte� t� b� compatibl� wit� onl� it��  NO� othe� IB� forma� �
i� utilized��  Fo� furthe� informatio� concernin� thi� format� �
pleas� revie� manua� GA21-9182� IB� Genera� Informatio� Manua� o� �
Diskettes.
    Th� progra� wa� designe� t� b� men� drive� wit� prompting�  �
Currently�� eac� respons� i� verified�� an� i� incorrect�� re-�
prompted��  I� yo� mak� � mistak� whic� i� � vali� reply� re-boo� �
CP/� an� restar� th� program��  A� thi� time�� n� backu� facilit� �
i� offere� s� b� carefu� a� t� you� responses.
    Whe� workin� wit� CP/� files�� th� fil� name� ar� assume� t� �
b� a� 1-� byt� nam� wit� � typ� o� '.DAT'��  Th� 1-� byt� nam� �
mus� correspon� wit� � fil� nam� o� th� IB� diskette.
pa �.HE INITIALIZE AN IBM DISKETTE
                  Initialize an IBM Diskette

    T� initializ� � diskett� i� IB͠ SIƠ format�� us� thi� �
command�  Plac� th� diskett� t� b� initialize� i� th� appropriat� �
drive��  Selec� thi� functio� (1)��  Repl� wit� th� driv� (A-D)�  �
The� repl� wit� th� ne� 6-byt� volum� seria� number�  Th� progra� �
wil� the� forma� th� diskett� t� IB� specifications��  Thi� ma� �
tak� � fe� minute� s� don'� b� alarme� i� i� doesn'� repl�� t� �
yo� immediately��  Afte� initialization� th� diskett� i� read� t� �
use as an IBM diskette.
PA �.HE CHANGE AN IBM VOLUME SERIAL NUMBER
              Change an IBM Volume Serial Number

    Thi� functio� allow� th� use� t� simpl�� chang� a� IB� �
diskette'� volum� seria� number�  Us� functio� cod� (2� t� invok� �
it�  Repl� wit� th� dis� driv� (A-D� tha� th� diskett� i� on� an� �
the� repl� wit� th� ne� volum� seria� number� 1-� characters�  N� �
checkin� i� don� o� th� res� o� th� diskette��  Onl� th� volum� �
serial number is changed.
PA �.HE CHANGE AN IBM DATASET'S DIRECTORY ENTRY
            Change an IBM Dataset's Directory Entry

    Thi� functio� allow� yo� t� chang� th� director� entr�� fo� �
a� IB� file��  Yo� wil� us� thi� entr� t� creat� � file�� renam�
i� o� adjus� it� parameters��  T� invok� thi� function�� us� cod�
(3)��  Repl�� wit� th� dis� driv� containin� th� IB͠ diskette�
The� repl� wit� th� director� secto� t� b� changed�  Yo� ca� fin�
th� secto� numbe� b� usin� functio� (6)�� Lis� Directory��  Th�
progra� wil� the� displa� al� th� field� i� th� entr� an� reques�
tha� yo� entr� � ne� value��  Ente� ONLY� th� field� tha� yo� wan�
t� change��  Whe� th� las� fiel� ha� bee� entered�� th� director�
wil� automaticall� b� updated�� an� � completio� messag� wil� b�
posted to the terminal.  You will then return to the main menu.
PA �.HE DELETE AN IBM DATASET'S DIRECTORY ENTRY
Delete an IBM Dataset's Directory Entry

    T� delet� � datase� fro� a� IB� diskette� plac� th� diskett� �
i� � drive�� invok� functio� cod� (4)� ente� th� dis� driv� (A-D� �
o� whic� th� diskett� resides� an� ente� th� secto� numbe� o� th� �
director�� entry��  I� yo� ar� i� doub� a� t� th� secto� number� �
us� functio� cod� (6)�� Lis� Directory�� t� fin� ou� wha� i� is�  �
Whe� th� entr� ha� bee� delete� an� � completio� messag� ha� bee� �
posted, control will return to the main menu.
PA �.HE LIST AN IBM DIRECTORY
PA �.HE TRANSFER A CP/M FILE TO IBM FORMAT (BLOCK)
PA �.HE TRANSFER AN IBM FILE TO CP/M FORMAT (BLOCK)
PA �.HE TRANSFER A CP/M FILE TO IBM FORMAT (SOURCE)
PA �.HE TRANSFER AN IBM FILE TO CP/M FORMAT (SOURCE)
PA �.HE MAINTENANCE POLICIES
                     Maintenance Policies

    I� th� even� o� � problem�� contac� Rober� M� Whit� a� (208� �
377-0336��  H� i� responsibl� fo� answerin� question� relatin� t� �
installation�� operatio� an� maintenance��  I� th� proble� i� �
determine� t� b� � par� o� thi� package�� pleas� obtai� � printe� �
dum� befor� callin� fo� support��  ALL� use� modification� mus� b� �
remove� befor� obtainin� an� erro� analysi� an� correctio� fro� �
Rober� M�� White�  I� th� proble� persist� afte� initia� contact� �
pleas� complet� th� Progra� Erro� Repor� supplie� a� � par� o� �
thi� manua� an� sen� i� alon� wit� al� supportin� documentatio� �
to:
                   Robert M. White
                   8530 Stonehaven
                   Boise, ID  83704

    Rober� M�� Whit� wil� provid� custo� modification� t� user� �
wh� reques� them��  Thes� modification� ma� requir� a� additiona� �
charg� an� ma� no� b� quarantee� t� functio� correctl�� i� al� �
futur� releases��  Al� agreement� mus� b� i� writing��  Estimate� �
wil� b� issue� pertainin� t� th� wor� involve� i� performin� th� �
modifications.
PA �.HE Program Error Report
Date: _______� Title:___________________________________________

Submittor:______________________________________________________

Address:  ______________________________________________________

         ______________________________________________________

         ______________________________________________________

Phone:    (   ) ___-____ ext. ____

Error Description:










Environment:
    Computer Type: ________________________________________

    Core Size:     _____k

    No. and type of disks: ________________________________

    Console type:  ________________________________________

    CP/M release:  ________________________________________
PA �
*****************************************************************
*                    LL(1) Language Analyzer                    *
*****************************************************************

BY:
       ROBERT M. WHITE
       H & W COMPUTER SYSTEMS, INC.
       P.O. BOX 4173
       BOISE, ID  83704

DESCRIPTION:
       Thi� syste� read� � BNƠ descriptio� o� a LL(1�
language�� analyze� i� fo� error� an� generate� th� selectio�
set� fo� th� productions��  Variou� intermediat� table� ar� als�
generated to allow better debugging of the language.

SOURCE LANGUAGE:
       PL/I-8� distributed by DIGITA� RESEARCH�� PACIFI� GROVE�
CALIFORNIA.  Release developed under was 1.3.

SYSTEM REQUIRED:
   1.  8080/Z80 processor w/60k minimum.
   3.  2 disk drives (I used Double-Density w/600k capacity.)
   2.  CP/͠� Release� 1.�� or  above� distributed� by� DIGITA�
RESEARCH, PACIFIC GROVE, CALIFORNIA.
   3.  PL/I-8� distributed by DIGITA� RESEARCH�� PACIFI� GROVE�
CALIFORNIA.  Release developed under was 1.3.

INSTALLATION:
       1�� Adjus� LL1ANL.SU� t� reflec� th� prope� driv� whic�
           contains the source.
       2)  Submit the file, LL1ANL.SUB.

SYSTEM EXECUTION:
       1��  Pu� th� BN� gramma� int� � fil� wit� th� extensio�
            o� GM� (i.e�� EXAMPLE.GMR)��  Thi� fil� i� expecte�
            t� b� i� standar� sourc� forma� (i.e�� eac� lin� i�
            terminate� wit� � carriage-return� line-feed)�  Th�
            format of the BNF must be as follows:
               <grammar> -> <rule> '<eof>'
                         ;
               <rule> -> '<ident>' <alt> ';' <rule>
                      ->
                      ;
               <alt> -> '->' <rp> <alt>
                     ->
                     ;
               <rp> -> '<string>' <rp>
                    -> '<ident>' <rp>
                    ->
                    ;
            A� identifie� i� an� 1-� character� surrounde� b�
            <...�� (i.e��� <grammar>��  �� strin� i� an�� 1-� �             character� surroun� b��� quote� (i.e��� '->')�
            Comment� ma�� b� adde� t� th� en� o� an�� lin� b�
            merel�� codin� � '$ � an� the� th� comments��  Th�
            analyze� als� ha� certai� switche� whic� ma�� b�
            turne� o� o� of� b� usin� th� '$� followe� b�� th�
            switc� numbers���  Revie�� program��� LL1P10�� fo�
            further information.
       2��  Sinc� th�  program� use� overlays�� th� currentl�
            logge� dis� mus� b� th� on� containin� th� objec�
            fo� LL1ANL.COM��  T� analyz� � grammar�� ente� th�
            following:
                       LL1ANL grammar_file_name<return>
            For example, the example grammar was analyzed with:
                       LL1ANL EXAMPLE<return>
            The file extension of GMR is always assumed.
��������3)   Prin� th� fil� wit� th� extensio� o� PRΠ (i.e�
�������������EXAMPLE.PRN)�  Thi� wil� prin� th� selectio� se� a�
�������������wel� a� th� intermediat� table� use� t� calculat�
�������������th� selectio� set�  Th� las� repor� wil� onl� exis�
�������������i� th� gramma� i� no� LL(1� an� i� wil� indicat�
�������������whic� production� cause� i� no� t� be.

FILES DONATED:
       EXAMPLE.GMR - First example grammar
       EXAMPLE2.GMR - Second example grammar
       LL1ANL.DOC - The file that you are reading.
       LL1ANL.PLI - Driver program
       LL1ANL.SUB - Command List to Compile and  Link
                    the language analysis programs.
       LL1CMN.DCL - Common area for all programs
       LL1LNK.SUB - Command List to Link the language analysis
                    programs after re-compiling one of them.
       LL1PRC.DCL - Common Procedures Declarations
       LL1PRC.PLI - Common Procedures generated in LL1ANL
       LL1P10.PLI - Language Parser
       LL1P20.PLI - Language Sort and Print
       LL1P30.PL� - Languag� Analysi� - Fin� Nullabl�
                    Production� an� Non-terminals
       LL1P40.PL� - Languag� Analysi� - Calculate the
                    Beginning type relationships
       LL1P50.PL� - Languag� Analysi� - Calculate the
                    Ending type relationships
       LL1P60.PL� - Languag� Analysi� - Calculate the
                    Follow Set Relationship
       LL1P70.PL� - Languag� Analysi� - Calculate the
                    Selection Set for all productions
       LL1P80.PL� - Languag� Analysi� - Validate that
                    the language is LL(1)

REFERENCES:
       These programs were written from the outline given in:
               'COMPILER DESIGN THEORY' by P.M. Lewis III,
               D.J. Rosenkrantz and R.E. Stearns, Addison-
               Wesley Publishing Company, 1978.
       If you are going to use this system, it is highly re-
       commended that you get this book.
       Other books referenced:
               1. 'Compiler Design and Construction' by
                  Arthur Pyster, Van Nostrand Reinhold Co.,
                  1980.
               2. 'Structured System Programming' by Jim
                  Welsh & Michael McKeag, Prentice-Hall
                  International, Inc., 1980.
               3. 'Algorithms + Data = Programs', by N.
                  Wirth, Prentice-Hall International, Inc.,
                  1976.

FUTURE ENHANCEMENTS:
       The following is list of items that I may or may not get
       around to doing.  They represent enhancements or changes
       for the better (I hope!).
               1.  Add the following to the input language:
                   a.  Allow sections of terminals to be sur-
                       rounded by parentheses followed by a
                       '?' for 0 or 1 repetitions, '*' for 0 or
                       more repetitions or '+' for 1 or more
                       repetitions.
                   b.  Allow lists to be defined as <nt> LIST
                       ',' which denotes a list of <nt>'s seperated
                       by commas.
               2.  Add a phase which checks for left recursion
                   since this is the most deadly sin.
               3.  Add a phase which given the internal language
                   tables and the selection set produces the outline
                   of the compiler for all the various rules.

NOTICE OF PUBLIC DOMAIN:
       The files herein contained and denoted under my control �       ar� hereb�� place� int� th� publi� domai� an� ma�� b�
       freely distributed for any non-commercial personal use.



                       Robert M. White
                       July 15, 1981