Project

General

Profile

Revision 2823bc51

View differences:

src/backends/EMF/EMF_backend.ml
246 246
	 (fun fmt (tag, instrs_tag) ->
247 247
	   let (*branch_outputs*) _, branch_inputs = branch_block_vars instrs_tag in    	   
248 248
	   fprintf fmt "@[<v 2>\"%s\": {@ " tag;
249
	   fprintf fmt "\"guard_value\": \"%a\",@ " pp_tag_id tag; 
249 250
	   fprintf fmt "\"inputs\": [%a],@ " pp_emf_vars_decl (VSet.elements branch_inputs); 
250 251
	   fprintf fmt "@[<v 2>\"instrs\": {@ ";
251 252
	   fprintf_list ~sep:",@ " (pp_emf_instr m) fmt instrs_tag;
src/backends/EMF/EMF_common.ml
51 51
let reset_name id =
52 52
  "reset_" ^ id
53 53
  
54
    
54
let pp_tag_id fmt t =
55
  let typ = (Corelang.typedef_of_top (Hashtbl.find Corelang.tag_table t)) in
56
  if typ.tydef_id = "bool" then
57
    pp_print_string fmt t
58
  else
59
    let const_list = match typ.tydef_desc with Tydec_enum tl -> tl | _ -> assert false in
60
    fprintf fmt "%i" (get_idx t const_list)
61
     
55 62
let pp_emf_cst_or_var fmt v =
56 63
  match v.value_desc with
57 64
  | Cst ((Const_tag t) as c)->
......
60 67
       fprintf fmt "{@[\"type\": \"constant\",@ \"value\": \"%a\"@ @]}"
61 68
	 Printers.pp_const c
62 69
     else (
63
       let const_list = match typ.tydef_desc with Tydec_enum tl -> tl | _ -> assert false in
64
       fprintf fmt "{@[\"type\": \"constant\",@ \"value\": \"%i\",@ " 
65
	 (get_idx t const_list);
70
       fprintf fmt "{@[\"type\": \"constant\",@ \"value\": \"%a\",@ " 
71
	 pp_tag_id t;
66 72
       fprintf fmt "\"origin_type\": \"%s\",@ \"origin_value\": \"%s\"@ "
67 73
	 typ.tydef_id t;
68 74
       fprintf fmt "@]}"

Also available in: Unified diff