org.objectweb.asm.tree.analysis (ASM 5.0.4 Documentation)
Date: 2015-09-18

# Package org.objectweb.asm.tree.analysis

Provides a framework for static code analysis based on the asm.tree package.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  Value | An immutable symbolic value for semantic interpretation of bytecode.

- Class Summary
  Class | Description
  --- | ---
  Analyzer<V extends Value> | A semantic bytecode analyzer.
  BasicInterpreter | An `Interpreter` for `BasicValue` values.
  BasicValue | A `Value` that is represented by its type in a seven types type system.
  BasicVerifier | An extended `BasicInterpreter` that checks that bytecode instructions are correctly used.
  Frame<V extends Value> | A symbolic execution stack frame.
  Interpreter<V extends Value> | A semantic bytecode interpreter.
  SimpleVerifier | An extended `BasicVerifier` that performs more precise verifications.
  SourceInterpreter | An `Interpreter` for `SourceValue` values.
  SourceValue | A `Value` that is represented by its type in a two types type system.

- Exception Summary
  Exception | Description
  --- | ---
  AnalyzerException | Thrown if a problem occurs during the analysis of a method.

## Package org.objectweb.asm.tree.analysis Description

Provides a framework for static code analysis based on the asm.tree package.

Basic usage:

    ClassReader cr = new ClassReader(bytecode);
    ClassNode cn = new ClassNode();
    cr.accept(cn, ClassReader.SKIP_DEBUG);

    List methods = cn.methods;
    for (int i = 0; i < methods.size(); ++i) {
        MethodNode method = (MethodNode) methods.get(i);
        if (method.instructions.size() > 0) {
            Analyzer a = new Analyzer(new BasicInterpreter());
            a.analyze(cn.name, method);
            Frame[] frames = a.getFrames();
            // Elements of the frames arrray now contains info for each instruction
            // from the analyzed method. BasicInterpreter creates BasicValue, that
            // is using simplified type system that distinguishes the UNINITIALZED,
            // INT, FLOAT, LONG, DOUBLE, REFERENCE and RETURNADDRESS types.
            ...
        }
    }

Since:
  ASM 1.4.3