Google
 

Trailing-Edge - PDP-10 Archives - FORTRAN-10_V7wLink_Feb83 - f72bnf.syn
There are 12 other files named f72bnf.syn in the archive. Click here to see a list.
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.

;COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1974, 1983
;AUTHORS: F. INFANTE, J. BELL, D. B. TOLMAN, T.F. VASAK/DCE/CKS/RVM/CDM

        THE SYNTAX OF DECsystem-10/20 FORTRAN 77 IN EXTENDED BNF
                        100-310-044-03
                        JUNE 12,1972

        F72BNFV = 7^24 + 0^18 + #1677      !Version date: 20-Nov-82

***** Begin Revision History *****

***** Begin Version 4B *****

1       334     17420   Correct format of DO statement.

***** Begin Version 5B *****

2       653     25441   Unit number for FIND should allow an array reference,
                        (DCE)

3       741     -----   Add warning for array declaration with a / (slash)
                        sererating the upper and lower bounds, (DCE)

***** Begin Version 6 *****

4       760     TFV     1-Mar-80        -----
        F77 I/O statement changes

***** End Revision History *****

***** Begin Version 7 *****

5       1202    DCE     1-JUL-80        -----
        Change syntax to allow expressions on output lists.

6       1203    DCE     24-Nov-80       -----
        Modify 1102 to do I/O lists correctly with GIOLIST

7       1213    TFV     20-may-81
        Fix ONEARRAY so type declarations are var(subs)*length

8       1233    CKS     27-Jun-81
        Replace [ COMMA ] with %OPTCOMMA% in RWSPEC to avoid ambiguity.
        Also occurs in IOSPEC1 and ENCODECODESPEC.  Add ERREOL action routine
        to prevent "TYPE *," from not parsing and also not typing an error
        message.

9       1256    CKS     8-Sep-81
        Modify COMMONGROUP.  The statement COMMON // X contains what used
        to be two slashes and is now a concatenation lexeme.  Modify the
        syntax to allow this.

10      1262    CKS     18-Sep-81
        Modify syntax of EQUIVALENCE to allow character substrings

11      1271    CKS     9-Oct-81
        Add optional comma in DO statement

12      1277    CKS     20-Oct-81
        Modify GOTOSPEC so optional comma in assigned GOTO works: change
        VARIABLESPEC to IDENTIFIER.

13      1410    CKS     28-Oct-81
        Modify COMMONGROUP to allow the comma in COMMON A,/B/C.
        Modify DATA to allow the comma in DATA A/1/,B/1/ to be omitted.

14      1416    CKS     9-Nov-81
        Modify DATA to allow character substrings in DATA statement
        variable lists.

15      1421    CKS     11-Nov-81
        Allow statement function definitions with zero arguments.

16      1464    RVM     26-Jan-82
        Add INTRINSPEC (the BNF for INTRINSIC statements).

17      1465    CKS     22-Jan-82
        Make the BNF for IOSPEC call action routine KEYSCAN.  IOSPEC is
        the syntax for the control information list in READ and WRITE
        statements, and is too hard to do in BNF.

18      1467    CDM     1-Feb-82
        Add SAVESPEC for parsing the SAVE statement.

1510    RVM     14-Mar-82
        Make ONEARRAY allow a dimension bound of an array to be asterisk.

1527    CKS     1-Apr-82
        Modify ONEARRAY to allow constant expressions in array bounds.
        Modify PARAMSPEC to allow F77 parentheses in parameter statement.

1546    CKS     31-May-82
        Modify IO statements to unify READ/WRITE and TYPE/ACCEPT.  Also
        allow expressions as specifiers in TYPE/ACCEPT and "READ f,list"
        forms.

1573    CKS     1-Jul-82
        Make the statement number in "DO 10 I = ..." be optional.  Add
        syntax of DO WHILE statement.

1575    TFV     7-Jul-82
        Fix ONEARRAY for type declarations.  Allow both 'var * len (subs)'
        and 'var (subs) * len' forms.

1656    CKS     22-Oct-82
        Modify parameter form IDENTIFIER EQUAL %CONSTEXPR% to be %PARMASSIGN%
        so we can allow parameter defs to be used later in the same statement
        that defines them.

