Project

General

Profile

« Previous | Next » 

Revision f6acf47b

Added by Pierre-Loïc Garoche about 9 years ago

Plugin based framework

View differences:

src/plugins.ml
1 1
open LustreSpec
2 2

  
3
module type PluginType =
4
sig
3
let plugins =
4
  [
5
    (module Scopes.Plugin : PluginType.PluginType);
6
    (module Salsa_plugin.Plugin : PluginType.PluginType)
7
  ]
5 8

  
6
end
7 9

  
10
let options () = 
11
  List.flatten (
12
    List.map Options.plugin_opt (
13
      List.map (fun m ->
14
	let module M = (val m : PluginType.PluginType) in
15
	(M.name, M.activate, M.options)
16
      ) plugins
17
    ))
8 18

  
19
let check_force_stateful () =
20
  List.exists (fun m ->
21
	let module M = (val m : PluginType.PluginType) in
22
	M.check_force_stateful ()
23
  ) plugins
24

  
25
let refine_machine_code prog machine_code =
26
  List.fold_left (fun accu m ->
27
    let module M = (val m : PluginType.PluginType) in
28
    M.refine_machine_code prog accu
29
  ) machine_code plugins
30

  
31

  
32
let c_backend_main_loop_body_suffix fmt () = 
33
  List.iter (fun (m: (module PluginType.PluginType)) -> 
34
    let module M = (val m : PluginType.PluginType) in
35
    M.c_backend_main_loop_body_suffix fmt ()) plugins
36

  
37
(* Specific treatment of annotations when inlining, specific of declared plugins *)
9 38

  
10 39
let inline_annots rename_var_fun annot_list =
11 40
  List.map (

Also available in: Unified diff