216b878dbfc5f9bdc4e0545806465577f1ef00cf
[nit.git] / contrib / pep8analysis / README.md
1 # Pep/8 Analysis
2
3 This project provides tools to statically analyze Pep/8 programs in order to detect bugs or bad programming practices.
4
5 For more information about the Pep/8 assembly language visit http://code.google.com/p/pep8-1/.
6
7 # Installation
8
9 Make sure you have a Nit compiler installed (http://nitlanguage.org) and the environment variable NIT\_DIR correctly set to the Nit installation directory.
10
11 Clone the source from http://github.com/xymus/pep8analysis.git and compile with `make`.
12
13 # Usage
14
15 For basic results, execute on the Pep/8 program prog.pep with `bin/pep8analyzer prog.pep`.
16
17 Call `bin/pep8analyer --help` for a description of the available (and up to date) options.
18
19 The tools provides its results in two ways, the final report and an annotated CFG (usually created in the out directory).
20
21 # Analyses
22
23 ## Dead code and possible execution of data
24
25 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.
26
27 ## Range analysis
28
29 The range analysis reports the value of registers and memory on the annotated CFG.
30
31 ## Reaching definitions
32
33 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.
34
35 ## Types analysis
36
37 The types analysis detects wrongful use of types or of uninitialized data. It reports possible errors in the final report.