1677    CKS     12-Nov-82
        Use ENCSPEC and DECSPEC to parse keyword lists in ENCODE and DECODE.
        Use REWSPEC for REWIND and the rest of the utility statements.  Use
        FINDSPEC for FIND.

ENDV7



NOTE **** Everything before the  first form  feed is  ignored, so  all
          global comments,  and the  revision  history must  be  fully
          contained on the first logical  page. Starting with page  2,
          all comments  must be  preceded by  a ;  (semicolon) in  the
          first column, and terminated with a . (dot).

          Also do not use tabs  for spacing, use spaces instead.   Put
          spaces around all specifications  of the grammar to  delimit
          them.
          The .OR.'s are small case l's (as in lucky).
          All lines must end in a period (.).


                THE  INFORMATION IN  THIS MEMORANDUM IS
                SUBJECT TO CHANGE  WITHOUT  NOTICE  AND
                SHOULD NOT BE CONSTRUED AS A COMMITMENT
                BY   DIGITAL  EQUIPEMENT  CORPORATION .
;                                                     100-310-044-03
                                                        PAGE 02
.
;THE COMPONENTS OF THE MODIFIED BNF SYNTAX USED IN THE PRODUCTIONS ON THE FOLLOWING PAGES .

BNFDEFINITION      = METASYMBOL "="  BNFCOMPONENT  [ COMMENT ] "." .

BNFCOMPONENT       = ( TERMINAL l
                     METASYMBOL l
                     ONE l
                     ALL l
                     OPTION l
                     LIST l
                     REPEAT l
                     ACTION ) .

TERMINAL           = """ *ALPHANUMERIC """ ;TERMINAL CHARACTER STRING .

METASYMBOL         = [ *LETTER  "-" ] *LETTER  ;AN ELEMENT
                     OF THE SYNTAX DEFINED BY THE SYNTAX OR BY A LEXICAL
                     PROCESS .

ONE                = "(" BNFCOMPONENT *[ "l" BNFCOMPONENT ] ")" 
                     ;ONLY ONE OF THE BNFCOMPONENTS IS REQUIRED .

ALL                = BNFCOMPONENT *[ BNFCOMPONENT ] ;ALL OF THE
                     BNFCOMPONENTS ARE REQUIRED .

OPTION             = "[" BNFCOMPONENT "]" ;USE OF THE BNFCOMPONENT IS
                     OPTIONAL .

LIST               = "+" BNFCOMPONENT ;BNFCOMPONENTS SEPERATED BY
                     COMMAS .

REPEAT             = "*" BNFCOMPONENT ;BNFCOMPONENTS NOT SEPERATED BY
                     COMMAS .

ACTION             = "%" ACTIONNAME "%" ;ACTION TO BE PERFORMED WHEN ENCOUNTERED .

COMMENT            = ";" *ASCIICHARACTER .

;*****************************************************************************************************************
;                                                     100-310-044-03
                                                        PAGE 03
.
;FORTRAN-10 SYNTAX IN MODIFIED BNF .

EXPRESSION     = %EXPRESS% .

VARIABLESPEC       = IDENTIFIER %NOLABELS% [ LPAREN +%EXPRESS% RPAREN ] .

DATA               = *( [ COMMA ] +DATAITEM VALUELIST ) LINEND .
; (This production permits a comma before the first DATALIST as in
        DATA, A/1/
   This error is caught in the semantic routine) .

;FORMAT             = %FORMATSYN% .

; INTEGERSPEC        = DECLARESPEC LINEND .

; REALSPEC           = DECLARESPEC LINEND .

; LOGICALSPEC        = DECLARESPEC LINEND .

; DOUBLEPRECISION    = DECLARESPEC LINEND .

; COMPLEXSPEC        = DECLARESPEC LINEND .

DECLARESPEC        = ( FUNCTIONSPEC l TYPELIST )  LINEND .

FUNCTIONSPEC       = %FUNCTIONSCAN% SUBPROGRAMID .

PARAMSPEC          = %PARMLPAREN% +%PARMASSIGN% %PARMRPAREN% LINEND . 
;                                                     100-310-044-03
                                                        PAGE 04
.
; PROGRAM            =  [ IDENTIFIER ] LINEND .

; BLOCKDATA          =  [ IDENTIFIER ] LINEND .

DIMENSION          = +ONEARRAY LINEND .

SUBROUTINE         = SUBPROGRAMID  LINEND  .  

