PAPER Sales Classification of Fortran 66 Statements

3
7/27/2019 PAPER Sales Classification of Fortran 66 Statements http://slidepdf.com/reader/full/paper-sales-classification-of-fortran-66-statements 1/3 1 1 The classification of FORTRAN statements A. H. J. Sale Basser Computing Department, University of Sydney, Sydney, Australia This paper d!scusses the problem of classifying ANSI FORTRAN statements into types, for example: assIgnment statements, DO statements, etc. The various problems that arise are ex plained, witb suggested solutions. An algorithm is presented whicb can type ANSI FORTRAN statements Into 36 classes. (Received June 1969) The classification of FORTRAN source statements from the lines presented to it is usually one of the first tasks of a FORTRAN compiler, or other FORTRAN source language processors. Th e determination of the type of a statement is no t completely trivial, although the structure of FORTRAN lends itself to a line-by-line classification and it is surprising to find that so few algorithms for this pu~pose have been published. The classification scheme presented here is built around three phases. Most FORTRAN statements can be identified ?y an initial keyword, the recognition of which is attempted I n the second phase. The purpose of the first phase is to remove those statement types not characterised by keywords and which may therefore confuse the second phase. Examples are comments and assignment statements. The third phase IS to make finer distinctions, for example between a logical IF and an arithmetic IF. By the ad hoc nature of FORTRAN this phase consists of very specific tests. This structure proved capable of accepting wide variations in dialects. The discussion to follow will assume that syntactically correct ANSI FORTRAN statements are presented to the classifier routine in the form of a 72 character array, which represent columns 1 to 72 of a FORTRAN line. Treatment of one line only means that there are restrictions on state ments that may be successfully classified, bilt is desirable to eliminate fruitless scans over long statements. It is obvious that comment statements must be isolated first, for columns 2 to 72 of a comment line may contain any FORTRAN characters, and even syntactically correct FORTRAN statements. This is very easy to do: the C in column I identifies them. Secondly, continuation lines must be isolated for their type is in general. ~~ete~minable, being at least partially deternuned the 10Il.J~1 hne that precedes them. According to the AmerIcan NatIOnal standard either the character b l a ~ k or character zero in column 6 of a line signifies an InJlIal hne, all other characters signify a continuation line. The third type that should be separated is the assignment statement, for there are no FORTRAN reserved words an d it is legal to use variable names such as READ, G01-02, D031, etc. There are several difficulties here which confuse the basic recognition rule of scanning the statement for an equals sign no t enclosed in parentheses. The DO statement poses the first. problem, for it too has 10 an equals sign not within any parentheses, and the recogni tion rules must distinguish between: and D021=1,5 D02J=I.5 A scan for a comma not in parentheses allows DO state ments to be differentiated from assignment statements. The logical IF also gives rise to problems, for it is really two statements in one: the IF test and an executable statement. Since most of the executable statements are permitted in a logical IF, they should no t be permitted to confuse the recognition rule . The natural way therefore to treat this problem is to ensure that the scan is terminated at most one non-blank character after encountering a right parenthesis at level O. This ensures that the equals sign of an assignment statement is always found, while the state ment following a logical IF expression will never be scanned past its first character. A DO statement cannot contain any parentheses. Hollerith constants, which in ANSI FORTRAN can appear in FORMAT statements, in DATA statements and in CALL statements (as actual parameters of subro~ltine calls), also crcate problems. HolJerith constants may contain any characters acceptable to the system, and consequently may wreck any scan scheme that ignores their existence. The only way to avoid this problem is to recognise a Hollenth constant on meeting it, an d then either to skip over the constant, or to terminate the scan . Since Hollerith constants may only follow a left arenthe~is (FORMAT and CALL), or a comma (FORMAT, DATA, and CALL), or a slash (FORMAT and DATA), or an asterisk (DATA), occurrences of these characters should initiate a special sequence which looks for the unsigned integer constant followed by an H which characterises such a constant. There is one insoluble problem on a line-by-line classifica tion basis: statement function definitions arithmetic assignments, and logical assignments are not distinguished by syntax alone. While s o ~ e occurrences can possibly be classdied, there are cases whIch cannot be classified without a knowledge of the variable and array declarations, for example: MOD(J,J) = I - (I{J)*J BOOL = UK T he Computer Journal

