lmasm

lmasm exposes the Java ASM bytecode inspection library as an lmcode host for class discovery and dependency analysis across JARs and class folders.

Quick reference

lmscript install github:lmctl-ai/lmasm@v0.1.0
lmasm --version
lmasm --lmcode-schema --json
lmasm --lmcode-signatures
lmscript examples/dep-analysis.lms
ItemKindPurpose
--lmcode FILECLI flagExecute compiled lmcode bytecode (repeatable for builders).
--lmcode-schema [--json]CLI flagPrint the exact embedded lmasm_v1 schema JSON bytes (with or without --json).
--lmcode-signaturesCLI flagPrint canonical host and standard library signatures.
fn asm_classes(string) -> StrListHost functionReturn dotted class names in a JAR, class folder, or .class file.
fn asm_refs(string, string) -> StrListHost functionReturn dotted names of all classes referenced by a given class.
RestGet..RestOptions, CliCommand, CliOptionSAM interfacesStandard lmcode_std_v3 REST and stateless CLI handler interfaces.
program = _lmcode_ cli="lmasm" install="github:lmctl-ai/lmasm@v0.1.0";
for (cn in asm_classes("fixtures/jars/liba.jar")) {
  let refs = asm_refs("fixtures/jars/liba.jar", cn);
  print(cn + " -> " + str(refs.len()) + " refs");
}
end _lmcode_
r = run_lmcode(program);
assert(r.ok);

Documentation pages

Source repository and releases