COMMON             = *COMMONGROUP LINEND .

EQUIVALENCE        = +( LPAREN SUBVARSPEC COMMA +SUBVARSPEC RPAREN ) LINEND .

SUBVARSPEC          = IDENTIFIER %NOLABELS% [ LPAREN
                           %COLNEXP% ( COLON %RPAREXP% RPAREN
                                     l COMMA +%EXPRESS% RPAREN [ SUBSTRSPEC ]
                                     l RPAREN [ SUBSTRSPEC ] ) ] .

SUBSTRSPEC         = LPAREN %COLNEXP% COLON %RPAREXP% RPAREN .

EXTERNSPEC         = +( [ ANDSGN l  ASTERISK  ]  IDENTIFIER  )   LINEND  . 

INTRINSPEC         = +IDENTIFIER LINEND .

; INCLUDESPEC        = LPAREN [ UNITSPEC COMMA ] ( LITSTRING l VARIABLESPEC ) RPAREN LINEND .

IMPLICIT           = +( %TYPEID% LPAREN +%IMPLICITSPEC% RPAREN ) LINEND .

SAVESPEC           = [ +( IDENTIFIER l SLASH IDENTIFIER SLASH ) ] LINEND .

; PROTECT            = +ONEARRAY LINEND .

; GLOBALSPEC         = +ONEARRAY LINEND .

NAMELIST           = *( SLASH IDENTIFIER SLASH +IDENTIFIER ) LINEND .

; IMPLICITSPEC       = %LETTER% [ DASH %LETTER% ] .
 
;TYPEID             = ( "SUBSCRIPTINTEGER" l "DOUBLEPRECISION" l
;                     ( "INTEGER" l "REAL" l "LOGICAL" l "COMPLEX" l "BIT" ) [ TIMES CONSTANT ] ) %SETTYPE% .

DATAITEM           = (  SUBVARSPEC l  LPAREN +DATAITEM [ LOOPPART ] RPAREN )  .
OUTPLIST           = %NOTEOL% %GIOLIST% .

LOOPPART           = EQUAL %EXPRESS% COMMA %EXPRESS% [ COMMA %EXPRESS% ] .

SUBPROGRAMID       = IDENTIFIER %PNAMSET% [ LPAREN [ +( IDENTIFIER l ASTERISK l DOLLAR l ANDSGN ) ] RPAREN ]  .

ONEARRAY           = IDENTIFIER %ASTERTYPE% [ 
                     LPAREN +( %ASTEREXPR% [ COLON %ASTEREXPR% ] ) 
                     RPAREN ]  %ASTERTYPE% .

TYPELIST           = +( +ONEARRAY  [ VALUELIST ] ) .

VALUELIST          = SLASH +( [ PLUS l MINUS ] 
                                    ( CONSTLEX [ TIMES ( [ PLUS l MINUS ] ( CONSTLEX l CMPLEXCON )   
                                                        l  LITSTRING 
                                                        )   
                                               ] 
                                     l  CMPLEXCON 
                                      ) 
                            l  LITSTRING 
                            )  SLASH  . 

CMPLEXCON          = LPAREN [ PLUS l MINUS ] CONSTLEX COMMA [ PLUS l MINUS ] CONSTLEX RPAREN .
;                                                     100-310-044-03
                                                        PAGE 05
.
COMMONGROUP        = [ SLASH IDENTIFIER SLASH l CONCAT ] +( ONEARRAY %CMNCOMMA% ) .

ASSIGN             = %LABELS% LABELEX %TOQUOTE% VARIABLESPEC LINEND .

GOTO               =  %LABELS% ( LABELEX l GOTOSPEC ) LINEND .

CALL               = IDENTIFIER [ LPAREN %EXPRLIST% RPAREN ] LINEND .

; RETURNSPEC         = [ %EXPRESS% ] LINEND .

;CONTINUE          = LINEND .

; STOP               = [ LITSTRING l CONSTLEX ] LINEND .

; PAUSE              = [ LITSTRING l CONSTLEX ] LINEND .

;END                 = LINEND .

RWSPEC               = %KEY1SPEC%  [ %OPTCOMMA% +OUTPLIST ] LINEND .

IOSPEC1              = %KEY4SPEC% [ %OPTCOMMA% +OUTPLIST ] LINEND .

