67 |
fun ppVarDecl ppStrm (AST.VD_Decl(x, e)) = let |
fun ppVarDecl ppStrm (AST.VD_Decl(x, e)) = let |
68 |
fun sp () = PP.space ppStrm 1 |
fun sp () = PP.space ppStrm 1 |
69 |
val string = PP.string ppStrm |
val string = PP.string ppStrm |
|
fun var x = string(Var.nameOf x) |
|
|
in |
|
|
PP.openHBox ppStrm; |
|
|
string(TU.toString(#2(Var.typeOf x))); sp(); var x; |
|
|
sp(); string "="; sp(); ppExp(ppStrm, e); string ";"; |
|
|
PP.closeBox ppStrm |
|
|
end |
|
|
|
|
|
fun ppStateVarDecl ppStrm (isOutput, AST.VD_Decl(x, e)) = let |
|
|
fun sp () = PP.space ppStrm 1 |
|
|
val string = PP.string ppStrm |
|
|
fun var x = string(Var.nameOf x) |
|
70 |
in |
in |
71 |
PP.openHBox ppStrm; |
PP.openHBox ppStrm; |
72 |
if isOutput then (string "output"; sp()) else (); |
case Var.kindOf x |
73 |
string(TU.toString(#2(Var.typeOf x))); sp(); var x; |
of AST.InputVar => (string "input"; sp()) |
74 |
|
| AST.ActorOutputVar => (string "output"; sp()) |
75 |
|
| _ => () |
76 |
|
(* end case *); |
77 |
|
string(TU.toString(#2(Var.typeOf x))); sp(); string(Var.nameOf x); |
78 |
sp(); string "="; sp(); ppExp(ppStrm, e); string ";"; |
sp(); string "="; sp(); ppExp(ppStrm, e); string ";"; |
79 |
PP.closeBox ppStrm |
PP.closeBox ppStrm |
80 |
end |
end |
167 |
nl(); |
nl(); |
168 |
PP.openVBox ppStrm indent; |
PP.openVBox ppStrm indent; |
169 |
string "{"; |
string "{"; |
170 |
List.app (fn vdcl => (nl(); ppStateVarDecl ppStrm vdcl)) state; |
List.app (fn vdcl => (nl(); ppVarDecl ppStrm vdcl)) state; |
171 |
List.app ppMethod methods; |
List.app ppMethod methods; |
172 |
PP.closeBox ppStrm; |
PP.closeBox ppStrm; |
173 |
nl(); |
nl(); |