Skip to content

Commit

Permalink
Method to get last temporary index
Browse files Browse the repository at this point in the history
  • Loading branch information
perezzini committed Nov 18, 2017
1 parent 3ba525e commit 6d1d314
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tigertemp.sig
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ signature tigertemp = sig
address is yet to be determined - just like a label in
assembly language. *)

type label = string (* Abstract names for static memory addresses *)
type temp = string (* Abstract names for local variables *)
type label = string (* Abstract names for static memory addresses *)
type temp = string (* Abstract names for local variables *)

val makeString: string -> string
val newtemp: unit -> temp (* Returns a new temporary from an infinite set of temps *)
val newlabel: unit -> label (* Returns a new label from an infinite set of labels *)
val newtemp: unit -> temp (* Returns a new temporary from an infinite set of temps *)
val newlabel: unit -> label (* Returns a new label from an infinite set of labels *)
val lastTempIndex: unit -> int (* Returns last index number used to identify a temp *)

end
1 change: 1 addition & 0 deletions tigertemp.sml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ in
j := !j+1;
s
end
fun lastTempIndex() = !i
end
end

0 comments on commit 6d1d314

Please sign in to comment.