GC  PREPRS:  PDS LABEL PRE-PARSING ROUTINE - CONVERT LINES TO STATEMENTSAC	CR/LFs within statements are removed (continuations).  CR/LF is;C	within statement if within an open text string or vector.AC	  If character before CR/LF not - or &, CR/LF replaced by space,C	  If & or - just before CR, CR/LF removed.+C	  If -& at end of text string, preserve -$C	CR/LFs between statements left in.C	Tabs and comments left in.?C	Also returns current label position (just before END<CR><LF>)BC  Args:	LABIN:  Char variable with raw label as read in from file=C		LABOUT: Char variable with output pre-parsed label (may beC			 same array as LABIN)2C		LBLSIZ: Number of characters in input raw labelBC		KPOS:   If >0, current position at <LF> just before END<CR><LF>C			 statement in LABOUT3C			If <0, syntax error (open vector or text, etc.)C  Limits:	No nested vectors. C		Assumes /* is comment denoter=C		No embedded comments (i.e. no comments before end of valueAC		 in a statement, except for lines which are entirely comments)5C		(-&) continuation construction not yet implemented?C		Current operation removes nice formatting in updated labels.CC  RMX 06jul87 preliminary version   19aug87 documentation modifiedC1      SUBROUTINE PREPRS(LABIN,LABOUT,LABSIZ,KPOS)!      CHARACTER*(*) LABIN ,LABOUT      CHARACTER*1 CR ,LF ,TAB)      LOGICAL TEXT, VECTOR, REMOVE, SPACEC      CR=CHAR(13)      LF=CHAR(10)      TAB=CHAR(9)(      TEXT=.FALSE.				! OPEN TEXT STRING%      VECTOR=.FALSE.				! OPEN VECTORC-      KIN=1					! INITIALIZE INPUT BUFFER PTR/      KOUT=1					! INITIALIZE OUTPUT BUFFER PTRC  NEXT LINE; 10   IF (KIN.GT.LABSIZ) GO TO 70		! CHECK FOR END OF INPUT?      KCR=INDEX(LABIN(KIN:),CR)			! FIND CR MARKING END OF LINE.      KLAST=KIN+KCR-2				! LAST CHAR BEFORE CR2      LENGTH=KCR+1				! LENGTH OF LINE, INCL CR/LF/C      WRITE (6,910) LABIN(KIN:KLAST)	! temp... C 910  FORMAT (1X,A)			! temp...       IF (KLAST.LT.KIN) GO TO 25?C   SEARCH THROUGH LINE, LOOKING FOR TEXT AND VECTOR DELIMITERS      DO 20 K=KIN,KLAST0      IF (LABIN(K:K).EQ.'(') THEN			! LEFT PAREN	IF (.NOT.TEXT) THEN	  IF (VECTOR) GO TO 70	  VECTOR=.TRUE.	ENDIF6      ELSE IF (LABIN(K:K).EQ.')') THEN			! RIGHT PAREN	IF (.NOT.TEXT) THEN	  IF (.NOT.VECTOR) GO TO 70	  VECTOR=.FALSE.	ENDIF7      ELSE IF (LABIN(K:K).EQ.'"') THEN			! DOUBLE QUOTE	IF (TEXT) THEN	  TEXT=.FALSE.	ELSE	  TEXT=.TRUE.	ENDIF      ENDIF 20   CONTINUEC  CHECK FOR CONTINUATIONS      REMOVE=.FALSE.      SPACE=.FALSE.      IF (TEXT) THEN	REMOVE=.TRUE.?	IF (LABIN(KLAST:KLAST).NE.'-') SPACE=.TRUE.	! NO HYPHEN AT END      ELSE IF (VECTOR) THEN	REMOVE=.TRUE.B	IF (LABIN(KLAST:KLAST).NE.'&') SPACE=.TRUE.	! NO AMPERSAND AT END      ENDIF!      IF (REMOVE) LENGTH=LENGTH-2C  COPY TO OUTPUT 25   IF (LENGTH.GT.0) THENI	LABOUT(KOUT:KOUT+LENGTH-1)=LABIN(KIN:KIN+LENGTH-1) ! MOVE LINE TO OUTPUT	IF (SPACE) THEN6	  LABOUT(KOUT+LENGTH:KOUT+LENGTH)=' '		! INSERT SPACE	  LENGTH=LENGTH+1	ENDIF      ENDIF9C      WRITE (6,910) LABOUT(KOUT:KOUT+LENGTH-1)	! temp...+      IF (LABOUT(KOUT:KOUT+2).EQ.'END'.AND.E     1	  LABOUT(KOUT+3:KOUT+3).EQ.CR) GO TO 30		! CHECK FOR "END<cr>")      KIN=KIN+KCR+1					! INCREMENT INPUT-      KOUT=KOUT+LENGTH					! INCREMENT OUTPUT&      GO TO 10						! GO GET NEXT LINEC  END OF LABEL 30   CONTINUEC      IF (TEXT.OR.VECTOR) GO TO 70		! ERROR - OPEN VECTOR OR STRING      KPOS=KOUT-1      RETURN	C  ERRORS
 70   KPOS=-1      RETURN	      END