Project

General

Profile

« Previous | Next » 

Revision 1b57e111

Added by Teme Kahsai almost 8 years ago

adding sfunction support

View differences:

src/backends/Horn/horn_backend.ml
93 93
    )
94 94
    dependencies
95 95

  
96
let check_sfunction mannot =
97
 (*Check if its an sfunction*)
98
  match mannot with
99
    [] -> false
100
  | [x] -> match x.annots with
101
             [] -> false
102
            |[(key,va)] -> match key with
103
                             [] -> false
104
                           | ["c_code"] -> true
105
                           | ["matlab"] -> true
106
                           | _ -> false
107
  | _  -> false
108

  
96 109
let translate fmt basename prog machines=
97 110
  (* We print typedef *)
98
  print_dep fmt prog;
111
  print_dep fmt prog; (*print static library e.g. math*)
99 112
  print_type_definitions fmt;
100
  List.iter (print_machine machines fmt) (List.rev machines);
113
  (*List.iter (print_machine machines fmt) (List.rev machines);*)
114
  List.iter(fun m ->
115
      let is_sfunction = check_sfunction m.mannot in
116
      if is_sfunction then(
117
        Log.report ~level:1 (fun fmt -> fprintf fmt ".. detected sfunction: %s@," m.mname.node_id);
118
        print_sfunction machines fmt m
119
      ) else (
120
         print_machine machines fmt m)
121
         )
122
           (List.rev machines);
101 123
  main_print machines fmt
102 124

  
103 125
(* Local Variables: *)

Also available in: Unified diff