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
| Item | Kind | Purpose |
|---|---|---|
| --lmcode FILE | CLI flag | Execute compiled lmcode bytecode (repeatable for builders). |
| --lmcode-schema [--json] | CLI flag | Print the exact embedded lmasm_v1 schema JSON bytes (with or without --json). |
| --lmcode-signatures | CLI flag | Print canonical host and standard library signatures. |
| fn asm_classes(string) -> StrList | Host function | Return dotted class names in a JAR, class folder, or .class file. |
| fn asm_refs(string, string) -> StrList | Host function | Return dotted names of all classes referenced by a given class. |
| RestGet..RestOptions, CliCommand, CliOption | SAM interfaces | Standard 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);