Project

General

Profile

« Previous | Next » 

Revision ca7ff3f7

Added by LĂ©lio Brun 7 months ago

reformatting

View differences:

src/tools/stateflow/semantics/cPS_ccode_generator.ml
1 1
open CPS_transformer
2 2

  
3
module CodeGenerator : ComparableTransformerType =
4
struct
3
module CodeGenerator : ComparableTransformerType = struct
5 4
  include TransformerStub
6 5

  
7
  type t =
8
  | Bot
9
  | Act of act_t
10
  | Seq of t list
11
  | Ite of cond_t * t * t
6
  type t = Bot | Act of act_t | Seq of t list | Ite of cond_t * t * t
12 7

  
13 8
  let null = Seq []
14 9

  
15 10
  let bot = Bot
16
 
11

  
17 12
  let ( >> ) tr1 tr2 =
18 13
    match tr1, tr2 with
19
    | Seq trl1, Seq trl2 -> Seq (trl1@trl2)
20
    | Seq trl1, _        -> Seq (trl1@[tr2])
21
    | _       , Seq trl2 -> Seq (tr1::trl2)
22
    | _                  -> Seq ([tr1;tr2])
14
    | Seq trl1, Seq trl2 ->
15
      Seq (trl1 @ trl2)
16
    | Seq trl1, _ ->
17
      Seq (trl1 @ [ tr2 ])
18
    | _, Seq trl2 ->
19
      Seq (tr1 :: trl2)
20
    | _ ->
21
      Seq [ tr1; tr2 ]
23 22

  
24 23
  let ( == ) tr1 tr2 = tr1 = tr2
25 24

  
......
27 26
    (*Format.printf "----- action = %a@." Action.pp_act action;*)
28 27
    Act action
29 28

  
30
  (*if (match trans.event with None -> true | _ -> e = trans.event) && trans.condition rho*)
29
  (*if (match trans.event with None -> true | _ -> e = trans.event) &&
30
    trans.condition rho*)
31 31
  let eval_cond condition ok ko =
32 32
    (*Format.printf "----- cond = %a@." Condition.pp_cond condition;*)
33 33
    Ite (condition, ok, ko)
34
    
34

  
35 35
  (* let rec pp_transformer fmt tr =
36 36
   *   match tr with
37 37
   *   | Bot           -> Format.fprintf fmt "bot"
......
46 46

  
47 47
  (* let pp_principal fmt tr =
48 48
   *   Format.fprintf fmt "principal =@.%a" pp_transformer tr *)
49
      
49

  
50 50
  (* let pp_component : type c. Format.formatter -> c call_t -> c -> t -> unit =
51 51
   *   fun fmt call -> match call with
52 52
   *   | Ecall -> (fun (p, p', f) tr ->
......
56 56
   *   | Xcall -> (fun (p, f) tr ->
57 57
   *     Format.fprintf fmt "component %a(%a, %a) =@.@[<v 2>begin@ %a@]@.end" pp_call call pp_path p pp_frontier f pp_transformer tr) *)
58 58

  
59
		     let mkcomponent _  = assert false
60
		     let mkprincipal _  = assert false
61
		     (* let mktransformer _  = assert false *)
62
		       
63
end
59
  let mkcomponent _ = assert false
64 60

  
61
  let mkprincipal _ = assert false
62
  (* let mktransformer _ = assert false *)
63
end

Also available in: Unified diff