code wiki / _hdl_build / nx_emitter_transduce.nx
nx_emitter_transduce.nx
buildroot/runtime/_hdl_build/nx_emitter_transduce.nx
about
nx_emitter_transduce.nx -- X-AUT-006 v0 PROBE: validate that reference->emitter is
MECHANICAL (the operator Level-2 question: get the BUILDER to author its own emitters).
I hand-transcribed gd_gamma into pe6_author_gamma; this proves that transcription is a
mechanical string transform, not a creative act. v0 = line-faithful transducer:
read a reference .nx, emit a template that RE-EMITS it via pe_w (quote/backslash
escaped). When the emitted template runs, its output must BYTE-MATCH the reference
(round-trip = the mechanism is sound). v1 (next) lifts numeric literals to c[] refs.
in: reference source path + out template path + out marker for round-trip
the emitted template is itself a runnable .nx whose main() writes the reproduction.
Durable: TRANSDUCE row -> knowledge/status/transduce.log. Exit 0 = round-trip exact.
argv[1]=reference argv[2]=template-out argv[3]=reproduction-out. license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const K_MAGIC_2097152: i64 = 2097152 |
| 14 | const K_MAGIC_2097136: i64 = 2097136 |
| 15 | const K_MAGIC_4194304: i64 = 4194304 |
| 16 | const K_MAGIC_4194288: i64 = 4194288 |
functions
| 17 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 18 | func _fp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 19 | func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 20 | func tr_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 30 | func tr_esc(fd: i64, c: i64) -> i64 |
| 39 | func main(argc: i64, argv: *i64) -> i64 |