## lustrec / src / backends / VHDL / vhdl_ast_map.ml @ 248eb65e

History | View | Annotate | Download (23.7 KB)

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_signal_condition_t) -> () |

27 |
let _ = fun (_ : vhdl_conditional_signal_t) -> () |

28 |
let _ = fun (_ : vhdl_process_t) -> () |

29 |
let _ = fun (_ : vhdl_selected_signal_t) -> () |

30 |
let _ = fun (_ : vhdl_port_mode_t) -> () |

31 |
let _ = fun (_ : vhdl_component_instantiation_t) -> () |

32 |
let _ = fun (_ : vhdl_concurrent_stmt_t) -> () |

33 |
let _ = fun (_ : vhdl_port_t) -> () |

34 |
let _ = fun (_ : vhdl_entity_t) -> () |

35 |
let _ = fun (_ : vhdl_package_t) -> () |

36 |
let _ = fun (_ : vhdl_load_t) -> () |

37 |
let _ = fun (_ : vhdl_architecture_t) -> () |

38 |
let _ = fun (_ : vhdl_configuration_t) -> () |

39 |
let _ = fun (_ : vhdl_library_unit_t) -> () |

40 |
let _ = fun (_ : vhdl_design_unit_t) -> () |

41 |
let _ = fun (_ : vhdl_design_file_t) -> () |

42 |
let _ = fun (_ : vhdl_file_t) -> () |

43 | |

44 |
class virtual vhdl_map = |

45 |
object (self) |

46 |
method virtual string : string -> string |

47 |
method virtual list : 'a . ('a -> 'a) -> 'a list -> 'a list |

48 |
method virtual unit : unit -> unit |

49 |
method virtual bool : bool -> bool |

50 |
method virtual option : 'a . ('a -> 'a) -> 'a option -> 'a option |

51 |
method virtual int : int -> int |

52 |
method virtual vhdl_name_t : vhdl_name_t -> vhdl_name_t |

53 |
method virtual vhdl_definition_t : vhdl_definition_t -> vhdl_definition_t |

54 |
method virtual vhdl_port_t : vhdl_port_t -> vhdl_port_t |

55 |
method virtual vhdl_expr_t : vhdl_expr_t -> vhdl_expr_t |

56 |
method virtual vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t |

57 |
method virtual vhdl_element_declaration_t : vhdl_element_declaration_t -> vhdl_element_declaration_t |

58 |
method virtual vhdl_subtype_indication_t : vhdl_subtype_indication_t -> vhdl_subtype_indication_t |

59 |
method virtual vhdl_conditional_signal_t : vhdl_conditional_signal_t -> vhdl_conditional_signal_t |

60 |
method virtual vhdl_process_t : vhdl_process_t -> vhdl_process_t |

61 |
method virtual vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t |

62 |
method virtual vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t |

63 |
method virtual vhdl_suffix_selection_t : vhdl_suffix_selection_t -> vhdl_suffix_selection_t |

64 |
method virtual vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t |

65 |
method virtual vhdl_sequential_stmt_t : vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t |

66 |
method virtual vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t |

67 |
method virtual vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t |

68 |
method virtual vhdl_subprogram_spec_t : vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t |

69 |
method virtual vhdl_discrete_range_t : vhdl_discrete_range_t -> vhdl_discrete_range_t |

70 |
method virtual vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t |

71 |
method virtual vhdl_component_instantiation_t : vhdl_component_instantiation_t -> vhdl_component_instantiation_t |

72 |
method virtual vhdl_concurrent_stmt_t : vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t |

73 |
method virtual vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t |

74 |
method virtual vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t |

75 |
method virtual vhdl_configuration_t : vhdl_configuration_t -> vhdl_configuration_t |

76 |
method virtual vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t |

77 |
method virtual vhdl_package_t : vhdl_package_t -> vhdl_package_t |

78 |
method virtual vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t |

79 |
method virtual vhdl_load_t : vhdl_load_t -> vhdl_load_t |

