The base of all analysis performed statically.

Introduced properties

type FLOW: FlowSet

nitc :: StaticAnalysis :: FLOW

Type of FlowSet representation used by the StaticAnalysis.
private var _current_inset: FLOW

nitc :: StaticAnalysis :: _current_inset

"in" set for the currently visited node.
private var _current_outset: FLOW

nitc :: StaticAnalysis :: _current_outset

'out' set for the currently visited node.
private var _insets: HashMap[ANode, FLOW]

nitc :: StaticAnalysis :: _insets

Sets at the entry of each node.
private var _modelbuilder: ModelBuilder

nitc :: StaticAnalysis :: _modelbuilder

ModelBuilder used to lookup AST nodes.
private var _outsets: HashMap[ANode, FLOW]

nitc :: StaticAnalysis :: _outsets

Sets at the exit of each node.
fun current_inset: FLOW

nitc :: StaticAnalysis :: current_inset

"in" set for the currently visited node.
fun current_inset=(current_inset: FLOW)

nitc :: StaticAnalysis :: current_inset=

"in" set for the currently visited node.
fun current_outset: FLOW

nitc :: StaticAnalysis :: current_outset

'out' set for the currently visited node.
fun current_outset=(current_outset: FLOW)

nitc :: StaticAnalysis :: current_outset=

'out' set for the currently visited node.
fun insets: HashMap[ANode, FLOW]

nitc :: StaticAnalysis :: insets

Sets at the entry of each node.
protected fun insets=(insets: HashMap[ANode, FLOW])

nitc :: StaticAnalysis :: insets=

Sets at the entry of each node.
abstract fun merge(s1: FLOW, s2: FLOW): FLOW

nitc :: StaticAnalysis :: merge

The merge operation on sets for confluence.
fun modelbuilder: ModelBuilder

nitc :: StaticAnalysis :: modelbuilder

ModelBuilder used to lookup AST nodes.
protected fun modelbuilder=(modelbuilder: ModelBuilder)

nitc :: StaticAnalysis :: modelbuilder=

ModelBuilder used to lookup AST nodes.
abstract fun new_initial_flow: FLOW

nitc :: StaticAnalysis :: new_initial_flow

Initial flow set to use.
fun new_initial_method_flow(v: AMethPropdef): FLOW

nitc :: StaticAnalysis :: new_initial_method_flow

Initial flow set to use within methods.
fun outsets: HashMap[ANode, FLOW]

nitc :: StaticAnalysis :: outsets

Sets at the exit of each node.
protected fun outsets=(outsets: HashMap[ANode, FLOW])

nitc :: StaticAnalysis :: outsets=

Sets at the exit of each node.
abstract fun pretty_print

nitc :: StaticAnalysis :: pretty_print

Pretty print the outsets of this analysis.
fun start_analysis(node: ANode)

nitc :: StaticAnalysis :: start_analysis

Run self on an AST node.

Redefined properties

redef type SELF: StaticAnalysis

nitc $ StaticAnalysis :: SELF

Type of this instance, automatically specialized in every class
redef init init

nitc $ StaticAnalysis :: init

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 FLOW: FlowSet

nitc :: StaticAnalysis :: FLOW

Type of FlowSet representation used by the StaticAnalysis.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _current_inset: FLOW

nitc :: StaticAnalysis :: _current_inset

"in" set for the currently visited node.
private var _current_node: nullable ANode

nitc :: Visitor :: _current_node

The current visited node
private var _current_outset: FLOW

nitc :: StaticAnalysis :: _current_outset

'out' set for the currently visited node.
private var _insets: HashMap[ANode, FLOW]

nitc :: StaticAnalysis :: _insets

Sets at the entry of each node.
private var _modelbuilder: ModelBuilder

nitc :: StaticAnalysis :: _modelbuilder

ModelBuilder used to lookup AST nodes.
private var _outsets: HashMap[ANode, FLOW]

nitc :: StaticAnalysis :: _outsets

Sets at the exit of each node.
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 current_inset: FLOW

nitc :: StaticAnalysis :: current_inset

"in" set for the currently visited node.
fun current_inset=(current_inset: FLOW)

nitc :: StaticAnalysis :: current_inset=

"in" set for the currently visited node.
fun current_node: nullable ANode

nitc :: Visitor :: current_node

The current visited node
fun current_node=(current_node: nullable ANode)

nitc :: Visitor :: current_node=

The current visited node
fun current_outset: FLOW

nitc :: StaticAnalysis :: current_outset

'out' set for the currently visited node.
fun current_outset=(current_outset: FLOW)

