Project

General

Profile

Download (24.7 KB) Statistics
| Branch: | Tag: | Revision:
1
open Vhdl_ast_deriving
2

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

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

    
85
    method vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t=
86
      fun x  ->
87
        match x with
88
        | CstInt a -> let a = self#int a  in CstInt a
89
        | CstStdLogic a -> let a = self#string a  in CstStdLogic a
90
        | CstLiteral a -> let a = self#string a  in CstLiteral a
91

    
92
    method vhdl_type_t : vhdl_type_t -> vhdl_type_t=
93
      fun x  ->
94
        match x with
95
        | Base a -> let a = self#string a  in Base a
96
        | Range (a,b,c) ->
97
            let a = self#option self#string a  in
98
            let b = self#int b  in let c = self#int c  in Range (a, b, c)
99
        | Bit_vector (a,b) ->
100
            let a = self#int a  in let b = self#int b  in Bit_vector (a, b)
101
        | Array { indexes; const; definition } ->
102
            let indexes = self#list self#vhdl_name_t indexes  in
103
            let const = self#option self#vhdl_constraint_t const  in
104
            let definition = self#vhdl_subtype_indication_t definition  in
105
            Array { indexes; const; definition }
106
        | Record a ->
107
            let a = self#list self#vhdl_element_declaration_t a  in Record a
108
        | Enumerated a ->
109
            let a = self#list self#vhdl_name_t a  in Enumerated a
110
        | Void  -> Void
111
    method vhdl_element_declaration_t :
112
      vhdl_element_declaration_t -> vhdl_element_declaration_t=
113
      fun { names; definition }  ->
114
        let names = self#list self#vhdl_name_t names  in
115
        let definition = self#vhdl_subtype_indication_t definition  in
116
        { names; definition }
117
    method vhdl_subtype_indication_t :
118
      vhdl_subtype_indication_t -> vhdl_subtype_indication_t=
119
      fun { name; functionName; const }  ->
120
        let name = self#vhdl_name_t name  in
121
        let functionName = self#vhdl_name_t functionName  in
122
        let const = self#vhdl_constraint_t const  in
123
        { name; functionName; const }
124
    method vhdl_discrete_range_t :
125
      vhdl_discrete_range_t -> vhdl_discrete_range_t=
126
      fun x  ->
127
        match x with
128
        | SubDiscreteRange a ->
129
            let a = self#vhdl_subtype_indication_t a  in SubDiscreteRange a
130
        | NamedRange a -> let a = self#vhdl_name_t a  in NamedRange a
131
        | DirectedRange { direction; from; _to } ->
132
            let direction = self#string direction  in
133
            let from = self#vhdl_expr_t from  in
134
            let _to = self#vhdl_expr_t _to  in
135
            DirectedRange { direction; from; _to }
136

    
137
    method vhdl_constraint_t : vhdl_constraint_t -> vhdl_constraint_t=
138
      fun x  ->
139
        match x with
140
        | RefConstraint { ref_name } ->
141
            let ref_name = self#vhdl_name_t ref_name  in
142
            RefConstraint { ref_name }
143
        | RangeConstraint { range } ->
144
            let range = self#vhdl_discrete_range_t range  in
145
            RangeConstraint { range }
146
        | IndexConstraint { ranges } ->
147
            let ranges = self#list self#vhdl_discrete_range_t ranges  in
148
            IndexConstraint { ranges }
149
        | ArrayConstraint { ranges; sub } ->
150
            let ranges = self#list self#vhdl_discrete_range_t ranges  in
151
            let sub = self#vhdl_constraint_t sub  in
152
            ArrayConstraint { ranges; sub }
153
        | RecordConstraint  -> RecordConstraint
154
        | NoConstraint  -> NoConstraint
155

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

    
265
    method vhdl_type_attributes_t :
266
      'a .
267
        ('a -> 'a) -> 'a vhdl_type_attributes_t -> 'a vhdl_type_attributes_t=
268
      fun _basetype  ->
269
        fun x  ->
270
          match x with
271
          | TAttNoArg { id } -> let id = self#string id  in TAttNoArg { id }
272
          | TAttIntArg { id; arg } ->
273
              let id = self#string id  in
274
              let arg = self#int arg  in TAttIntArg { id; arg }
