Project

General

Profile

Download (25.7 KB) Statistics
| Branch: | Tag: | Revision:
1
open Vhdl_ast
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_waveform_element_t)  -> ()
28
let _ = fun (_ : vhdl_signal_condition_t)  -> () 
29
let _ = fun (_ : vhdl_conditional_signal_t)  -> () 
30
let _ = fun (_ : vhdl_process_t)  -> () 
31
let _ = fun (_ : vhdl_selected_signal_t)  -> () 
32
let _ = fun (_ : vhdl_port_mode_t)  -> () 
33
let _ = fun (_ : vhdl_component_instantiation_t)  -> ()
34
let _ = fun (_ : vhdl_concurrent_stmt_t)  -> () 
35
let _ = fun (_ : vhdl_port_t)  -> () 
36
let _ = fun (_ : vhdl_entity_t)  -> () 
37
let _ = fun (_ : vhdl_package_t)  -> () 
38
let _ = fun (_ : vhdl_load_t)  -> () 
39
let _ = fun (_ : vhdl_architecture_t)  -> () 
40
let _ = fun (_ : vhdl_configuration_t)  -> () 
41
let _ = fun (_ : vhdl_library_unit_t)  -> () 
42
let _ = fun (_ : vhdl_design_unit_t)  -> () 
43
let _ = fun (_ : vhdl_design_file_t)  -> () 
44
let _ = fun (_ : vhdl_file_t)  -> () 
45

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

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

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

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

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

    
272
    method vhdl_type_attributes_t :
273
      'a .
274
        ('a -> 'a) -> 'a vhdl_type_attributes_t -> 'a vhdl_type_attributes_t=
275
      fun _basetype  ->
276
        fun x  ->
277
          match x with
278
          | TAttNoArg { id } -> let id = self#string id  in TAttNoArg { id }
279
          | TAttIntArg { id; arg } ->
280
              let id = self#string id  in
281
              let arg = self#int arg  in TAttIntArg { id; arg }
282
          | TAttValArg { id; arg } ->
283
              let id = self#string id  in
284
              let arg = _basetype arg  in TAttValArg { id; arg }
285
          | TAttStringArg { id; arg } ->
286
              let id = self#string id  in
287
              let arg = self#string arg  in TAttStringArg { id; arg }
288

    
289
    method vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t=
290
      fun { names; mode; typ; init_val }  ->
291
        let names = self#list self#vhdl_name_t names  in
292
        let mode = self#list self#string mode  in
293
        let typ = self#vhdl_subtype_indication_t typ  in
294
        let init_val = self#option self#vhdl_cst_val_t init_val  in
295
        { names; mode; typ; init_val }
296

    
297
    method vhdl_subprogram_spec_t :
298
      vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t=
299
      fun { name; subprogram_type; typeMark; parameters; isPure }  ->
300
        let name = self#string name  in
301
        let subprogram_type = self#string subprogram_type  in
302
        let typeMark = self#vhdl_name_t typeMark  in
303
        let parameters = self#list self#vhdl_parameter_t parameters  in
304
        let isPure = self#bool isPure  in
305
        { name; subprogram_type; typeMark; parameters; isPure }
306

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

    
364
    method vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t=
365
      fun x  ->
366
        match x with