80 |
method virtual vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t |

81 |
method virtual vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t |

82 | |

83 |
method vhdl_cst_val_t : vhdl_cst_val_t -> vhdl_cst_val_t= |

84 |
fun x -> |

85 |
match x with |

86 |
| CstInt a -> let a = self#int a in CstInt a |

87 |
| CstStdLogic a -> let a = self#string a in CstStdLogic a |

88 |
| CstLiteral a -> let a = self#string a in CstLiteral a |

89 | |

90 |
method vhdl_type_t : vhdl_type_t -> vhdl_type_t= |

91 |
fun x -> |

92 |
match x with |

93 |
| Base a -> let a = self#string a in Base a |

94 |
| Range (a,b,c) -> |

95 |
let a = self#option self#string a in |

96 |
let b = self#int b in let c = self#int c in Range (a, b, c) |

97 |
| Bit_vector (a,b) -> |

98 |
let a = self#int a in let b = self#int b in Bit_vector (a, b) |

99 |
| Array { indexes; const; definition } -> |

100 |
let indexes = self#list self#vhdl_name_t indexes in |

101 |
let const = self#option self#vhdl_constraint_t const in |

102 |
let definition = self#vhdl_subtype_indication_t definition in |

103 |
Array { indexes; const; definition } |

104 |
| Record a -> |

105 |
let a = self#list self#vhdl_element_declaration_t a in Record a |

106 |
| Enumerated a -> |

107 |
let a = self#list self#vhdl_name_t a in Enumerated a |

108 |
| Void -> Void |

109 |
method vhdl_element_declaration_t : |

110 |
vhdl_element_declaration_t -> vhdl_element_declaration_t= |

111 |
fun { names; definition } -> |

112 |
let names = self#list self#vhdl_name_t names in |

113 |
let definition = self#vhdl_subtype_indication_t definition in |

114 |
{ names; definition } |

115 |
method vhdl_subtype_indication_t : |

116 |
vhdl_subtype_indication_t -> vhdl_subtype_indication_t= |

117 |
fun { name; functionName; const } -> |

118 |
let name = self#vhdl_name_t name in |

119 |
let functionName = self#vhdl_name_t functionName in |

120 |
let const = self#vhdl_constraint_t const in |

121 |
{ name; functionName; const } |

122 |
method vhdl_discrete_range_t : |

123 |
vhdl_discrete_range_t -> vhdl_discrete_range_t= |

124 |
fun x -> |

125 |
match x with |

126 |
| SubDiscreteRange a -> |

127 |
let a = self#vhdl_subtype_indication_t a in SubDiscreteRange a |

128 |
| NamedRange a -> let a = self#vhdl_name_t a in NamedRange a |

129 |
| DirectedRange { direction; from; _to } -> |

130 |
let direction = self#string direction in |

131 |
let from = self#vhdl_expr_t from in |

132 |
let _to = self#vhdl_expr_t _to in |

133 |
DirectedRange { direction; from; _to } |

134 | |

135 |
method vhdl_constraint_t : vhdl_constraint_t -> vhdl_constraint_t= |

136 |
fun x -> |

137 |
match x with |

138 |
| RefConstraint { ref_name } -> |

139 |
let ref_name = self#vhdl_name_t ref_name in |

140 |
RefConstraint { ref_name } |

141 |
| RangeConstraint { range } -> |

142 |
let range = self#vhdl_discrete_range_t range in |

143 |
RangeConstraint { range } |

144 |
| IndexConstraint { ranges } -> |

145 |
let ranges = self#list self#vhdl_discrete_range_t ranges in |

146 |
IndexConstraint { ranges } |

147 |
| ArrayConstraint { ranges; sub } -> |

148 |
let ranges = self#list self#vhdl_discrete_range_t ranges in |

149 |
let sub = self#vhdl_constraint_t sub in |

150 |
ArrayConstraint { ranges; sub } |

151 |
| RecordConstraint -> RecordConstraint |

