Project

General

Profile

Revision f779d524

View differences:

src/backends/VHDL/vhdl_ast_deriving.ml
14 14
  | CstStdLogic of string 
15 15
  | CstLiteral of string [@name "CST_LITERAL"]
16 16

  
17
(* Adapted *)
17 18
let rec (pp_vhdl_cst_val_t :
18 19
          Format.formatter -> vhdl_cst_val_t -> Ppx_deriving_runtime.unit)
19 20
  =
......
21 22
      fun fmt  ->
22 23
        function
23 24
        | CstInt a0 ->
24
            (Format.fprintf fmt "(@[<2>CstInt@ ";
25 25
             (Format.fprintf fmt "%d") a0;
26
             Format.fprintf fmt "@])")
27 26
        | CstStdLogic a0 ->
28
            (Format.fprintf fmt "(@[<2>CstStdLogic@ ";
29 27
             (Format.fprintf fmt "%S") a0;
30
             Format.fprintf fmt "@])")
31 28
        | CstLiteral a0 ->
32
            (Format.fprintf fmt "(@[<2>CstLiteral@ ";
33
             (Format.fprintf fmt "%S") a0;
34
             Format.fprintf fmt "@])"))
29
             (Format.fprintf fmt "%s") a0;)
35 30
  [@ocaml.warning "-A"])
36 31

  
37 32
and show_vhdl_cst_val_t : vhdl_cst_val_t -> Ppx_deriving_runtime.string =
......
186 181
      fun fmt  ->
187 182
        function
188 183
        | Base a0 ->
189
            (Format.fprintf fmt "(@[<2>Base@ ";
190
             (Format.fprintf fmt "%S") a0;
191
             Format.fprintf fmt "@])")
184
             (Format.fprintf fmt "%s") a0;
192 185
        | Range (a0,a1,a2) ->
193
            (Format.fprintf fmt "(@[<2>Range (@,";
194
             ((((function
186
             ((
187
               (Format.fprintf fmt "%d") a1);
188
               ((function
195 189
                 | None  -> Format.pp_print_string fmt "None"
196 190
                 | Some x ->
197
                     (Format.pp_print_string fmt "(Some ";
198 191
                      (Format.fprintf fmt "%S") x;
199
                      Format.pp_print_string fmt ")"))) a0;
200
               Format.fprintf fmt ",@ ";
201
               (Format.fprintf fmt "%d") a1);
202
              Format.fprintf fmt ",@ ";
192
                      )) a0;
203 193
              (Format.fprintf fmt "%d") a2);
204
             Format.fprintf fmt "@,))@]")
205 194
        | Bit_vector (a0,a1) ->
206
            (Format.fprintf fmt "(@[<2>Bit_vector (@,";
207
             ((Format.fprintf fmt "%d") a0;
208
              Format.fprintf fmt ",@ ";
209
              (Format.fprintf fmt "%d") a1);
210
             Format.fprintf fmt "@,))@]")
195
             (Format.fprintf fmt "%d .. %d") a0 a1;
211 196
        | Array (a0,a1,a2) ->
212
            (Format.fprintf fmt "(@[<2>Array (@,";
213
             (((Format.fprintf fmt "%d") a0;
214
               Format.fprintf fmt ",@ ";
215
               (Format.fprintf fmt "%d") a1);
216
              Format.fprintf fmt ",@ ";
217
              ((__0 ()) fmt) a2);
218
             Format.fprintf fmt "@,))@]")
197
             (((__0 ()) fmt) a2;
198
              (Format.fprintf fmt "[%d,%d]") a0 a1);
219 199
        | Enumerated a0 ->
220
            (Format.fprintf fmt "(@[<2>Enumerated@ ";
221 200
             ((fun x  ->
222 201
                 Format.fprintf fmt "@[<2>[";
223 202
                 ignore
......
228 207
                           (Format.fprintf fmt "%S") x;
229 208
                           true) false x);
230 209
                 Format.fprintf fmt "@,]@]")) a0;
231
             Format.fprintf fmt "@])")
232 210
        | Void  -> Format.pp_print_string fmt "Void")
233 211
    [@ocaml.warning "-A"])
234 212

  
235 213
and show_vhdl_type_t : vhdl_type_t -> Ppx_deriving_runtime.string =
236 214
  fun x  -> Format.asprintf "%a" pp_vhdl_type_t x
237 215

  
216
(* Adapted *)
238 217
and pp_vhdl_subtype_indication_t :
239 218
  Format.formatter -> vhdl_subtype_indication_t -> Ppx_deriving_runtime.unit
240 219
  =
......
247 226
  ((let open! Ppx_deriving_runtime in
248 227
      fun fmt  ->
249 228
        fun x  ->
250
          Format.fprintf fmt "@[<2>{ ";
251
          (((Format.fprintf fmt "@[%s =@ " "name";
252
             ((__0 ()) fmt) x.name;
253
             Format.fprintf fmt "@]");
254
            Format.fprintf fmt ";@ ";
255
            Format.fprintf fmt "@[%s =@ " "functionName";
256
            ((__1 ()) fmt) x.functionName;
257
            Format.fprintf fmt "@]");
258
           Format.fprintf fmt ";@ ";
259
           Format.fprintf fmt "@[%s =@ " "const";
260
           ((__2 ()) fmt) x.const;
261
           Format.fprintf fmt "@]");
262
          Format.fprintf fmt "@ }@]")
229
          ((__0 ()) fmt) x.name;
230
          ((__1 ()) fmt) x.functionName;
231
          Format.fprintf fmt " ";
232
          ((__2 ()) fmt) x.const;
233
    )
263 234
    [@ocaml.warning "-A"])
264 235

  
265 236
and show_vhdl_subtype_indication_t :
266 237
  vhdl_subtype_indication_t -> Ppx_deriving_runtime.string =
267 238
  fun x  -> Format.asprintf "%a" pp_vhdl_subtype_indication_t x
268 239

  
240
(* Adapted *)
269 241
and pp_vhdl_discrete_range_t :
270 242
  Format.formatter -> vhdl_discrete_range_t -> Ppx_deriving_runtime.unit =
271 243
  let __3 () = pp_vhdl_expr_t
......
280 252
      fun fmt  ->
281 253
        function
282 254
        | SubDiscreteRange a0 ->
283
            (Format.fprintf fmt "(@[<2>SubDiscreteRange@ ";
284 255
             ((__0 ()) fmt) a0;
285
             Format.fprintf fmt "@])")
286 256
        | NamedRange a0 ->
287
            (Format.fprintf fmt "(@[<2>NamedRange@ ";
288 257
             ((__1 ()) fmt) a0;
289
             Format.fprintf fmt "@])")
290 258
        | DirectedRange { direction = adirection; from = afrom; _to = a_to }
291 259
            ->
292
            (Format.fprintf fmt "@[<2>DirectedRange {@,";
293
             (((Format.fprintf fmt "@[%s =@ " "direction";
294
                (Format.fprintf fmt "%S") adirection;
295
                Format.fprintf fmt "@]");
296
               Format.fprintf fmt ";@ ";
297
               Format.fprintf fmt "@[%s =@ " "from";
298 260
               ((__2 ()) fmt) afrom;
299
               Format.fprintf fmt "@]");
300
              Format.fprintf fmt ";@ ";
301
              Format.fprintf fmt "@[%s =@ " "_to";
302
              ((__3 ()) fmt) a_to;
303
              Format.fprintf fmt "@]");
304
             Format.fprintf fmt "@]}"))
261
               (Format.fprintf fmt " %s ") adirection;
262
               ((__3 ()) fmt) a_to;
263
    )
305 264
    [@ocaml.warning "-A"])
306 265

  
307 266
and show_vhdl_discrete_range_t :
308 267
  vhdl_discrete_range_t -> Ppx_deriving_runtime.string =
309 268
  fun x  -> Format.asprintf "%a" pp_vhdl_discrete_range_t x
310 269

  
270
(* Requires adaptation for: ArrayConstraint, RecordConstraint *)
311 271
and pp_vhdl_constraint_t :
312 272
  Format.formatter -> vhdl_constraint_t -> Ppx_deriving_runtime.unit =