367
        | VarDecl { 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
            VarDecl { names; typ; init_val }
372
        | CstDecl { names; typ; init_val } ->
373
            let names = self#list self#vhdl_name_t names  in
374
            let typ = self#vhdl_subtype_indication_t typ  in
375
            let init_val = self#vhdl_expr_t init_val  in
376
            CstDecl { names; typ; init_val }
377
        | SigDecl { names; typ; init_val } ->
378
            let names = self#list self#vhdl_name_t names  in
379
            let typ = self#vhdl_subtype_indication_t typ  in
380
            let init_val = self#vhdl_expr_t init_val  in
381
            SigDecl { names; typ; init_val }
382
        | ComponentDecl { name; generics; ports } ->
383
            let name = self#vhdl_name_t name  in
384
            let generics = self#list self#vhdl_port_t generics  in
385
            let ports = self#list self#vhdl_port_t ports  in
386
            ComponentDecl { name; generics; ports }
387
        | Subprogram { spec; decl_part; stmts } ->
388
            let spec = self#vhdl_subprogram_spec_t spec  in
389
            let decl_part = self#list self#vhdl_declaration_t decl_part  in
390
            let stmts = self#list self#vhdl_sequential_stmt_t stmts  in
391
            Subprogram { spec; decl_part; stmts }
392

    
393
    method vhdl_declarative_item_t :
394
      vhdl_declarative_item_t -> vhdl_declarative_item_t=
395
      fun { use_clause; declaration; definition }  ->
396
        let use_clause = self#option self#vhdl_load_t use_clause  in
397
        let declaration = self#option self#vhdl_declaration_t declaration  in
398
        let definition = self#option self#vhdl_definition_t definition  in
399
        { use_clause; declaration; definition }
400

    
401
    method vhdl_waveform_element_t :
402
      vhdl_waveform_element_t -> vhdl_waveform_element_t=
403
      fun { value; delay }  ->
404
        let value = self#option self#vhdl_expr_t value  in
405
        let delay = self#option self#vhdl_expr_t delay  in { value; delay }
406

    
407
    method vhdl_signal_condition_t :
408
      vhdl_signal_condition_t -> vhdl_signal_condition_t=
409
      fun { expr; cond }  ->
410
        let expr = self#list self#vhdl_waveform_element_t expr  in
411
        let cond = self#option self#vhdl_expr_t cond  in { expr; cond }
412

    
413
    method vhdl_signal_selection_t :
414
      vhdl_signal_selection_t -> vhdl_signal_selection_t=
415
      fun { expr; when_sel }  ->
416
        let expr = self#list self#vhdl_waveform_element_t expr  in
417
        let when_sel = self#list self#vhdl_expr_t when_sel  in
418
        { expr; when_sel }
419

    
420
    method vhdl_conditional_signal_t :
421
      vhdl_conditional_signal_t -> vhdl_conditional_signal_t=
422
      fun { postponed; label; lhs; rhs; delay }  ->
423
        let postponed = self#bool postponed  in
424
        let label = self#vhdl_name_t label  in
425
        let lhs = self#vhdl_name_t lhs  in
426
        let rhs = self#list self#vhdl_signal_condition_t rhs  in
427
        let delay = self#vhdl_expr_t delay  in
428
        { postponed; label; lhs; rhs; delay }
429

    
430
    method vhdl_process_t : vhdl_process_t -> vhdl_process_t=
431
      fun { id; declarations; active_sigs; body }  ->
432
        let id = self#vhdl_name_t id  in
433
        let declarations = self#list self#vhdl_declarative_item_t declarations  in
434
        let active_sigs = self#list self#vhdl_name_t active_sigs  in
435
        let body = self#list self#vhdl_sequential_stmt_t body  in
436
        { id; declarations; active_sigs; body }
437

    
438
    method vhdl_selected_signal_t :
439
      vhdl_selected_signal_t -> vhdl_selected_signal_t=
440
      fun { postponed; label; lhs; sel; branches; delay }  ->
441
        let postponed = self#bool postponed  in
442
        let label = self#vhdl_name_t label  in
443
        let lhs = self#vhdl_name_t lhs  in
444
        let sel = self#vhdl_expr_t sel  in
445
        let branches = self#list self#vhdl_signal_selection_t branches  in
446
        let delay = self#option self#vhdl_expr_t delay  in
447
        { postponed; label; lhs; sel; branches; delay }
448

    
449
    method vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t=
450
      fun x  -> x
451

    
452
    method vhdl_component_instantiation_t :
453
      vhdl_component_instantiation_t -> vhdl_component_instantiation_t=
454
        fun { name; inst_unit; inst_unit_type; archi_name; generic_map; port_map }  ->
455
        let name = self#vhdl_name_t name  in
456
        let inst_unit = self#vhdl_name_t inst_unit  in
457
        let inst_unit_type = self#string inst_unit_type  in
458
        let archi_name = self#option self#vhdl_name_t archi_name  in
459
        let generic_map = self#list self#vhdl_assoc_element_t generic_map  in
460
        let port_map = self#list self#vhdl_assoc_element_t port_map  in
461
        { name; inst_unit; inst_unit_type; archi_name; generic_map; port_map }
462

    
463
    method vhdl_concurrent_stmt_t :
464
      vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t=
465
      fun x  ->
466
        match x with
467
        | SigAssign a -> let a = self#vhdl_conditional_signal_t a  in SigAssign a
468
        | Process a -> let a = self#vhdl_process_t a  in Process a
469
        | SelectedSig a -> let a = self#vhdl_selected_signal_t a  in SelectedSig a
470
        | ComponentInst a -> let a = self#vhdl_component_instantiation_t a  in ComponentInst a 
471

    
472
    method vhdl_port_t : vhdl_port_t -> vhdl_port_t=
473
      fun { names; mode; typ; expr }  ->
474
        let names = self#list self#vhdl_name_t names  in
475
        let mode = self#vhdl_port_mode_t mode  in
476
        let typ = self#vhdl_subtype_indication_t typ  in
477
        let expr = self#vhdl_expr_t expr  in { names; mode; typ; expr }
478

    
479
    method vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t=
480
      fun { name; generics; ports; declaration; stmts }  ->
481
        let name = self#vhdl_name_t name  in
482
        let generics = self#list self#vhdl_port_t generics  in
483
        let ports = self#list self#vhdl_port_t ports  in
484
        let declaration = self#list self#vhdl_declarative_item_t declaration
485
           in
486
        let stmts = self#list self#vhdl_concurrent_stmt_t stmts  in
487
        { name; generics; ports; declaration; stmts }
488

    
489
    method vhdl_package_t : vhdl_package_t -> vhdl_package_t=
490
      fun { name; shared_defs; shared_decls; shared_uses }  ->
491
        let name = self#vhdl_name_t name  in
492
        let shared_defs = self#list self#vhdl_definition_t shared_defs  in
493
        let shared_decls = self#list self#vhdl_declaration_t shared_decls  in
494
        let shared_uses = self#list self#vhdl_load_t shared_uses  in
495
        { name; shared_defs; shared_decls; shared_uses }
496

    
497
    method vhdl_load_t : vhdl_load_t -> vhdl_load_t=
498
      fun x  ->
499
        match x with
500
        | Library a -> let a = self#list self#vhdl_name_t a  in Library a
501
        | Use a -> let a = self#list self#vhdl_name_t a  in Use a
502

    
503
    method vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t=
504
      fun { name; entity; declarations; body }  ->
505
        let name = self#vhdl_name_t name  in
506
        let entity = self#vhdl_name_t entity  in
507
        let declarations = self#list self#vhdl_declarative_item_t declarations  in
508
        let body = self#list self#vhdl_concurrent_stmt_t body  in
509
        { name; entity; declarations; body }
510

    
511
    method vhdl_configuration_t :
512
      vhdl_configuration_t -> vhdl_configuration_t= self#unit
513

    
514
    method vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t=
515
      fun x  ->
516
        match x with
517
        | Package a -> let a = self#vhdl_package_t a  in Package a
518
        | Entities a -> let a = self#vhdl_entity_t a  in Entities a
519
        | Architecture a ->
520
            let a = self#vhdl_architecture_t a  in Architecture a
521
        | Configuration a ->
522
            let a = self#vhdl_configuration_t a  in Configuration a
523

    
524
    method vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t=
525
      fun { contexts; library }  ->
526
        let contexts = self#list self#vhdl_load_t contexts  in
527
        let library = self#vhdl_library_unit_t library  in
528
        { contexts; library }
529

    
530
    method vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t=
531
      fun { design_units }  ->
532
        let design_units = self#list self#vhdl_design_unit_t design_units  in
533
        { design_units }
534

    
535
    method vhdl_file_t : vhdl_file_t -> vhdl_file_t=
536
      fun { design_file }  ->
537
        let design_file = self#vhdl_design_file_t design_file  in
538
        { design_file }
539
  end
(5-5/10)