pep8analysis -
Pep/8 Analysis, static checker to detect bugs and bad programming practices in Pep/8 programs
For more information about the Pep/8 assembly language visit http://code.google.com/p/pep8-1/.
Installation
Make sure you have a Nit compiler installed (http://nitlanguage.org) and the environment variable NIT_DIR correctly set to the Nit installation directory.
Clone the source from http://github.com/xymus/pep8analysis.git and compile with make
.
Usage
For basic results, execute on the Pep/8 program prog.pep with bin/pep8analyzer prog.pep
.
Call bin/pep8analyer --help
for a description of the available (and up to date) options.
The tools provides its results in two ways, the final report and an annotated CFG (usually created in the out directory).
Analyses
Dead code and possible execution of data
The tools analyses statically the program according to possbile branches and function calls to find wrongfully placed instructions and directives. It reports dead code blocks and possibly executed data blocks.
Range analysis
The range analysis reports the value of registers and memory on the annotated CFG.
Reaching definitions
The reaching definitions analysis tracks what lines may have assigned values to register and memory. Its results are on the anotated CFG. They can be used to better understand a program.
Types analysis
The types analysis detects wrongful use of types or of uninitialized data. It reports possible errors in the final report.
Content
- pep8analysis: Pep/8 Analysis, static checker to detect bugs and bad programming practices in Pep/8 programs (contrib/pep8analysis)
- src (contrib/pep8analysis/src)
- ast (contrib/pep8analysis/src/ast)
- ast (contrib/pep8analysis/src/ast/ast.nit)
- ast_base (contrib/pep8analysis/src/ast/ast_base.nit)
- pretty_instructions (contrib/pep8analysis/src/ast/pretty_instructions.nit)
- rich_instructions (contrib/pep8analysis/src/ast/rich_instructions.nit)
- suffixed_instructions (contrib/pep8analysis/src/ast/suffixed_instructions.nit)
- backbone (contrib/pep8analysis/src/backbone.nit)
- cfg (contrib/pep8analysis/src/cfg)
- cfg (contrib/pep8analysis/src/cfg/cfg.nit)
- cfg_base (contrib/pep8analysis/src/cfg/cfg_base.nit)
- dot_printer (contrib/pep8analysis/src/cfg/dot_printer.nit)
- sanity (contrib/pep8analysis/src/cfg/sanity.nit)
- flow_analysis (contrib/pep8analysis/src/flow_analysis)
- flow_analysis (contrib/pep8analysis/src/flow_analysis/flow_analysis.nit)
- framework (contrib/pep8analysis/src/flow_analysis/framework.nit)
- range_analysis (contrib/pep8analysis/src/flow_analysis/range_analysis.nit)
- reaching_defs (contrib/pep8analysis/src/flow_analysis/reaching_defs.nit)
- types (contrib/pep8analysis/src/flow_analysis/types.nit)
- location: This module is used to model Nit source-file and locations in source-file (contrib/pep8analysis/src/location.nit)
- model (contrib/pep8analysis/src/model)
- directives (contrib/pep8analysis/src/model/directives.nit)
- model (contrib/pep8analysis/src/model/model.nit)
- operands (contrib/pep8analysis/src/model/operands.nit)
- vars (contrib/pep8analysis/src/model/vars.nit)
- parser: This directory contains the nit parser. It is generated from a grammar for sablecc3 ( http://www.sablecc.org ). (contrib/pep8analysis/src/parser)
- lexer: Lexer and its tokens. (contrib/pep8analysis/src/parser/lexer.nit)
- parser: Parser. (contrib/pep8analysis/src/parser/parser.nit)
- parser_nodes: Raw AST node hierarchy. (contrib/pep8analysis/src/parser/parser_nodes.nit)
- parser_prod: Production AST nodes full definition. (contrib/pep8analysis/src/parser/parser_prod.nit)
- tables: Module that interfaces the parsing tables. (contrib/pep8analysis/src/parser/tables.nit)
- pep8analysis (contrib/pep8analysis/src/pep8analysis.nit)
- pep8analysis_web: Web version of the pep8analysis tool (contrib/pep8analysis/src/pep8analysis_web.nit)
- ast (contrib/pep8analysis/src/ast)
- tests (contrib/pep8analysis/tests)
- src (contrib/pep8analysis/src)