All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.tascalate.asmx.tree.analysis.package.html Maven / Gradle / Ivy

Go to download

Tascalate ASMX / Analysis, static code analysis API of ObjectWeb ASM (shaded), a very small and fast Java bytecode manipulation framework

There is a newer version: 9.7.0
Show newest version




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

Basic usage:

ClassReader classReader = new ClassReader(bytecode);
ClassNode classNode = new ClassNode();
classReader.accept(classNode, ClassReader.SKIP_DEBUG);

for (MethodNode method : classNode.methods) {
  if (method.instructions.size() > 0) {
    Analyzer analyzer = new Analyzer(new BasicInterpreter());
    analyzer.analyze(classNode.name, method);
    Frame[] frames = analyzer.getFrames();
    // Elements of the frames array 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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy