Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / src / backends / VHDL / vhdl_ast_map.ml @ 6d3b5007

History | View | Annotate | Download (22.9 KB)

1
open Vhdl_ast_deriving
2

    
3
let _ = fun (_ : vhdl_cst_val_t)  -> () 
4
let _ = fun (_ : vhdl_type_t)  -> () 
5
let _ = fun (_ : vhdl_subtype_indication_t)  -> () 
6
let _ = fun (_ : vhdl_discrete_range_t)  -> () 
7
let _ = fun (_ : vhdl_constraint_t)  -> () 
8
let _ = fun (_ : vhdl_definition_t)  -> () 
9
let _ = fun (_ : vhdl_expr_t)  -> () 
10
let _ = fun (_ : vhdl_name_t)  -> () 
11
let _ = fun (_ : vhdl_assoc_element_t)  -> () 
12
let _ = fun (_ : vhdl_element_assoc_t)  -> () 
13
let _ = fun (_ : vhdl_array_attributes_t)  -> () 
14
let _ = fun (_ : vhdl_signal_attributes_t)  -> () 
15
let _ = fun (_ : vhdl_string_attributes_t)  -> () 
16
let _ = fun (_ : vhdl_suffix_selection_t)  -> () 
17
let _ = fun (_ : 'basetype vhdl_type_attributes_t)  -> () 
18
let _ = fun (_ : vhdl_parameter_t)  -> () 
19
let _ = fun (_ : vhdl_subprogram_spec_t)  -> () 
20
let _ = fun (_ : vhdl_sequential_stmt_t)  -> () 
21
let _ = fun (_ : vhdl_if_case_t)  -> () 
22
let _ = fun (_ : vhdl_case_item_t)  -> () 
23
let _ = fun (_ : vhdl_declaration_t)  -> () 
24
let _ = fun (_ : vhdl_signal_selection_t)  -> () 
25
let _ = fun (_ : vhdl_signal_condition_t)  -> () 
26
let _ = fun (_ : vhdl_conditional_signal_t)  -> () 
27
let _ = fun (_ : vhdl_process_t)  -> () 
28
let _ = fun (_ : vhdl_selected_signal_t)  -> () 
29
let _ = fun (_ : vhdl_port_mode_t)  -> () 
30
let _ = fun (_ : vhdl_component_instantiation_t)  -> ()
31
let _ = fun (_ : vhdl_concurrent_stmt_t)  -> () 
32
let _ = fun (_ : vhdl_port_t)  -> () 
33
let _ = fun (_ : vhdl_entity_t)  -> () 
34
let _ = fun (_ : vhdl_package_t)  -> () 
35
let _ = fun (_ : vhdl_load_t)  -> () 
36
let _ = fun (_ : vhdl_architecture_t)  -> () 
37
let _ = fun (_ : vhdl_configuration_t)  -> () 
38
let _ = fun (_ : vhdl_library_unit_t)  -> () 
39
let _ = fun (_ : vhdl_design_unit_t)  -> () 
40
let _ = fun (_ : vhdl_design_file_t)  -> () 
41
let _ = fun (_ : vhdl_file_t)  -> () 
42

    
43
class virtual vhdl_map =
44
  object (self)
45
    method virtual  string : string -> string
46
    method virtual  list : 'a . ('a -> 'a) -> 'a list -> 'a list
47
    method virtual  unit : unit -> unit
48
    method virtual  bool : bool -> bool
49
    method virtual  option : 'a . ('a -> 'a) -> 'a option -> 'a option
50
    method virtual  int : int -> int
51
    method virtual  vhdl_name_t : vhdl_name_t -> vhdl_name_t
52
    method virtual  vhdl_definition_t : vhdl_definition_t -> vhdl_definition_t
53
    method virtual  vhdl_port_t : vhdl_port_t -> vhdl_port_t
54
    method virtual  vhdl_expr_t : vhdl_expr_t -> vhdl_expr_t
55
    method virtual  vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t
56
    method virtual  vhdl_subtype_indication_t : vhdl_subtype_indication_t -> vhdl_subtype_indication_t
57
    method virtual  vhdl_conditional_signal_t : vhdl_conditional_signal_t -> vhdl_conditional_signal_t
58
    method virtual  vhdl_process_t : vhdl_process_t -> vhdl_process_t
59
    method virtual  vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t
60
    method virtual  vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t
61
    method virtual  vhdl_suffix_selection_t : vhdl_suffix_selection_t -> vhdl_suffix_selection_t
62
    method virtual  vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t
63
    method virtual  vhdl_sequential_stmt_t : vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t
64
    method virtual  vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t
65
    method virtual  vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t
66
    method virtual  vhdl_subprogram_spec_t : vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t
67
    method virtual  vhdl_discrete_range_t : vhdl_discrete_range_t -> vhdl_discrete_range_t
68
    method virtual  vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t
69
    method virtual  vhdl_component_instantiation_t : vhdl_component_instantiation_t -> vhdl_component_instantiation_t
70
    method virtual  vhdl_concurrent_stmt_t : vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t
71
    method virtual  vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t
72
    method virtual  vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t
73
    method virtual  vhdl_configuration_t : vhdl_configuration_t -> vhdl_configuration_t
74
    method virtual  vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t
75
    method virtual  vhdl_package_t : vhdl_package_t -> vhdl_package_t
76
    method virtual  vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t
77
    method virtual  vhdl_load_t : vhdl_load_t -> vhdl_load_t
78
    method virtual  vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t
79
    method virtual  vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t
80

    
81
    method vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t=
82
      fun x  ->
83
        match x with
84
        | CstInt a -> let a = self#int a  in CstInt a
85
        | CstStdLogic a -> let a = self#string a  in CstStdLogic a
86
        | CstLiteral a -> let a = self#string a  in CstLiteral a
87

    
88
    method vhdl_type_t : vhdl_type_t -> vhdl_type_t=
89
      fun x  ->
90
        match x with
91
        | Base a -> let a = self#string a  in Base a
92
        | Range (a,b,c) ->
93
            let a = self#option self#string a  in
94
            let b = self#int b  in let c = self#int c  in Range (a, b, c)
95
        | Bit_vector (a,b) ->
96
            let a = self#int a  in let b = self#int b  in Bit_vector (a, b)
97
        | Array (a,b,c) ->
98
            let a = self#int a  in
99
            let b = self#int b  in
100
            let c = self#vhdl_type_t c  in Array (a, b, c)
101
        | Enumerated a -> let a = self#list self#string a  in Enumerated a
102
        | Void  -> Void
103
    method vhdl_subtype_indication_t :
104
      vhdl_subtype_indication_t -> vhdl_subtype_indication_t=
105
      fun { name; functionName; const }  ->
106
        let name = self#vhdl_name_t name  in
107
        let functionName = self#vhdl_name_t functionName  in
108
        let const = self#vhdl_constraint_t const  in
109
        { name; functionName; const }
110
    method vhdl_discrete_range_t :
111
      vhdl_discrete_range_t -> vhdl_discrete_range_t=
112
      fun x  ->
113
        match x with
114
        | SubDiscreteRange a ->
115
            let a = self#vhdl_subtype_indication_t a  in SubDiscreteRange a
116
        | NamedRange a -> let a = self#vhdl_name_t a  in NamedRange a
117
        | DirectedRange { direction; from; _to } ->
118
            let direction = self#string direction  in
119
            let from = self#vhdl_expr_t from  in
120
            let _to = self#vhdl_expr_t _to  in
121
            DirectedRange { direction; from; _to }
122

    
123
    method vhdl_constraint_t : vhdl_constraint_t -> vhdl_constraint_t=
124
      fun x  ->
125
        match x with
126
        | RefConstraint { ref_name } ->
127
            let ref_name = self#vhdl_name_t ref_name  in
128
            RefConstraint { ref_name }
129
        | RangeConstraint { range } ->
130
            let range = self#vhdl_discrete_range_t range  in
131
            RangeConstraint { range }
132
        | IndexConstraint { ranges } ->
133
            let ranges = self#list self#vhdl_discrete_range_t ranges  in
134
            IndexConstraint { ranges }
135
        | ArrayConstraint { ranges; sub } ->
136
            let ranges = self#list self#vhdl_discrete_range_t ranges  in
137
            let sub = self#vhdl_constraint_t sub  in
138
            ArrayConstraint { ranges; sub }
139
        | RecordConstraint  -> RecordConstraint
140
        | NoConstraint  -> NoConstraint
141

    
142
    method vhdl_definition_t : vhdl_definition_t -> vhdl_definition_t=
143
      fun x  ->
144
        match x with
145
        | Type { name; definition } ->
146
            let name = self#vhdl_name_t name  in
147
            let definition = self#vhdl_type_t definition  in
148
            Type { name; definition }
149
        | Subtype { name; typ } ->
150
            let name = self#vhdl_name_t name  in
151
            let typ = self#vhdl_subtype_indication_t typ  in
152
            Subtype { name; typ }
153
    method vhdl_expr_t : vhdl_expr_t -> vhdl_expr_t=
154
      fun x  ->
155
        match x with
156
        | Call a -> let a = self#vhdl_name_t a  in Call a
157
        | Cst a -> let a = self#vhdl_cst_val_t a  in Cst a
158
        | Op { id; args } ->
159
            let id = self#string id  in
160
            let args = self#list self#vhdl_expr_t args  in Op { id; args }
161
        | IsNull  -> IsNull
162
        | Time { value; phy_unit } ->
163
            let value = self#int value  in
164
            let phy_unit = self#string phy_unit  in Time { value; phy_unit }
165
        | Sig { name; att } ->
166
            let name = self#vhdl_name_t name  in
167
            let att = self#option self#vhdl_signal_attributes_t att  in
168
            Sig { name; att }
169
        | SuffixMod { expr; selection } ->
170
            let expr = self#vhdl_expr_t expr  in
171
            let selection = self#vhdl_suffix_selection_t selection  in
172
            SuffixMod { expr; selection }
173
        | Aggregate { elems } ->
174
            let elems = self#list self#vhdl_element_assoc_t elems  in
175
            Aggregate { elems }
176
        | Others  -> Others
177
    method vhdl_name_t : vhdl_name_t -> vhdl_name_t=
178
      fun x  ->
179
        match x with
180
        | Simple a -> let a = self#string a  in Simple a
181
        | Identifier a -> let a = self#string a  in Identifier a
182
        | Selected a -> let a = self#list self#vhdl_name_t a  in Selected a
183
        | Index { id; exprs } ->
184
            let id = self#vhdl_name_t id  in
185
            let exprs = self#list self#vhdl_expr_t exprs  in
186
            Index { id; exprs }
187
        | Slice { id; range } ->
188
            let id = self#vhdl_name_t id  in
189
            let range = self#vhdl_discrete_range_t range  in
190
            Slice { id; range }
191
        | Attribute { id; designator; expr } ->
192
            let id = self#vhdl_name_t id  in
193
            let designator = self#vhdl_name_t designator  in
194
            let expr = self#vhdl_expr_t expr  in
195
            Attribute { id; designator; expr }
196
        | Function { id; assoc_list } ->
197
            let id = self#vhdl_name_t id  in
198
            let assoc_list = self#list self#vhdl_assoc_element_t assoc_list
199
               in
200
            Function { id; assoc_list }
201
        | NoName  -> NoName
202
    method vhdl_assoc_element_t :
203
      vhdl_assoc_element_t -> vhdl_assoc_element_t=
204
      fun
205
        { formal_name; formal_arg; actual_name; actual_designator;
206
          actual_expr }
207
         ->
208
        let formal_name = self#option self#vhdl_name_t formal_name  in
209
        let formal_arg = self#option self#vhdl_name_t formal_arg  in
210
        let actual_name = self#option self#vhdl_name_t actual_name  in
211
        let actual_designator =
212
          self#option self#vhdl_name_t actual_designator  in
213
        let actual_expr = self#option self#vhdl_expr_t actual_expr  in
214
        {
215
          formal_name;
216
          formal_arg;
217
          actual_name;
218
          actual_designator;
219
          actual_expr
220
        }
221
    method vhdl_element_assoc_t :
222
      vhdl_element_assoc_t -> vhdl_element_assoc_t=
223
      fun { choices; expr }  ->
224
        let choices = self#list self#vhdl_expr_t choices  in
225
        let expr = self#vhdl_expr_t expr  in { choices; expr }
226
    method vhdl_array_attributes_t :
227
      vhdl_array_attributes_t -> vhdl_array_attributes_t=
228
      fun x  ->
229
        match x with
230
        | AAttInt { id; arg } ->
231
            let id = self#string id  in
232
            let arg = self#int arg  in AAttInt { id; arg }
233
        | AAttAscending  -> AAttAscending
234
    method vhdl_signal_attributes_t :
235
      vhdl_signal_attributes_t -> vhdl_signal_attributes_t=
236
      fun x  -> match x with | SigAtt a -> let a = self#string a  in SigAtt a
237
    method vhdl_string_attributes_t :
238
      vhdl_string_attributes_t -> vhdl_string_attributes_t=
239
      fun x  ->
240
        match x with | StringAtt a -> let a = self#string a  in StringAtt a
241
    method vhdl_suffix_selection_t : vhdl_suffix_selection_t -> vhdl_suffix_selection_t=
242
      fun x  ->
243
        match x with
244
        | Idx a -> let a = self#int a  in Idx a
245
        | SuffixRange (a,b) ->
246
            let a = self#int a  in let b = self#int b  in SuffixRange (a, b)
247

    
248
    method vhdl_type_attributes_t :
249
      'a .
250
        ('a -> 'a) -> 'a vhdl_type_attributes_t -> 'a vhdl_type_attributes_t=
251
      fun _basetype  ->
252
        fun x  ->
253
          match x with
254
          | TAttNoArg { id } -> let id = self#string id  in TAttNoArg { id }
255
          | TAttIntArg { id; arg } ->
256
              let id = self#string id  in
257
              let arg = self#int arg  in TAttIntArg { id; arg }
258
          | TAttValArg { id; arg } ->
259
              let id = self#string id  in
260
              let arg = _basetype arg  in TAttValArg { id; arg }
261
          | TAttStringArg { id; arg } ->
262
              let id = self#string id  in
263
              let arg = self#string arg  in TAttStringArg { id; arg }
264

    
265
    method vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t=
266
      fun { names; mode; typ; init_val }  ->
267
        let names = self#list self#vhdl_name_t names  in
268
        let mode = self#list self#string mode  in
269
        let typ = self#vhdl_subtype_indication_t typ  in
270
        let init_val = self#option self#vhdl_cst_val_t init_val  in
271
        { names; mode; typ; init_val }
272

    
273
    method vhdl_subprogram_spec_t :
274
      vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t=
275
      fun { name; typeMark; parameters; isPure }  ->
276
        let name = self#string name  in
277
        let typeMark = self#vhdl_name_t typeMark  in
278
        let parameters = self#list self#vhdl_parameter_t parameters  in
279
        let isPure = self#bool isPure  in
280
        { name; typeMark; parameters; isPure }
281

    
282
    method vhdl_sequential_stmt_t :
283
      vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t=
284
      fun x  ->
285
        match x with
286
        | VarAssign { label; lhs; rhs } ->
287
            let label = self#vhdl_name_t label  in
288
            let lhs = self#vhdl_name_t lhs  in
289
            let rhs = self#vhdl_expr_t rhs  in VarAssign { label; lhs; rhs }
290
        | SigSeqAssign { label; lhs; rhs } ->
291
            let label = self#vhdl_name_t label  in
292
            let lhs = self#vhdl_name_t lhs  in
293
            let rhs = self#list self#vhdl_expr_t rhs  in
294
            SigSeqAssign { label; lhs; rhs }
295
        | If { label; if_cases; default } ->
296
            let label = self#vhdl_name_t label  in
297
            let if_cases = self#list self#vhdl_if_case_t if_cases  in
298
            let default = self#list self#vhdl_sequential_stmt_t default  in
299
            If { label; if_cases; default }
300
        | Case { label; guard; branches } ->
301
            let label = self#vhdl_name_t label  in
302
            let guard = self#vhdl_expr_t guard  in
303
            let branches = self#list self#vhdl_case_item_t branches  in
304
            Case { label; guard; branches }
305
        | Exit { label; loop_label; condition } ->
306
            let label = self#vhdl_name_t label  in
307
            let loop_label = self#option self#string loop_label  in
308
            let condition = self#option self#vhdl_expr_t condition  in
309
            Exit { label; loop_label; condition }
310
        | Assert { label; cond; report; severity } ->
311
            let label = self#vhdl_name_t label  in
312
            let cond = self#vhdl_expr_t cond  in
313
            let report = self#vhdl_expr_t report  in
314
            let severity = self#vhdl_expr_t severity  in
315
            Assert { label; cond; report; severity }
316
        | ProcedureCall { label; name; assocs } ->
317
            let label = self#vhdl_name_t label  in
318
            let name = self#vhdl_name_t name  in
319
            let assocs = self#list self#vhdl_assoc_element_t assocs  in
320
            ProcedureCall { label; name; assocs }
321
        | Wait  -> Wait
322
        | Null { label } ->
323
            let label = self#vhdl_name_t label  in Null { label }
324
        | Return { label } ->
325
            let label = self#vhdl_name_t label  in Return { label }
326
    method vhdl_if_case_t : vhdl_if_case_t -> vhdl_if_case_t=
327
      fun { if_cond; if_block }  ->
328
        let if_cond = self#vhdl_expr_t if_cond  in
329
        let if_block = self#list self#vhdl_sequential_stmt_t if_block  in
330
        { if_cond; if_block }
331
    method vhdl_case_item_t : vhdl_case_item_t -> vhdl_case_item_t=
332
      fun { when_cond; when_stmt }  ->
333
        let when_cond = self#list self#vhdl_expr_t when_cond  in
334
        let when_stmt = self#list self#vhdl_sequential_stmt_t when_stmt  in
335
        { when_cond; when_stmt }
336

    
337
    method vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t=
338
      fun x  ->
339
        match x with
340
        | VarDecl { names; typ; init_val } ->
341
            let names = self#list self#vhdl_name_t names  in
342
            let typ = self#vhdl_subtype_indication_t typ  in
343
            let init_val = self#vhdl_expr_t init_val  in
344
            VarDecl { names; typ; init_val }
345
        | CstDecl { names; typ; init_val } ->
346
            let names = self#list self#vhdl_name_t names  in
347
            let typ = self#vhdl_subtype_indication_t typ  in
348
            let init_val = self#vhdl_expr_t init_val  in
349
            CstDecl { names; typ; init_val }
350
        | SigDecl { names; typ; init_val } ->
351
            let names = self#list self#vhdl_name_t names  in
352
            let typ = self#vhdl_subtype_indication_t typ  in
353
            let init_val = self#vhdl_expr_t init_val  in
354
            SigDecl { names; typ; init_val }
355
        | Subprogram { name; kind; spec; decl_part; stmts } ->
356
            let name = self#vhdl_name_t name  in
357
            let kind = self#string kind  in
358
            let spec = self#vhdl_subprogram_spec_t spec  in
359
            let decl_part = self#list self#vhdl_declaration_t decl_part  in
360
            let stmts = self#list self#vhdl_sequential_stmt_t stmts  in
361
            Subprogram { name; kind; spec; decl_part; stmts }
362

    
363
    method vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t=
364
      fun { expr; cond }  ->
365
        let expr = self#list self#vhdl_expr_t expr  in
366
        let cond = self#vhdl_expr_t cond  in { expr; cond }
367

    
368
    method vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t=
369
      fun { expr; when_sel }  ->
370
        let expr = self#vhdl_expr_t expr  in
371
        let when_sel = self#list self#vhdl_expr_t when_sel  in
372
        { expr; when_sel }
373

    
374
    method vhdl_conditional_signal_t :
375
      vhdl_conditional_signal_t -> vhdl_conditional_signal_t=
376
      fun { postponed; label; lhs; rhs; cond; delay }  ->
377
        let postponed = self#bool postponed  in
378
        let label = self#vhdl_name_t label  in
379
        let lhs = self#vhdl_name_t lhs  in
380
        let rhs = self#list self#vhdl_signal_condition_t rhs  in
381
        let cond = self#vhdl_expr_t cond  in
382
        let delay = self#vhdl_expr_t delay  in
383
        { postponed; label; lhs; rhs; cond; delay }
384

    
385

    
386
    method vhdl_process_t : vhdl_process_t -> vhdl_process_t=
387
      fun { id; declarations; active_sigs; body }  ->
388
        let id = self#vhdl_name_t id  in
389
        let declarations =
390
          self#option (self#list self#vhdl_declaration_t) declarations  in
391
        let active_sigs = self#list self#vhdl_name_t active_sigs  in
392
        let body = self#list self#vhdl_sequential_stmt_t body  in
393
        { id; declarations; active_sigs; body }
394

    
395
    method vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t=
396
      fun { postponed; label; lhs; sel; branches; delay }  ->
397
        let postponed = self#bool postponed  in
398
        let label = self#vhdl_name_t label  in
399
        let lhs = self#vhdl_name_t lhs  in
400
        let sel = self#vhdl_expr_t sel  in
401
        let branches = self#list self#vhdl_signal_selection_t branches  in
402
        let delay = self#option self#vhdl_expr_t delay  in
403
        { postponed; label; lhs; sel; branches; delay }
404

    
405
    method vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t=
406
      fun x  -> x
407

    
408
    method vhdl_component_instantiation_t :
409
      vhdl_component_instantiation_t -> vhdl_component_instantiation_t=
410
      fun { name; inst_unit; archi_name; generic_map; port_map }  ->
411
        let name = self#vhdl_name_t name  in
412
        let inst_unit = self#vhdl_name_t inst_unit  in
413
        let archi_name = self#option self#vhdl_name_t archi_name  in
414
        let generic_map = self#option self#vhdl_assoc_element_t generic_map
415
           in
416
        let port_map = self#option self#vhdl_assoc_element_t port_map  in
417
        { name; inst_unit; archi_name; generic_map; port_map }
418

    
419
    method vhdl_concurrent_stmt_t :
420
      vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t=
421
      fun x  ->
422
        match x with
423
        | SigAssign a -> let a = self#vhdl_conditional_signal_t a  in SigAssign a
424
        | Process a -> let a = self#vhdl_process_t a  in Process a
425
        | SelectedSig a -> let a = self#vhdl_selected_signal_t a  in SelectedSig a
426
        | ComponentInst a -> let a = self#vhdl_component_instantiation_t a  in ComponentInst a 
427

    
428
    method vhdl_port_t : vhdl_port_t -> vhdl_port_t=
429
      fun { names; mode; typ; expr }  ->
430
        let names = self#list self#vhdl_name_t names  in
431
        let mode = self#vhdl_port_mode_t mode  in
432
        let typ = self#vhdl_subtype_indication_t typ  in
433
        let expr = self#vhdl_expr_t expr  in { names; mode; typ; expr }
434

    
435
    method vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t=
436
      fun { name; generics; ports; declaration; stmts }  ->
437
        let name = self#vhdl_name_t name  in
438
        let generics = self#list self#vhdl_port_t generics  in
439
        let ports = self#list self#vhdl_port_t ports  in
440
        let declaration = self#list self#vhdl_declaration_t declaration  in
441
        let stmts = self#list self#vhdl_concurrent_stmt_t stmts  in
442
        { name; generics; ports; declaration; stmts }
443

    
444
    method vhdl_package_t : vhdl_package_t -> vhdl_package_t=
445
      fun { name; shared_defs }  ->
446
        let name = self#vhdl_name_t name  in
447
        let shared_defs = self#list self#vhdl_definition_t shared_defs  in
448
        { name; shared_defs }
449

    
450
    method vhdl_load_t : vhdl_load_t -> vhdl_load_t=
451
      fun x  ->
452
        match x with
453
        | Library a -> let a = self#list self#vhdl_name_t a  in Library a
454
        | Use a -> let a = self#list self#vhdl_name_t a  in Use a
455

    
456
    method vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t=
457
      fun { name; entity; declarations; body }  ->
458
        let name = self#vhdl_name_t name  in
459
        let entity = self#vhdl_name_t entity  in
460
        let declarations = self#list self#vhdl_declaration_t declarations  in
461
        let body = self#list self#vhdl_concurrent_stmt_t body  in
462
        { name; entity; declarations; body }
463

    
464
    method vhdl_configuration_t :
465
      vhdl_configuration_t -> vhdl_configuration_t= self#unit
466

    
467
    method vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t=
468
      fun x  ->
469
        match x with
470
        | Package a -> let a = self#vhdl_package_t a  in Package a
471
        | Entities a -> let a = self#vhdl_entity_t a  in Entities a
472
        | Architecture a ->
473
            let a = self#vhdl_architecture_t a  in Architecture a
474
        | Configuration a ->
475
            let a = self#vhdl_configuration_t a  in Configuration a
476

    
477
    method vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t=
478
      fun { contexts; library }  ->
479
        let contexts = self#list self#vhdl_load_t contexts  in
480
        let library = self#vhdl_library_unit_t library  in
481
        { contexts; library }
482

    
483
    method vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t=
484
      fun { design_units }  ->
485
        let design_units = self#list self#vhdl_design_unit_t design_units  in
486
        { design_units }
487

    
488
    method vhdl_file_t : vhdl_file_t -> vhdl_file_t=
489
      fun { design_file }  ->
490
        let design_file = self#vhdl_design_file_t design_file  in
491
        { design_file }
492
  end