Project

General

Profile

« Previous | Next » 

Revision e0f0bc2c

Added by Arnaud Dieumegard over 3 years ago

Added polymorphic option for generated visitors

View differences:

src/backends/VHDL/mini_vhdl_ast.ml
140 140
    packages: mini_vhdl_package_t list;
141 141
  }
142 142
(*[@@deriving show { with_path = false }]*)
143
[@@deriving visitors { variety = "iter"; name = "mini_vhdl_iter"; ancestors = ["vhdl_iter"] }]
143
[@@deriving visitors { variety = "iter"; name = "mini_vhdl_iter"; ancestors = ["vhdl_iter"]; polymorphic = true }]
src/backends/VHDL/mini_vhdl_utils.ml
77 77
      | hda::tla -> match b with
78 78
                    | [] -> a
79 79
                    | hdb::tlb -> [hdb@hda]@(times tla tlb)
80

  
81
(* Signals lattice *)
82
let build_signals_lattice = object (self)
83
  inherit [_] mini_vhdl_iter as super
84

  
85
(*  method! visit_vhdl_expr_t env e = 
86
    match e with
87
    | Op ({id=""; args=hd::[]}) -> self#visit_vhdl_expr_t env hd
88
    | _ -> super#visit_vhdl_expr_t env e*)
89
end
90

  
91

  
src/backends/VHDL/vhdl_ast.ml
354 354
    design_file: vhdl_design_file_t [@yojson.default {design_units=[]}] [@yojson.key "DESIGN_FILE"];
355 355
  }
356 356
(*[@@deriving show { with_path = false }]*)
357
[@@deriving visitors { variety = "iter"; name = "vhdl_iter" }, 
357
[@@deriving visitors { variety = "iter"; name = "vhdl_iter"; polymorphic = true }, 
358 358
            visitors { variety = "map"; name = "vhdl_map"; polymorphic = true },
359 359
            yojson];;

Also available in: Unified diff