nitc :: StaticAnalysis :: defaultinit
# 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