A local variable (including parameters, automatic variables and self)

Introduced properties

private var _assignment_blocks: Array[BasicBlock]

nitc :: Variable :: _assignment_blocks

The blocks in which this variable is assigned
private var _declared_type: nullable MType

nitc :: Variable :: _declared_type

The declared type of the variable
private var _dep_exprs: Array[AExpr]

nitc :: Variable :: _dep_exprs

The expressions of AST of this variable depends
private var _is_adapted: Bool

nitc :: Variable :: _is_adapted

Was the variable type-adapted?
private var _location: nullable Location

nitc :: Variable :: _location

The declaration of the variable, if any
private var _name: String

nitc :: Variable :: _name

The name of the variable (as used in the program)
private var _original_variable: nullable Variable

nitc :: Variable :: _original_variable

The original Variable in case of renaming
private var _parameter: Bool

nitc :: Variable :: _parameter

If true, this variable is a parameter of a method
private var _position: Int

nitc :: Variable :: _position

The position in the environment
private var _read_blocks: Array[BasicBlock]

nitc :: Variable :: _read_blocks

Part of the program where this variable is read
private var _stack: Array[Variable]

nitc :: Variable :: _stack

The stack of this variable, used for SSA renaming
private var _warn_unread: Bool

nitc :: Variable :: _warn_unread

Is the local variable not read and need a warning?
fun assignment_blocks: Array[BasicBlock]

nitc :: Variable :: assignment_blocks

The blocks in which this variable is assigned
protected fun assignment_blocks=(assignment_blocks: Array[BasicBlock])

nitc :: Variable :: assignment_blocks=

The blocks in which this variable is assigned
fun declared_type: nullable MType

nitc :: Variable :: declared_type

The declared type of the variable
fun declared_type=(declared_type: nullable MType)

nitc :: Variable :: declared_type=

The declared type of the variable
fun dep_exprs: Array[AExpr]

nitc :: Variable :: dep_exprs

The expressions of AST of this variable depends
protected fun dep_exprs=(dep_exprs: Array[AExpr])

nitc :: Variable :: dep_exprs=

The expressions of AST of this variable depends
private fun is_adapted: Bool

nitc :: Variable :: is_adapted

Was the variable type-adapted?
private fun is_adapted=(is_adapted: Bool)

nitc :: Variable :: is_adapted=

Was the variable type-adapted?
fun location: nullable Location

nitc :: Variable :: location

The declaration of the variable, if any
fun location=(location: nullable Location)

nitc :: Variable :: location=

The declaration of the variable, if any
fun name: String

nitc :: Variable :: name

The name of the variable (as used in the program)
fun name=(name: String)

nitc :: Variable :: name=

The name of the variable (as used in the program)
fun original_variable: nullable Variable

nitc :: Variable :: original_variable

The original Variable in case of renaming
protected fun original_variable=(original_variable: nullable Variable)

nitc :: Variable :: original_variable=

The original Variable in case of renaming
fun parameter: Bool

nitc :: Variable :: parameter

If true, this variable is a parameter of a method
protected fun parameter=(parameter: Bool)

nitc :: Variable :: parameter=

If true, this variable is a parameter of a method
fun position: Int

nitc :: Variable :: position

The position in the environment
fun position=(position: Int)

nitc :: Variable :: position=

The position in the environment
fun read_blocks: Array[BasicBlock]

nitc :: Variable :: read_blocks

Part of the program where this variable is read
protected fun read_blocks=(read_blocks: Array[BasicBlock])

nitc :: Variable :: read_blocks=

Part of the program where this variable is read
fun stack: Array[Variable]

nitc :: Variable :: stack

The stack of this variable, used for SSA renaming
protected fun stack=(stack: Array[Variable])

nitc :: Variable :: stack=

The stack of this variable, used for SSA renaming
fun warn_unread: Bool

nitc :: Variable :: warn_unread

Is the local variable not read and need a warning?
fun warn_unread=(warn_unread: Bool)

nitc :: Variable :: warn_unread=

Is the local variable not read and need a warning?

Redefined properties

redef type SELF: Variable

nitc $ Variable :: SELF

Type of this instance, automatically specialized in every class
redef fun infobox(v: HtmlightVisitor): HInfoBox

nitc :: htmlight $ Variable :: infobox

An new infobox documenting the entity
redef fun to_s: String

nitc $ Variable :: to_s

Alias of name

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _assignment_blocks: Array[BasicBlock]

nitc :: Variable :: _assignment_blocks

The blocks in which this variable is assigned
private var _declared_type: nullable MType

nitc :: Variable :: _declared_type

The declared type of the variable
private var _dep_exprs: Array[AExpr]

nitc :: Variable :: _dep_exprs

The expressions of AST of this variable depends
private var _is_adapted: Bool

nitc :: Variable :: _is_adapted

Was the variable type-adapted?
private var _location: nullable Location

nitc :: Variable :: _location

The declaration of the variable, if any
private var _name: String

nitc :: Variable :: _name

The name of the variable (as used in the program)
private var _original_variable: nullable Variable

nitc :: Variable :: _original_variable

The original Variable in case of renaming
private var _parameter: Bool

nitc :: Variable :: _parameter

If true, this variable is a parameter of a method
private var _position: Int

nitc :: Variable :: _position

The position in the environment
private var _read_blocks: Array[BasicBlock]

nitc :: Variable :: _read_blocks

Part of the program where this variable is read
private var _stack: Array[Variable]

nitc :: Variable :: _stack

The stack of this variable, used for SSA renaming
private var _warn_unread: Bool