152 |
| NoConstraint -> NoConstraint |

153 | |

154 |
method vhdl_definition_t : vhdl_definition_t -> vhdl_definition_t= |

155 |
fun x -> |

156 |
match x with |

157 |
| Type { name; definition } -> |

158 |
let name = self#vhdl_name_t name in |

159 |
let definition = self#vhdl_type_t definition in |

160 |
Type { name; definition } |

161 |
| Subtype { name; typ } -> |

162 |
let name = self#vhdl_name_t name in |

163 |
let typ = self#vhdl_subtype_indication_t typ in |

164 |
Subtype { name; typ } |

165 |
method vhdl_expr_t : vhdl_expr_t -> vhdl_expr_t= |

166 |
fun x -> |

167 |
match x with |

168 |
| Call a -> let a = self#vhdl_name_t a in Call a |

169 |
| Cst a -> let a = self#vhdl_cst_val_t a in Cst a |

170 |
| Op { id; args } -> |

171 |
let id = self#string id in |

172 |
let args = self#list self#vhdl_expr_t args in Op { id; args } |

173 |
| IsNull -> IsNull |

174 |
| Time { value; phy_unit } -> |

175 |
let value = self#int value in |

176 |
let phy_unit = self#string phy_unit in Time { value; phy_unit } |

177 |
| Sig { name; att } -> |

178 |
let name = self#vhdl_name_t name in |

179 |
let att = self#option self#vhdl_signal_attributes_t att in |

180 |
Sig { name; att } |

181 |
| SuffixMod { expr; selection } -> |

182 |
let expr = self#vhdl_expr_t expr in |

183 |
let selection = self#vhdl_suffix_selection_t selection in |

184 |
SuffixMod { expr; selection } |

185 |
| Aggregate { elems } -> |

186 |
let elems = self#list self#vhdl_element_assoc_t elems in |

187 |
Aggregate { elems } |

188 |
| Others -> Others |

189 |
method vhdl_name_t : vhdl_name_t -> vhdl_name_t= |

190 |
fun x -> |

191 |
match x with |

192 |
| Simple a -> let a = self#string a in Simple a |

193 |
| Identifier a -> let a = self#string a in Identifier a |

194 |
| Selected a -> let a = self#list self#vhdl_name_t a in Selected a |

195 |
| Index { id; exprs } -> |

196 |
let id = self#vhdl_name_t id in |

197 |
let exprs = self#list self#vhdl_expr_t exprs in |

198 |
Index { id; exprs } |

199 |
| Slice { id; range } -> |

200 |
let id = self#vhdl_name_t id in |

201 |
let range = self#vhdl_discrete_range_t range in |

202 |
Slice { id; range } |

203 |
| Attribute { id; designator; expr } -> |

204 |
let id = self#vhdl_name_t id in |

205 |
let designator = self#vhdl_name_t designator in |

206 |
let expr = self#vhdl_expr_t expr in |

207 |
Attribute { id; designator; expr } |

208 |
| Function { id; assoc_list } -> |

209 |
let id = self#vhdl_name_t id in |

210 |
let assoc_list = self#list self#vhdl_assoc_element_t assoc_list |

211 |
in |

212 |
Function { id; assoc_list } |

213 |
| NoName -> NoName |

214 |
method vhdl_assoc_element_t : |

215 |
vhdl_assoc_element_t -> vhdl_assoc_element_t= |

216 |
fun |

217 |
{ formal_name; formal_arg; actual_name; actual_designator; |

218 |
actual_expr } |

219 |
-> |

220 |
let formal_name = self#option self#vhdl_name_t formal_name in |

221 |
let formal_arg = self#option self#vhdl_name_t formal_arg in |

222 |
let actual_name = self#option self#vhdl_name_t actual_name in |

223 |
let actual_designator = |

224 |
self#option self#vhdl_name_t actual_designator in |

225 |
let actual_expr = self#option self#vhdl_expr_t actual_expr in |