275
          | TAttValArg { id; arg } ->
276
              let id = self#string id  in
277
              let arg = _basetype arg  in TAttValArg { id; arg }
278
          | TAttStringArg { id; arg } ->
279
              let id = self#string id  in
280
              let arg = self#string arg  in TAttStringArg { id; arg }
281

    
282
    method vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t=
283
      fun { names; mode; typ; init_val }  ->
284
        let names = self#list self#vhdl_name_t names  in
285
        let mode = self#list self#string mode  in
286
        let typ = self#vhdl_subtype_indication_t typ  in
287
        let init_val = self#option self#vhdl_cst_val_t init_val  in
288
        { names; mode; typ; init_val }
289

    
290
    method vhdl_subprogram_spec_t :
291
      vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t=
292
      fun { name; typeMark; parameters; isPure }  ->
293
        let name = self#string name  in
294
        let typeMark = self#vhdl_name_t typeMark  in
295
        let parameters = self#list self#vhdl_parameter_t parameters  in
296
        let isPure = self#bool isPure  in
297
        { name; typeMark; parameters; isPure }
298

    
299
    method vhdl_sequential_stmt_t :
300
      vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t=
301
      fun x  ->
302
        match x with
303
        | VarAssign { label; lhs; rhs } ->
304
            let label = self#vhdl_name_t label  in
305
            let lhs = self#vhdl_name_t lhs  in
306
            let rhs = self#vhdl_expr_t rhs  in VarAssign { label; lhs; rhs }
307
        | SigSeqAssign { label; lhs; rhs } ->
308
            let label = self#vhdl_name_t label  in
309
            let lhs = self#vhdl_name_t lhs  in
310
            let rhs = self#list self#vhdl_expr_t rhs  in
311
            SigSeqAssign { label; lhs; rhs }
312
        | If { label; if_cases; default } ->
313
            let label = self#vhdl_name_t label  in
314
            let if_cases = self#list self#vhdl_if_case_t if_cases  in
315
            let default = self#list self#vhdl_sequential_stmt_t default  in
316
            If { label; if_cases; default }
317
        | Case { label; guard; branches } ->
318
            let label = self#vhdl_name_t label  in
319
            let guard = self#vhdl_expr_t guard  in
320
            let branches = self#list self#vhdl_case_item_t branches  in
321
            Case { label; guard; branches }
322
        | Exit { label; loop_label; condition } ->
323
            let label = self#vhdl_name_t label  in
324
            let loop_label = self#option self#string loop_label  in
325
            let condition = self#option self#vhdl_expr_t condition  in
326
            Exit { label; loop_label; condition }
327
        | Assert { label; cond; report; severity } ->
328
            let label = self#vhdl_name_t label  in
329
            let cond = self#vhdl_expr_t cond  in
330
            let report = self#vhdl_expr_t report  in
331
            let severity = self#vhdl_expr_t severity  in
332
            Assert { label; cond; report; severity }
333
        | ProcedureCall { label; name; assocs } ->
334
            let label = self#vhdl_name_t label  in
335
            let name = self#vhdl_name_t name  in
336
            let assocs = self#list self#vhdl_assoc_element_t assocs  in
337
            ProcedureCall { label; name; assocs }
338
        | Wait  -> Wait
339
        | Null { label } ->
340
            let label = self#vhdl_name_t label  in Null { label }
341
        | Return { label } ->
342
            let label = self#vhdl_name_t label  in Return { label }
343
    method vhdl_if_case_t : vhdl_if_case_t -> vhdl_if_case_t=
344
      fun { if_cond; if_block }  ->
345
        let if_cond = self#vhdl_expr_t if_cond  in
346
        let if_block = self#list self#vhdl_sequential_stmt_t if_block  in
347
        { if_cond; if_block }
348
    method vhdl_case_item_t : vhdl_case_item_t -> vhdl_case_item_t=
349
      fun { when_cond; when_stmt }  ->
350
        let when_cond = self#list self#vhdl_expr_t when_cond  in
351
        let when_stmt = self#list self#vhdl_sequential_stmt_t when_stmt  in
352
        { when_cond; when_stmt }
353

    
354
    method vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t=
355
      fun x  ->
356
        match x with
357
        | VarDecl { names; typ; init_val } ->
