Firstly, let's see the signature of the main module called COSYENV:
signature COSYENV =
sig
val display : string -> unit
val parser_csr_expand : string -> string
end
Inside the body of signature COSYENV we can see that we have defined two functions. One function is display. It acts as a displayer which reads an expanded COSY program as a string and displays it on the screen. The other function is parser_csr_expand. It inputs the Macro COSY program as a string and outputs an expanded COSY program as a string as well. As the name indicates, it parses first, and then, checks the context- sensitive restrictions (csr for short), finally, does the expansion. When we define a structure for the COSY environment (we will discuss the structure later), we need to use four main signatures and six auxiliary signatures to assist.
Main signatures:
Auxiliary signatures: