SUBROUTINE SETPAT(TOUNIX) INTEGER TOUNIX COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 IF((TOUNIX.NE.1))GOTO 10000 PATAN0=174 PATBO0=222 PATNO0=222 PATST0=168 PATSU0=169 ESCAP0=220 UNIXS0=1 GOTO 10001 10000 PATAN0=191 PATBO0=165 PATNO0=254 PATST0=251 PATSU0=253 ESCAP0=192 UNIXS0=0 10001 RETURN END INTEGER FUNCTION MATCH(LIN,PAT) INTEGER LIN(1),PAT(256) COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER AMATCH INTEGER I,JUNK(9) I=1 GOTO 10004 10002 I=I+(1) 10004 IF((LIN(I).EQ.0))GOTO 10003 IF((AMATCH(LIN,I,PAT,JUNK,JUNK).LE.0))GOTO 10002 MATCH=1 RETURN 10003 MATCH=0 RETURN END INTEGER FUNCTION AMATCH(LIN,FROM,PAT,TAGBEG,TAGEND) INTEGER LIN(1),PAT(256) INTEGER FROM,TAGEND(9),TAGBEG(9) INTEGER OMATCH,PATSIZ INTEGER I,J,OFFSET,STACK COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 STACK=0 OFFSET=FROM J=1 GOTO 10008 10006 J=J+(PATSIZ(PAT,J)) 10008 IF((PAT(J).EQ.0))GOTO 10007 IF((PAT(J).NE.170))GOTO 10009 STACK=J J=J+(4) I=OFFSET GOTO 10012 10010 CONTINUE 10012 IF((LIN(I).EQ.0))GOTO 10011 IF((OMATCH(LIN,I,PAT,J).NE.0))GOTO 10010 GOTO 10011 10011 PAT(STACK+1)=I-OFFSET PAT(STACK+3)=OFFSET OFFSET=I GOTO 10006 10009 IF((PAT(J).NE.PATST0))GOTO 10015 I=PAT(J+1) TAGBEG(I)=OFFSET GOTO 10016 10015 IF((PAT(J).NE.PATSU0))GOTO 10017 I=PAT(J+1) TAGEND(I)=OFFSET GOTO 10018 10017 IF((OMATCH(LIN,OFFSET,PAT,J).NE.0))GOTO 10019 GOTO 10022 10020 STACK=PAT(STACK+2) 10022 IF((STACK.LE.0))GOTO 10021 IF((PAT(STACK+1).LE.0))GOTO 10020 GOTO 10021 10021 IF((STACK.GT.0))GOTO 10024 AMATCH=0 RETURN 10024 PAT(STACK+1)=PAT(STACK+1)-(1) J=STACK+4 OFFSET=PAT(STACK+3)+PAT(STACK+1) 10019 CONTINUE 10018 CONTINUE 10016 CONTINUE 10014 GOTO 10006 10007 AMATCH=OFFSET RETURN END INTEGER FUNCTION OMATCH(LIN,I,PAT,J) INTEGER LIN(1),PAT(256) INTEGER I,J COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER LOCATE INTEGER BUMP INTEGER AAAAA0 INTEGER AAAAB0 INTEGER AAAAC0(24) DATA AAAAC0/233,238,160,239,237,225,244,227,232,186,160,227,225,23 *8,167,244,160,232,225,240,240,229,238,0/ OMATCH=0 IF((LIN(I).NE.0))GOTO 10025 RETURN 10025 BUMP=-1 AAAAA0=PAT(J) GOTO 10026 10027 IF((LIN(I).NE.PAT(J+1)))GOTO 10029 BUMP=1 10028 GOTO 10029 10030 IF((I.NE.1))GOTO 10029 BUMP=0 10031 GOTO 10029 10032 IF((LIN(I).EQ.138))GOTO 10029 BUMP=1 10033 GOTO 10029 10034 IF((LIN(I).NE.138))GOTO 10029 BUMP=0 10035 GOTO 10029 10036 IF((LOCATE(LIN(I),PAT,J+1).NE.1))GOTO 10029 BUMP=1 10037 GOTO 10029 10038 IF((LIN(I).EQ.138))GOTO 10029 IF((LOCATE(LIN(I),PAT,J+1).NE.0))GOTO 10029 BUMP=1 10039 GOTO 10029 10026 IF((PATBO0.EQ.AAAAA0))GOTO 10030 IF((PATAN0.EQ.AAAAA0))GOTO 10032 IF(AAAAA0.EQ.164)GOTO 10034 AAAAB0=AAAAA0-218 GOTO(10036,10040,10040,10040,10040,10040,10027),AAAAB0 IF(AAAAA0.EQ.238)GOTO 10038 10040 CALL ERROR(AAAAC0) 10029 IF((BUMP.LT.0))GOTO 10041 I=I+(BUMP) OMATCH=1 10041 RETURN END INTEGER FUNCTION LOCATE(C,PAT,OFFSET) INTEGER C,PAT(256) INTEGER OFFSET COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER I I=OFFSET+PAT(OFFSET) GOTO 10044 10042 I=I-(1) 10044 IF((I.LE.OFFSET))GOTO 10043 IF((C.NE.PAT(I)))GOTO 10042 LOCATE=1 RETURN 10043 LOCATE=0 RETURN END INTEGER FUNCTION PATSIZ(PAT,N) INTEGER PAT(256) INTEGER N COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER AAAAD0(24) DATA AAAAD0/233,238,160,240,225,244,243,233,250,186,160,227,225,23 *8,167,244,160,232,225,240,240,229,238,0/ IF((PAT(N).EQ.225))GOTO 10047 IF((PAT(N).EQ.PATST0))GOTO 10047 IF((PAT(N).EQ.PATSU0))GOTO 10047 GOTO 10046 10047 PATSIZ=2 GOTO 10048 10046 IF((PAT(N).EQ.PATBO0))GOTO 10050 IF((PAT(N).EQ.164))GOTO 10050 IF((PAT(N).EQ.PATAN0))GOTO 10050 GOTO 10049 10050 PATSIZ=1 GOTO 10051 10049 IF((PAT(N).EQ.219))GOTO 10053 IF((PAT(N).EQ.238))GOTO 10053 GOTO 10052 10053 PATSIZ=PAT(N+1)+2 GOTO 10054 10052 IF((PAT(N).NE.170))GOTO 10055 PATSIZ=4 GOTO 10056 10055 CALL ERROR(AAAAD0) 10056 CONTINUE 10054 CONTINUE 10051 CONTINUE 10048 RETURN END INTEGER FUNCTION MAKPAT(ARG,FROM,DELIM,PAT) INTEGER ARG(128),DELIM,PAT(256) INTEGER FROM COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER ESC INTEGER ADDSET,GETCCL,STCLOS INTEGER I,J,JUNK,LASTCL,LASTJ,LJ,TAGNE0,TAGNUM,TAGST0(9) LOGICAL START0,STOPT0 J=1 LASTJ=1 LASTCL=0 TAGNUM=0 TAGNE0=0 I=FROM GOTO 10059 10057 I=I+(1) 10059 IF((ARG(I).EQ.DELIM))GOTO 10058 IF((ARG(I).EQ.0))GOTO 10058 LJ=J IF((ARG(I).NE.PATAN0))GOTO 10060 JUNK=ADDSET(PATAN0,PAT,J,256) GOTO 10061 10060 IF((ARG(I).NE.PATBO0))GOTO 10062 IF((I.NE.FROM))GOTO 10062 JUNK=ADDSET(PATBO0,PAT,J,256) GOTO 10063 10062 IF((ARG(I).NE.164))GOTO 10064 IF((ARG(I+1).NE.DELIM))GOTO 10064 JUNK=ADDSET(164,PAT,J,256) GOTO 10065 10064 IF((ARG(I).NE.219))GOTO 10066 IF((GETCCL(ARG,I,PAT,J).NE.-3))GOTO 10068 MAKPAT=-3 RETURN 10066 IF((ARG(I).NE.170))GOTO 10069 IF((I.LE.FROM))GOTO 10069 LJ=LASTJ IF((PAT(LJ).EQ.PATBO0))GOTO 10058 IF((PAT(LJ).EQ.164))GOTO 10058 IF((PAT(LJ).EQ.170))GOTO 10058 IF((PAT(LJ).EQ.PATST0))GOTO 10058 IF((PAT(LJ).EQ.PATSU0))GOTO 10058 GOTO 10070 10070 LASTCL=STCLOS(PAT,J,LASTJ,LASTCL) GOTO 10072 10069 IF((.NOT.START0(ARG,I)))GOTO 10073 IF((TAGNUM.LT.9))GOTO 10074 GOTO 10058 10074 TAGNUM=TAGNUM+(1) TAGNE0=TAGNE0+(1) TAGST0(TAGNE0)=TAGNUM JUNK=ADDSET(PATST0,PAT,J,256) JUNK=ADDSET(TAGNUM,PAT,J,256) GOTO 10075 10073 IF((.NOT.STOPT0(ARG,I)))GOTO 10076 IF((TAGNE0.LE.0))GOTO 10076 JUNK=ADDSET(PATSU0,PAT,J,256) JUNK=ADDSET(TAGST0(TAGNE0),PAT,J,256) TAGNE0=TAGNE0-(1) GOTO 10077 10076 JUNK=ADDSET(225,PAT,J,256) JUNK=ADDSET(ESC(ARG,I),PAT,J,256) 10077 CONTINUE 10075 CONTINUE 10072 CONTINUE 10068 CONTINUE 10065 CONTINUE 10063 CONTINUE 10061 LASTJ=LJ GOTO 10057 10058 IF((ARG(I).EQ.DELIM))GOTO 10078 MAKPAT=-3 GOTO 10079 10078 IF((ADDSET(0,PAT,J,256).NE.0))GOTO 10080 MAKPAT=-3 GOTO 10081 10080 IF((TAGNE0.EQ.0))GOTO 10082 MAKPAT=-3 GOTO 10083 10082 MAKPAT=I 10083 CONTINUE 10081 CONTINUE 10079 RETURN END INTEGER FUNCTION GETCCL(ARG,I,PAT,J) INTEGER ARG(128),PAT(256) INTEGER I,J COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER ADDSET INTEGER JSTART,JUNK I=I+(1) IF((ARG(I).NE.PATNO0))GOTO 10084 JUNK=ADDSET(238,PAT,J,256) I=I+(1) GOTO 10085 10084 JUNK=ADDSET(219,PAT,J,256) 10085 JSTART=J JUNK=ADDSET(0,PAT,J,256) CALL FILSET(221,ARG,I,PAT,J,256) PAT(JSTART)=J-JSTART-1 IF((ARG(I).NE.221))GOTO 10086 GETCCL=-2 GOTO 10087 10086 GETCCL=-3 10087 RETURN END INTEGER FUNCTION STCLOS(PAT,J,LASTJ,LASTCL) INTEGER PAT(256) INTEGER J,LASTJ,LASTCL COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER ADDSET INTEGER JP,JT,JUNK JP=J-1 GOTO 10090 10088 JP=JP-(1) 10090 IF((JP.LT.LASTJ))GOTO 10089 JT=JP+4 JUNK=ADDSET(PAT(JP),PAT,JT,256) GOTO 10088 10089 J=J+(4) STCLOS=LASTJ JUNK=ADDSET(170,PAT,LASTJ,256) JUNK=ADDSET(0,PAT,LASTJ,256) JUNK=ADDSET(LASTCL,PAT,LASTJ,256) JUNK=ADDSET(0,PAT,LASTJ,256) RETURN END INTEGER FUNCTION MAKSUB(ARG,FROM,DELIM,SUB) INTEGER ARG(1),DELIM,SUB(256) INTEGER FROM COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER ESC,TYPE INTEGER ADDSET INTEGER I,J,JUNK J=1 I=FROM GOTO 10093 10091 I=I+(1) 10093 IF((ARG(I).EQ.DELIM))GOTO 10092 IF((ARG(I).EQ.0))GOTO 10092 IF((ARG(I).NE.166))GOTO 10094 JUNK=ADDSET(-3,SUB,J,256) JUNK=ADDSET(0+-10,SUB,J,256) GOTO 10091 10094 IF((ARG(I).NE.ESCAP0))GOTO 10096 IF((TYPE(ARG(I+1)).NE.176))GOTO 10096 I=I+(1) JUNK=ADDSET(-3,SUB,J,256) JUNK=ADDSET(ARG(I)-176+-10,SUB,J,256) GOTO 10097 10096 JUNK=ADDSET(ESC(ARG,I),SUB,J,256) 10097 CONTINUE 10095 GOTO 10091 10092 IF((ARG(I).EQ.DELIM))GOTO 10098 MAKSUB=-3 GOTO 10099 10098 IF((ADDSET(0,SUB,J,256).NE.0))GOTO 10100 MAKSUB=-3 GOTO 10101 10100 MAKSUB=I 10101 CONTINUE 10099 RETURN END SUBROUTINE CATSUB(LIN,FROM,TO,SUB,NEW,K,MAXNEW) INTEGER FROM(10),TO(10),K,MAXNEW INTEGER LIN(512),NEW(MAXNEW),SUB(256) COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER ADDSET INTEGER I,J,JUNK,RI I=1 GOTO 10104 10102 I=I+(1) 10104 IF((SUB(I).EQ.0))GOTO 10103 IF((SUB(I).NE.-3))GOTO 10105 I=I+(1) RI=SUB(I)+1--10 J=FROM(RI) GOTO 10108 10106 J=J+(1) 10108 IF((J.GE.TO(RI)))GOTO 10102 JUNK=ADDSET(LIN(J),NEW,K,MAXNEW) GOTO 10106 10105 JUNK=ADDSET(SUB(I),NEW,K,MAXNEW) 10109 GOTO 10102 10103 RETURN END SUBROUTINE FILSET(DELIM,ARRAY,I,SET,J,MAXSET) INTEGER I,J,MAXSET INTEGER ARRAY(1),DELIM,SET(MAXSET) COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER ESC INTEGER ADDSET,INDEX INTEGER JUNK INTEGER DIGITS(11) INTEGER LOWALF(27) INTEGER UPALF(27) DATA DIGITS/176,177,178,179,180,181,182,183,184,185,0/ DATA LOWALF/225,226,227,228,229,230,231,232,233,234,235,236,237,23 *8,239,240,241,242,243,244,245,246,247,248,249,250,0/ DATA UPALF/193,194,195,196,197,198,199,200,201,202,203,204,205,206 *,207,208,209,210,211,212,213,214,215,216,217,218,0/ GOTO 10112 10110 I=I+(1) 10112 IF((ARRAY(I).EQ.DELIM))GOTO 10111 IF((ARRAY(I).EQ.0))GOTO 10111 IF((ARRAY(I).NE.ESCAP0))GOTO 10113 JUNK=ADDSET(ESC(ARRAY,I),SET,J,MAXSET) GOTO 10110 10113 IF((ARRAY(I).EQ.173))GOTO 10115 JUNK=ADDSET(ARRAY(I),SET,J,MAXSET) GOTO 10116 10115 IF((J.LE.1))GOTO 10118 IF((ARRAY(I+1).EQ.0))GOTO 10118 GOTO 10117 10118 JUNK=ADDSET(173,SET,J,MAXSET) GOTO 10119 10117 IF((INDEX(DIGITS,SET(J-1)).LE.0))GOTO 10120 CALL DODASH(DIGITS,ARRAY,I,SET,J,MAXSET) GOTO 10121 10120 IF((INDEX(LOWALF,SET(J-1)).LE.0))GOTO 10122 CALL DODASH(LOWALF,ARRAY,I,SET,J,MAXSET) GOTO 10123 10122 IF((INDEX(UPALF,SET(J-1)).LE.0))GOTO 10124 CALL DODASH(UPALF,ARRAY,I,SET,J,MAXSET) GOTO 10125 10124 JUNK=ADDSET(173,SET,J,MAXSET) 10125 CONTINUE 10123 CONTINUE 10121 CONTINUE 10119 CONTINUE 10116 CONTINUE 10114 GOTO 10110 10111 RETURN END SUBROUTINE DODASH(VALID,ARRAY,I,SET,J,MAXSET) INTEGER I,J,MAXSET INTEGER ARRAY(1),SET(MAXSET),VALID(1) COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 INTEGER ESC INTEGER ADDSET,INDEX INTEGER JUNK,K,LIMIT I=I+(1) J=J-(1) LIMIT=INDEX(VALID,ESC(ARRAY,I)) K=INDEX(VALID,SET(J)) GOTO 10128 10126 K=K+(1) 10128 IF((K.GT.LIMIT))GOTO 10127 JUNK=ADDSET(VALID(K),SET,J,MAXSET) GOTO 10126 10127 RETURN END INTEGER FUNCTION ADDSET(C,SET,J,MAXSIZ) INTEGER J,MAXSIZ INTEGER C,SET(MAXSIZ) COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 IF((J.LE.MAXSIZ))GOTO 10129 ADDSET=0 GOTO 10130 10129 SET(J)=C J=J+(1) ADDSET=1 10130 RETURN END INTEGER FUNCTION ESC(ARRAY,I) INTEGER ARRAY(1) INTEGER I COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 IF((ARRAY(I).EQ.ESCAP0))GOTO 10131 ESC=ARRAY(I) GOTO 10132 10131 IF((ARRAY(I+1).NE.0))GOTO 10133 ESC=ESCAP0 GOTO 10134 10133 I=I+(1) IF((ARRAY(I).NE.238))GOTO 10135 ESC=138 GOTO 10136 10135 IF((ARRAY(I).NE.244))GOTO 10137 ESC=137 GOTO 10138 10137 ESC=ARRAY(I) 10138 CONTINUE 10136 CONTINUE 10134 CONTINUE 10132 RETURN END LOGICAL FUNCTION START0(ARG,I) INTEGER ARG(1) INTEGER I COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 IF((UNIXS0.NE.1))GOTO 10139 IF((ARG(I).NE.ESCAP0))GOTO 10140 IF((ARG(I+1).NE.PATST0))GOTO 10140 I=I+(1) START0=.TRUE. RETURN 10140 START0=.FALSE. RETURN 10139 IF((ARG(I).NE.PATST0))GOTO 10141 START0=.TRUE. RETURN 10141 START0=.FALSE. RETURN END LOGICAL FUNCTION STOPT0(ARG,I) INTEGER ARG(1) INTEGER I COMMON /PATCOM/PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0,UNIXS0 INTEGER PATAN0,PATBO0,PATNO0,PATST0,PATSU0,ESCAP0 INTEGER UNIXS0 IF((UNIXS0.NE.1))GOTO 10142 IF((ARG(I).NE.ESCAP0))GOTO 10143 IF((ARG(I+1).NE.PATSU0))GOTO 10143 I=I+(1) STOPT0=.TRUE. RETURN 10143 STOPT0=.FALSE. RETURN 10142 IF((ARG(I).NE.PATSU0))GOTO 10144 STOPT0=.TRUE. RETURN 10144 STOPT0=.FALSE. RETURN END C ---- Long Name Map ---- C inslines insli0 C gt40pos gt40p0 C terakpos terak0 C clrscreen clrsc0 C printverboseerrormessage print0 C starttag start0 C uniquelyname uniqu0 C dologout dolog0 C doshell doshe0 C addspos addsp0 C fixscreen fixsc0 C adjustwindow adjus0 C updscreen updsc0 C PATBOL patbo0 C setscreen setsc0 C forsyspos forsy0 C litmesg litme0 C PATSTARTTAG patst0 C getrange getra0 C tagnest tagne0 C drawbox drawb0 C garbagecollect garba0 C dellines delli0 C displaymessage displ0 C loadstr loads0 C restorescreen resto0 C cleartoeol clear0 C whereami where0 C PATANY patan0 C tagstack tagst0 C Unixstyle unixs0 C ansipos ansip0 C regentpos regen0 C sendmesg sendm0 C initialize initi0 C overlay overl0 C stoptag stopt0 C cunixswt cunix0 C decodemnemonic decod0 C PATNOT patno0 C PATSTOPTAG patsu0 C recvmesg recvm0 C bee2pos bee2p0 C positioncursor posit0 C hwinsdel hwins0 C litnnum litnn0 C gettermtype gette0 C sbeecoord sbeec0 C warndeleted warnd0 C b200coord b200c0 C spinject spinj0 C ESCAPE escap0 C senddelay sendd0 C cgcoord cgcoo0