313 273
  let __4 () = pp_vhdl_constraint_t
......
324 284
      fun fmt  ->
325 285
        function
326 286
        | RefConstraint { ref_name = aref_name } ->
327
            (Format.fprintf fmt "@[<2>RefConstraint {@,";
328
             (Format.fprintf fmt "@[%s =@ " "ref_name";
287
             (Format.fprintf fmt "(";
329 288
              ((__0 ()) fmt) aref_name;
330
              Format.fprintf fmt "@]");
331
             Format.fprintf fmt "@]}")
289
              Format.fprintf fmt ")");
332 290
        | RangeConstraint { range = arange } ->
333
            (Format.fprintf fmt "@[<2>RangeConstraint {@,";
334
             (Format.fprintf fmt "@[%s =@ " "range";
291
             (Format.fprintf fmt "(";
335 292
              ((__1 ()) fmt) arange;
336
              Format.fprintf fmt "@]");
337
             Format.fprintf fmt "@]}")
293
              Format.fprintf fmt ")");
338 294
        | IndexConstraint { ranges = aranges } ->
339
            (Format.fprintf fmt "@[<2>IndexConstraint {@,";
340
             (Format.fprintf fmt "@[%s =@ " "ranges";
341
              ((fun x  ->
342
                  Format.fprintf fmt "@[<2>[";
343
                  ignore
344
                    (List.fold_left
345
                       (fun sep  ->
346
                          fun x  ->
347
                            if sep then Format.fprintf fmt ";@ ";
348
                            ((__2 ()) fmt) x;
349
                            true) false x);
350
                  Format.fprintf fmt "@,]@]")) aranges;
351
              Format.fprintf fmt "@]");
352
             Format.fprintf fmt "@]}")
295
            Format.fprintf fmt "(";
296
            ((fun x  ->
297
                ignore
298
                  (List.fold_left
299
                     (fun sep  ->
300
                        fun x  ->
301
                          if sep then Format.fprintf fmt ", ";
302
                          ((__2 ()) fmt) x;
303
                          true) false x))) aranges;
304
            Format.fprintf fmt ")";
353 305
        | ArrayConstraint { ranges = aranges; sub = asub } ->
354 306
            (Format.fprintf fmt "@[<2>ArrayConstraint {@,";
355 307
             ((Format.fprintf fmt "@[%s =@ " "ranges";
......
369 321
              ((__4 ()) fmt) asub;
370 322
              Format.fprintf fmt "@]");
371 323
             Format.fprintf fmt "@]}")
372
        | RecordConstraint  -> Format.pp_print_string fmt "RecordConstraint"
373
        | NoConstraint  -> Format.pp_print_string fmt "NoConstraint")
324
        | RecordConstraint  -> Format.pp_print_string fmt ""
325
        | NoConstraint  -> Format.pp_print_string fmt "")
374 326
    [@ocaml.warning "-A"])
375 327

  
376 328
and show_vhdl_constraint_t : vhdl_constraint_t -> Ppx_deriving_runtime.string
......
390 342
      fun fmt  ->
391 343
        function
392 344
        | Type { name = aname; definition = adefinition } ->
393
            (Format.fprintf fmt "@[<2>Type {@,";
394
             ((Format.fprintf fmt "@[%s =@ " "name";
395
               ((__0 ()) fmt) aname;
396
               Format.fprintf fmt "@]");
397
              Format.fprintf fmt ";@ ";
398
              Format.fprintf fmt "@[%s =@ " "definition";
399
              ((__1 ()) fmt) adefinition;
400
              Format.fprintf fmt "@]");
401
             Format.fprintf fmt "@]}")
345
            Format.fprintf fmt "@[<2>type ";
346
            ((__0 ()) fmt) aname;
347
            Format.fprintf fmt " is ";
348
            ((__1 ()) fmt) adefinition;
349
            Format.fprintf fmt "@]}";
402 350
        | Subtype { name = aname; typ = atyp } ->
403
            (Format.fprintf fmt "@[<2>Subtype {@,";
404
             ((Format.fprintf fmt "@[%s =@ " "name";
405
               ((__2 ()) fmt) aname;
406
               Format.fprintf fmt "@]");
407
              Format.fprintf fmt ";@ ";
408
              Format.fprintf fmt "@[%s =@ " "typ";
409
              ((__3 ()) fmt) atyp;
410
              Format.fprintf fmt "@]");
411
             Format.fprintf fmt "@]}"))
351
            Format.fprintf fmt "@[<2>subtype ";
352
            ((__2 ()) fmt) aname;
353
            Format.fprintf fmt " is ";
354
            ((__3 ()) fmt) atyp;
355
            Format.fprintf fmt "@]";
356
   )
412 357
    [@ocaml.warning "-A"])
413 358

  
414 359
and show_vhdl_definition_t : vhdl_definition_t -> Ppx_deriving_runtime.string
415 360
  = fun x  -> Format.asprintf "%a" pp_vhdl_definition_t x
416 361

  
362
(* adaptation to be provided for Op, Time, Sig, suffixMod, Aggregate,  *)
417 363
and pp_vhdl_expr_t :
418 364
  Format.formatter -> vhdl_expr_t -> Ppx_deriving_runtime.unit =
419 365
  let __7 () = pp_vhdl_element_assoc_t
......
436 382
      fun fmt  ->
437 383
        function
438 384
        | Call a0 ->
439
            (Format.fprintf fmt "(@[<2>Call@ ";
440 385
             ((__0 ()) fmt) a0;
441
             Format.fprintf fmt "@])")
442 386
        | Cst a0 ->
443
            (Format.fprintf fmt "(@[<2>Cst@ ";
444 387
             ((__1 ()) fmt) a0;
445
             Format.fprintf fmt "@])")
446 388
        | Op { id = aid; args = aargs } ->
389
            (match aargs with
390
            | [] -> (Format.fprintf fmt "%s") aid;
391
            | hd::[] ->
392
               (Format.fprintf fmt "%s") aid;
393
               ((__2 ()) fmt) hd
394
            | hd::(hd2::[]) -> 
395
               ((__2 ()) fmt) hd;
396
               (Format.fprintf fmt " %s ") aid;
397
               ((__2 ()) fmt) hd2
398
            | _ ->
447 399
            (Format.fprintf fmt "@[<2>Op {@,";
448 400
             ((Format.fprintf fmt "@[%s =@ " "id";
449 401
               (Format.fprintf fmt "%S") aid;
......
461 413
                            true) false x);
462 414
                  Format.fprintf fmt "@,]@]")) aargs;
463 415
              Format.fprintf fmt "@]");
464
             Format.fprintf fmt "@]}")
465
        | IsNull  -> Format.pp_print_string fmt "IsNull"
416
             Format.fprintf fmt "@]}"))
417
        | IsNull  -> Format.pp_print_string fmt ""
466 418
        | Time { value = avalue; phy_unit = aphy_unit } ->
467 419
            (Format.fprintf fmt "@[<2>Time {@,";
468 420
             ((Format.fprintf fmt "@[%s =@ " "value";
......
513 465
                  Format.fprintf fmt "@,]@]")) aelems;
514 466
              Format.fprintf fmt "@]");
515 467
             Format.fprintf fmt "@]}")
516
        | Others  -> Format.pp_print_string fmt "Others")
468
        | Others  -> Format.pp_print_string fmt "others")
517 469
    [@ocaml.warning "-A"])
518 470

  
519 471
and show_vhdl_expr_t : vhdl_expr_t -> Ppx_deriving_runtime.string =
520 472
  fun x  -> Format.asprintf "%a" pp_vhdl_expr_t x
521 473

  
474
(* Missing adaptation for : Function *)
522 475
and pp_vhdl_name_t :
523 476
  Format.formatter -> vhdl_name_t -> Ppx_deriving_runtime.unit =
524 477
  let __9 () = pp_vhdl_assoc_element_t
......
545 498
      fun fmt  ->
546 499
        function
547 500
        | Simple a0 ->
