mat_term Subroutine

public subroutine mat_term()

Arguments

None

Contents

Source Code


Variables

Type Visibility Attributes Name Initial
integer, public :: op

Source Code

subroutine mat_term()
integer                   :: op

   select case( G_RSTK(G_PT) )
   case(6,7)
      G_PT = G_PT+1
      G_RSTK(G_PT) = 8
      ! *call* factor
      return
   case(8)
      G_PT = G_PT-1
   case(9)
      op = G_PSTK(G_PT)
      G_PT = G_PT-1
      call mat_stack2(op)
      if (G_ERR .gt. 0)then
         return
      endif
      ! some binary ops done in matfns
      if (G_FUN .ne. 0) then
         G_PT = G_PT+1
         G_RSTK(G_PT) = 15
         ! *call* matfn
         return
      endif
   case(15)
      G_PT = G_PT-1
   case default
      call mat_err(22)
      return
   end select

   op = 0
   if (G_SYM .eq. dot) then
      op = dot
      call mat_getsym()
   endif
   if (.not.(G_SYM.eq.star .or. G_SYM.eq.slash .or. G_SYM.eq.bslash)) then
      return
   endif

   if(op.eq.0)then ! make a special code out of two characters ie. "./" or just set to last symbol found if op=0
      op = G_SYM
   else
      op = G_SYM + 1000
   endif

   call mat_getsym()

   if (G_SYM .eq. dot)then
      op = op + 1000  ! now holds three characters
      call mat_getsym()
   endif

   G_PT = G_PT+1
   G_PSTK(G_PT) = op
   G_RSTK(G_PT) = 9
   ! *call* factor

end subroutine mat_term