Back to table

Several grammar checks

The following is valid µOCCAM. Valid code to test several grammatical situations, comments and continuation lines. This code is valid.

Program file: /public/cs3/web/ipptests-phase-1/manytests.accept
--Try this one
SEQ
  SKIP
  SEQ
    --a comment
    this.is ? an.input
    this.is ! an.output
  --back to level 1 indentation
  ALT
    input ? again
      STOP -- this should be ignored
    boolean & input ? yet.again
      SKIP
  PROC now.it.gets.complicated ()
    SKIP
  :
  PROC multiple (INT multiple, INT entries, INT may, INT cause, INT problems)
    SEQ
         --comment with loads of indentation
      --this one is sufficient also
      SEQ
	--theres a tab here
	SEQ
	  SEQ -- a tab followed by spaces
            SEQ
  :
  --time to check continuation lines

  INT this.should.be.allowed = 
  ( 4 + 
  2 ) : -- a comment is allowed here but not in the 2 lines above
  



  --we need a process here after a specification
  STOP