548
            (Format.fprintf fmt "(@[<2>Simple@ ";
549
             (Format.fprintf fmt "%S") a0;
550
             Format.fprintf fmt "@])")
501
             (Format.fprintf fmt "%s") a0;
551 502
        | Identifier a0 ->
552
            (Format.fprintf fmt "(@[<2>Identifier@ ";
553
             (Format.fprintf fmt "%S") a0;
554
             Format.fprintf fmt "@])")
503
             (Format.fprintf fmt "%s") a0;
555 504
        | Selected a0 ->
556
            (Format.fprintf fmt "(@[<2>Selected@ ";
557 505
             ((fun x  ->
558
                 Format.fprintf fmt "@[<2>[";
559 506
                 ignore
560 507
                   (List.fold_left
561 508
                      (fun sep  ->
562 509
                         fun x  ->
563
                           if sep then Format.fprintf fmt ";@ ";
510
                           if sep then Format.fprintf fmt ".";
564 511
                           ((__0 ()) fmt) x;
565
                           true) false x);
566
                 Format.fprintf fmt "@,]@]")) a0;
567
             Format.fprintf fmt "@])")
512
                           true) false x);) a0;)
568 513
        | Index { id = aid; exprs = aexprs } ->
569
            (Format.fprintf fmt "@[<2>Index {@,";
570
             ((Format.fprintf fmt "@[%s =@ " "id";
571
               ((__1 ()) fmt) aid;
572
               Format.fprintf fmt "@]");
573
              Format.fprintf fmt ";@ ";
574
              Format.fprintf fmt "@[%s =@ " "exprs";
575
              ((fun x  ->
576
                  Format.fprintf fmt "@[<2>[";
577
                  ignore
578
                    (List.fold_left
579
                       (fun sep  ->
580
                          fun x  ->
581
                            if sep then Format.fprintf fmt ";@ ";
582
                            ((__2 ()) fmt) x;
583
                            true) false x);
584
                  Format.fprintf fmt "@,]@]")) aexprs;
585
              Format.fprintf fmt "@]");
586
             Format.fprintf fmt "@]}")
514
            ((__1 ()) fmt) aid;
515
            Format.fprintf fmt "(";
516
            (fun x  ->
517
                ignore
518
                (List.fold_left
519
                  (fun sep  ->
520
                    fun x  ->
521
                      if sep then Format.fprintf fmt ",@ ";
522
                                  ((__2 ()) fmt) x;
523
                                  true
524
                  ) false x);
525
            ) aexprs;
526
            Format.fprintf fmt ")";
587 527
        | Slice { id = aid; range = arange } ->
588
            (Format.fprintf fmt "@[<2>Slice {@,";
589
             ((Format.fprintf fmt "@[%s =@ " "id";
590
               ((__3 ()) fmt) aid;
591
               Format.fprintf fmt "@]");
592
              Format.fprintf fmt ";@ ";
593
              Format.fprintf fmt "@[%s =@ " "range";
528
              ((__3 ()) fmt) aid;
529
              Format.fprintf fmt "(";
594 530
              ((__4 ()) fmt) arange;
595
              Format.fprintf fmt "@]");
596
             Format.fprintf fmt "@]}")
531
              Format.fprintf fmt ")";
597 532
        | Attribute { id = aid; designator = adesignator; expr = aexpr } ->
598
            (Format.fprintf fmt "@[<2>Attribute {@,";
599
             (((Format.fprintf fmt "@[%s =@ " "id";
600
                ((__5 ()) fmt) aid;
601
                Format.fprintf fmt "@]");
602
               Format.fprintf fmt ";@ ";
603
               Format.fprintf fmt "@[%s =@ " "designator";
604
               ((__6 ()) fmt) adesignator;
605
               Format.fprintf fmt "@]");
606
              Format.fprintf fmt ";@ ";
607
              Format.fprintf fmt "@[%s =@ " "expr";
608
              ((__7 ()) fmt) aexpr;
609
              Format.fprintf fmt "@]");
610
             Format.fprintf fmt "@]}")
533
              ((__5 ()) fmt) aid;
534
              Format.fprintf fmt "\'";
535
              ((__6 ()) fmt) adesignator;
536
              (match aexpr with
537
              | IsNull -> Format.fprintf fmt "";
538
              | _ ->
539
                Format.fprintf fmt "(";
540
                ((__7 ()) fmt) aexpr;
541
                Format.fprintf fmt ")")
611 542
        | Function { id = aid; assoc_list = aassoc_list } ->
612 543
            (Format.fprintf fmt "@[<2>Function {@,";
613 544
             ((Format.fprintf fmt "@[%s =@ " "id";
......
627 558
                  Format.fprintf fmt "@,]@]")) aassoc_list;
628 559
              Format.fprintf fmt "@]");
629 560
             Format.fprintf fmt "@]}")
630
        | NoName  -> Format.pp_print_string fmt "NoName")
561
        | NoName  -> Format.pp_print_string fmt "")
631 562
    [@ocaml.warning "-A"])
632 563

  
633 564
and show_vhdl_name_t : vhdl_name_t -> Ppx_deriving_runtime.string =
......
2785 2716
      fun fmt  ->
2786 2717
        function
2787 2718
        | VarAssign { label = alabel; lhs = alhs; rhs = arhs } ->
2719
            (match alabel with
2720
              | NoName -> Format.fprintf fmt "";
2721
              | _ -> (((__0 ()) fmt) alabel;
2722
                     Format.fprintf fmt ":@ ")
2723
            );
2724
            Format.fprintf fmt "@[<2>";
2725
            ((__1 ()) fmt) alhs;
2726
            Format.fprintf fmt "@ :=@ ";
2727
            ((__2 ()) fmt) arhs;
2728
            Format.fprintf fmt "@]";
