The LABEL signature

A module used throughout the code generator to describe labels.


Synopsis

signature LABEL

Interface

datatype label
  = Label of {id : int, addr : int ref, comment : string}
val newLabel : string -> label
val nameOf : label -> string
val info : label -> string
val id : label -> int
val addrOf : label -> int
val setAddr : (label * int) -> unit
val reset : unit -> unit

Description

datatype label
The id and comment field are used for printing the label, and addr is the offset of this label from the beginning of the compilation unit.

newLabel s
Creates a new label. The string argument is used as the comment associated with the label.

nameOf la
Returns a unique printable name for the label la.

info la
Returns the comment associated with the label.

id la
Returns the id field of the label.

addrOf la
Returns the address field addr of the label.

setAddr (la, i)
Sets the address field of the label la to i.

reset ()
Resets the internal counter used to generate labels.



  Submit a comment on this page  

[ INDEX | TOP | Parent | Root ]

Author: Lal George
Last Modified: October 14, 1996
Copyright © 1996 Bell Laboratories