\part{Type system} \begin{grammar} = \alt{} \alt{} \alt{} \alt{} \alt{} . \end{grammar} \chapter{Primitive types} \begin{itemize} \item Pointer \item Word \item Int \item Bool \item String \item Char \end{itemize} \chapter{Pointer types} \begin{grammar} = `^' . \end{grammar} \begin{lstlisting}[caption=Example] program; var x: Int; y: ^Int; begin y := @x; y^ := 0 end. \end{lstlisting} \chapter{Static array} \begin{grammar} = `[' `]' . \end{grammar} \begin{lstlisting}[caption=Example] program; var array: [3]Int := [1, 2, 3]; begin array[1] := array[2] end. \end{lstlisting} \chapter{Procedure types} \begin{grammar} = `proc' \\ `(' [ \{`,' \}] `)' . = `end'. = `;' (block | `extern'). = [`->' `!\@' | `->' type]. = `proc' `(' [] `)' . \end{grammar} \begin{lstlisting}[caption=Example] program; var a: proc(Int) -> Int; proc f(x: Int) -> Int; end; begin a := f; a(0) end. \end{lstlisting} \chapter{Records} \begin{grammar} = `:\@' . = `record' [`(' `)'] [ \{`;' \}] `end'. \end{grammar} \begin{lstlisting}[caption=Example] program; type T = record x: Int end; U = record(T) y: Int; z: Int end; var u: U; begin u := U(0, 1, 2); u.x := 3 end. \end{lstlisting} \chapter{Enumerations} \begin{grammar} = `(' \{`,' \} `)'. \end{grammar} \begin{lstlisting}[caption=Example] program; type E = (one, two, three); var e: E; begin e := E.one end. \end{lstlisting}