2729
(* TODO: Check
2788 2730
            (Format.fprintf fmt "@[<2>VarAssign {@,";
2789 2731
             (((Format.fprintf fmt "@[%s =@ " "label";
2790 2732
                ((__0 ()) fmt) alabel;
......
2797 2739
              Format.fprintf fmt "@[%s =@ " "rhs";
2798 2740
              ((__2 ()) fmt) arhs;
2799 2741
              Format.fprintf fmt "@]");
2800
             Format.fprintf fmt "@]}")
2742
             Format.fprintf fmt "@]}") *)
2801 2743
        | SigSeqAssign { label = alabel; lhs = alhs; rhs = arhs } ->
2802
            (Format.fprintf fmt "@[<2>SigSeqAssign {@,";
2803
             (((Format.fprintf fmt "@[%s =@ " "label";
2804
                ((__3 ()) fmt) alabel;
2805
                Format.fprintf fmt "@]");
2806
               Format.fprintf fmt ";@ ";
2807
               Format.fprintf fmt "@[%s =@ " "lhs";
2808
               ((__4 ()) fmt) alhs;
2809
               Format.fprintf fmt "@]");
2810
              Format.fprintf fmt ";@ ";
2811
              Format.fprintf fmt "@[%s =@ " "rhs";
2812
              ((fun x  ->
2813
                  Format.fprintf fmt "@[<2>[";
2814
                  ignore
2815
                    (List.fold_left
2816
                       (fun sep  ->
2817
                          fun x  ->
2818
                            if sep then Format.fprintf fmt ";@ ";
2819
                            ((__5 ()) fmt) x;
2820
                            true) false x);
2821
                  Format.fprintf fmt "@,]@]")) arhs;
2822
              Format.fprintf fmt "@]");
2823
             Format.fprintf fmt "@]}")
2744
            (match alabel with
2745
              | NoName -> Format.fprintf fmt "";
2746
              | _ -> (((__3 ()) fmt) alabel;
2747
                     Format.fprintf fmt ":@ ")
2748
            );
2749
            Format.fprintf fmt "@[<2>";
2750
            ((__4 ()) fmt) alhs;
2751
            Format.fprintf fmt "@ <=@ ";
2752
            ((fun x  ->
2753
               Format.fprintf fmt "@[";
2754
               ignore
2755
                 (List.fold_left
2756
                   (fun sep  ->
2757
                     fun x  ->
2758
                       if sep then Format.fprintf fmt "";
2759
                        ((__5 ()) fmt) x;
2760
                        Format.fprintf fmt ";";
2761
                        true) false x);
2762
             Format.fprintf fmt "@]@]")) arhs;
2824 2763
        | If { label = alabel; if_cases = aif_cases; default = adefault } ->
2825
            (Format.fprintf fmt "@[<2>If {@,";
2826
             (((Format.fprintf fmt "@[%s =@ " "label";
2827
                ((__6 ()) fmt) alabel;
2828
                Format.fprintf fmt "@]");
2829
               Format.fprintf fmt ";@ ";
2830
               Format.fprintf fmt "@[%s =@ " "if_cases";
2831
               ((fun x  ->
2832
                   Format.fprintf fmt "@[<2>[";
2833
                   ignore
2834
                     (List.fold_left
2835
                        (fun sep  ->
2836
                           fun x  ->
2837
                             if sep then Format.fprintf fmt ";@ ";
2838
                             ((__7 ()) fmt) x;
2839
                             true) false x);
2840
                   Format.fprintf fmt "@,]@]")) aif_cases;
2841
               Format.fprintf fmt "@]");
2842
              Format.fprintf fmt ";@ ";
2843
              Format.fprintf fmt "@[%s =@ " "default";
2844
              ((fun x  ->
2845
                  Format.fprintf fmt "@[<2>[";
2846
                  ignore
2847
                    (List.fold_left
2848
                       (fun sep  ->
2849
                          fun x  ->
2850
                            if sep then Format.fprintf fmt ";@ ";
2851
                            ((__8 ()) fmt) x;
2852
                            true) false x);
2853
                  Format.fprintf fmt "@,]@]")) adefault;
2854
              Format.fprintf fmt "@]");
2855
             Format.fprintf fmt "@]}")
2764
            (match alabel with
2765
              | NoName -> Format.fprintf fmt "";
2766
              | _ -> (((__6 ()) fmt) alabel;
2767
                     Format.fprintf fmt ":@ ")
2768
            );
2769
            Format.fprintf fmt "@[<v>if";
2770
            ((fun x ->
2771
               ignore
2772
               (List.fold_left
2773
                 (fun sep  ->
2774
                   fun x  ->
2775
                           if sep then Format.fprintf fmt "@;elseif";
2776
                                ((__7 ()) fmt) x;
2777
                                true
2778
                 ) false x);
2779
             )) aif_cases;
2780
            Format.fprintf fmt "@]";
2781
            (match adefault with
2782
              | [] -> Format.fprintf fmt "";
2783
              | _  -> (Format.fprintf fmt "@;else";
2784
                      ((fun x  ->
2785
                          Format.fprintf fmt "@;<0 2>";
2786
                          ignore
2787
                            (List.fold_left
2788
                              (fun sep  ->
2789
                                fun x  ->
2790
                                        if sep then Format.fprintf fmt "";
2791
                          ((__8 ()) fmt) x;
2792
                          true) false x);
2793
             )) adefault;))
2856 2794
        | Case { label = alabel; guard = aguard; branches = abranches } ->
2857
            (Format.fprintf fmt "@[<2>Case {@,";
2858
             (((Format.fprintf fmt "@[%s =@ " "label";
2859
                ((__9 ()) fmt) alabel;
2860
                Format.fprintf fmt "@]");
2861
               Format.fprintf fmt ";@ ";
2862
               Format.fprintf fmt "@[%s =@ " "guard";
2863
               ((__10 ()) fmt) aguard;
2864
               Format.fprintf fmt "@]");
2865
              Format.fprintf fmt ";@ ";
2866
              Format.fprintf fmt "@[%s =@ " "branches";
2867
              ((fun x  ->
2868
                  Format.fprintf fmt "@[<2>[";
2869
                  ignore
2870
                    (List.fold_left
2871
                       (fun sep  ->
2872
                          fun x  ->
2873
                            if sep then Format.fprintf fmt ";@ ";
2874
                            ((__11 ()) fmt) x;
2875
                            true) false x);
2876
                  Format.fprintf fmt "@,]@]")) abranches;
2877
              Format.fprintf fmt "@]");
2878
             Format.fprintf fmt "@]}")
2795
            (match alabel with
2796
              | NoName -> Format.fprintf fmt "";
2797
              | _ -> (((__9 ()) fmt) alabel;
2798
                     Format.fprintf fmt ":@ ")
2799
            );
2800
            Format.fprintf fmt "@[<v>case ";
2801
            ((__10 ()) fmt) aguard;
2802
            Format.fprintf fmt " is";
2803
            ((fun x  ->
2804
                ignore
2805
                  (List.fold_left
2806
                     (fun sep  ->
2807
                        fun x  ->
2808
                          if sep then Format.fprintf fmt "";
2809
                          ((__11 ()) fmt) x;
2810
                          true) false x);)) abranches;
2811
            Format.fprintf fmt "@]";
2879 2812
        | Exit
2880 2813
            { label = alabel; loop_label = aloop_label;
2881 2814
              condition = acondition }
......
2943 2876
  vhdl_sequential_stmt_t -> Ppx_deriving_runtime.string =
2944 2877
  fun x  -> Format.asprintf "%a" pp_vhdl_sequential_stmt_t x
2945 2878

  
2879
(* Adapted *)
2946 2880
and pp_vhdl_if_case_t :
2947 2881
  Format.formatter -> vhdl_if_case_t -> Ppx_deriving_runtime.unit =
2948 2882
  let __1 () = pp_vhdl_sequential_stmt_t
......
2952 2886
  ((let open! Ppx_deriving_runtime in
2953 2887
      fun fmt  ->
2954 2888
        fun x  ->
2955
          Format.fprintf fmt "@[<2>{ ";
2956
          ((Format.fprintf fmt "@[%s =@ " "if_cond";
2957
            ((__0 ()) fmt) x.if_cond;
2958
            Format.fprintf fmt "@]");
2959
           Format.fprintf fmt ";@ ";
2960
           Format.fprintf fmt "@[%s =@ " "if_block";
2961
           ((fun x  ->
2962
               Format.fprintf fmt "@[<2>[";
2963
               ignore
2964
                 (List.fold_left
2965
                    (fun sep  ->
2966
                       fun x  ->
2967
                         if sep then Format.fprintf fmt ";@ ";
2968
                         ((__1 ()) fmt) x;
2969
                         true) false x);
2970
               Format.fprintf fmt "@,]@]")) x.if_block;
2971
           Format.fprintf fmt "@]");
2972
          Format.fprintf fmt "@ }@]")
2889
          Format.fprintf fmt " (";
2890
          ((__0 ()) fmt) x.if_cond;
2891
          Format.fprintf fmt ") then@;<0 2>";
2892
          ((fun x  ->
2893
             ignore
2894
               (List.fold_left
2895
                  (fun sep  ->
2896
                     fun x  ->
2897
                             if sep then Format.fprintf fmt "@;<0 2>";
2898
                       ((__1 ()) fmt) x;
2899
                       true) false x);
2900
          )) x.if_block;)
2973 2901
    [@ocaml.warning "-A"])
2974 2902

  
2975 2903
and show_vhdl_if_case_t : vhdl_if_case_t -> Ppx_deriving_runtime.string =
......
2984 2912
  ((let open! Ppx_deriving_runtime in
2985 2913
      fun fmt  ->
2986 2914
        fun x  ->
2987
          Format.fprintf fmt "@[<2>{ ";
2988
          ((Format.fprintf fmt "@[%s =@ " "when_cond";
2915
                Format.fprintf fmt "@;<0 2>when ";
2989 2916
            ((fun x  ->
2990
                Format.fprintf fmt "@[<2>[";
2991 2917
                ignore
2992 2918
                  (List.fold_left
2993 2919
                     (fun sep  ->
2994 2920
                        fun x  ->
2995
                          if sep then Format.fprintf fmt ";@ ";
2921
                          if sep then Format.fprintf fmt "@ |@ ";
2996 2922
                          ((__0 ()) fmt) x;
2997
                          true) false x);
2998
                Format.fprintf fmt "@,]@]")) x.when_cond;
2999
            Format.fprintf fmt "@]");
3000
           Format.fprintf fmt ";@ ";
3001
           Format.fprintf fmt "@[%s =@ " "when_stmt";
2923
                          true) false x);)) x.when_cond;
