      SUBROUTINE EXPR
      IMPLICIT NONE
C
      INCLUDE MATLAB$KOM:RECU.KOM
      INCLUDE MATLAB$KOM:IOP.KOM
      INCLUDE MATLAB$KOM:COM.KOM
C
      INTEGER OP, R, BLANK, SIGN, PLUS, MINUS, NAME, COLON, EYE(4)
      INTEGER KOUNT, LS
C
      DATA COLON / 40 /, BLANK / 36 /, PLUS / 41 /
      DATA MINUS / 42 /, NAME / 1 /, EYE / 14, 34, 14, 36 /
C
C
      IF (DDT.EQ.1) WRITE (WTE, 100) PT, RSTK(PT)
100   FORMAT (' EXPR  ', 2I4)
      R = RSTK(PT)
      GO TO (01, 01, 01, 01, 01, 05, 25, 99, 99, 01,
     .       01, 99, 99, 99, 99, 99, 99, 01, 01, 01), R
C
01    CONTINUE
      IF (SYM.EQ.COLON) CALL PUTID (SYN, EYE)
      IF (SYM.EQ.COLON) SYM = NAME
      KOUNT = 1
C
02    CONTINUE
      SIGN = PLUS
      IF (SYM.EQ.MINUS) SIGN = MINUS
      IF (SYM.EQ.PLUS .OR. SYM.EQ.MINUS) CALL GETSYM
      PT = PT+1
      IF (PT.GT.PSIZE-1) CALL ERROR (26)
      IF (ERR.GT.0) RETURN
      PSTK(PT) = SIGN+256*KOUNT
      RSTK(PT) = 6
C *CALL* TERM
      RETURN
C
05    CONTINUE
      SIGN = MOD (PSTK(PT), 256)
      KOUNT = PSTK(PT)/256
      PT = PT-1
      IF (SIGN.EQ.MINUS) CALL STACK1 (MINUS)
      IF (ERR.GT.0) RETURN
C
10    CONTINUE
      IF (SYM.EQ.PLUS .OR. SYM.EQ.MINUS) GO TO 20
      GO TO 50
C
20    CONTINUE
      IF (RSTK(PT).NE.10) GO TO 21
C ***      BLANK IS DELIMITER INSIDE ANGLE BRACKETS
      LS = LPT(3)-2
      IF (LIN(LS).EQ.BLANK) GO TO 50
C
21    CONTINUE
      OP = SYM
      CALL GETSYM
      PT = PT+1
      PSTK(PT) = OP+256*KOUNT
      RSTK(PT) = 7
C *CALL* TERM
      RETURN
C
25    CONTINUE
      OP = MOD (PSTK(PT), 256)
      KOUNT = PSTK(PT)/256
      PT = PT-1
      CALL STACK2 (OP)
      IF (ERR.GT.0) RETURN
      GO TO 10
C
50    CONTINUE
      IF (SYM.NE.COLON) GO TO 60
      CALL GETSYM
      KOUNT = KOUNT+1
      GO TO 02
C
60    CONTINUE
      IF (KOUNT.GT.3) CALL ERROR (33)
      IF (ERR.GT.0) RETURN
      RHS = KOUNT
      IF (KOUNT.GT.1) CALL STACK2 (COLON)
      IF (ERR.GT.0) RETURN
      RETURN
C
99    CONTINUE
      CALL ERROR (22)
      IF (ERR.GT.0) RETURN
C
      RETURN
      END
