nitc :: AstMetricsPhase :: _id_counter
nitc :: AstMetricsPhase :: _node_counter
nitc :: AstMetricsPhase :: defaultinit
nitc :: AstMetricsPhase :: id_counter
nitc :: AstMetricsPhase :: id_counter=
nitc :: AstMetricsPhase :: node_counter
nitc :: AstMetricsPhase :: node_counter=
nitc $ AstMetricsPhase :: SELF
Type of this instance, automatically specialized in every classnitc $ AstMetricsPhase :: process_mainmodule
Specific action to execute on the whole program.nitc :: AstMetricsPhase :: _id_counter
nitc :: Phase :: _in_hierarchy
The dependence relation of the phase with the other phasesnitc :: AstMetricsPhase :: _node_counter
nitc :: Phase :: _toolcontext
The toolcontext instance attached to the phasecore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: Phase :: defaultinit
nitc :: AstMetricsPhase :: defaultinit
core :: Object :: defaultinit
nitc :: AstMetricsPhase :: id_counter
nitc :: AstMetricsPhase :: id_counter=
nitc :: Phase :: in_hierarchy
The dependence relation of the phase with the other phasesnitc :: Phase :: in_hierarchy=
The dependence relation of the phase with the other phasescore :: 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.nitc :: AstMetricsPhase :: node_counter
nitc :: AstMetricsPhase :: node_counter=
core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: Phase :: process_annotated_node
Specific actions to execute on annotated nodesnitc :: Phase :: process_mainmodule
Specific action to execute on the whole program.nitc :: Phase :: process_nclassdef
Specific actions to execute on the tree of a class definitionnitc :: Phase :: process_nmodule
Specific actions to execute on the whole tree of a modulenitc :: Phase :: process_nmodule_after
Specific actions to execute on the whole tree of a modulenitc :: Phase :: process_npropdef
Specific actions to execute on the tree of a propertynitc :: Phase :: toolcontext
The toolcontext instance attached to the phasenitc :: Phase :: toolcontext=
The toolcontext instance attached to the phase
private class AstMetricsPhase
super Phase
var node_counter = new Counter[String]
var id_counter = new Counter[String]
redef fun process_mainmodule(mainmodule, given_mmodules)
do
if not toolcontext.opt_ast.value and not toolcontext.opt_all.value then return
print "--- AST Metrics ---"
# Visit all the source code to collect data
var visitor = new AstMetricsVisitor(self)
for nmodule in toolcontext.modelbuilder.nmodules do
visitor.enter_visit(nmodule)
end
print "## All nodes of the AST"
node_counter.print_summary
node_counter.print_elements(10)
print "## All identifiers of the AST"
id_counter.print_summary
id_counter.print_elements(10)
end
end
src/metrics/ast_metrics.nit:25,1--46,3