Back to table

Invalid Assignment Test

The following is an invalid µOCCAM program.

Program file: /public/cs3/web/ipptests/superinvalid.reject

INT x:
PAR
  SEQ
      stdin ! x      --huh?!   ?!?!?!
      stdout ? x
  SEQ
      stdin ? y      --emmm, i see, y is an undeclared variable
      stdout ! y

  SEQ
      INT zzzz = bedtime  --bad assignment and : missing

  SEQ
      INT a:         --the lone survivor
      stdin ? a
      stdout ! a

z := ops             --bad assignment and out of scope

Good luck!           --this is an invalid comment