Transcript of PAPER Sales Classification of Fortran 66 Statements

Page 1: PAPER Sales Classification of Fortran 66 Statements

7/27/2019 PAPER Sales Classification of Fortran 66 Statements

http://slidepdf.com/reader/full/paper-sales-classification-of-fortran-66-statements 1/3

1

1

The classification of FORTRAN statements

A. H. J. Sale

Basser Computing Department, University of Sydney, Sydney, Australia

This paper d!scusses the problem of classifying ANSI FORTRAN statements into types, forexample: assIgnment statements, DO statements, etc. The various problems that arise are explained, witb suggested solutions. An algorithm is presented whicb can type ANSI FORTRANstatements Into 36 classes.

(Received June 1969)

The classification of FORTRAN source statements from

the lines presented to it is usually one of the first tasks of aFORTRAN compiler, or other FORTRAN sourcelanguage processors. The determination of the type of astatement is not completely trivial, although the structure of

FORTRAN lends itself to a line-by-line classification andit is surprising to find that so few algorithms for this p u ~ p o s ehave been published.

The classification scheme presented here is built aroundthree phases. Most FORTRAN statements can be identified?y an initial keyword, the recognition of which is attemptedIn the second phase. The purpose of the first phase is toremove those statement types not characterised by keywordsand which may therefore confuse the second phase. Examplesare comments and assignment statements. The third phaseIS to make finer distinctions, for example between a logicalIF and an arithmetic IF. By the ad hoc nature of FORTRAN

this phase consists of very specific tests. This structure

proved capable of accepting wide variations in dialects.The discussion to follow will assume that syntactically

correct ANSI FORTRAN statements are presented to theclassifier routine in the form of a 72 character array, whichrepresent columns 1 to 72 of a FORTRAN line. Treatmentof one line only means that there are restrictions on statements that may be successfully classified, bi lt is desirable to

eliminate fruitless scans over long statements.It is obvious that comment statements must be isolated

first, for columns 2 to 72 of a comment line may containany FORTRAN characters, and even syntactically correctFORTRAN statements. This is very easy to do: the C in

column I identifies them.Secondly, continuation lines must be isolated for their

type is in general. ~ ~ e t e ~ m i n a b l e , being at least partiallydeternuned the 1 0 I l . J ~ 1 hne that precedes them. Accordingto the AmerIcan NatIOnal standard either the character

b l a ~ k or character zero in column 6 of a line signifiesan InJlIal hne, all other characters signify a continuationline.

The third type that should be separated is the assignmentstatement, for there are no FORTRAN reserved words and

it is legal to use variable names such as READ, G01-02,

D031, etc. There are several difficulties here which confuse

the basic recognition rule of scanning the statement for anequals sign not enclosed in parentheses.

The DO statement poses the first. problem, for it too has

10

an equals sign not within any parentheses, and the recogni

tion rules must distinguish between:

and

D021=1,5

D02J=I.5

A scan for a comma not in parentheses allows DO statements to be differentiated from assignment statements.

The logical IF also gives rise to problems, for it is reallytwo statements in one: the IF test and an executablestatement. Since most of the executable statements are

permitted in a logical IF, they should not be permitted toconfuse the recognition rule. The natural way therefore totreat this problem is to ensure that the scan is terminatedat most one non-blank character after encountering a rightparenthesis at level O. This ensures that the equals sign of

an assignment statement is always found, while the statement following a logical IF expression will never bescanned past its first character. A DO statement cannotcontain any parentheses.

Hollerith constants, which in ANSI FORTRAN canappear in FORMAT statements, in DATA statements andin CALL statements (as actual parameters of s u b r o ~ l t i n ecalls), also crcate problems. HolJerith constants maycontain any characters acceptable to the system, andconsequently may wreck any scan scheme that ignores their

existence. The only way to avoid this problem is to recognisea Hollenth constant on meeting it, and then either to skip

over the constant, or to terminate the scan . Since Hollerithconstants may only follow a left a r e n t h e ~ i s (FORMAT andCALL), or a comma (FORMAT, DATA, and CALL), or aslash (FORMAT and DATA), or an asterisk (DATA),occurrences of these characters should initiate a special

