Changeset 2858 for driver


Ignore:
Timestamp:
Mar 13, 2013, 12:52:16 AM (7 years ago)
Author:
sacerdot
Message:

Trying to pretty print the code graph in visit order.
Slightly bugged ATM, IKD why.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/backendPrinter.ml

    r2856 r2858  
    4444let string_of_pos n = string_of_int (Extracted.Glue.int_of_matitapos n)
    4545
     46let print_ident n = "fun_" ^ string_of_pos n
     47
    4648let printing_pass_independent_params =
    4749 { Extracted.Joint_printer.print_String =
     
    5052 ; print_concat = (fun s1 s2 -> s1 ^ " " ^ s2)
    5153 ; print_empty = ""
    52  ; print_newline = "\n"
    53  ; print_ident = (fun n -> "fun_" ^ string_of_pos n)
     54 ; print_ident = print_ident
    5455 ; print_costlabel = (fun n -> "k_" ^ string_of_pos n)
    5556 ; print_label = (fun n -> "l_" ^ string_of_pos n)
     
    135136 }
    136137
    137 let print_LTL_program =
    138  Extracted.LTL_printer.print_LTL_program joint_LTL_LIN_printing_params
     138let rec list_of_matitalist =
     139 function
     140    Extracted.List.Nil -> []
     141  | Extracted.List.Cons (hd,tl) -> hd :: list_of_matitalist tl
     142
     143let print_graph l =
     144 let l = list_of_matitalist l in
     145  String.concat "\n\n"
     146   (List.map
     147     (fun {Extracted.Types.fst=ident; snd=commands} ->
     148       let commands = list_of_matitalist commands in
     149       print_ident ident ^ ":\n" ^
     150       String.concat "\n" commands
     151     )
     152    l)
     153
     154let print_LTL_program program =
     155 let res =
     156  Extracted.LTL_printer.print_LTL_program joint_LTL_LIN_printing_params program
     157 in
     158  "\n" ^ print_graph res ^ "\n"
Note: See TracChangeset for help on using the changeset viewer.