2924
           Format.fprintf fmt " => ";
3002 2925
           ((fun x  ->
3003
               Format.fprintf fmt "@[<2>[";
3004 2926
               ignore
3005 2927
                 (List.fold_left
3006 2928
                    (fun sep  ->
3007 2929
                       fun x  ->
3008
                         if sep then Format.fprintf fmt ";@ ";
2930
                         if sep then Format.fprintf fmt "";
3009 2931
                         ((__1 ()) fmt) x;
3010
                         true) false x);
3011
               Format.fprintf fmt "@,]@]")) x.when_stmt;
3012
           Format.fprintf fmt "@]");
3013
          Format.fprintf fmt "@ }@]")
2932
                         true) false x);)) x.when_stmt)
3014 2933
    [@ocaml.warning "-A"])
3015 2934

  
3016 2935
and show_vhdl_case_item_t : vhdl_case_item_t -> Ppx_deriving_runtime.string =
......
3653 3572
  decl_part: vhdl_declaration_t list [@default []];
3654 3573
  stmts: vhdl_sequential_stmt_t list [@default []]} [@name "SUBPROGRAM_BODY"]
3655 3574

  
3575
(* Needs adaptation for: SubProgram *)
3656 3576
let rec pp_vhdl_declaration_t :
3657 3577
  Format.formatter -> vhdl_declaration_t -> Ppx_deriving_runtime.unit =
3658 3578
  let __12 () = pp_vhdl_sequential_stmt_t
......
3685 3605
      fun fmt  ->
3686 3606
        function
3687 3607
        | VarDecl { names = anames; typ = atyp; init_val = ainit_val } ->
3688
            (Format.fprintf fmt "@[<2>VarDecl {@,";
3689
             (((Format.fprintf fmt "@[%s =@ " "names";
3690
                ((fun x  ->
3691
                    Format.fprintf fmt "@[<2>[";
3608
            (Format.fprintf fmt "@[<2>variable@ ";
3609
             ((((fun x  ->
3692 3610
                    ignore
3693 3611
                      (List.fold_left
3694 3612
                         (fun sep  ->
3695 3613
                            fun x  ->
3696
                              if sep then Format.fprintf fmt ";@ ";
3614
                              if sep then Format.fprintf fmt ",";
3697 3615
                              ((__0 ()) fmt) x;
3698
                              true) false x);
3699
                    Format.fprintf fmt "@,]@]")) anames;
3700
                Format.fprintf fmt "@]");
3701
               Format.fprintf fmt ";@ ";
3702
               Format.fprintf fmt "@[%s =@ " "typ";
3616
                              true) false x);)) anames;
3617
               Format.fprintf fmt "@ :@ ";
3703 3618
               ((__1 ()) fmt) atyp;
3704
               Format.fprintf fmt "@]");
3705
              Format.fprintf fmt ";@ ";
3706
              Format.fprintf fmt "@[%s =@ " "init_val";
3707 3619
              ((function
3708
                | None  -> Format.pp_print_string fmt "None"
3620
                | None  -> Format.pp_print_string fmt ""
3709 3621
                | Some x ->
3710
                    (Format.pp_print_string fmt "(Some ";
3711
                     ((__2 ()) fmt) x;
3712
                     Format.pp_print_string fmt ")"))) ainit_val;
3622
                    (Format.fprintf fmt ":=";
3623
                     ((__2 ()) fmt) x;))) ainit_val;
3713 3624
              Format.fprintf fmt "@]");
3714
             Format.fprintf fmt "@]}")
3625
            ))
3715 3626
        | CstDecl { names = anames; typ = atyp; init_val = ainit_val } ->
3716
            (Format.fprintf fmt "@[<2>CstDecl {@,";
3717
             (((Format.fprintf fmt "@[%s =@ " "names";
3718
                ((fun x  ->
3719
                    Format.fprintf fmt "@[<2>[";
3627
            (Format.fprintf fmt "@[<2>constant@ ";
3628
             ((((fun x  ->
3720 3629
                    ignore
3721 3630
                      (List.fold_left
3722 3631
                         (fun sep  ->
3723 3632
                            fun x  ->
3724
                              if sep then Format.fprintf fmt ";@ ";
3633
                              if sep then Format.fprintf fmt ",";
3725 3634
                              ((__3 ()) fmt) x;
3726
                              true) false x);
3727
                    Format.fprintf fmt "@,]@]")) anames;
3728
                Format.fprintf fmt "@]");
3729
               Format.fprintf fmt ";@ ";
3730
               Format.fprintf fmt "@[%s =@ " "typ";
3635
                              true) false x);)) anames;
3636
               Format.fprintf fmt "@ :@ ";
3731 3637
               ((__4 ()) fmt) atyp;
3732
               Format.fprintf fmt "@]");
3733
              Format.fprintf fmt ";@ ";
3734
              Format.fprintf fmt "@[%s =@ " "init_val";
3638
              Format.fprintf fmt ":=";
3735 3639
              ((__5 ()) fmt) ainit_val;
3736 3640
              Format.fprintf fmt "@]");
3737
             Format.fprintf fmt "@]}")
3641
             ))
3738 3642
        | SigDecl { names = anames; typ = atyp; init_val = ainit_val } ->
3739
            (Format.fprintf fmt "@[<2>SigDecl {@,";
3740
             (((Format.fprintf fmt "@[%s =@ " "names";
3741
                ((fun x  ->
3742
                    Format.fprintf fmt "@[<2>[";
3743
                    ignore
3744
                      (List.fold_left
3745
                         (fun sep  ->
3746
                            fun x  ->
3747
                              if sep then Format.fprintf fmt ";@ ";
3748
                              ((__6 ()) fmt) x;
3749
                              true) false x);
3750
                    Format.fprintf fmt "@,]@]")) anames;
3751
                Format.fprintf fmt "@]");
3752
               Format.fprintf fmt ";@ ";
3753
               Format.fprintf fmt "@[%s =@ " "typ";
3754
               ((__7 ()) fmt) atyp;
3755
               Format.fprintf fmt "@]");
3756
              Format.fprintf fmt ";@ ";
3757
              Format.fprintf fmt "@[%s =@ " "init_val";
3758
              ((function
3759
                | None  -> Format.pp_print_string fmt "None"
3760
                | Some x ->
3761
                    (Format.pp_print_string fmt "(Some ";
3762
                     ((__8 ()) fmt) x;
3763
                     Format.pp_print_string fmt ")"))) ainit_val;
3764
              Format.fprintf fmt "@]");
3765
             Format.fprintf fmt "@]}")
3643
            (Format.fprintf fmt "@[<2>signal@ ";
3644
            ((fun x  ->
3645
              ignore
3646
              (List.fold_left
3647
                (fun sep  ->
3648
                  fun x  ->
3649
                    if sep then Format.fprintf fmt ",";
3650
                                ((__6 ()) fmt) x;
3651
                                true) false x);
3652
              )) anames;
3653
            Format.fprintf fmt "@ :@ ";
3654
            ((__7 ()) fmt) atyp;
3655
            (function
3656
              | None  -> Format.pp_print_string fmt ""
3657
              | Some x ->
3658
                  (Format.fprintf fmt ":=";
3659
                  ((__8 ()) fmt) x;)
3660
            ) ainit_val;
3661
            Format.fprintf fmt "@]";
3662
            )
3766 3663
        | Subprogram
3767 3664
            { name = aname; kind = akind; spec = aspec;
3768 3665
              decl_part = adecl_part; stmts = astmts }
......
4941 4838
  | SelectedSig of vhdl_selected_signal_t
4942 4839
  [@name "SELECTED_SIGNAL_ASSIGNMENT"]
