Project

General

Profile

« Previous | Next » 

Revision 45d53dc3

Added by Pierre-Loïc Garoche over 5 years ago

EMF export of local type definition (for simple types)

View differences:

src/backends/EMF/EMF_common.ml
77 77
  
78 78
  
79 79
let pp_tag_type fmt typ =
80
  let const_list = match typ.tydef_desc with Tydec_enum tl -> tl | _ -> assert false in
81
  let size = List.length const_list in
82
  if size < 255 then
83
    fprintf fmt "uint8"
84
  else if size < 65535 then
85
fprintf fmt "uint16"
86
  else
87
    assert false (* Too much states. This not reasonable *)
88
      
89
   
80
  let rec aux tydec_desc =
81
  match tydec_desc with  
82
  | Tydec_int -> fprintf fmt "int"
83
  | Tydec_real -> fprintf fmt "real"
84
  | Tydec_bool -> fprintf fmt "bool"
85
  | Tydec_clock ty -> aux ty
86
  | Tydec_enum const_list -> (
87
    let size = List.length const_list in
88
    if size < 255 then
89
      fprintf fmt "uint8"
90
    else if size < 65535 then
91
      fprintf fmt "uint16"
92
    else
93
      assert false (* Too much states. This not reasonable *)
94
  )
95
  | Tydec_const _ | Tydec_struct _ | Tydec_array _ | Tydec_any -> eprintf "unhandled cst tag in EMF: %a@." Printers.pp_var_type_dec_desc tydec_desc; assert false
96
  in
97
  aux typ.tydef_desc
98

  
90 99
     
91 100
let pp_cst_type fmt c (*infered_typ*) =
92 101
  match c with

Also available in: Unified diff