358
            let names = self#list self#vhdl_name_t names  in
359
            let typ = self#vhdl_subtype_indication_t typ  in
360
            let init_val = self#vhdl_expr_t init_val  in
361
            VarDecl { names; typ; init_val }
362
        | CstDecl { names; typ; init_val } ->
363
            let names = self#list self#vhdl_name_t names  in
364
            let typ = self#vhdl_subtype_indication_t typ  in
365
            let init_val = self#vhdl_expr_t init_val  in
366
            CstDecl { names; typ; init_val }
367
        | SigDecl { names; typ; init_val } ->
368
            let names = self#list self#vhdl_name_t names  in
369
            let typ = self#vhdl_subtype_indication_t typ  in
370
            let init_val = self#vhdl_expr_t init_val  in
371
            SigDecl { names; typ; init_val }
372
        | ComponentDecl { name; generics; ports } ->
373
            let name = self#vhdl_name_t name  in
374
            let generics = self#list self#vhdl_port_t generics  in
375
            let ports = self#list self#vhdl_port_t ports  in
376
            ComponentDecl { name; generics; ports }
377
        | Subprogram { name; kind; spec; decl_part; stmts } ->
378
            let name = self#string name  in
379
            let kind = self#string kind  in
380
            let spec = self#option self#vhdl_subprogram_spec_t spec  in
381
            let decl_part = self#list self#vhdl_declaration_t decl_part  in
382
            let stmts = self#list self#vhdl_sequential_stmt_t stmts  in
383
            Subprogram { name; kind; spec; decl_part; stmts }
384

    
385
    method vhdl_declarative_item_t :
386
      vhdl_declarative_item_t -> vhdl_declarative_item_t=
387
      fun { use_clause; declaration; definition }  ->
388
        let use_clause = self#option self#vhdl_load_t use_clause  in
389
        let declaration = self#option self#vhdl_declaration_t declaration  in
390
        let definition = self#option self#vhdl_definition_t definition  in
391
        { use_clause; declaration; definition }
392

    
393
    method vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t=
394
      fun { expr; cond }  ->
395
        let expr = self#list self#vhdl_expr_t expr  in
396
        let cond = self#vhdl_expr_t cond  in { expr; cond }
397

    
398
    method vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t=
399
      fun { expr; when_sel }  ->
400
        let expr = self#vhdl_expr_t expr  in
401
        let when_sel = self#list self#vhdl_expr_t when_sel  in
402
        { expr; when_sel }
403

    
404
    method vhdl_conditional_signal_t :
405
      vhdl_conditional_signal_t -> vhdl_conditional_signal_t=
406
      fun { postponed; label; lhs; rhs; cond; delay }  ->
407
        let postponed = self#bool postponed  in
408
        let label = self#vhdl_name_t label  in
409
        let lhs = self#vhdl_name_t lhs  in
410
        let rhs = self#list self#vhdl_signal_condition_t rhs  in
411
        let cond = self#vhdl_expr_t cond  in
412
        let delay = self#vhdl_expr_t delay  in
413
        { postponed; label; lhs; rhs; cond; delay }
414

    
415

    
416
    method vhdl_process_t : vhdl_process_t -> vhdl_process_t=
417
      fun { id; declarations; active_sigs; body }  ->
418
        let id = self#vhdl_name_t id  in
419
        let declarations = self#list self#vhdl_declarative_item_t declarations  in
420
        let active_sigs = self#list self#vhdl_name_t active_sigs  in
421
        let body = self#list self#vhdl_sequential_stmt_t body  in
422
        { id; declarations; active_sigs; body }
423

    
424
    method vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t=
425
      fun { postponed; label; lhs; sel; branches; delay }  ->
426
        let postponed = self#bool postponed  in
427
        let label = self#vhdl_name_t label  in
428
        let lhs = self#vhdl_name_t lhs  in
429
        let sel = self#vhdl_expr_t sel  in
430
        let branches = self#list self#vhdl_signal_selection_t branches  in
431
        let delay = self#option self#vhdl_expr_t delay  in
432
        { postponed; label; lhs; sel; branches; delay }
433

    
434
    method vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t=
435
      fun x  -> x
436

    
437
    method vhdl_component_instantiation_t :
438
      vhdl_component_instantiation_t -> vhdl_component_instantiation_t=