4943 4840

  
4841
(* Adapted *)
4944 4842
let rec pp_vhdl_concurrent_stmt_t :
4945 4843
  Format.formatter -> vhdl_concurrent_stmt_t -> Ppx_deriving_runtime.unit =
4946 4844
  let __2 () = pp_vhdl_selected_signal_t
......
4953 4851
      fun fmt  ->
4954 4852
        function
4955 4853
        | SigAssign a0 ->
4956
            (Format.fprintf fmt "(@[<2>SigAssign@ ";
4957 4854
             ((__0 ()) fmt) a0;
4958
             Format.fprintf fmt "@])")
4959 4855
        | Process a0 ->
4960
            (Format.fprintf fmt "(@[<2>Process@ ";
4961 4856
             ((__1 ()) fmt) a0;
4962
             Format.fprintf fmt "@])")
4963 4857
        | SelectedSig a0 ->
4964
            (Format.fprintf fmt "(@[<2>SelectedSig@ ";
4965 4858
             ((__2 ()) fmt) a0;
4966
             Format.fprintf fmt "@])"))
4859
    )
4967 4860
    [@ocaml.warning "-A"])
4968 4861

  
4969 4862
and show_vhdl_concurrent_stmt_t :
......
5019 4912
  ((let open! Ppx_deriving_runtime in
5020 4913
      fun fmt  ->
5021 4914
        function
5022
        | InPort  -> Format.pp_print_string fmt "InPort"
5023
        | OutPort  -> Format.pp_print_string fmt "OutPort"
5024
        | InoutPort  -> Format.pp_print_string fmt "InoutPort"
5025
        | BufferPort  -> Format.pp_print_string fmt "BufferPort")
4915
        | InPort  -> Format.pp_print_string fmt "in"
4916
        | OutPort  -> Format.pp_print_string fmt "out"
4917
        | InoutPort  -> Format.pp_print_string fmt "inout"
4918
        | BufferPort  -> Format.pp_print_string fmt "buffer")
5026 4919
  [@ocaml.warning "-A"])
5027 4920

  
5028 4921
and show_vhdl_port_mode_t : vhdl_port_mode_t -> Ppx_deriving_runtime.string =
......
5057 4950
  typ: vhdl_subtype_indication_t ;
5058 4951
  expr: vhdl_expr_t [@default IsNull]}
5059 4952

  
4953
(* Adapted *)
5060 4954
let rec pp_vhdl_port_t :
5061 4955
  Format.formatter -> vhdl_port_t -> Ppx_deriving_runtime.unit =
5062 4956
  let __3 () = pp_vhdl_expr_t
......
5070 4964
  ((let open! Ppx_deriving_runtime in
5071 4965
      fun fmt  ->
5072 4966
        fun x  ->
5073
          Format.fprintf fmt "@[<2>{ ";
5074
          ((((Format.fprintf fmt "@[%s =@ " "names";
4967
          Format.fprintf fmt "@[";
4968
          ((((
5075 4969
              ((fun x  ->
5076
                  Format.fprintf fmt "@[<2>[";
4970
                  Format.fprintf fmt "@[";
5077 4971
                  ignore
5078 4972
                    (List.fold_left
5079 4973
                       (fun sep  ->
5080 4974
                          fun x  ->
5081
                            if sep then Format.fprintf fmt ";@ ";
4975
                            if sep then Format.fprintf fmt ",@ ";
5082 4976
                            ((__0 ()) fmt) x;
5083 4977
                            true) false x);
5084
                  Format.fprintf fmt "@,]@]")) x.names;
5085
              Format.fprintf fmt "@]");
5086
             Format.fprintf fmt ";@ ";
5087
             Format.fprintf fmt "@[%s =@ " "mode";
4978
                  Format.fprintf fmt "@,@]")) x.names;
4979
              );
4980
             Format.fprintf fmt ":@ ";
5088 4981
             ((__1 ()) fmt) x.mode;
5089
             Format.fprintf fmt "@]");
5090
            Format.fprintf fmt ";@ ";
5091
            Format.fprintf fmt "@[%s =@ " "typ";
4982
             );
4983
             Format.fprintf fmt "@ ";
5092 4984
            ((__2 ()) fmt) x.typ;
5093
            Format.fprintf fmt "@]");
5094
           Format.fprintf fmt ";@ ";
5095
           Format.fprintf fmt "@[%s =@ " "expr";
5096
           ((__3 ()) fmt) x.expr;
5097
           Format.fprintf fmt "@]");
5098
          Format.fprintf fmt "@ }@]")
4985
            );
4986
          (match x.expr with
4987
           | IsNull -> Format.fprintf fmt "";
4988
           | _ -> (Format.fprintf fmt "@[:=@ ";
4989
                   ((__3 ()) fmt) x.expr;
4990
                   Format.fprintf fmt "@]"));
4991
          Format.fprintf fmt "@]"))
5099 4992
    [@ocaml.warning "-A"])
5100 4993

  
5101 4994
and show_vhdl_port_t : vhdl_port_t -> Ppx_deriving_runtime.string =
......
5193 5086
  stmts: vhdl_concurrent_stmt_t list
5194 5087
    [@key "ENTITY_STATEMENT_PART"][@default []]}
5195 5088

  
5089
(* Adapted *)
5196 5090
let rec pp_vhdl_entity_t :
5197 5091
  Format.formatter -> vhdl_entity_t -> Ppx_deriving_runtime.unit =
5198 5092
  let __4 () = pp_vhdl_concurrent_stmt_t
......
5208 5102
  ((let open! Ppx_deriving_runtime in
5209 5103
      fun fmt  ->
5210 5104
        fun x  ->
5211
          Format.fprintf fmt "@[<2>{ ";
5212
          (((((Format.fprintf fmt "@[%s =@ " "name";
5105
          (((((
5213 5106
               ((__0 ()) fmt) x.name;
5214
               Format.fprintf fmt "@]");
5215
              Format.fprintf fmt ";@ ";
5216
              Format.fprintf fmt "@[%s =@ " "generics";
5107
               Format.fprintf fmt " is@ ");
5108
              Format.fprintf fmt "@[<v>";
5217 5109
              ((fun x  ->
5218
                  Format.fprintf fmt "@[<2>[";
5110
                  Format.fprintf fmt "@[";
5219 5111
                  ignore
5220 5112
                    (List.fold_left
5221 5113
                       (fun sep  ->
......
5223 5115
                            if sep then Format.fprintf fmt ";@ ";
5224 5116
                            ((__1 ()) fmt) x;
5225 5117
                            true) false x);
5226
                  Format.fprintf fmt "@,]@]")) x.generics;
5118
                  Format.fprintf fmt "@]")) x.generics;
5227 5119
              Format.fprintf fmt "@]");
5228
             Format.fprintf fmt ";@ ";
5229
             Format.fprintf fmt "@[%s =@ " "ports";
5120
             Format.fprintf fmt "port (@[<v>";
5230 5121
             ((fun x  ->
5231
                 Format.fprintf fmt "@[<2>[";
5122
                 Format.fprintf fmt "@[";
5232 5123
                 ignore
5233 5124
                   (List.fold_left
5234 5125
                      (fun sep  ->
......
5236 5127
                           if sep then Format.fprintf fmt ";@ ";
5237 5128
                           ((__2 ()) fmt) x;
5238 5129
                           true) false x);
5239
                 Format.fprintf fmt "@,]@]")) x.ports;
5240
             Format.fprintf fmt "@]");
5241
            Format.fprintf fmt ";@ ";
5242
            Format.fprintf fmt "@[%s =@ " "declaration";
5130
                 Format.fprintf fmt "@]")) x.ports;
5131
             Format.fprintf fmt "@]);");
5132
            Format.fprintf fmt "@[<v>";
5243 5133
            ((fun x  ->
5244
                Format.fprintf fmt "@[<2>[";
5134
                Format.fprintf fmt "@[";
5245 5135
                ignore
5246 5136
                  (List.fold_left
5247 5137
                     (fun sep  ->
......
5249 5139
                          if sep then Format.fprintf fmt ";@ ";
5250 5140
                          ((__3 ()) fmt) x;
5251 5141
                          true) false x);
5252
                Format.fprintf fmt "@,]@]")) x.declaration;
5142
                Format.fprintf fmt "@]")) x.declaration;
5253 5143
            Format.fprintf fmt "@]");
