Home /Modules/impl/README.md

README.md

impl/xclass/README.md · 90 line(s) · markdown

<img align="right" src="https://github.com/mearvk/SLeeLa/blob/master/images/debian/debian-logo.png" width="75" height="75" alt="SLeeLa">

<img src="https://github.com/mearvk/SLeeLa/blob/master/images/sleela/sleela-logo-004.jpg" alt="SLeeLa">

Sleela ← SecureJDK 28 .xclass input

Sleela can take SecureJDK 28 .xclass files (XML class files, the SecureJDK primary class format — see userland/openjdk/jvm-config.xml) as input. The loader parses the .xclass structure emitted by the xmc compiler and reconstructs an equivalent, runnable Sleela program, closing the loop:

Sleela source --(xmc / SecureJDK 28)--> .xclass --(this loader)--> Sleela

The normative mapping is in XCLASS.model (XCI-0001).

Use

cd impl && make

# Ingest a .xclass and run the reconstructed program:
./build/sleela run xclass/samples/Person.xclass

# Ingest several into one program:
./build/sleela run xclass/samples/Greeter.xclass xclass/samples/Person.xclass

# Print the reconstructed Sleela source (does not run) — the human-readable view:
./build/sleela xclass --emit xclass/samples/Person.xclass

# Print identity / security / provenance:
./build/sleela xclass --info xclass/samples/Person.xclass

sleela run <file.xclass> auto-detects the extension; sleela <file.xclass> works too.

What is (and isn't) reconstructed

An .xclass carries a class's structure, not executable bytecode: each method records its name, return type, parameter count, and modifiers plus lines/complexity counts — there is no instruction stream. So the loader:

The reconstruction is faithful at the level the format actually carries — the type structure and metadata — and it round-trips: --emit output re-parses and runs as ordinary Sleela.

Samples

Original reference files emitted by xmc 1.0.0: samples/Greeter.xclass, samples/Person.xclass, samples/Role.xclass (from the Ubuntu.Determinant tools/xmc/ tree).

New-lineup reference files emitted by xmc 1.1.0, mirroring the current SLeeLa Advantage™ connect medium (lib/advantage/connect/):

# Load the new-lineup images:
./build/sleela xclass --info impl/xclass/samples/SLTechInstallerII.xclass
./build/sleela run impl/xclass/samples/SLTechInstallerII.xclass impl/xclass/samples/SLMoneyConnector.xclass

xmc itself (the SecureJDK 28 compiler that emits .xclass) lives in the Ubuntu.Determinant tools/xmc/ tree; these in-repo samples are its reference output, kept in step with the SLeeLa classes they image. The loader is format-versioned (version="1"), so xmc 1.1.0 output loads under the same v1 loader as xmc 1.0.0.