sequence which looks for the unsigned integer constantfollowed by an H which characterises such a constant.

There is one insoluble problem on a line-by-line classification basis: statement function definitions arithmeticassignments, and logical assignments are not distinguishedby syntax alone. While s o ~ e occurrences can possibly be

classdied, there are cases whIch cannot be classified withouta knowledge of the variable and array declarations, for

example:

MOD(J,J) = I - (I{J)*JBOOL = UK

The Computer Journal

Page 2: PAPER Sales Classification of Fortran 66 Statements

7/27/2019 PAPER Sales Classification of Fortran 66 Statements

http://slidepdf.com/reader/full/paper-sales-classification-of-fortran-66-statements 2/3

Jt .

All three types are therefore assigned the same type code.

Practically all statements must pass through the assignment scan, and it should therefore be as efficient as possible.Any conditions which indicate that there is no need to

continue the scan furtber might well be noted and used,thus reducing the scan length. The algorithm suggested istherefore to scan for upper-level equals signs and commas

(to identify assignment statements and DO statements, and

incidentally assigned GO TOs), while watching for Holl erithconstants. The scan may be terminated under the following

conditions:

I . On meeting an upper-level comma.

2. On finding a Hollerith constant.

3. On meeting an equals sign in parentheses.4. One non-blank character after the parenthesis level

drops to zero.5. On reaching the end of a line.

Nearly all other statements, after the comments, continuations, assignments and statement function definitions,and DOs have been removed, can be classified by tbeir

initial keywords. The DO can also be classified this way,

but the assignment scan produces it as a by-product. Thisscan should of course be efficient, for there is a fairly largenumber of keywords to be tested. Probably the fastest and

most flexible way to organise this scan is around a linkedbinary tree. The arrangement of links can be chosen to

make common statements fast to classify, and to optimise .

the overall scan time. Statements which are not classifiedafter this scan are either in error, or do not comply with therecognition rules, and they should be given a 'rogue' type

code.There remain three more problems. The first is that

simple GO TOs and assigned GO TOs are not differentiatedby their keywords. Separation is most easily done by

checking to see if a comma was found in the earlier scan,which identifies an assigned GO TO.

Secondly, it is desirable to give arithmetic and logical IF

statements different type codes. This is done by checking thefirst non-blank character after the closing parenthesis of

the IF test, which must be a numeric digit in an arithmeticIF, and cannot be numeric in a logical IF.

The third problem concerns typed flllctions such as:

REAL FUNCTION RANDOM (A,B)

It is probably better that such statements be classified as

FUNCTION statements and not as INTEGER, REAL, etc.All type statements (INTEGER, REAL, DOUBLE

PRECISION, COMPLEX and LOGICAL) should thereforebe checked for the occurrence of tbe !I-character word'FUNCTION', which cannot be confused with any 6-

character name.A statement, to be recognisable from its initial line, must

therefore satisfy the following conditions:

I. Comments, continuations and EN D statements arealways recognisable.

2. An assignment statement must have up to and including the equals sign on the initial line.

3. DO statements and assigned GOTOs must have upto and including the first comma on the initial line.

4. Arithmetic IFs must have the first digit of the first

statement label on the initial line.5. All other statcmcnts must have the minimum key

characters as shown in Table 1 on the initial line,except for typed function declarations which must

have up to and including the word 'FUNCTION' on

the initial line. Tt can be seen that these requirements

are far from restrictive, and very seldom will they be

the cause of classification failure .

Volume 14 Number 1

A FORTRAN subroutine is presented which classifiesANSI FORTRAN lines. It has been written almost

entirely to comply with the requirements of Bas ie FOR-

TRAN; the exceptions being the DATA statement and theimplication of an A 1 f ormat type. Table I shows the in

teger type-codes assigned to the various statement types,which have been grouped into a reasonable order.

Table 1 Statement type codes

CODE DESCR[PTiON I KEYREMARKS

CHARACTERS

1 conunent - C in column 1

2 continuation - not blank or 0in column 6

3 assignment - special rules4 ASSIGN A

5 GO TO GOTO sec 66 assigned GO TO GOTO separated from

5 by special

rules7 computed GO TO GOTO(

8 arithmetic IF IF see 99 logical IF IF separated from

8 by specialrules

10 DO - special rulesI I CONTINUE CON

12 CALL CA

13 RETURN RET

14 STOP ST15 PAUSE P

16 READ READ

17 WRITE W18 REWIND REW

19 BACKSPACE BA

20 ENDFILE ENDF

21 FORMAT FO

22 INTEGER

IN fneed to be

23 REAL REAL further24 DOUBLE checked

PRECISION DO U for

25 COMPLEX ~ O M P J FUNCTION

26 LOGICAL type

27 EXTERNAL EX

28 DIMENSION DI

29 COMMON COMM

30 EQUIVALENCE EQ

31 DATA DA

32 BLOCK DATA BL

33 FUNCTION FU

34 SUBROUTINE SU

35 END EN D

unclassified

36 rogue type - statements

11

Page 3: PAPER Sales Classification of Fortran 66 Statements

7/27/2019 PAPER Sales Classification of Fortran 66 Statements

http://slidepdf.com/reader/full/paper-sales-classification-of-fortran-66-statements 3/3

The algorithm

t . • •• • 10 Cl AS!. IFY 'USAS FOII! TIU,N THeMOS n C. l HSESSl}iUWIJl INt; ClAS S I r.. ITYPI

c•••••c. ••• ••Sf'EC lf I CAr IC M

O J H f : " ' S I Q , " ~ , ;1121(. ....................... ............................................... .c . u s ~ s t. l llTlU,'i IHeORI) 0 1 f - -C.l ' SS-,.C. O 4 C . U ~ . . . .USllS F )R l itA ,; IlW I "c EI\I(LI ' Ll US AS eAS I " f U ~ A N

( \lpu r . . . . .C o IC. • t o  l'-l r F :" E't "1I . n' c .):-4rU'i l 1 C; 1 0 1 L - i A t t ~ C "lI t .I .[ U.'

C' O i , l TPU T. . . . .t o I r 'fP - A'1 IN I ; '- [ I TV PL CIJIi E 1- 0 " I I U HI

( . e iUI OR [ ,I , l l S. . . . •

( . IW'IE

C ' SU!lIU)IIIINi'ii Rc.:/ UIU O ••••

kCOfolP· 1 ,u (.' l r .. : ' I : " ' f ' t r !'1 fE::"" .11' . : '11)" ' 11 .' AU f P! :'t o A5. .U!(.U l' f I S A' , . I \ C. .. l l ' 1 : " I . I - O l U . , l l < "(i "' ' l l ' ' ' ' ' • .I/ojO

:. . J I f , P" I.\l'l ' 1·' 0 1 . " u O l " ' : l l o \ . OIHU ( ioIH \

C' T'l P£ Cil oe'>.. . . •c;. I 1 : .: .. tt .. \ .. ; ..·l "i' " " S .t o .... (.O 1 <.1 co • . I . ' . ; . p . '.J I .> ~ I I ~ . IF

l a 1 J ) L .. . "! . Ul :lCo 1 1 q U ,; .. .. Il ,II:;" ' '0 PA . Sf: It. 11. ( &0

C ' IT a" II l ' ~ o l IQ " J .. .q, P . .; l · . ~ D F I U :c . I. .. " I I .' ) a ll : .. f}ou6. I 'II EC.

t. i • . ; ... 1(. I" , o : . . l \ ., t " ....L , ft E ~ S I U : - lC. I :; J ... J.. ) ; Ol l'L r .,CI .u r &lA )2 ~ l O C K OAU

), " ' J ~ ~ W h J . ..::.rl · ' .. t .. u jb ~ O G U Ec••••••••••••••••••• . . . . ••••••••••• ••••••••••• •••••••••••• •••••••••• ,.

c .. . .DH. LA '; .ITI . -. \

O I "e "' :..I ·)" . . . .LP,.toJ •• 5 _.:.14:0 1 . . . . AL . I\Ot:C 1101 ,lI: rf l i l

r. . . . . . t ~ C . l , . ')' tA .... "

04. TA L' ... . 11 11

C .. . . IIL I'H4", 1(, t3'> \ ... , S . .. ) "A 1(.11 .... i LES

' •• • • • Ut : '. "L OI c" II S fUol IhlIlGtR .( COG rlltO,,, ,

O.:.r A , : . t l . I l . ' .KO£C.C2', 5 '>EC I ", KLlH 14 , ,I\ OE C U I ,

.. NU 1 r. : f C'Io '. ltllfC I 1 i", II;VE:C I8J . I ( !IECI'lI . KOt:t I1 ?1

.\Nf) I I t" : ' . l H1,IH1,lJoot) , lH4.1t15.J i't. . IH7.11t1S.ltl 'U

C ..... .. l .. :" '0 · f ~ C ION- f llR !"ArC- II I NG

OAr . . . . . 1 1 1 . " f l Z I, IV IJ , . KFI ~ " K f I S I. U : fC: I .K H 11 .KF f Ii 1

l ·. O 1 1 1 I i f . 1 H V , I ~ . l H t . I T , I H I , I H " " ' 1(. .... CH.t IliA\.J[ .S fOil. i\fC,o(; '11 1 11l'. TE STS,. .. . . ili l1 l C.1I ARE: . . . C I 5 L A " ' ~ • I ; II , • ':! •

O . fA a l ~ I ( . K L l l l C j . O , \ 1 o j ( f O II <+C ,11""I,lIll.ltl hl · h l

0 \ T . "rI. K:;itSH , 0; IK,lI.l LI U. ": '·l 11'1" , I ' " ,1 .-, I : .t .,. 1c . . .. . C H U "IE i l ...RR. ..... f OR r .. : c:

O lA KAL PI 1I .KALPI Z J .kA t" C 1I.I t 'L"1 '" I l HI . IHf . l l1ft,lHI;IDAt A 1(4LP I 5J .I\AL Pt 61,o;AIPI 1J . 1('L PI II I I l i iO .J" ' . lH U oIH lIn AIl. j(t.lP I ? 1 . .. l1l ' II::. J .X6L PII I I . . . . . .. 11/ 1 ' I14C .I"6 .1HO.\ l11II1

0 .. I A KAlP I13 I , I ALj> I t" 6 l P I I ~ I , " A L P I 1 6 1 1 l r 4 , . . l h I H ~ 1oloT .. rl.AlPt 11 1, Kj.LP, II I . ,; .. , 1'1 L'H. 1C.4LPll IJHE.IHA,lHD.IHLIDATA IC,o\LI11 11.ICAll'l 11 I . I tUP ( 2) 1 1(41PI1'" IlllT ,IH"II'. I 1iF, 1110104'0\ ......LPt25J . K .. .. . ALP I ZO l lum, l l - tO. l I t1 , l l1 , \1

O . TA KALPI Z<JI ,IC4L"1 I : ' , . " ' l " " Jl ) , lI:A l P 1)21 11tiCh lHU,lHW, t JotS ,DA TA kl\ LP (3 ) I .K 4l .. I I - . . .... lPI) ' ; l ' . 'U lP I 3b l 11HT,lHU,IH!;,l t tNI06110 P t l 7 1 , " . I . l : . o 1 Ji d .. .AlPf \ ' I •• ItALP'4 : 1 II HO,l l lF,1I\l . ,1ttQI

04. r .. I!,t.L PI toll , (.1l" I " ZI . "&l '>' JI . JlALP It, 4 ) I"HS ,HfA.IHl.III""

OArA " & . l P I " 5 1 . l \ J . l I " ~ 1 11Hl ,I I IPI

C .... SLJC.C fl tJ U .. " f l ot '.H .O.HA 1 l . " ~ 1 1 .I(:\.U(.1 1 2 . - 8 ,- 2Z. 51Uf\", ":1. . .:1 . c S J ' : ' J 71 .,.,, '; J CI II > I 6. 7, B.·7I

DATA , , ~ U C « 'iJ . " :l.X II : 'I . __ : UL I I I I .k ! .o ,KI1 2 1 I 10 . - I Z . 12,-111

O U A .,:'..1( 1 1 ) ' ... ; X I I " ' . __ SI){ I l : ' l .k \ I I(. I I LI I 1 ' t . - 2Q.-Z5 , II I

:J.\lJ. : I ~ ' I . ' , I I : : l . U C I Ifl. IQ.-1 6. - Z) 1o . r .. . J : ' I J 1 I I t : l . U t t ' ; : ' 1 1 - 13.-18 . 24 .- 211

O.lo IA : ' I ! \ 1 . " " " : ' 1 1 6 I ' ' ' : I . ' ' ' : 1 1 ' 1 . I I . S l l t 1-)1,. 21 . -28 . - 311.. · . / : I " l I , . ~ " " ; ' I ) ) I . 1 I . 5 u C . 1 ) l 1 ' ' ' ~ U C D 2 1 1 0 . -2 .. -1 7 . 3 ) 1

1).\1 . •   : 1!H.·:l.u.:., HI . OlS U; (J S I, !(SUCtJ6 ' I- H,-)). 16 , H IJ J I4 • . . : I " ' .. .. JlI)II I .. . .. . ..ll / )8. -2) . -2 7 , - )31).101 \ · : .·: . ," II . ' \J -.I " U , Ol!.U: lto l l, _ :\ :JC(UIl I 1O:!. - 19 . -32 . - lol

"' , . . . . : ' '') : ,'' ). .1: I l b l I , Zb.-1OjIr . .. . ':'j. ;:; .. ' ; ' ; \ : !' j

: If .. .. . 1 II .,I !L I Z I . , f411 ) I , l(r" ' ll 1 1 I '" ), - 36 . QoI

: 1 : . "' ' 1I \,., ' .10:1 t. 1. 1( '6ll n . lCfi1u I'll 1·)( .o,-}6 . -1b . -5 1

: u .0' .1

'l 1 " " l l l;",lI f "l l l l l . , ; ' A LI : Z ) 1 1 6 . 11 . - )6 . II I. . : . " ' - ' : ~ . L I 1 4 " l I f A l l l I . I ( A L I I 6 1 1- )0 ' l5 ,- 3b . l}1

J. : • ' . t l • • fAl l l t l l • • ' f l l t l q , .I(FAlf l . 1 1 - ) 6 . 2' . ZI j , - )b l,_ . i.tlll .II' .1 LC121.K f .L D1 1. I'.r ItLC Z '-1 I 2Z . - Jb . 26 , 2 < ; /

. l' t . . . . . . " l) I •• .f:, Ll1ol . lt r 'U11l .oI . ' .Ll ZIl I 1-16 , J 1". 111. 291"I . I : 11 . ·. f.t. l l, ; I , l ( r " lLll l, l<fAll l 'l 1 - ) 6 . - · f 6 , jZ , ]'11

., . , • . .... . l \l I ... 'U l l " I . K f . I . l ( f t . l I / ) " . - )6 . 1,1 , 3?1. 1· , ; t l . " ' . t . l l l e l 1 q ' . l ( f " ' l f ~ , ~ } t . , 4(., - )0 1

.1 " 0111 .. ~ I ' . " l t " 1 1 , l \ f 6 L ( .. ') . lCr.lL I " . J 1"10 , 103,-)b, 451. 11 1 U U . .. ) I •• 'ALtlt t .J 1 .. . , -3c l

.......... .. .... ..... ..... ..... ..... ........ .. ..... .. ..................... • ••• . ... \ .. t · .1:1." I' J I;f

...... : . H :' ·' ' 'Ml'U:. , . .. " .. II , .. I I Zol . 2. .. ..

~ ' . 1 '.\: ..... r ... ' .. W . u I O ' j kftURn

.' : ' " • • PC (""' .. d l .... 11 1, ·J. 1

.. I' I " .· ; " I \ ' I :oJ , l;; "lJII ..

.. JT ,Po 7

;.oj TJ ':oj.............. ..................... ..... ... ...... ............. ........t .• . . • I ·tl !1 "l I/ L ' '' l l J.I;t

"!io J\ .o .)

t 1 1 1 " ' : >.J[O -a

.}( " ... ·OJttOll

J s, &VE · lI.aLNI(C•• •• • ' I , ' i S ( ; ~ / l i ~ C l o . l,1;;1>

00 26 J . l,LCttCoJ(;II" KI J)

[f CK C",,","I J( " , l!.tSl :'O 1 6 . 7 " , 6(. ..... 1150 HOI DLt.J K, I S " O l ~ ! ; k I T C ~ "

f> I t- IJ I-t!lLL) 1201 Z .'

., DO #I l -I d ;I F I JO.COHPIJCH. oI.OEI: ' ll ll 11.10.8

8 CON TIN UEC .. . . FI RST T Pte, NO INtI C,E.H / I I E '"Iur HOLLE. ;UTIi

lI ' I I " ' L L ~ 1 1 11.1I,OJ

Rererences

C.... . OTrlFRoI I SE LOOi( F OR THE M

9 If I KCO /ll P I JC H, II:HII 11 , 32 ,1 1

C .... ST l l l f i lS IIOLLERirH I ' . . n ~ u . N T SYNr U10 JHlJLL oJII OLL +l

GO Tll Z o;

C. . . . . NUI 0\ H O L L ~ f l . 1 1 1 I CQ1>Ii U 'III . H I Sli n CH Of f

II JHOLL ' JC. . . . . T E:.I tlll.EJt ~ A C H R S tl ,' I '

It (I(CO"PI J (,I"h J(,LP I\II;II D,7 ' : . 13

11 If I It (.UMPlJCH. KR PJ,RII 14 , 1 6 01-.H IF 4Kc.:O"llP{JCH,I\C ..... II 1 'j , l!2 ol 5

15 If IXCO_P{J t H, k£U II 16 • .n . l bIb If ~ P I J C H S L S I I \ " .Z I ,l lJJ IF I t C O H P I J C t J ( A ~ T K I I Z5 ,ll. 25

t ..... RI c"ttf fI ..RL·HHESI$ . OU'IUt8 J!. oI · J S, , ·1

If 19 , 1'1,25t . . . . . SE I SlflTCH 10 ALLOW UNl1' UilE HORE ~ - O l " N CHARACTER

lq ISw - l

Go 10 2&C. . . . . H T P6..A.I::·jfHESIS J.OUNr  

':(.1 J o ; ~C .... SH HOLLCIUffI ~ I / I I C H f:JR I • I .

1.1 J HI)LL" ICO 10 ;O S

t .• . •. '0 141'4 .4 fOUND , CH ECk lI , VI! l21 If tJ S ,d ,=..} :" ,H

C.. . .. ' h l A L fUl.mo. CH E Cpr; lE V r l

ZJ 'f- IJ ) , 24.2<',)2

H JfQ - lC..... 1 l 5 r 1F TERH!NUEn [)Y 5wl l CH SeT

25 If I tS . ' 2t. . lb ,l '(. .. . .. UF I\ S S I GN HErlT SC ... LOUP

1& C:)'H l ltU f:

Gn 10 18

( . . . . . .WE l 45 T CMlRt,tT EK IF TUfoIlNArFD I::ARU'21 JSIoVc · JC I1 .

C• • • • • • • • • • • • • • • • • • • • • • • • • • •• • • • • • • • • •• .. • .. • .. •• • • • • • • • • ..... ...... . ..t • •• • . LEA',!E SCo\N "1IIl) CO"lf; MC IlE II- •• • .• •

NO MOil.[ CHI:.IE6.C(!:R S

C.. • • • U.IE CItAQl\t Il It AF IE'" ... 111 CHf PAA[ /t IIfI.:S I S

t ..... NOT . . co . C . H I tl t 4nIG"'EJot( .

28 If IJ U.;I J l . 1 2 .Z 1

1fJ JI YPa )GO TU 5 S

C.. . .. .. . ..... .. .... .... . . . . ..... . ....... • • • • • • • • • • • • • .. . .. .... . ..... .C. . . . . L EAVE s . cn AN ll La"' !: HE:itE If .. •c . •• • • A . UP PE It L FV I: L CD'''' FOU:of I)

C .... MI GH I al:: A 1)0. NOt. "!'I > l " ' fJCtU.· tI f )l , lZ "Jl

J I JI 1 ... I Jc.rJ TO 5S

c ••• •••••••••••• · ••. •••. . • . .. . . . · · · · •• .. · ·• ·•• •• •••·· • •. . . . . . . . .. . . . . . .C. . . . . E AV( SCAN CQ.oo;f lifliE .. . . •

C.. .. . ,.. '"LILLE R" ' " 1 . 6 . ' - I r ri)VI\l j)C.. .. . iQUo,l ':. 1'1 P/ . il.t: ' ITHEsrS

c..... fl IL UK( Of DO .u,o o !>S I(.""" E"" l tSTSC.. .. . I T H I ; ~ A nn " ' J ~ 1'1, 1 I C ' H ~ ( 1 ' I tc .. . • rlTfR TilE II.(:V . ORD t LA B IFI{. AII U"f

) Z J o l

15 .. -1) ) Je H- XI I S WI

C• • • • • tF A lHAl'IJ: . IG"Of((. Gel T"t: N ~ , I ( IIf P I J ( . J l I J V ~ > ( ' 14d1 .1 t .

C .. . . IBI 1 t ( . CUil.Uo1T (R H CHAIl AClE '14 Ir I" CU -'4PI JCH.I (AlP IJ I I l 3 ,>,l l . , )5

(. .. . .. CrMRt.(.n", OOt S ,1 0 1 :06.IC I4, TR,( fllf 1II, ,1{ 1 I": tH E

J :i J -::o jP;fAlI J II f U I

C .... • CHARACTE.iI. HUt t lH , TRY NE)( T t R f . ( A""!) 1"1 RECDA a

)6 J " KSUC IJ IIf I J. )9 . )9 . H _

)1

I F t " C I .) ) .n.1R

C • • • • • tt · RU:i OVf Of CHAI(Il.( H:RS . fORO " I\uc.vr TYP E"

lIS JC thK "L"' ' 'GO

rot ..... . .. . . . . . . .. . ..... . ........ . ........... .. . .. . . . . . .. . . ........... ..C..... l 6 S ~ l r 1 L ; r . ! 0 : 0 4 C!lld' l E TLU . fOlU1 TvpE. rOOf

]'1 J I 1'P.a -J

C.. . . . CMECK Tf) HE If IOIIlKE R E A " ' I ~ ' H "' H OED

' f- ) 55 . 105 ,4 0I,,,) JF J l ' r ' P I 55 , 43 , 041

"-I II IJ I ' ( I ' -121 ~ 5 . £ ,.. 1 IF IJr l ' i' - l h l " ""',55

C•• •• • a: . . .... ... ..... . .. ... . ... . ...... .... , .. .. . ...... ........ .... . .C..... IF S,EPfoIlld !U-: TESt

43 00 " L- ' .1O' t- l l j o l P t J S A ~ E . I ( O I : C ( L l I I " 4 , ' 54 . CO ' I"' L E

J 'YP" ' i

GO TO So;

P ~ R ; r f ; ~ ; " i ~ ; ~ G ~ ~ o i " " " " " " " ' "If i J ( . " -" '55.5S .. 6

"6 J I YP. (.

GO ' A ""0C...... ............ . .. .. ..... ........ . .. ...... " '" .. .. . . . . ......... .C..... Cl l!;CI< IoHHHU, THIS I S A TYPE S TA I ( "t N : A 'YI'E O . t:TJ01'l

"1 l II .

IjU TO S2

"8 t ool "1" IL - lfHGI " '1.4"" , 5

49 If II!.Cf}/'IP' kU.I ....OLIII{II '> 'I ."a, 5Ci

".i0 I F Ilt t>JMP('KI L I."I!.fI I S"II111 >l , I) ) , 5 l

)1 IF I lSw-11 ~ 8 , : ' 2'52 1501011

c.o 10 50

S)

IF f HOI-BI "8,-<08.0;;4

5 4 J I YP - H

C • • • • • ALL Ih'SUl1'i to"lE fiCRt fO P. H r Uit1'l

55 I r YP ' J lYP

RETLlR"i

'"

AMERICAN NATIONAL STANDARDS INSTITUTE( 1966). ANSI FORTRAN. X3.9-1966.

AMERlCAN NATIONAL STANDARDS INSTITUTE (1966). ANSI Basic FORTRAN, X3.JO-1966.

PYLE. l. C. (1964). Implem.entation of FORTRAN on ATLAS, Illtroductioll to System Programmillg, Ed. P. Wegner. AcademicPress. 1964.

'2 The Computer Journal