diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 20:52:35 +0000 |
| commit | 46439007cf417cbd9ac8049bb4122c890097a0fa (patch) | |
| tree | 6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/format.m | |
| parent | 37da2899f40661e3e9631e497da8dc59b971cbd0 (diff) | |
20060303-partial
Diffstat (limited to 'module/format.m')
| -rw-r--r-- | module/format.m | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/module/format.m b/module/format.m new file mode 100644 index 00000000..1f3bfab6 --- /dev/null +++ b/module/format.m @@ -0,0 +1,30 @@ +Format: module { + PATH: con "/dis/lib/format.dis"; + Fmtspec: adt { + name: string; + fields: cyclic array of Fmtspec; + }; + Fmt: adt { + kind: int; + fields: cyclic array of Fmt; + }; + Fmtval: adt { + val: ref Sexprs->Sexp; + recs: cyclic array of array of Fmtval; + + text: fn(v: self Fmtval): string; + }; + Fmtfile: adt { + spec: array of Fmtspec; + descr: array of byte; + + new: fn(spec: array of Fmtspec): Fmtfile; + open: fn(f: self Fmtfile, name: string): ref Bufio->Iobuf; + read: fn(f: self Fmtfile, iob: ref Bufio->Iobuf): (array of Fmtval, string); + }; + init: fn(); + spec2se: fn(spec: array of Fmtspec): list of ref Sexprs->Sexp; + spec2fmt: fn(spec: array of Fmtspec): array of Fmt; + se2fmt: fn(spec: array of Fmtspec, se: ref Sexprs->Sexp): (array of Fmt, string); + rec2val: fn(spec: array of Fmtspec, rec: ref Sexprs->Sexp): (array of Fmtval, string); +}; |
