lmasm reference

Command-line flags, schema functions, standard REST and CLI interfaces, and exit codes for lmasm.

CLI flags

FlagDescription
--versionPrint the lmasm build version and exit 0.
--lmcode-schema [--json]Print the exact embedded JSON bytes of schema/lmasm.schema.json.
--lmcode-signaturesPrint sorted canonical signatures for domain functions and the standard catalog.
--lmcode FILEExecute a compiled DSLB v6 bytecode file (repeatable for multi-part builder invocations).

Domain host functions (lmasm_v1)

SignatureReturn typeDescription
fn asm_classes(container_path: string)StrListList dotted class names found in a .jar archive, classes directory, or .class file (skips module-info and package-info).
fn asm_refs(container_path: string, class_name: string)StrListList dotted class names referenced by class_name in container_path via constant-pool CONSTANT_Class entries and an ASM ClassNode tree walk.
fn print(message: string)voidWrite a line of diagnostic or report text during bytecode execution.
fn assert_close(actual: float, expected: float, tol: float)voidFail execution if actual and expected differ by more than tol.

Standard REST and CLI interfaces (lmcode_std_v3)

Interface or functionSignatureRole
RestGet, RestPost, RestPut, RestDelete, RestPatch, RestHead, RestOptions, RestHandler(exchange: RestExchange) -> voidSAM interfaces for @"/path/:param" or @"/{param}" HTTP route handlers.
CliCommand, CliOption(exchange: RestExchange) -> voidSAM interfaces for @"command" subcommands and @"--flag" options dispatched by rest_cli.
fn rest_config(key: string, value: string)voidSet a router configuration key such as prefix, base_path, or max_body_bytes.
fn rest_route(method: string, path: string, entry: string)voidRegister an explicit HTTP method and route template to an entry function.
fn rest_serve()voidServe registered REST endpoints over HTTP/1.1.
fn rest_stop()voidStop the active REST server loop.
fn rest_cli(argv: StrList)stringDispatch CLI options, commands, or route paths in-memory and return the response payload.

Exit codes

CodeMeaning
0Execution or introspection succeeded.
2Invalid CLI flags or malformed LMCODE_INVOCATION_FILE manifest.
3Bytecode load failure, schema hash mismatch, or runtime error reading class containers.
4Application failure or failed assertion.