Home /Modules/compiler/API.md

API.md

compiler/API.md · 16 line(s) · markdown

Native Compiler API

Public header: include/sleela/compiler.hpp.

CLI native-output modes are sleelac --emit-c OUTPUT.c SOURCE.sleela and sleelac --emit-cpp OUTPUT.cpp SOURCE.sleela. Both output forms contain a small checked interpreter and the validated subset's bytecode. The C++ output is intentionally C-compatible, allowing one code generator to keep execution behavior consistent across both targets.

Opcodes: PUSH_INT, LOAD_LOCAL, STORE_LOCAL, ADD, SUB, MUL, DIV, NEG, PRINT, RETURN, HALT. The API and file format are experimental; compatibility is not promised. This prototype does not implement the complete SLeeLa grammar and is not a substitute for /impl.