X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=blobdiff_plain;f=compiler%2Fsrc%2Flib%2Ftiger%2Ftiger_temp.mli;fp=compiler%2Fsrc%2Flib%2Ftiger%2Ftiger_temp.mli;h=5535a2a9aabe4754e30aecfdde5cee4e5aeffccb;hp=0000000000000000000000000000000000000000;hb=cc540a7e2dfcee4411953075210a64de874b91e5;hpb=21d0f0503ea169988685a4f39d0e32b2b097dae6 diff --git a/compiler/src/lib/tiger/tiger_temp.mli b/compiler/src/lib/tiger/tiger_temp.mli new file mode 100644 index 0000000..5535a2a --- /dev/null +++ b/compiler/src/lib/tiger/tiger_temp.mli @@ -0,0 +1,27 @@ +(* "We use the word _temporary_ to mean a value that is temporarily held in a + * register, and the word _label_ to mean some machine-language location whose + * exact address is yet to be determined - just like a label in assembly + * language." ch. 6.2, p. 139 *) + +(* "temp" is an abstract name of "local variable" *) +module Temp : sig + type t + + val gen : unit -> t + (** "newtemp" - new temporary from an infinite set of temps. *) + + val to_string : t -> string +end + +(* "label" is an abstract name for "static memory address" *) +module Label : sig + type t + + val gen : unit -> t + (** "newlabel" - new label from an infinite set of labels. *) + + val of_string : string -> t + (** "namedlabel" - new label whose assembly-language name is string. *) + + val to_string : t -> string +end