5254
           Format.fprintf fmt ";@ ";
5255
           Format.fprintf fmt "@[%s =@ " "stmts";
5144
           Format.fprintf fmt "@[<v>";
5256 5145
           ((fun x  ->
5257
               Format.fprintf fmt "@[<2>[";
5146
               Format.fprintf fmt "@[";
5258 5147
               ignore
5259 5148
                 (List.fold_left
5260 5149
                    (fun sep  ->
......
5262 5151
                         if sep then Format.fprintf fmt ";@ ";
5263 5152
                         ((__4 ()) fmt) x;
5264 5153
                         true) false x);
5265
               Format.fprintf fmt "@,]@]")) x.stmts;
5154
               Format.fprintf fmt "@]")) x.stmts;
5266 5155
           Format.fprintf fmt "@]");
5267
          Format.fprintf fmt "@ }@]")
5156
          Format.fprintf fmt "@]")
5268 5157
    [@ocaml.warning "-A"])
5269 5158

  
5270 5159
and show_vhdl_entity_t : vhdl_entity_t -> Ppx_deriving_runtime.string =
......
5403 5292
  name: vhdl_name_t [@default NoName];
5404 5293
  shared_defs: vhdl_definition_t list [@default []]}
5405 5294

  
5295
(* Adapted -- TODO: indentation of package content is not correct *)
5406 5296
let rec pp_vhdl_package_t :
5407 5297
  Format.formatter -> vhdl_package_t -> Ppx_deriving_runtime.unit =
5408 5298
  let __1 () = pp_vhdl_definition_t
......
5412 5302
  ((let open! Ppx_deriving_runtime in
5413 5303
      fun fmt  ->
5414 5304
        fun x  ->
5415
          Format.fprintf fmt "@[<2>{ ";
5416
          ((Format.fprintf fmt "@[%s =@ " "name";
5305
          ((Format.fprintf fmt "@[";
5417 5306
            ((__0 ()) fmt) x.name;
5418
            Format.fprintf fmt "@]");
5419
           Format.fprintf fmt ";@ ";
5420
           Format.fprintf fmt "@[%s =@ " "shared_defs";
5307
            Format.fprintf fmt " is@.");
5308
           Format.fprintf fmt "@[<v 2>";
5421 5309
           ((fun x  ->
5422
               Format.fprintf fmt "@[<2>[";
5310
               Format.fprintf fmt "@[";
5423 5311
               ignore
5424 5312
                 (List.fold_left
5425 5313
                    (fun sep  ->
......
5427 5315
                         if sep then Format.fprintf fmt ";@ ";
5428 5316
                         ((__1 ()) fmt) x;
5429 5317
                         true) false x);
5430
               Format.fprintf fmt "@,]@]")) x.shared_defs;
5318
               Format.fprintf fmt "@,@]")) x.shared_defs;
5431 5319
           Format.fprintf fmt "@]");
5432
          Format.fprintf fmt "@ }@]")
5320
          Format.fprintf fmt "@]")
5433 5321
    [@ocaml.warning "-A"])
5434 5322

  
5435 5323
and show_vhdl_package_t : vhdl_package_t -> Ppx_deriving_runtime.string =
......
5494 5382
  | Library of vhdl_name_t list [@name "LIBRARY_CLAUSE"][@default []]
5495 5383
  | Use of vhdl_name_t list [@name "USE_CLAUSE"][@default []]
5496 5384

  
5385
(* Adapted *)
5497 5386
let rec pp_vhdl_load_t :
5498 5387
  Format.formatter -> vhdl_load_t -> Ppx_deriving_runtime.unit =
5499 5388
  let __1 () = pp_vhdl_name_t
......
5504 5393
      fun fmt  ->
5505 5394
        function
5506 5395
        | Library a0 ->
5507
            (Format.fprintf fmt "(@[<2>Library@ ";
5396
            (Format.fprintf fmt "@[<2>library@ ";
5508 5397
             ((fun x  ->
5509
                 Format.fprintf fmt "@[<2>[";
5398
                 Format.fprintf fmt "@[<2>";
5510 5399
                 ignore
5511 5400
                   (List.fold_left
5512 5401
                      (fun sep  ->
5513 5402
                         fun x  ->
5514
                           if sep then Format.fprintf fmt ";@ ";
5403
                           if sep then Format.fprintf fmt ".";
5515 5404
                           ((__0 ()) fmt) x;
5516 5405
                           true) false x);
5517
                 Format.fprintf fmt "@,]@]")) a0;
5518
             Format.fprintf fmt "@])")
5406
                 Format.fprintf fmt "@,@]")) a0;
5407
             Format.fprintf fmt "@]:")
5519 5408
        | Use a0 ->
5520
            (Format.fprintf fmt "(@[<2>Use@ ";
5409
            (Format.fprintf fmt "@[<2>use@ ";
5521 5410
             ((fun x  ->
5522
                 Format.fprintf fmt "@[<2>[";
5411
                 Format.fprintf fmt "@[<2>";
5523 5412
                 ignore
5524 5413
                   (List.fold_left
5525 5414
                      (fun sep  ->
5526 5415
                         fun x  ->
5527
                           if sep then Format.fprintf fmt ";@ ";
5416
                           if sep then Format.fprintf fmt ".";
5528 5417
                           ((__1 ()) fmt) x;
5529 5418
                           true) false x);
5530
                 Format.fprintf fmt "@,]@]")) a0;
5531
             Format.fprintf fmt "@])"))
5419
                 Format.fprintf fmt "@,@]")) a0;
5420
             Format.fprintf fmt "@];"))
5532 5421
    [@ocaml.warning "-A"])
5533 5422

  
5534 5423
and show_vhdl_load_t : vhdl_load_t -> Ppx_deriving_runtime.string =
......
5576 5465
  body: vhdl_concurrent_stmt_t list
5577 5466
    [@key "ARCHITECTURE_STATEMENT_PART"][@default []]}
5578 5467

  
5468
(* Adapted *)
5579 5469
let rec pp_vhdl_architecture_t :
5580 5470
  Format.formatter -> vhdl_architecture_t -> Ppx_deriving_runtime.unit =
5581 5471
  let __3 () = pp_vhdl_concurrent_stmt_t
......
5589 5479
  ((let open! Ppx_deriving_runtime in
5590 5480
      fun fmt  ->
5591 5481
        fun x  ->
5592
          Format.fprintf fmt "@[<2>{ ";
5593
          ((((Format.fprintf fmt "@[%s =@ " "name";
5482
          ((((
5594 5483
              ((__0 ()) fmt) x.name;
5595
              Format.fprintf fmt "@]");
5596
             Format.fprintf fmt ";@ ";
5597
             Format.fprintf fmt "@[%s =@ " "entity";
5484
             );
5485
             Format.fprintf fmt " of ";
5598 5486
             ((__1 ()) fmt) x.entity;
5599
             Format.fprintf fmt "@]");
5600
            Format.fprintf fmt ";@ ";
5601
            Format.fprintf fmt "@[%s =@ " "declarations";
5487
            );
5488
            Format.fprintf fmt " is @ ";
5489
            Format.fprintf fmt "@[<v>";
5602 5490
            ((fun x  ->
5603
                Format.fprintf fmt "@[<2>[";
5491
                Format.fprintf fmt "@[";
5604 5492
                ignore
5605 5493
                  (List.fold_left
5606 5494
                     (fun sep  ->
5607 5495
                        fun x  ->
5608
                          if sep then Format.fprintf fmt ";@ ";
5496
                          if sep then Format.fprintf fmt "@ ";
5609 5497
                          ((__2 ()) fmt) x;
5610 5498
                          true) false x);
5611
                Format.fprintf fmt "@,]@]")) x.declarations;
5499
                Format.fprintf fmt "@]")) x.declarations;
5612 5500
            Format.fprintf fmt "@]");
5613
           Format.fprintf fmt ";@ ";
5614
           Format.fprintf fmt "@[%s =@ " "body";
5501
           Format.fprintf fmt "@ ";
5502
           Format.fprintf fmt "@[<v>";
5503
           (match x.body with
5504
             | [] -> Format.fprintf fmt "";
5505
             | _ -> Format.fprintf fmt "begin@ @[<2>";
5615 5506
           ((fun x  ->
5616
               Format.fprintf fmt "@[<2>[";
5507
               Format.fprintf fmt "@[";
5617 5508
               ignore
5618 5509
                 (List.fold_left
5619 5510
                    (fun sep  ->
5620 5511
                       fun x  ->
5621
                         if sep then Format.fprintf fmt ";@ ";
5512
                         if sep then Format.fprintf fmt "@ ";
5622 5513
                         ((__3 ()) fmt) x;
5623 5514
                         true) false x);
5624
               Format.fprintf fmt "@,]@]")) x.body;
5515
               Format.fprintf fmt "@]")) x.body;
5625 5516
           Format.fprintf fmt "@]");
5626
          Format.fprintf fmt "@ }@]")