nitc :: Variable :: _warn_unread

Is the local variable not read and need a warning?
fun assignment_blocks: Array[BasicBlock]

nitc :: Variable :: assignment_blocks

The blocks in which this variable is assigned
protected fun assignment_blocks=(assignment_blocks: Array[BasicBlock])

nitc :: Variable :: assignment_blocks=

The blocks in which this variable is assigned
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun declared_type: nullable MType

nitc :: Variable :: declared_type

The declared type of the variable
fun declared_type=(declared_type: nullable MType)

nitc :: Variable :: declared_type=

The declared type of the variable
fun dep_exprs: Array[AExpr]

nitc :: Variable :: dep_exprs

The expressions of AST of this variable depends
protected fun dep_exprs=(dep_exprs: Array[AExpr])

nitc :: Variable :: dep_exprs=

The expressions of AST of this variable depends
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
abstract fun infobox(v: HtmlightVisitor): HInfoBox

nitc :: HInfoBoxable :: infobox

An new infobox documenting the entity
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
private fun is_adapted: Bool

nitc :: Variable :: is_adapted

Was the variable type-adapted?
private fun is_adapted=(is_adapted: Bool)

nitc :: Variable :: is_adapted=

Was the variable type-adapted?
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun location: nullable Location

nitc :: Variable :: location

The declaration of the variable, if any
fun location=(location: nullable Location)

nitc :: Variable :: location=

The declaration of the variable, if any
fun name: String

nitc :: Variable :: name

The name of the variable (as used in the program)
fun name=(name: String)

nitc :: Variable :: name=

The name of the variable (as used in the program)
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun original_variable: nullable Variable

nitc :: Variable :: original_variable

The original Variable in case of renaming
protected fun original_variable=(original_variable: nullable Variable)

nitc :: Variable :: original_variable=

The original Variable in case of renaming
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun parameter: Bool

nitc :: Variable :: parameter

If true, this variable is a parameter of a method
protected fun parameter=(parameter: Bool)

nitc :: Variable :: parameter=

If true, this variable is a parameter of a method
fun position: Int

nitc :: Variable :: position

The position in the environment
fun position=(position: Int)

nitc :: Variable :: position=

The position in the environment
fun read_blocks: Array[BasicBlock]

nitc :: Variable :: read_blocks

Part of the program where this variable is read
protected fun read_blocks=(read_blocks: Array[BasicBlock])

nitc :: Variable :: read_blocks=

Part of the program where this variable is read
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun stack: Array[Variable]

nitc :: Variable :: stack

The stack of this variable, used for SSA renaming
protected fun stack=(stack: Array[Variable])

nitc :: Variable :: stack=

The stack of this variable, used for SSA renaming
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun warn_unread: Bool

nitc :: Variable :: warn_unread

Is the local variable not read and need a warning?
fun warn_unread=(warn_unread: Bool)

nitc :: Variable :: warn_unread=

Is the local variable not read and need a warning?
package_diagram nitc::Variable Variable nitc::HInfoBoxable HInfoBoxable nitc::Variable->nitc::HInfoBoxable core::Object Object nitc::HInfoBoxable->core::Object ...core::Object ... ...core::Object->core::Object nitc::PhiFunction PhiFunction nitc::PhiFunction->nitc::Variable

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

interface HInfoBoxable

nitc :: HInfoBoxable

Model entity or whatever that can produce an infobox

Children

class PhiFunction

nitc :: PhiFunction

A PhiFunction is a kind of Variable used in SSA-construction,

Class definitions

nitc $ Variable
# A local variable (including parameters, automatic variables and self)
class Variable
	# The name of the variable (as used in the program)
	var name: String is writable

	# Alias of `name`
	redef fun to_s do return self.name

	# The declaration of the variable, if any
	var location: nullable Location = null is writable

	# Is the local variable not read and need a warning?
	var warn_unread = false is writable
end
src/semantize/scope.nit:34,1--47,3

nitc :: typing $ Variable
redef class Variable
	# The declared type of the variable
	var declared_type: nullable MType = null is writable

	# Was the variable type-adapted?
	# This is used to speedup type retrieval while it remains `false`
	private var is_adapted = false
end
src/semantize/typing.nit:827,1--834,3

nitc :: ssa $ Variable
redef class Variable
	# The expressions of AST of this variable depends
	var dep_exprs = new Array[AExpr]

	# The blocks in which this variable is assigned
	var assignment_blocks: Array[BasicBlock] = new Array[BasicBlock] is lazy

	# Part of the program where this variable is read
	var read_blocks: Array[BasicBlock] = new Array[BasicBlock] is lazy

	# The stack of this variable, used for SSA renaming
	var stack = new Array[Variable] is lazy

	# The original Variable in case of renaming
	var original_variable: nullable Variable = self

	# If true, this variable is a parameter of a method
	var parameter: Bool = false
end
src/ssa.nit:139,1--157,3

nitc :: variables_numbering $ Variable
redef class Variable
	# The position in the environment
	var position: Int is writable
end
src/vm/variables_numbering.nit:69,1--72,3

nitc :: htmlight $ Variable
redef class Variable
	super HInfoBoxable
	redef fun infobox(v)
	do
		var declared_type = self.declared_type
		if declared_type == null then
			var res = new HInfoBox(v, "{name}")
			res.new_field("local var").append("{name}")
			return res
		end
		var res = new HInfoBox(v, "{name}: {declared_type}")
		res.new_field("local var").append("{name}:").add(declared_type.linkto(v))
		return res
	end
end
src/htmlight.nit:705,1--719,3