]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_notation/grafiteAstPp.ml
ocaml 3.09 transition
[helm.git] / helm / ocaml / cic_notation / grafiteAstPp.ml
index 0c63d2594d0ea4e4398a7902981302ee2e7aa47c..3e19ed28140c6b2b5ed1fcdf98e6cc4a58f84001 100644 (file)
@@ -29,7 +29,7 @@ open GrafiteAst
 
 module Ast = CicNotationPt
 
-let tactical_terminator = "."
+let tactical_terminator = ""
 let tactic_terminator = tactical_terminator
 let command_terminator = tactical_terminator
 
@@ -270,6 +270,11 @@ let pp_dir_opt = function
   | Some `LeftToRight -> "> "
   | Some `RightToLeft -> "< "
 
+let pp_metadata =
+  function
+  | Dependency buri -> sprintf "dependency %s" buri
+  | Baseuri buri -> sprintf "baseuri %s" buri
+
 let pp_command = function
   | Include (_,path) -> "include " ^ path
   | Qed _ -> "qed"
@@ -293,6 +298,7 @@ let pp_command = function
         (pp_associativity assoc)
         (pp_precedence prec)
         (pp_l2_pattern l2_pattern)
+  | Metadata (_, m) -> sprintf "metadata %s" (pp_metadata m)
   | Render _
   | Dump _ -> assert false  (* ZACK: debugging *)
 
@@ -307,16 +313,27 @@ let rec pp_tactical = function
   | Try (_, tac) -> "try " ^ pp_tactical tac
   | Solve (_, tac) -> sprintf "solve [%s]" (pp_tacticals ~sep:" | " tac)
 
-and pp_tacticals ~sep tacs =
-  String.concat sep (List.map pp_tactical tacs)
+  | Dot _ -> "."
+  | Semicolon _ -> ";"
+  | Branch _ -> "["
+  | Shift _ -> "|"
+  | Pos (_, i) -> sprintf "%d:" i
+  | Merge _ -> "]"
+  | Focus (_, goals) ->
+      sprintf "focus %s" (String.concat " " (List.map string_of_int goals))
+  | Unfocus _ -> "unfocus"
+  | Skip _ -> "skip"
+
+and pp_tacticals ~sep tacs = String.concat sep (List.map pp_tactical tacs)
 
-let pp_tactical tac = pp_tactical tac ^ tactical_terminator
-let pp_tactic tac = pp_tactic tac ^ tactic_terminator
-let pp_command tac = pp_command tac ^ command_terminator
+let pp_tactical tac = pp_tactical tac
+let pp_tactic tac = pp_tactic tac 
+let pp_command tac = pp_command tac
 
 let pp_executable = function
   | Macro (_,x) -> pp_macro_ast x
-  | Tactical (_,x) -> pp_tactical x
+  | Tactical (_, tac, Some punct) -> pp_tactical tac ^ pp_tactical punct
+  | Tactical (_, tac, None) -> pp_tactical tac
   | Command (_,x) -> pp_command x
                       
 let pp_comment = function
@@ -338,6 +355,12 @@ let pp_cic_command = function
   | Render _
   | Dump _
   | Interpretation _
+  | Metadata _
   | Notation _
   | Obj _ -> assert false (* not implemented *)
 
+let pp_dependency = function
+  | IncludeDep str -> "include \"" ^ str ^ "\""
+  | BaseuriDep str -> "set \"baseuri\" \"" ^ str ^ "\""
+  | UriDep uri -> "uri \"" ^ UriManager.string_of_uri uri ^ "\""
+