Program
|
idl
|
->
|
decl_1 ... decl_n
|
n >= 1
|
Declaration
|
decl
|
->
|
proc
|
|
|
|
|
|
%const var
[var_1, ...
,var_n]
|
Constants, n >= 1
|
|
|
|
|
%dis var var_1 ... var_n = dis
|
n >= 0
|
|
|
|
|
%prefix var
|
Prefix to strip from Haskell function names
|
|
|
|
|
%C var
|
entire line is passed (stripped) to C
|
|
|
|
|
%- var
|
entire line is passed verbatim to C
|
Procedure
|
proc
|
->
|
sig [call] [ccode] [result]
|
|
Signature
|
sig
|
->
|
%fun var :: type
|
Name and type
|
Type
|
type
|
->
|
var
|
simple type
|
|
|
|
|
var type
|
type application
|
|
|
|
|
type -> type
|
function type
|
|
|
|
|
(type_1, ...
,type_n)
|
tuple types, n >= 0
|
|
|
|
|
[type]
|
list type
|
Call
|
call
|
->
|
%call dis_1 ... dis_n
|
|
Result
|
result
|
->
|
%fail cexp cexp [result]
|
In I/O monad
|
|
|
|
|
%result dis
|
|
C Expression
|
cexp
|
->
|
" var "
|
string excludes " character
|
C Code
|
ccode
|
->
|
%code var
|
|