lmasm reference
Command-line flags, schema functions, standard REST and CLI interfaces, and exit codes for lmasm.
CLI flags
| Flag | Description |
|---|---|
| --version | Print the lmasm build version and exit 0. |
| --lmcode-schema [--json] | Print the exact embedded JSON bytes of schema/lmasm.schema.json. |
| --lmcode-signatures | Print sorted canonical signatures for domain functions and the standard catalog. |
| --lmcode FILE | Execute a compiled DSLB v6 bytecode file (repeatable for multi-part builder invocations). |
Domain host functions (lmasm_v1)
| Signature | Return type | Description |
|---|---|---|
| fn asm_classes(container_path: string) | StrList | List 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) | StrList | List 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) | void | Write a line of diagnostic or report text during bytecode execution. |
| fn assert_close(actual: float, expected: float, tol: float) | void | Fail execution if actual and expected differ by more than tol. |
Standard REST and CLI interfaces (lmcode_std_v3)
| Interface or function | Signature | Role |
|---|---|---|
| RestGet, RestPost, RestPut, RestDelete, RestPatch, RestHead, RestOptions, RestHandler | (exchange: RestExchange) -> void | SAM interfaces for @"/path/:param" or @"/{param}" HTTP route handlers. |
| CliCommand, CliOption | (exchange: RestExchange) -> void | SAM interfaces for @"command" subcommands and @"--flag" options dispatched by rest_cli. |
| fn rest_config(key: string, value: string) | void | Set a router configuration key such as prefix, base_path, or max_body_bytes. |
| fn rest_route(method: string, path: string, entry: string) | void | Register an explicit HTTP method and route template to an entry function. |
| fn rest_serve() | void | Serve registered REST endpoints over HTTP/1.1. |
| fn rest_stop() | void | Stop the active REST server loop. |
| fn rest_cli(argv: StrList) | string | Dispatch CLI options, commands, or route paths in-memory and return the response payload. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Execution or introspection succeeded. |
| 2 | Invalid CLI flags or malformed LMCODE_INVOCATION_FILE manifest. |
| 3 | Bytecode load failure, schema hash mismatch, or runtime error reading class containers. |
| 4 | Application failure or failed assertion. |