class funUtils :
object
.. end
The class contains all the method and objects which differ from one subroutine and the other,
or the main program
val mutable inl : instruction list
The intermediate code instruction list
val mutable label_table : (int, element) Hashtbl.t
The table which bind an instruction number with a Label
val mutable labelC : label
The label counter
val mutable offcount : offset
The offset counter (which is the next offset for a new variable)
method addInstr : instruction -> unit
Add an instruction to the list
i
: The instruction to be added
method getInstr : int -> instruction
Get the i-th instruction from the list
Returns The instruction at position i
i
: The position number
method getInl : instruction list
Get all the instruction list
Returns The instruction list
method getIc : int
Get the instruction counter (how many instructions have been added)
Returns The number of added instructions
method stack : offset
Return the next offset from the stack pointer
Returns The next offset
method incLabel : label
Increments the label counter
Returns the next label index
method addLabel : element -> int -> unit
Add a new label to the table
lab
: The label to add
ip
: The instruction pointer to binf with the label
method getLabel : element
Create a new label
Returns A new Label
method hasLabel : int -> bool
Check if an instruction is binded with a label
Returns True if the instruction is binded with a label, false otherwise
i
: The index to check
method getInstrLabel : int -> element
Retrive the label binded with an instruction
Returns The label binded with the instruction
i
: The instruction associated with a label