X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbin%2Fxhtbl%2Ftable.ml;fp=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbin%2Fxhtbl%2Ftable.ml;h=d3ee13bfa14e11d87a9eaf593ba17963290ce025;hb=d2545ffd201b1aa49887313791386add78fa8603;hp=0000000000000000000000000000000000000000;hpb=57ae1762497a5f3ea75740e2908e04adb8642cc2;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/bin/xhtbl/table.ml b/matita/matita/contribs/lambdadelta/bin/xhtbl/table.ml new file mode 100644 index 000000000..d3ee13bfa --- /dev/null +++ b/matita/matita/contribs/lambdadelta/bin/xhtbl/table.ml @@ -0,0 +1,70 @@ +type css = string list + +type uri = string + +type ext = string + +type anchor = string + +type absolute = bool + +type size = { + y : int; (* first row *) + x : int; (* first column *) + rf: int; (* finite rows *) + cf: int; (* finite columns *) + ri: int; (* infinite rows *) + ci: int; (* infinite columns *) + p : bool option; (* parent kind *) +} + +type border = { + n: bool; (* north *) + s: bool; (* south *) + e: bool; (* east *) + w: bool; (* west *) +} + +type text = Plain of string + | Link of absolute * string * string + +type key = Text of text list + | Glue of int option + +type table = { + tn: anchor; (* named anchor *) + mutable tc: css; (* css classes *) + mutable tu: uri; (* uri *) + mutable tx: ext; (* uri extension *) + mutable ts: size; (* dimension *) + tb: border; (* border *) + te: entry; (* contents *) + ti: int; (* table identifier *) +} + +and entry = Key of key + | Line of bool * table list (* true for a row *) + +let id = + let current = ref 0 in + fun () -> incr current; !current + +let no_size = { + y = 0; x = 0; rf = 0; cf = 0; ri = 0; ci = 0; p = None; +} + +let border b = { + n = b; s = b; e = b; w = b; +} + +let mk_key k tc tu tx tn = { + ts = no_size; tb = border false; te = Key k; + tc = tc; tu = tu; tx = tx; tn = tn; + ti = id (); +} + +let mk_line b tl tc tu tx tn = { + ts = no_size; tb = border b; te = Line (b, tl); + tc = tc; tu = tu; tx = tx; tn = tn; + ti = id (); +}