anchor.diff:            EXIT
           END IF
         ELSE IF (TABLE(1,J).GT.STATE) THEN
  -        CALL SCNERR(INP,I)
  +        CALL SCNERR(INP,I,STATE)
         END IF
    1011 CONTINUE
   *
   ****  PERFORM ACTION
         SELECT CASE (ACTN)
         CASE(ERR)
  -        CALL SCNERR(INP,I)
  +        CALL SCNERR(INP,I,STATE)
         CASE(NEW)
           STRT = I
  -        TKLN = 1
  +        ENDT = STRT
         CASE(PUSH)
  -        TKLN = TKLN + 1
  +        ENDT = ENDT + 1
         CASE(FLSH)
  -        WRITE(6,9031) STATE,TKLN,INP(STRT:(STRT+TKLN-1))
  +        WRITE(6,9011) STATE,ENDT-STRT+1,INP(STRT:ENDT)
           STRT = I
  -        TKLN = 1
  +        ENDT = STRT
         END SELECT
  -      STATE = NXTST
  -*
  -***   WRITE(6,9011) C,IND
  -***   WRITE(6,9021) BUFF(1:BUFLN)
  - 1001 CONTINUE
  -*
  -      IF (TKLN.GT.0) THEN
  -        WRITE(6,9031) STATE,TKLN,INP(STRT:(STRT+TKLN-1))
  + 1001 STATE = NXTST
  +*
  +      IF (ENDT.GE.STRT) THEN
  +        WRITE(6,9011) STATE,ENDT-STRT+1,INP(STRT:ENDT)
         END IF
   *
    8999 RETURN
    9001 FORMAT('INPUT STRING: -->',A,'<--')
  - 9011 FORMAT('        CHAR: -->',A1,'<--',1X,I6)
  - 9021 FORMAT('      BUFFER: -->',A,'<--')
  - 9031 FORMAT('       TOKEN:    ',I4,X,I4,X,'-->',A,'<--')
  + 9011 FORMAT('       TOKEN:    ',I4,X,I4,X,'-->',A,'<--')
         END SUBROUTINE SCAN
   ************************************************************************
  -      SUBROUTINE SCNERR(INP,IND)
  +      SUBROUTINE SCNERR(INP,IND,STATE)
         IMPLICIT NONE
         CHARACTER*(*) INP
  -      INTEGER IND
  +      INTEGER IND,STATE
         WRITE(0,9001)
         WRITE(0,9011) TRIM(INP)
         WRITE(0,9011) REPEAT(' ',IND-1)//'^'
         WRITE(0,9021) ICHAR(INP(IND:IND))
  +      WRITE(0,9031) STATE
         GOTO 9999
    8999 RETURN
    9001 FORMAT('0*** ERROR SCANNING')
    9011 FORMAT('0***  ',A)
  - 9021 FORMAT('0***  CHARACTER CODE: ',I3)
  + 9021 FORMAT('0***  CHARACTER CODE: ',I4)
  + 9031 FORMAT('0***      SCAN STATE: ',I4)
    9999 STOP 'SCAN ERROR'
         END SUBROUTINE SCNERR
   ************************************************************************
  
positive.code:       IMPLICIT NONE
  * ----------------------------------------------------------------------
        INTEGER    NCLS,     NRWS
        PARAMETER (NCLS=5,   NRWS=46)
  *
        INTEGER    UNKN,      WHIT,      IDEN      
        PARAMETER (UNKN=0,    WHIT=101,  IDEN=201)
  
negative.code:       IMPLICIT NONE
        CHARACTER INP*(*),C
        INTEGER I,J,LNGTH,STATE,ACTN,NXTST,IND
        INTEGER STRT,ENDT
  * ----------------------------------------------------------------------
        INTEGER    NCLS,     NRWS
        PARAMETER (NCLS=5,   NRWS=53)
  *
        INTEGER    UNKN,      WHIT,      IDEN      
        PARAMETER (UNKN=0,    WHIT=101,  IDEN=201)
  