%DCL (DEFINESET, INSET) ENTRY; %DCL (LENGTH, NEWLINE, SUBSTR, INDEX) BUILTIN; %DEFINESET: PROC(NAME,ELEMENTS) STATEMENT RETURNS(CHAR); DCL(NAME,ELEMENTS) CHAR; RETURN(' %DCL '||NAME||' CHAR; %'||NAME||' = '''|| ELEMENTS || ','';'); %END DEFINESET; %INSET: PROC (Y,X) RETURNS(CHAR); DCL(Y,X) CHAR; DCL VAL CHAR; DCL (I,J,K) FIXED; VAL = ''; I = 1; DO WHILE(I < LENGTH(X)); IF I ^= 1 THEN VAL = VAL || ' .OR. '; J = INDEX(SUBSTR(X,I),','); VAL = VAL || Y || '.EQ.' || SUBSTR(X,I,J-1); I = I + J; END; RETURN ('('||VAL||')'); %END INSET; INTEGER*4 PROG DEFINESET (VALID_PROGS) ELEMENTS(2,10,14,16,30); IF INSET(PROG,VALID_PROGS) THEN WRITE(6,100) PROG END IF !A FORTRAN 77 COMMENT C A REGULAR FORTRAN COMMENT 100 FORMAT(' INVALID PROGRAM ACTIVITY: ',I5) 200 FORMAT(' TESTING SCANNER:',2F10.4) END