1sig kitty. 2%accum_sig tigerabsyn. 3accum_sig bobparser. 4 5kind kexp type. % continuation passing expression 6 7type kret kexp. % stop 8type kreturn texp -> kexp. % at end of functions. 9type incpc kexp. % increment program counter 10type kseq (list kexp) -> kexp. 11type kabs (texp -> kexp) -> kexp. % "administrative lambda" 12type kfix (string -> kexp) -> kexp. % simpler form for now 13type klet (string -> kexp) -> kexp. % simpler form for now 14type kname (string -> kexp) -> kexp. % simpler form for now 15% strings are for function and class names 16type kfunc string -> string -> kexp -> kexp. 17type karg texp -> int -> kexp -> kexp. %used to represent a func. argument 18type kfree texp -> kexp. % used to indicate value nolonger needed. 19type kvar string -> string -> texp -> kexp -> kexp. 20 21% last kexp is the K continuation: 22type kcall texp -> int -> kexp -> kexp. 23type kcall0 string -> int -> kexp -> kexp. 24type kif kexp -> kexp -> kexp -> kexp -> kexp. 25type kwhile kexp -> kexp -> kexp -> kexp. 26type kstruct string -> (list kexp) -> kexp -> kexp. 27type cps texp -> kexp -> kexp. 28type abscps texp -> kexp -> o. 29type klass string -> (list string) -> kexp -> kexp. 30type inclass string -> o. 31 32% formcps is always relative to some "current continuation" 33% - moved to second parameter position to improve indexing 6/03 34type formcps texp -> kexp -> kexp -> o. 35 36type atomic texp -> o. 37type primitive texp -> o. 38 39% a cps term is a computation AND an continuation. 40% should be different than a stand-alone kabs function. 41 42type kopy kexp -> kexp -> o. 43type notfreeink, okkursin texp -> kexp -> o. 44 45% manipulate the source absyn: 46 47type numoccur int -> texp -> kexp -> o. 48 49 50 51 52