Project

General

Profile

Revision b08ffca7 src/printers.ml

View differences:

src/printers.ml
131 131
    pp_eq_lhs eq.eq_lhs
132 132
    pp_expr eq.eq_rhs
133 133

  
134
let pp_node_eqs = fprintf_list ~sep:"@ " pp_node_eq
134
let pp_restart fmt restart =
135
  Format.fprintf fmt "%s" (if restart then "restart" else "resume")
136

  
137
let pp_unless fmt (_, expr, restart, st) =
138
  Format.fprintf fmt "unless %a %a %s"
139
    pp_expr expr
140
    pp_restart restart
141
    st
142

  
143
let pp_until fmt (_, expr, restart, st) =
144
  Format.fprintf fmt "until %a %a %s"
145
    pp_expr expr
146
    pp_restart restart
147
    st
148

  
149
let rec pp_handler fmt handler =
150
  Format.fprintf fmt "state %s -> %a %a let %a tel %a"
151
    handler.hand_state
152
    (Utils.fprintf_list ~sep:"@ " pp_unless) handler.hand_unless
153
    (fun fmt locals ->
154
      match locals with [] -> () | _ ->
155
	Format.fprintf fmt "@[<v 4>var %a@]@ " 
156
	  (Utils.fprintf_list ~sep:"@ " 
157
	     (fun fmt v -> Format.fprintf fmt "%a;" pp_node_var v))
158
	  locals)
159
    handler.hand_locals
160
    pp_node_stmts handler.hand_stmts
161
    (Utils.fprintf_list ~sep:"@ " pp_until) handler.hand_until
162

  
163
and pp_node_stmt fmt stmt =
164
  match stmt with
165
  | Eq eq -> pp_node_eq fmt eq
166
  | Aut aut -> pp_node_aut fmt aut
167

  
168
and pp_node_stmts fmt stmts = fprintf_list ~sep:"@ " pp_node_stmt fmt stmts
169

  
170
and pp_node_aut fmt aut =
171
  Format.fprintf fmt "automaton %s %a"
172
    aut.aut_id
173
    (Utils.fprintf_list ~sep:"@ " pp_handler) aut.aut_handlers
174

  
175
and pp_node_eqs fmt eqs = fprintf_list ~sep:"@ " pp_node_eq fmt eqs
135 176

  
136 177
let rec pp_var_struct_type_field fmt (label, tdesc) =
137 178
  fprintf fmt "%a : %a;" pp_print_string label pp_var_type_dec_desc tdesc
......
217 258
      checks
218 259
  ) nd.node_checks
219 260
  (fprintf_list ~sep:"@ " pp_expr_annot) nd.node_annot
220
  pp_node_eqs nd.node_eqs
261
  pp_node_stmts nd.node_stmts
221 262
  pp_asserts nd.node_asserts
222 263
(*fprintf fmt "@ /* Scheduling: %a */ @ " (fprintf_list ~sep:", " pp_print_string) (Scheduling.schedule_node nd)*)
223 264

  

Also available in: Unified diff