5517
           Format.fprintf fmt "@]");
5518
          Format.fprintf fmt "@ ")
5627 5519
    [@ocaml.warning "-A"])
5628 5520

  
5629 5521
and show_vhdl_architecture_t :
......
5769 5661
  | Architecture of vhdl_architecture_t [@name "ARCHITECTURE_BODY"]
5770 5662
  | Configuration of vhdl_configuration_t [@name "CONFIGURATION_DECLARATION"]
5771 5663

  
5664
(* Adapted *)
5772 5665
let rec pp_vhdl_library_unit_t :
5773 5666
  Format.formatter -> vhdl_library_unit_t -> Ppx_deriving_runtime.unit =
5774 5667
  let __3 () = pp_vhdl_configuration_t
......
5783 5676
      fun fmt  ->
5784 5677
        function
5785 5678
        | Package a0 ->
5786
            (Format.fprintf fmt "(@[<2>Package@ ";
5679
            (Format.fprintf fmt "@[<2>package ";
5787 5680
             ((__0 ()) fmt) a0;
5788
             Format.fprintf fmt "@])")
5681
             Format.fprintf fmt "@.end;")
5789 5682
        | Entities a0 ->
5790
            (Format.fprintf fmt "(@[<2>Entities@ ";
5683
            (Format.fprintf fmt "@[<2>entity ";
5791 5684
             ((__1 ()) fmt) a0;
5792
             Format.fprintf fmt "@])")
5685
             Format.fprintf fmt "@.end;")
5793 5686
        | Architecture a0 ->
5794
            (Format.fprintf fmt "(@[<2>Architecture@ ";
5687
            (Format.fprintf fmt "@[<2>architecture ";
5795 5688
             ((__2 ()) fmt) a0;
5796
             Format.fprintf fmt "@])")
5689
             Format.fprintf fmt "@.end;")
5797 5690
        | Configuration a0 ->
5798
            (Format.fprintf fmt "(@[<2>Configuration@ ";
5691
            (Format.fprintf fmt "@[<2>configuration ";
5799 5692
             ((__3 ()) fmt) a0;
5800
             Format.fprintf fmt "@])"))
5693
             Format.fprintf fmt "@.end;"))
5801 5694
    [@ocaml.warning "-A"])
5802 5695

  
5803 5696
and show_vhdl_library_unit_t :
......
5853 5746
  contexts: vhdl_load_t list [@default []];
5854 5747
  library: vhdl_library_unit_t }
5855 5748

  
5749
(* Adapted *)
5856 5750
let rec pp_vhdl_design_unit_t :
5857 5751
  Format.formatter -> vhdl_design_unit_t -> Ppx_deriving_runtime.unit =
5858 5752
  let __1 () = pp_vhdl_library_unit_t
......
5862 5756
  ((let open! Ppx_deriving_runtime in
5863 5757
      fun fmt  ->
5864 5758
        fun x  ->
5865
          Format.fprintf fmt "@[<2>{ ";
5866
          ((Format.fprintf fmt "@[%s =@ " "contexts";
5759
          ((
5760
            Format.fprintf fmt "@[<v>";
5867 5761
            ((fun x  ->
5868
                Format.fprintf fmt "@[<2>[";
5869 5762
                ignore
5870 5763
                  (List.fold_left
5871 5764
                     (fun sep  ->
5872 5765
                        fun x  ->
5873
                          if sep then Format.fprintf fmt ";@ ";
5766
                                if sep then Format.fprintf fmt "@ ";
5874 5767
                          ((__0 ()) fmt) x;
5875 5768
                          true) false x);
5876
                Format.fprintf fmt "@,]@]")) x.contexts;
5877
            Format.fprintf fmt "@]");
5878
           Format.fprintf fmt ";@ ";
5879
           Format.fprintf fmt "@[%s =@ " "library";
5769
                )) x.contexts;
5770
           Format.fprintf fmt "@ ";
5771
           Format.fprintf fmt "@[";
5880 5772
           ((__1 ()) fmt) x.library;
5881
           Format.fprintf fmt "@]");
5882
          Format.fprintf fmt "@ }@]")
5773
           Format.fprintf fmt "@]";
5774
           Format.fprintf fmt "@]";
5775
           ))
5776
    )
5883 5777
    [@ocaml.warning "-A"])
5884 5778

  
5885 5779
and show_vhdl_design_unit_t :
......
5946 5840
  {
5947 5841
  design_units: vhdl_design_unit_t list [@default []]}
5948 5842

  
5843
(* Adapted *)
5949 5844
let rec pp_vhdl_design_file_t :
5950 5845
  Format.formatter -> vhdl_design_file_t -> Ppx_deriving_runtime.unit =
5951 5846
  let __0 () = pp_vhdl_design_unit_t  in
5952 5847
  ((let open! Ppx_deriving_runtime in
5953 5848
      fun fmt  ->
5954 5849
        fun x  ->
5955
          Format.fprintf fmt "@[<2>{ ";
5956
          (Format.fprintf fmt "@[%s =@ " "design_units";
5957 5850
           ((fun x  ->
5958
               Format.fprintf fmt "@[<2>[";
5959 5851
               ignore
5960 5852
                 (List.fold_left
5961 5853
                    (fun sep  ->
5962 5854
                       fun x  ->
5963
                         if sep then Format.fprintf fmt ";@ ";
5855
                         if sep then Format.fprintf fmt "@ ";
5964 5856
                         ((__0 ()) fmt) x;
5965 5857
                         true) false x);
5966
               Format.fprintf fmt "@,]@]")) x.design_units;
5967
           Format.fprintf fmt "@]");
5968
          Format.fprintf fmt "@ }@]")
5858
             )) x.design_units;
5859
    )
5969 5860
    [@ocaml.warning "-A"])
5970 5861

  
5971 5862
and show_vhdl_design_file_t :
......
6022 5913
  design_file: vhdl_design_file_t
6023 5914
    [@default { design_units = [] }][@key "DESIGN_FILE"]}
6024 5915

  
5916
(* Adapted *)
6025 5917
let rec pp_vhdl_file_t :
6026 5918
  Format.formatter -> vhdl_file_t -> Ppx_deriving_runtime.unit =
6027 5919
  let __0 () = pp_vhdl_design_file_t  in
6028 5920
  ((let open! Ppx_deriving_runtime in
6029 5921
      fun fmt  ->
6030 5922
        fun x  ->
6031
          Format.fprintf fmt "@[<2>{ ";
6032
          (Format.fprintf fmt "@[%s =@ " "design_file";
6033 5923
           ((__0 ()) fmt) x.design_file;
6034
           Format.fprintf fmt "@]");
6035
          Format.fprintf fmt "@ }@]")
5924
   )
6036 5925
    [@ocaml.warning "-A"])
6037 5926

  
6038 5927
and show_vhdl_file_t : vhdl_file_t -> Ppx_deriving_runtime.string =

Also available in: Unified diff