nitc :: nitmetrics
nitc :: actors_generation_phase
Generate a support module for each module that contain a class annotated withis actor
nitc :: actors_injection_phase
Injects model for the classes annotated with "is actor" sonitc :: astbuilder
Instantiation and transformation of semantic nodes in the AST of expressions and statementsnitc :: detect_variance_constraints
Collect metrics about detected variances constraints on formal types.nitc :: i18n_phase
Basic support of internationalization through the generation of id-to-string tablesSerializable::inspect
to show more useful information
markdown2 :: markdown_html_rendering
HTML rendering of Markdown documentsnitc :: modelbuilder
more_collections :: more_collections
Highly specific, but useful, collections-related classes.threaded
annotation
nitc :: serialization_code_gen_phase
Phase generating methods (code) to serialize Nit objectsserialization :: serialization_core
Abstract services to serialize Nit objects to different formatsnitc :: serialization_model_phase
Phase generating methods (model-only) to serialize Nit objectsnitc :: toolcontext
Common command-line tool infrastructure than handle options and error messagescore :: union_find
union–find algorithm using an efficient disjoint-set data structure
# A program that collects various metrics on nit programs and libraries
module nitmetrics
import frontend::code_gen
import metrics
# Create a tool context to handle options and paths
var toolcontext = new ToolContext
toolcontext.tooldescription = "Usage: nitmetrics [OPTION]... <file.nit>...\nComputes various metrics on Nit programs."
# We do not add other options, so process them now!
toolcontext.process_options(args)
# Get arguments
var arguments = toolcontext.option_context.rest
# We need a model to collect stuff
var model = new Model
# And a model builder to parse files
var modelbuilder = new ModelBuilder(model, toolcontext)
# Here we load an process all modules passed on the command line
var mmodules = modelbuilder.parse_full(arguments)
modelbuilder.run_phases
print "*** METRICS ***"
toolcontext.run_global_phases(mmodules)
src/nitmetrics.nit:17,1--44,39