code wiki / (root) / nx_main.nx

nx_main.nx

buildroot/runtime/nx_main.nx

3403 B90 linesdepth 9pulls 26 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

main.nx -- NishiLang-side compiler driver. Pipeline: source text -> lex -> parse -> opt -> regalloc -> riscv -> write-to-stdout. Stands in for main.c. Real source-file reading (openat + read + grow buffer) is a follow-up; this turn drives the pipeline from an in-memory source string so the whole stack of nx-side modules links cleanly through a single entry point. Once file I/O is in syscalls.nx and string concatenation lands, this driver becomes the authoritative NishiLang compiler -- the C nxc2 retires behind it.

dependencies 9 imports · 0 importers

nx_syscalls.nx nx_types.nx nx_lex_kinds.nx nx_ir.nx nx_tokenizer.nx nx_parse.nx nx_opt.nx nx_regalloc.nx nx_riscv.nx nx_main.nx

imports: nx_syscalls.nxnx_types.nxnx_lex_kinds.nxnx_ir.nxnx_tokenizer.nxnx_parse.nxnx_opt.nxnx_regalloc.nxnx_riscv.nx

imported by: nobody (leaf or entry point)

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

main compile lex_source 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 ↻ lexm_expand lexm_prescan lexm_isid is_alnum lexm_body_end lexm_define lexm_init lexm_warn_body_too_long lexm_name_at lexm_body_at sys_mmap ↻ lexm_isid ↻ lexm_body_end ↻ lexm_for_expand lexm_isid ↻ lexm_body_end ↻ lexm_for_emit lexm_isid ↻ sys_mmap ↻ lexm_for_bound lexm_lookup lexm_body_int

structs

none

consts

none

functions

33func compile(src: *u8) -> i64
81func main() -> i64
calls 1: compile