439
      fun { name; inst_unit; archi_name; generic_map; port_map }  ->
440
        let name = self#vhdl_name_t name  in
441
        let inst_unit = self#vhdl_name_t inst_unit  in
442
        let archi_name = self#option self#vhdl_name_t archi_name  in
443
        let generic_map = self#list self#vhdl_assoc_element_t generic_map  in
444
        let port_map = self#list self#vhdl_assoc_element_t port_map  in
445
        { name; inst_unit; archi_name; generic_map; port_map }
446

    
447
    method vhdl_concurrent_stmt_t :
448
      vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t=
449
      fun x  ->
450
        match x with
451
        | SigAssign a -> let a = self#vhdl_conditional_signal_t a  in SigAssign a
452
        | Process a -> let a = self#vhdl_process_t a  in Process a
453
        | SelectedSig a -> let a = self#vhdl_selected_signal_t a  in SelectedSig a
454
        | ComponentInst a -> let a = self#vhdl_component_instantiation_t a  in ComponentInst a 
455

    
456
    method vhdl_port_t : vhdl_port_t -> vhdl_port_t=
457
      fun { names; mode; typ; expr }  ->
458
        let names = self#list self#vhdl_name_t names  in
459
        let mode = self#vhdl_port_mode_t mode  in
460
        let typ = self#vhdl_subtype_indication_t typ  in
461
        let expr = self#vhdl_expr_t expr  in { names; mode; typ; expr }
462

    
463
    method vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t=
464
      fun { name; generics; ports; declaration; stmts }  ->
465
        let name = self#vhdl_name_t name  in
466
        let generics = self#list self#vhdl_port_t generics  in
467
        let ports = self#list self#vhdl_port_t ports  in
468
        let declaration = self#list self#vhdl_declarative_item_t declaration
469
           in
470
        let stmts = self#list self#vhdl_concurrent_stmt_t stmts  in
471
        { name; generics; ports; declaration; stmts }
472

    
473
    method vhdl_package_t : vhdl_package_t -> vhdl_package_t=
474
      fun { name; shared_defs; shared_decls }  ->
475
        let name = self#vhdl_name_t name  in
476
        let shared_defs = self#list self#vhdl_definition_t shared_defs  in
477
        let shared_decls = self#list self#vhdl_declaration_t shared_decls  in
478
        { name; shared_defs; shared_decls }
479

    
480
    method vhdl_load_t : vhdl_load_t -> vhdl_load_t=
481
      fun x  ->
482
        match x with
483
        | Library a -> let a = self#list self#vhdl_name_t a  in Library a
484
        | Use a -> let a = self#list self#vhdl_name_t a  in Use a
485

    
486
    method vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t=
487
      fun { name; entity; declarations; body }  ->
488
        let name = self#vhdl_name_t name  in
489
        let entity = self#vhdl_name_t entity  in
490
        let declarations = self#list self#vhdl_declarative_item_t declarations  in
491
        let body = self#list self#vhdl_concurrent_stmt_t body  in
492
        { name; entity; declarations; body }
493

    
494
    method vhdl_configuration_t :
495
      vhdl_configuration_t -> vhdl_configuration_t= self#unit
496

    
497
    method vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t=
498
      fun x  ->
499
        match x with
500
        | Package a -> let a = self#vhdl_package_t a  in Package a
501
        | Entities a -> let a = self#vhdl_entity_t a  in Entities a
502
        | Architecture a ->
503
            let a = self#vhdl_architecture_t a  in Architecture a
504
        | Configuration a ->
505
            let a = self#vhdl_configuration_t a  in Configuration a
506

    
507
    method vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t=
508
      fun { contexts; library }  ->
509
        let contexts = self#list self#vhdl_load_t contexts  in
510
        let library = self#vhdl_library_unit_t library  in
511
        { contexts; library }
512

    
513
    method vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t=
514
      fun { design_units }  ->
515
        let design_units = self#list self#vhdl_design_unit_t design_units  in
516
        { design_units }
517

    
518
    method vhdl_file_t : vhdl_file_t -> vhdl_file_t=
519
      fun { design_file }  ->
520
        let design_file = self#vhdl_design_file_t design_file  in
521
        { design_file }
522
  end
(3-3/6)