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

Introduced properties

abstract fun loop_block: nullable ANode

nitc :: ADoBlockHelper :: loop_block

The block contained by this loop.
fun loop_fix_point(v: StaticAnalysis, node: ANode)

nitc :: ADoBlockHelper :: loop_fix_point

Lookup fix point for this loop.

Redefined properties

redef type SELF: ADoBlockHelper

nitc $ ADoBlockHelper :: SELF

Type of this instance, automatically specialized in every class

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
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 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.
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".
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.
abstract fun loop_block: nullable ANode

nitc :: ADoBlockHelper :: loop_block

The block contained by this loop.
fun loop_fix_point(v: StaticAnalysis, node: ANode)

nitc :: ADoBlockHelper :: loop_fix_point

Lookup fix point for this loop.
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 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 serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
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.
package_diagram nitc::ADoBlockHelper ADoBlockHelper core::Object Object nitc::ADoBlockHelper->core::Object nitc::ADoExpr ADoExpr nitc::ADoExpr->nitc::ADoBlockHelper nitc::ALoopExpr ALoopExpr nitc::ALoopExpr->nitc::ADoBlockHelper nitc::AWhileExpr AWhileExpr nitc::AWhileExpr->nitc::ADoBlockHelper nitc::AForExpr AForExpr nitc::AForExpr->nitc::ADoBlockHelper

Parents

interface Object

core :: Object

The root of the class hierarchy.

Children

class ADoExpr

nitc :: ADoExpr

A do statement
class AForExpr

nitc :: AForExpr

A for statement
class ALoopExpr

nitc :: ALoopExpr

A loop statement
class AWhileExpr

nitc :: AWhileExpr

A while statement

Class definitions

nitc $ ADoBlockHelper
# 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