nitc :: StaticAnalysis :: current_outset=

'out' set for the currently visited node.
fun enter_visit(e: nullable ANode)

nitc :: Visitor :: enter_visit

Ask the visitor to visit a given node.
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 insets: HashMap[ANode, FLOW]

nitc :: StaticAnalysis :: insets

Sets at the entry of each node.
protected fun insets=(insets: HashMap[ANode, FLOW])

nitc :: StaticAnalysis :: insets=

Sets at the entry of each node.
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 merge(s1: FLOW, s2: FLOW): FLOW

nitc :: StaticAnalysis :: merge

The merge operation on sets for confluence.
fun modelbuilder: ModelBuilder

nitc :: StaticAnalysis :: modelbuilder

ModelBuilder used to lookup AST nodes.
protected fun modelbuilder=(modelbuilder: ModelBuilder)

nitc :: StaticAnalysis :: modelbuilder=

ModelBuilder used to lookup AST nodes.
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
abstract fun new_initial_flow: FLOW

nitc :: StaticAnalysis :: new_initial_flow

Initial flow set to use.
fun new_initial_method_flow(v: AMethPropdef): FLOW

nitc :: StaticAnalysis :: new_initial_method_flow

Initial flow set to use within methods.
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 outsets: HashMap[ANode, FLOW]

nitc :: StaticAnalysis :: outsets

Sets at the exit of each node.
protected fun outsets=(outsets: HashMap[ANode, FLOW])

nitc :: StaticAnalysis :: outsets=

Sets at the exit of each node.
abstract fun pretty_print

nitc :: StaticAnalysis :: pretty_print

Pretty print the outsets of this analysis.
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun start_analysis(node: ANode)

nitc :: StaticAnalysis :: start_analysis

Run self on an AST node.
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.
protected abstract fun visit(e: ANode)

nitc :: Visitor :: visit

What the visitor do when a node is visited
package_diagram nitc::StaticAnalysis StaticAnalysis nitc::Visitor Visitor nitc::StaticAnalysis->nitc::Visitor core::Object Object nitc::Visitor->core::Object ...core::Object ... ...core::Object->core::Object nitc::ForwardAnalysis ForwardAnalysis nitc::ForwardAnalysis->nitc::StaticAnalysis nitc::ReachingDefsAnalysis ReachingDefsAnalysis nitc::ReachingDefsAnalysis->nitc::ForwardAnalysis nitc::ReachingDefsAnalysis... ... nitc::ReachingDefsAnalysis...->nitc::ReachingDefsAnalysis

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

abstract class Visitor

nitc :: Visitor

Abstract standard visitor on the AST

Children

class ForwardAnalysis

nitc :: ForwardAnalysis

An analysis go forward from the entry point to the exit point.

Descendants

class ReachingDefsAnalysis

nitc :: ReachingDefsAnalysis

Determines wich variables definitions reach each statement.

Class definitions

nitc $ StaticAnalysis
# The base of all analysis performed statically.
abstract class StaticAnalysis
	super Visitor

	# Type of FlowSet representation used by the StaticAnalysis.
	type FLOW: FlowSet

	# "in" set for the currently visited node.
	var current_inset: FLOW is noinit, writable

	# 'out' set for the currently visited node.
	var current_outset: FLOW is noinit, writable

	# Sets at the entry of each node.
	#
	# Each node is associated with the `current_inset` it got.
	var insets = new HashMap[ANode, FLOW]

	# Sets at the exit of each node.
	#
	# Each node is associated with the `current_outset` it got.
	var outsets = new HashMap[ANode, FLOW]

	init do
		current_inset = new_initial_flow
		current_outset = new_initial_flow
	end

	# Initial flow set to use.
	#
	# Because the initial flow set depends on the analysis performed, the
	# implementation of this method is the responsability the subclass.
	fun new_initial_flow: FLOW is abstract

	# Initial flow set to use within methods.
	#
	# Returns `new_initial_flow` by default.
	# Redefine this method to inject things in the inset like parameters from
	# the signature.
	fun new_initial_method_flow(v: AMethPropdef): FLOW do return new_initial_flow

	# The merge operation on sets for confluence.
	#
	# Depends on the analysis performed.
	fun merge(s1, s2: FLOW): FLOW is abstract

	# ModelBuilder used to lookup AST nodes.
	var modelbuilder: ModelBuilder

	# Run `self` on an AST `node`.
	fun start_analysis(node: ANode) do visit(node)

	# Pretty print the outsets of this analysis.
	#
	# Mainly used for debug and testing.
	fun pretty_print is abstract
end
src/saf/saf_base.nit:25,1--81,3