class intermediateCode :
object
.. end
This class is a over-structure for the funUtils class, and has methods for the manage of global variables, like registers, which are indipendent from the function (main or subroutines) that is processed
val mutable il : funUtils
The instance of the funUtils class created by default
val mutable reg : register
The variable which count how many registers have been used
method getIc : int
A wrapper for the getIc method of the funUtils class
Returns The instruction counter
method getInstructionList : instruction list
A wrapper for the getIc method of the funUtils class
Returns The instruction list
method setInstructionClass : funUtils -> unit
Setter method which allows substitution of the funUtils class
newil
: The new funUtils instance
method getInstructionClass : funUtils
Getter method of the funUtils class
Returns the funUtils instance
method addInstr : instruction -> unit
Add a new instruction, calling the addInstr
method of the funUtils class
i
: The instruction to add
method getInstr : int -> instruction
Get the instruction at position i,
calling the getInstr method of the funUtils class
Returns The instruction at index i
i
: The instruction index to get
method stack : offset
Get the next offset for a variable
Returns The next available offset
method getReg : register
Get the next available register index
Returns The next register index
method addLabel : element -> int -> unit
Wrapper for the addLabel method
lab
: The element (a label) to bind with the instruction
ip
: The number of the instruction where the label is binded
method getLabel : element
Retrive the label binded with an instruction
Returns The label binded with the instruction
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