roles: WIP ...
include ../Makefile.common
test:
-# @$(MAKE) --no-print-directory -C ../../ www
+ @./roles.native -C ../.. -r -W > roles.html
-.PHONY: test
+up-css:
+ @scp roles.css lahar.helm.cs.unibo.it:/projects/helm/public_html/lambdadelta/css/
+
+.PHONY: test up-css
--- /dev/null
+@charset "UTF-8";
+
+/* anchors ******************************************************************/
+
+a:link {
+ text-decoration: initial;
+ color: inherit;
+}
+
+/* visited link */
+a:visited {
+ text-decoration: initial;
+ color: inherit;
+}
+
+/* mouse over link */
+a:hover {
+ text-decoration: underline;
+ color: inherit;
+}
+
+/* selected link */
+a:active {
+ text-decoration: underline;
+ color: inherit;
+}
+
+/* layouts ******************************************************************/
+
+.atoms-head {
+}
+
+.count {
+}
+
+.atoms {
+ overflow-x: auto;
+ border-bottom: 0.5em solid white;
+}
+
+.atom {
+ padding: 0.25em 0.5em;
+}
+
+.selected {
+ border: 1pt dotted;
+}
+
+/* colors *******************************************************************/
+
+.object {
+ color: skyblue;
+}
+
+.name {
+ color: darkseagreen;
+}
let print_status () =
EO.out_status stdout st
+
+let visit_status before_t each_t after_t before_w each_w after_w =
+ EU.list_visit before_t each_t after_t EU.string_of_obj [1] st.ET.t;
+ EU.list_visit before_w each_w after_w EU.string_of_name [2] st.ET.w
val write_status: unit -> unit
val print_status: unit -> unit
+
+val visit_status:
+ (string -> string -> unit) -> (string -> bool -> string -> unit) -> (unit -> unit) ->
+ (string -> string -> unit) -> (string -> bool -> string -> unit) -> (unit -> unit) ->
+ unit
if b <= 0 then b = 0 else
list_exists compare tl
+let rec list_count s c = function
+ | [] -> s, c
+ | (b, _)::tl -> list_count (s + if b then 1 else 0) (succ c) tl
+
let string_of_version v =
String.concat "." (List.map string_of_int v)
ET.r = []; ET.s = []; ET.t = []; ET.w = [];
}
+let string_of_pointer = string_of_version
+
let pointer_of_string = version_of_string
+let list_visit before each after string_of p l =
+ let ptr p = string_of_pointer (List.rev p) in
+ let rec aux i = function
+ | [] -> ()
+ | (b, x)::tl ->
+ each (ptr (i::p)) b (string_of x);
+ aux (succ i) tl
+ in
+ let s, c = list_count 0 0 l in
+ let count = Printf.sprintf "%u/%u" s c in
+ before (ptr p) count;
+ aux 0 l;
+ after ()
+
let string_of_error = function
| ET.EWrongExt x ->
Printf.sprintf "unknown input file type %S" x
val list_select: 'b option -> (bool * 'b) list -> 'b option
+val list_visit:
+ (string -> string -> unit) -> (string -> bool -> string -> unit) -> (unit -> unit) ->
+ ('a -> string) -> RolesTypes.pointer -> (bool * 'a) list -> unit
+
val string_of_version: RolesTypes.version -> string
val version_of_string: string -> RolesTypes.version
let close_out () =
close_out_html ()
+let status_out () =
+ let before_atoms a p count =
+ let c, str =
+ if a then "object", "objects"
+ else "name", "names"
+ in
+ KP.printf "<div class=\"atoms-head %s\">\n" c;
+ KP.printf "<a href=\"\">%s:</a>\n" str;
+ KP.printf "<span class=\"count\">%s</span>\n" count;
+ KP.printf "</div>\n";
+ KP.printf "<div class=\"atoms\"><table><tr>\n"
+ in
+ let each_atom a p b str =
+ let c = if a then "object" else "name" in
+ let s = if b then " selected" else "" in
+ KP.printf "<td class=\"atom %s%s\"><a href=\"\">%s</a></td>\n" c s str
+ in
+ let after_atoms () =
+ KP.printf "</tr></table></div>\n"
+ in
+ EE.visit_status
+ (before_atoms true) (each_atom true) after_atoms
+ (before_atoms false) (each_atom false) after_atoms
+
let init () =
open_out ();
+ status_out ();
close_out ()