226 |
{ |

227 |
formal_name; |

228 |
formal_arg; |

229 |
actual_name; |

230 |
actual_designator; |

231 |
actual_expr |

232 |
} |

233 |
method vhdl_element_assoc_t : |

234 |
vhdl_element_assoc_t -> vhdl_element_assoc_t= |

235 |
fun { choices; expr } -> |

236 |
let choices = self#list self#vhdl_expr_t choices in |

237 |
let expr = self#vhdl_expr_t expr in { choices; expr } |

238 |
method vhdl_array_attributes_t : |

239 |
vhdl_array_attributes_t -> vhdl_array_attributes_t= |

240 |
fun x -> |

241 |
match x with |

242 |
| AAttInt { id; arg } -> |

243 |
let id = self#string id in |

244 |
let arg = self#int arg in AAttInt { id; arg } |

245 |
| AAttAscending -> AAttAscending |

246 |
method vhdl_signal_attributes_t : |

247 |
vhdl_signal_attributes_t -> vhdl_signal_attributes_t= |

248 |
fun x -> match x with | SigAtt a -> let a = self#string a in SigAtt a |

249 |
method vhdl_string_attributes_t : |

250 |
vhdl_string_attributes_t -> vhdl_string_attributes_t= |

251 |
fun x -> |

252 |
match x with | StringAtt a -> let a = self#string a in StringAtt a |

253 |
method vhdl_suffix_selection_t : vhdl_suffix_selection_t -> vhdl_suffix_selection_t= |

254 |
fun x -> |

255 |
match x with |

256 |
| Idx a -> let a = self#int a in Idx a |

257 |
| SuffixRange (a,b) -> |

258 |
let a = self#int a in let b = self#int b in SuffixRange (a, b) |

259 | |

260 |
method vhdl_type_attributes_t : |

261 |
'a . |

262 |
('a -> 'a) -> 'a vhdl_type_attributes_t -> 'a vhdl_type_attributes_t= |

263 |
fun _basetype -> |

264 |
fun x -> |

265 |
match x with |

266 |
| TAttNoArg { id } -> let id = self#string id in TAttNoArg { id } |

267 |
| TAttIntArg { id; arg } -> |

268 |
let id = self#string id in |

269 |
let arg = self#int arg in TAttIntArg { id; arg } |

270 |
| TAttValArg { id; arg } -> |

271 |
let id = self#string id in |

272 |
let arg = _basetype arg in TAttValArg { id; arg } |

273 |
| TAttStringArg { id; arg } -> |

274 |
let id = self#string id in |

275 |
let arg = self#string arg in TAttStringArg { id; arg } |

276 | |

277 |
method vhdl_parameter_t : vhdl_parameter_t -> vhdl_parameter_t= |

278 |
fun { names; mode; typ; init_val } -> |

279 |
let names = self#list self#vhdl_name_t names in |

280 |
let mode = self#list self#string mode in |

281 |
let typ = self#vhdl_subtype_indication_t typ in |

282 |
let init_val = self#option self#vhdl_cst_val_t init_val in |

283 |
{ names; mode; typ; init_val } |

284 | |

285 |
method vhdl_subprogram_spec_t : |

286 |
vhdl_subprogram_spec_t -> vhdl_subprogram_spec_t= |

287 |
fun { name; typeMark; parameters; isPure } -> |

288 |
let name = self#string name in |

289 |
let typeMark = self#vhdl_name_t typeMark in |

290 |
let parameters = self#list self#vhdl_parameter_t parameters in |

291 |
let isPure = self#bool isPure in |

292 |
{ name; typeMark; parameters; isPure } |

293 | |

294 |
method vhdl_sequential_stmt_t : |

295 |
vhdl_sequential_stmt_t -> vhdl_sequential_stmt_t= |

296 |
fun x -> |

297 |
match x with |

298 |
| VarAssign { label; lhs; rhs } -> |

299 |
let label = self#vhdl_name_t label in |

300 |
let lhs = self#vhdl_name_t lhs in |

