nitc :: APropdef :: numbering_variables
# Numbering the variable inside the propdef
fun numbering_variables(vm: VirtualMachine) is abstract
src/vm/variables_numbering.nit:115,2--116,56
# Assign a position in the environment to each local variable
# *`vm` The current VirtualMachine
redef fun numbering_variables(vm: VirtualMachine)
do
# The position in the environment
var position = 0
# The `self` variable has the first position
if self.selfvariable != null then
self.selfvariable.position = position
position += 1
end
# Recursively go into the AST nodes to number all local variables
if n_block != null then
position = vm.numbering(self.n_block, position)
end
is_numbering = true
# The size of the environment to create to execute a call to this method
environment_size = position
end
src/vm/variables_numbering.nit:153,2--175,4
# Assign a position in the environment to each local variable
# *`vm` The current VirtualMachine
redef fun numbering_variables(vm: VirtualMachine)
do
# The position in the environment
var position = 0
# The `self` variable has the first position
if self.selfvariable != null then
self.selfvariable.position = position
position += 1
end
# Number the parameters
for i in [0..mpropdef.msignature.arity[ do
var variable = self.n_signature.n_params[i].variable
variable.as(not null).position = position
position += 1
end
# Recursively go into the AST nodes to number all local variables
if n_block != null then
position = vm.numbering(self.n_block, position)
end
is_numbering = true
# The size of the environment to create to execute a call to this method
environment_size = position
end
src/vm/variables_numbering.nit:120,2--149,4