Associates a variable to the location of its definition.
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: VarDef :: defaultinit
core :: Comparable :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).
# A Variable definition.
#
# Associates a variable to the location of its definition.
class VarDef
super Comparable
redef type OTHER: VarDef
# Variable this definition is about.
var variable: Variable
# Location of this definition in the source code.
var location: Location
redef fun ==(o) do
return o isa OTHER and variable == o.variable and location == o.location
end
redef fun <=>(o) do
if variable.name == o.variable.name then
return location.line_start <=> o.location.line_start
else
return variable.name <=> o.variable.name
end
end
redef fun hash do return variable.hash + location.hash
redef fun to_s do return "\{{variable}: {location.line_start}\}"
end
src/saf/reaching_defs.nit:117,1--145,3