301 |
let rhs = self#vhdl_expr_t rhs in VarAssign { label; lhs; rhs } |

302 |
| SigSeqAssign { label; lhs; rhs } -> |

303 |
let label = self#vhdl_name_t label in |

304 |
let lhs = self#vhdl_name_t lhs in |

305 |
let rhs = self#list self#vhdl_expr_t rhs in |

306 |
SigSeqAssign { label; lhs; rhs } |

307 |
| If { label; if_cases; default } -> |

308 |
let label = self#vhdl_name_t label in |

309 |
let if_cases = self#list self#vhdl_if_case_t if_cases in |

310 |
let default = self#list self#vhdl_sequential_stmt_t default in |

311 |
If { label; if_cases; default } |

312 |
| Case { label; guard; branches } -> |

313 |
let label = self#vhdl_name_t label in |

314 |
let guard = self#vhdl_expr_t guard in |

315 |
let branches = self#list self#vhdl_case_item_t branches in |

316 |
Case { label; guard; branches } |

317 |
| Exit { label; loop_label; condition } -> |

318 |
let label = self#vhdl_name_t label in |

319 |
let loop_label = self#option self#string loop_label in |

320 |
let condition = self#option self#vhdl_expr_t condition in |

321 |
Exit { label; loop_label; condition } |

322 |
| Assert { label; cond; report; severity } -> |

323 |
let label = self#vhdl_name_t label in |

324 |
let cond = self#vhdl_expr_t cond in |

325 |
let report = self#vhdl_expr_t report in |

326 |
let severity = self#vhdl_expr_t severity in |

327 |
Assert { label; cond; report; severity } |

328 |
| ProcedureCall { label; name; assocs } -> |

329 |
let label = self#vhdl_name_t label in |

330 |
let name = self#vhdl_name_t name in |

331 |
let assocs = self#list self#vhdl_assoc_element_t assocs in |

332 |
ProcedureCall { label; name; assocs } |

333 |
| Wait -> Wait |

334 |
| Null { label } -> |

335 |
let label = self#vhdl_name_t label in Null { label } |

336 |
| Return { label } -> |

337 |
let label = self#vhdl_name_t label in Return { label } |

338 |
method vhdl_if_case_t : vhdl_if_case_t -> vhdl_if_case_t= |

339 |
fun { if_cond; if_block } -> |

340 |
let if_cond = self#vhdl_expr_t if_cond in |

341 |
let if_block = self#list self#vhdl_sequential_stmt_t if_block in |

342 |
{ if_cond; if_block } |

343 |
method vhdl_case_item_t : vhdl_case_item_t -> vhdl_case_item_t= |

344 |
fun { when_cond; when_stmt } -> |

345 |
let when_cond = self#list self#vhdl_expr_t when_cond in |

346 |
let when_stmt = self#list self#vhdl_sequential_stmt_t when_stmt in |

347 |
{ when_cond; when_stmt } |

348 | |

349 |
method vhdl_declaration_t : vhdl_declaration_t -> vhdl_declaration_t= |

350 |
fun x -> |

351 |
match x with |

352 |
| VarDecl { names; typ; init_val } -> |

353 |
let names = self#list self#vhdl_name_t names in |

354 |
let typ = self#vhdl_subtype_indication_t typ in |

355 |
let init_val = self#vhdl_expr_t init_val in |

356 |
VarDecl { names; typ; init_val } |

