EX06: An example in which Pascal program text is rearranged to form an ADT. This example achieves what EX05 does, but without additive macros. @!****************************** @O@==@{@- program adt(input,output); @ @ @ begin startproc; end. @} @$@==@{@- @ @ @} @$@==@{@- @ @} @$@==@{@- @ @ @} @!****************************** @$@==@{@- type buffer_type = record length : integer; buf : array[1..100] of char; end; @} @$@==@{@- bigbuf : buffer_type; @} @$@==@{@- procedure buf_init(var b : buffer_type) {Body of buf_init} procedure buf_add(var b : buffer_type; ch : char) {Body of buf_add} procedure buf_get(var b : buffer_type; var ch : char) {Body of buf_get} @} @!****************************** @$@==@{@- type complex_type = record r,i : real; end; @} @$@+=@{@- procedure cm_set(var c: complex_type; a,b : real) {Body of cm_set} procedure cm_add(a,b : complex_type; var c: complex_type) {Body of cm_add} {Other procedures and functions} @}