; ACCEPT             = %LABELS% FORMATID [ COMMA +OUTPLIST ] LINEND .

; PUNCH              = %LABELS% FORMATID [ COMMA +OUTPLIST ] LINEND .

; WRITESPEC          = %LABELS% ( IOSPEC l FORMATID ) [ %OPTCOMMA% +OUTPLIST ] LINEND .

; PRINT              = %LABELS% FORMATID [ COMMA  +OUTPLIST ] LINEND .

; TYPESPEC           = %LABELS% FORMATID [ COMMA  +OUTPLIST ] LINEND .

; ENCODE             = ENCODECODESPEC LINEND .

; DECODE             = ENCODECODESPEC LINEND .

; REREAD             = %LABELS% FORMATID [ COMMA +OUTPLIST ] LINEND .
;                                                     100-310-044-03
                                                        PAGE 06
.
; BACKSPEC           = UTILSPEC .

;  REWIND             = UTILSPEC .

; UNLOAD             = UTILSPEC .

; ENDFILESPEC        = UTILSPEC .

; SKIPSPEC           = UTILSPEC  .

; OPEN               = LPAREN +( IDENTIFIER EQUAL ( VARIABLESPEC l CONSTANT l LITSTRING ) ) RPAREN LINEND .

; CLOSESPEC          = LPAREN ( CONSTANT l VARIABLESPEC )
;                     *[ COMMA IDENTIFIER EQUAL ( VARIABLESPEC l LITSTRING ) ] RPAREN LINEND .

FIND               = LPAREN %FINDSPEC% RPAREN LINEND .

; KEYSPEC          = %NOLABELS% +( IDENTIFIER  EQUAL ( CONSTLEX l VARIABLESPEC l ASTERISK ) ) .

; KEYORUNIT        = %NOLABELS% ( CONSTLEX [ %RECORDMARK% %EXPRESS% ] l 
                   IDENTIFIER [ %RECORDMARK% %EXPRESS% l EQUAL ( CONSTLEX l VARIABLESPEC l ASTERISK ) ] ) .

; KEYORFMT       = %LABELS% ( LABELEX l VARIABLESPEC [ EQUAL %NOLABELS% ( CONSTLEX l VARIABLESPEC l
                     ASTERISK ) ] l ASTERISK ) .

GOTOSPEC           = ( IDENTIFIER [ [ COMMA ] LPAREN +( %LABELS% LABELEX ) RPAREN ] l
                     LPAREN +( %LABELS% LABELEX ) RPAREN [ COMMA ] %EXPRESS% ) .

ENCODECODESPEC     = LPAREN %ENCDECSPEC% RPAREN [ %OPTCOMMA% +OUTPLIST ] LINEND .

; FORMATID           =   ( LABELEX l IDENTIFIER  l ASTERISK ) .

; ACTUALARG          = ( %EXPRESS%  l DOLLAR CONSTLEX ) .


; REPEATEXPR         = +( [ LPAREN ] ( CONSTLEX l VARIABLESPEC ) [ RPAREN ] [ LPAREN ( CONSTLEX l VARIABLESPEC ) RPAREN ] ) .

UTILSPEC         = %REWSPEC% LINEND .

;                                                     100-310-044-03
                                                        PAGE 07
.
STATEFUNCSPEC      = LPAREN  ( RPAREN  l  %NULLCHECK% +%SUBLOCAL% RPAREN )  EQUAL %EXPRESS% LINEND .

ARRAYASSIGNSPEC    = LPAREN +%EXPRESS% RPAREN   EQUAL %EXPRESS%  LINEND .

LOGICALIFSPEC      = LPAREN %EXPRESS% RPAREN .

ARITHIFSPEC        = LPAREN %EXPRESS% RPAREN %LABELS% LABELEX COMMA %LABELS% LABELEX [ COMMA %LABELS% LABELEX ] LINEND .

ASSIGNSPEC         = IDENTIFIER  EQUAL %EXPRESS%  LINEND .

DOSPEC             = %LABELS% [ LABELEX [ COMMA ] ] %NOLABELS% IDENTIFIER EQUAL
                     %EXPRESS% COMMA %EXPRESS% [ COMMA %EXPRESS% ] LINEND .

DOWHILE            = %LABELANDWHILE% LPAREN %EXPRESS% RPAREN LINEND .