code wiki / (root) / nx_compile_wat_scalararm.nx

nx_compile_wat_scalararm.nx

buildroot/runtime/nx_compile_wat_scalararm.nx

3819 B106 linesdepth 9pulls 28 transitivereach 0 importersview sourcekind tooltopic compile
docsdependenciesstructsconstsfunctions

about

nx_compile_wat.nx -- SOVEREIGN source-file driver for the NishiLang WAT (WebAssembly) backend. The NishiLang counterpart of nxc2.exe's --target wat path: reads a .nx (import-expanded), runs lex_source -> parse_module -> opt_run -> wat_emit_module (nx_wasm.nx, now f32-capable), writes WAT to stdout. This WIRES the sovereign wat emitter into a usable driver so the wat path is no longer C-only. The wat is then fed to nx_wat_compiler (.wat -> .wasm, sovereign) for the browser. usage: nx_compile_wat <src.nx> > out.wat license_tier: ORIGINAL

dependencies 12 imports · 0 importers

nx_syscalls.nx nx_types.nx nx_lex_kinds.nx nx_outbuf.nx nx_ir.nx nx_tokenizer.nx nx_parse.nx nx_opt.nx nx_ir_dump.nx nx_ir_validate.nx nx_compile_wat_scalararm.nx

diagram shows first 10 each side; +2 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_types.nxnx_lex_kinds.nxnx_outbuf.nxnx_ir.nxnx_tokenizer.nxnx_parse.nxnx_opt.nxnx_ir_dump.nxnx_ir_validate.nxnx_import.nxnx_wasm_scalararm.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ expand_ctx_new sys_mmap ↻ expand_imports expand_imports_inner watd_log sys_write ↻ lex_source sys_mmap ↻ lexm_expand lexm_prescan lexm_isid is_alnum is_alpha is_digit lexm_body_end lexm_define lexm_init sys_mmap ↻ lexm_warn_body_too_long lexm_diag_cell lexm_emit_str lexm_emit_dec sys_write ↻ lexm_name_at

structs

none

consts

20const WAT_SRC_CAP: i64 = 2097152
21const WAT_OUT_CAP: i64 = 16777216
22const WAT_EXPAND_CAP: i64 = 4194304

functions

24func watd_log(msg: *u8, n: i64) -> i64 { return sys_write(2, msg, n) }
called by 1: main calls 1: sys_write
25func watd_read_stdin(buf: *u8, cap: i64) -> i64
calls 1: sys_read
47func main(argc: i64, argv: *i64) -> i64