do .. end
blocks.Used to factorize implementations across do blocks, whiles, fors and loops.
This factorization makes sense since all these contructs can be flow managed through contine and breack statements.
TODO move this up in the module hierarchy
nitc :: ADoBlockHelper :: accept_loop_forward_analysis
Factorize loop forward analysis.nitc :: ADoBlockHelper :: defaultinit
nitc :: ADoBlockHelper :: loop_block
The block contained by this loop.nitc :: ADoBlockHelper :: loop_fix_point
Lookup fix point for this loop.nitc $ ADoBlockHelper :: SELF
Type of this instance, automatically specialized in every classnitc :: ADoBlockHelper :: accept_loop_forward_analysis
Factorize loop forward analysis.core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: ADoBlockHelper :: 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.
nitc :: ADoBlockHelper :: loop_block
The block contained by this loop.nitc :: ADoBlockHelper :: loop_fix_point
Lookup fix point for this loop.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).
# Represent all kind of `do .. end` blocks.
#
# Used to factorize implementations across do blocks, whiles, fors and loops.
#
# This factorization makes sense since all these contructs can be flow managed
# through contine and breack statements.
#
# TODO move this up in the module hierarchy
interface ADoBlockHelper
# Lookup fix point for this loop.
fun loop_fix_point(v: StaticAnalysis, node: ANode) do
var inset = v.current_inset.clone
var last: nullable FlowSet = null
while v.current_outset != last do
v.enter_visit(node)
v.current_inset = v.merge(inset, v.current_outset)
v.current_outset = v.current_inset.clone
last = v.current_outset.clone
end
v.current_inset = inset
v.current_outset = v.merge(inset, v.current_outset)
end
# Factorize loop forward analysis.
fun accept_loop_forward_analysis(v: StaticAnalysis) do
var n_block = loop_block
if not n_block == null then loop_fix_point(v, n_block)
end
# The block contained by this loop.
fun loop_block: nullable ANode is abstract
end
src/saf/saf_base.nit:167,1--198,3