357 |
| CstDecl { 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 |
CstDecl { names; typ; init_val } |

362 |
| SigDecl { 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 |
SigDecl { names; typ; init_val } |

367 |
| Subprogram { name; kind; spec; decl_part; stmts } -> |

368 |
let name = self#vhdl_name_t name in |

369 |
let kind = self#string kind in |

370 |
let spec = self#vhdl_subprogram_spec_t spec in |

371 |
let decl_part = self#list self#vhdl_declaration_t decl_part in |

372 |
let stmts = self#list self#vhdl_sequential_stmt_t stmts in |

373 |
Subprogram { name; kind; spec; decl_part; stmts } |

374 | |

375 |
method vhdl_signal_condition_t : vhdl_signal_condition_t -> vhdl_signal_condition_t= |

376 |
fun { expr; cond } -> |

377 |
let expr = self#list self#vhdl_expr_t expr in |

378 |
let cond = self#vhdl_expr_t cond in { expr; cond } |

379 | |

380 |
method vhdl_signal_selection_t : vhdl_signal_selection_t -> vhdl_signal_selection_t= |

381 |
fun { expr; when_sel } -> |

382 |
let expr = self#vhdl_expr_t expr in |

383 |
let when_sel = self#list self#vhdl_expr_t when_sel in |

384 |
{ expr; when_sel } |

385 | |

386 |
method vhdl_conditional_signal_t : |

387 |
vhdl_conditional_signal_t -> vhdl_conditional_signal_t= |

388 |
fun { postponed; label; lhs; rhs; cond; delay } -> |

389 |
let postponed = self#bool postponed in |

390 |
let label = self#vhdl_name_t label in |

391 |
let lhs = self#vhdl_name_t lhs in |

392 |
let rhs = self#list self#vhdl_signal_condition_t rhs in |

393 |
let cond = self#vhdl_expr_t cond in |

394 |
let delay = self#vhdl_expr_t delay in |

395 |
{ postponed; label; lhs; rhs; cond; delay } |

396 | |

397 | |

398 |
method vhdl_process_t : vhdl_process_t -> vhdl_process_t= |

399 |
fun { id; declarations; active_sigs; body } -> |

400 |
let id = self#vhdl_name_t id in |

401 |
let declarations = |

402 |
self#option (self#list self#vhdl_declaration_t) declarations in |

403 |
let active_sigs = self#list self#vhdl_name_t active_sigs in |

404 |
let body = self#list self#vhdl_sequential_stmt_t body in |

405 |
{ id; declarations; active_sigs; body } |

406 | |

407 |
method vhdl_selected_signal_t : vhdl_selected_signal_t -> vhdl_selected_signal_t= |

408 |
fun { postponed; label; lhs; sel; branches; delay } -> |

409 |
let postponed = self#bool postponed in |

410 |
let label = self#vhdl_name_t label in |

411 |
let lhs = self#vhdl_name_t lhs in |

412 |
let sel = self#vhdl_expr_t sel in |

413 |
let branches = self#list self#vhdl_signal_selection_t branches in |

414 |
let delay = self#option self#vhdl_expr_t delay in |

415 |
{ postponed; label; lhs; sel; branches; delay } |

416 | |

417 |
method vhdl_port_mode_t : vhdl_port_mode_t -> vhdl_port_mode_t= |

418 |
fun x -> x |

419 | |

420 |
method vhdl_component_instantiation_t : |

421 |
vhdl_component_instantiation_t -> vhdl_component_instantiation_t= |

422 |
fun { name; inst_unit; archi_name; generic_map; port_map } -> |

423 |
let name = self#vhdl_name_t name in |

424 |
let inst_unit = self#vhdl_name_t inst_unit in |

425 |
let archi_name = self#option self#vhdl_name_t archi_name in |

426 |
let generic_map = self#option self#vhdl_assoc_element_t generic_map |

427 |
in |

428 |
let port_map = self#option self#vhdl_assoc_element_t port_map in |

429 |
{ name; inst_unit; archi_name; generic_map; port_map } |

430 | |

431 |
method vhdl_concurrent_stmt_t : |

432 |
vhdl_concurrent_stmt_t -> vhdl_concurrent_stmt_t= |

433 |
fun x -> |

434 |
match x with |

435 |
| SigAssign a -> let a = self#vhdl_conditional_signal_t a in SigAssign a |

436 |
| Process a -> let a = self#vhdl_process_t a in Process a |

437 |
| SelectedSig a -> let a = self#vhdl_selected_signal_t a in SelectedSig a |

438 |
| ComponentInst a -> let a = self#vhdl_component_instantiation_t a in ComponentInst a |

439 | |

440 |
method vhdl_port_t : vhdl_port_t -> vhdl_port_t= |

441 |
fun { names; mode; typ; expr } -> |

442 |
let names = self#list self#vhdl_name_t names in |

443 |
let mode = self#vhdl_port_mode_t mode in |

444 |
let typ = self#vhdl_subtype_indication_t typ in |

445 |
let expr = self#vhdl_expr_t expr in { names; mode; typ; expr } |

446 | |

447 |
method vhdl_entity_t : vhdl_entity_t -> vhdl_entity_t= |

448 |
fun { name; generics; ports; declaration; stmts } -> |

449 |
let name = self#vhdl_name_t name in |

450 |
let generics = self#list self#vhdl_port_t generics in |

451 |
let ports = self#list self#vhdl_port_t ports in |

452 |
let declaration = self#list self#vhdl_declaration_t declaration in |

453 |
let stmts = self#list self#vhdl_concurrent_stmt_t stmts in |

454 |
{ name; generics; ports; declaration; stmts } |

455 | |

456 |
method vhdl_package_t : vhdl_package_t -> vhdl_package_t= |

457 |
fun { name; shared_defs; shared_decls } -> |

458 |
let name = self#vhdl_name_t name in |

459 |
let shared_defs = self#list self#vhdl_definition_t shared_defs in |

460 |
let shared_decls = self#list self#vhdl_declaration_t shared_decls in |

461 |
{ name; shared_defs; shared_decls } |

462 | |

463 |
method vhdl_load_t : vhdl_load_t -> vhdl_load_t= |

464 |
fun x -> |

465 |
match x with |

466 |
| Library a -> let a = self#list self#vhdl_name_t a in Library a |

467 |
| Use a -> let a = self#list self#vhdl_name_t a in Use a |

468 | |

469 |
method vhdl_architecture_t : vhdl_architecture_t -> vhdl_architecture_t= |

470 |
fun { name; entity; declarations; body } -> |

471 |
let name = self#vhdl_name_t name in |

472 |
let entity = self#vhdl_name_t entity in |

473 |
let declarations = self#list self#vhdl_declaration_t declarations in |

474 |
let body = self#list self#vhdl_concurrent_stmt_t body in |

475 |
{ name; entity; declarations; body } |

476 | |

477 |
method vhdl_configuration_t : |

478 |
vhdl_configuration_t -> vhdl_configuration_t= self#unit |

479 | |

480 |
method vhdl_library_unit_t : vhdl_library_unit_t -> vhdl_library_unit_t= |

481 |
fun x -> |

482 |
match x with |

483 |
| Package a -> let a = self#vhdl_package_t a in Package a |

484 |
| Entities a -> let a = self#vhdl_entity_t a in Entities a |

485 |
| Architecture a -> |

486 |
let a = self#vhdl_architecture_t a in Architecture a |

487 |
| Configuration a -> |

488 |
let a = self#vhdl_configuration_t a in Configuration a |

489 | |

490 |
method vhdl_design_unit_t : vhdl_design_unit_t -> vhdl_design_unit_t= |

491 |
fun { contexts; library } -> |

492 |
let contexts = self#list self#vhdl_load_t contexts in |

493 |
let library = self#vhdl_library_unit_t library in |

494 |
{ contexts; library } |

495 | |

496 |
method vhdl_design_file_t : vhdl_design_file_t -> vhdl_design_file_t= |

497 |
fun { design_units } -> |

498 |
let design_units = self#list self#vhdl_design_unit_t design_units in |

499 |
{ design_units } |

500 | |

501 |
method vhdl_file_t : vhdl_file_t -> vhdl_file_t= |

502 |
fun { design_file } -> |

503 |
let design_file = self#vhdl_design_file_t design_file in |

504 |
{ design_file } |

505 |
end |