# # initially generated by c2l # newarc(n: ref Node, r: ref Rule, stem: array of byte, match: array of Resub): ref Arc { a: ref Arc; a = ref Arc; a.n = n; a.r = r; a.stem = libc0->strdup(stem); a.match = array[NREGEXP] of array of byte; rcopy(a.match, match, NREGEXP); a.next = nil; a.flag = 0; a.prog = r.prog; return a; } dumpa(s: array of byte, a: ref Arc) { buf := array[1024] of byte; bout.puts(sys->sprint("%sArc@%x: n=%x r=%x flag=0x%x stem='%s'", libc0->ab2s(s), a, a.n, a.r, a.flag, libc0->ab2s(a.stem))); if(a.prog != nil) bout.puts(sys->sprint(" prog='%s'", libc0->ab2s(a.prog))); bout.puts("\n"); if(a.n != nil){ if(s[0] == byte ' ') stob(buf, sys->sprint("%s ", libc0->ab2s(s))); else stob(buf, sys->sprint("%s ", "")); dumpn(buf, a.n); } } nrep() { sym: ref Symtab; w: ref Word; sym = symlooki(libc0->s2ab("NREP"), S_VAR, 0); if(sym != nil){ w = sym.wvalue; if(w != nil && w.s != nil && int w.s[0]) nreps = int string w.s; } if(nreps < 1) nreps = 1; if(debug&D_GRAPH) bout.puts(sys->sprint("nreps = %d\n", nreps)); }