- let txt_refpath i r p = txt_inv i ^ txt_ref r ^ txt_path p ^ " " in
- let txt_assign (pl, pr) = txt_vvar (fst pl) ^ " <- " ^ txt_path pr in
- let rec txt_val = function
- | M.Const [s] -> txt_str s
- | M.Const l -> "{" ^ txt_list txt_str ", " l ^ "}"
- | M.VVar vv -> txt_vvar vv
- | M.Record (rv, p) -> txt_rvar rv ^ "." ^ txt_vvar (fst p)
- | M.Fun (s, x) -> "fun " ^ txt_str s ^ " " ^ txt_val x
- | M.Property (i, r, p, x) -> "property " ^ txt_refpath i r p ^ txt_val x
- | M.RefOf x -> "refof " ^ txt_set x
- and txt_boole = function
- | M.False -> "false"
- | M.True -> "true"
- | M.Ex b x -> "ex " ^ txt_boole x
-(* | M.Ex b x -> "ex [" ^ txt_list txt_rvar "," b ^ "] " ^ txt_boole x
-*) | M.Not x -> "not " ^ txt_boole x
- | M.And (x, y) -> "(" ^ txt_boole x ^ " and " ^ txt_boole y ^ ")"
- | M.Or (x, y) -> "(" ^ txt_boole x ^ " or " ^ txt_boole y ^ ")"
- | M.Sub (x, y) -> "(" ^ txt_val x ^ " sub " ^ txt_val y ^ ")"
- | M.Meet (x, y) -> "(" ^ txt_val x ^ " meet " ^ txt_val y ^ ")"
- | M.Eq (x, y) -> "(" ^ txt_val x ^ " eq " ^ txt_val y ^ ")"
+ let txt_log a b =
+ if a then out "xml ";
+ if b then out "source "
+ in
+ let txt_allbut b = if b then out "allbut " in
+ let rec txt_con (pat, p, x) =
+ txt_path out p;
+ if pat then out " match " else out " in ";
+ txt_val x
+ and txt_con_list s = function
+ | [] -> ()
+ | l -> out s; txt_list out txt_con ", " l
+ and txt_istrue lt = txt_con_list " istrue " lt
+ and txt_isfalse lf = txt_con_list " isfalse " lf
+ and txt_ass (p, x) = txt_val x; out " as "; txt_path out p
+ and txt_ass_list l = txt_list out txt_ass ", " l
+ and txt_assg_list g = txt_list out txt_ass_list "; " g
+ and txt_val_list = function
+ | [v] -> txt_val v
+ | l -> out "{"; txt_list out txt_val ", " l; out "}"
+ and txt_grp = function
+ | M.Attr g -> txt_assg_list g
+ | M.From av -> txt_avar av
+ and txt_val = function
+ | M.True -> out "true"
+ | M.False -> out "false"
+ | M.Const s -> txt_str out s
+ | M.Set l -> txt_val_list l
+ | M.VVar vv -> txt_vvar vv
+ | M.Dot av p -> txt_avar av; out "."; txt_path out p
+ | M.Proj op x -> out "proj "; txt_opt_path op; txt_set x
+ | M.Ex b x -> out "ex "; txt_val x
+(* | M.Ex b x -> out "ex ["; txt_list out txt_avar "," b; out "] "; txt_val x
+*) | M.Not x -> out "not "; txt_val x
+ | M.Test k x y -> out "("; txt_val x; txt_test k; txt_val y; out ")"
+ | M.StatVal x -> out "stat "; txt_val x
+ | M.Count x -> out "count "; txt_val x
+ | M.Align s x -> out "align "; txt_str out s; out " in "; txt_val x