/nesc-1.3.3/src/AST_parent.c

# · C · 527 lines · 453 code · 72 blank · 2 comment · 0 complexity · ea6a8fe6399031242dc957402ba0258b MD5 · raw file

  1. /* Automatically generated from nodetypes.def, do not edit. */
  2. /* See the copyright notice in nodetypes.def */
  3. case kind_node: break;
  4. case kind_declaration: case kind_error_decl: break;
  5. case kind_statement: case kind_error_stmt: break;
  6. case kind_expression: case kind_error_expr: break;
  7. case kind_type_element: break;
  8. case kind_declarator: break;
  9. case kind_label: break;
  10. case kind_asm_decl: {
  11. asm_decl x = CAST(asm_decl, n);
  12. AST_set_parent_list(&x->asm_stmt, n);
  13. break;
  14. }
  15. case kind_data_decl: {
  16. data_decl x = CAST(data_decl, n);
  17. AST_set_parent_list(&x->modifiers, n);
  18. AST_set_parent_list(&x->decls, n);
  19. break;
  20. }
  21. case kind_extension_decl: {
  22. extension_decl x = CAST(extension_decl, n);
  23. AST_set_parent_list(&x->decl, n);
  24. break;
  25. }
  26. case kind_ellipsis_decl: break;
  27. case kind_enumerator: {
  28. enumerator x = CAST(enumerator, n);
  29. AST_set_parent_list(&x->arg1, n);
  30. break;
  31. }
  32. case kind_oldidentifier_decl: break;
  33. case kind_function_decl: {
  34. function_decl x = CAST(function_decl, n);
  35. AST_set_parent_list(&x->declarator, n);
  36. AST_set_parent_list(&x->modifiers, n);
  37. AST_set_parent_list(&x->attributes, n);
  38. AST_set_parent_list(&x->stmt, n);
  39. break;
  40. }
  41. case kind_implicit_decl: break;
  42. case kind_variable_decl: {
  43. variable_decl x = CAST(variable_decl, n);
  44. AST_set_parent_list(&x->declarator, n);
  45. AST_set_parent_list(&x->attributes, n);
  46. AST_set_parent_list(&x->arg1, n);
  47. AST_set_parent_list(&x->asm_stmt, n);
  48. break;
  49. }
  50. case kind_field_decl: {
  51. field_decl x = CAST(field_decl, n);
  52. AST_set_parent_list(&x->declarator, n);
  53. AST_set_parent_list(&x->attributes, n);
  54. AST_set_parent_list(&x->arg1, n);
  55. break;
  56. }
  57. case kind_asttype: {
  58. asttype x = CAST(asttype, n);
  59. AST_set_parent_list(&x->declarator, n);
  60. AST_set_parent_list(&x->qualifiers, n);
  61. break;
  62. }
  63. case kind_typename: break;
  64. case kind_typeof_expr: {
  65. typeof_expr x = CAST(typeof_expr, n);
  66. AST_set_parent_list(&x->arg1, n);
  67. break;
  68. }
  69. case kind_typeof_type: {
  70. typeof_type x = CAST(typeof_type, n);
  71. AST_set_parent_list(&x->asttype, n);
  72. break;
  73. }
  74. case kind_attribute: {
  75. attribute x = CAST(attribute, n);
  76. AST_set_parent_list(&x->word1, n);
  77. break;
  78. }
  79. case kind_gcc_attribute: case kind_target_attribute: {
  80. gcc_attribute x = CAST(gcc_attribute, n);
  81. AST_set_parent_list(&x->word1, n);
  82. AST_set_parent_list(&x->args, n);
  83. break;
  84. }
  85. case kind_rid: break;
  86. case kind_qualifier: break;
  87. case kind_tag_ref: case kind_enum_ref: case kind_attribute_ref: {
  88. tag_ref x = CAST(tag_ref, n);
  89. AST_set_parent_list(&x->word1, n);
  90. AST_set_parent_list(&x->attributes, n);
  91. AST_set_parent_list(&x->fields, n);
  92. break;
  93. }
  94. case kind_struct_ref: case kind_nx_struct_ref: {
  95. struct_ref x = CAST(struct_ref, n);
  96. AST_set_parent_list(&x->word1, n);
  97. AST_set_parent_list(&x->attributes, n);
  98. AST_set_parent_list(&x->fields, n);
  99. break;
  100. }
  101. case kind_union_ref: case kind_nx_union_ref: {
  102. union_ref x = CAST(union_ref, n);
  103. AST_set_parent_list(&x->word1, n);
  104. AST_set_parent_list(&x->attributes, n);
  105. AST_set_parent_list(&x->fields, n);
  106. break;
  107. }
  108. case kind_nested_declarator: {
  109. nested_declarator x = CAST(nested_declarator, n);
  110. AST_set_parent_list(&x->declarator, n);
  111. break;
  112. }
  113. case kind_function_declarator: {
  114. function_declarator x = CAST(function_declarator, n);
  115. AST_set_parent_list(&x->declarator, n);
  116. AST_set_parent_list(&x->parms, n);
  117. AST_set_parent_list(&x->gparms, n);
  118. AST_set_parent_list(&x->qualifiers, n);
  119. AST_set_parent_list(&x->return_type, n);
  120. break;
  121. }
  122. case kind_pointer_declarator: {
  123. pointer_declarator x = CAST(pointer_declarator, n);
  124. AST_set_parent_list(&x->declarator, n);
  125. break;
  126. }
  127. case kind_qualified_declarator: {
  128. qualified_declarator x = CAST(qualified_declarator, n);
  129. AST_set_parent_list(&x->declarator, n);
  130. AST_set_parent_list(&x->modifiers, n);
  131. break;
  132. }
  133. case kind_array_declarator: {
  134. array_declarator x = CAST(array_declarator, n);
  135. AST_set_parent_list(&x->declarator, n);
  136. AST_set_parent_list(&x->arg1, n);
  137. break;
  138. }
  139. case kind_identifier_declarator: break;
  140. case kind_asm_stmt: {
  141. asm_stmt x = CAST(asm_stmt, n);
  142. AST_set_parent_list(&x->arg1, n);
  143. AST_set_parent_list(&x->asm_operands1, n);
  144. AST_set_parent_list(&x->asm_operands2, n);
  145. AST_set_parent_list(&x->asm_clobbers, n);
  146. AST_set_parent_list(&x->qualifiers, n);
  147. break;
  148. }
  149. case kind_compound_stmt: {
  150. compound_stmt x = CAST(compound_stmt, n);
  151. AST_set_parent_list(&x->id_labels, n);
  152. AST_set_parent_list(&x->decls, n);
  153. AST_set_parent_list(&x->stmts, n);
  154. break;
  155. }
  156. case kind_if_stmt: {
  157. if_stmt x = CAST(if_stmt, n);
  158. AST_set_parent_list(&x->condition, n);
  159. AST_set_parent_list(&x->stmt1, n);
  160. AST_set_parent_list(&x->stmt2, n);
  161. break;
  162. }
  163. case kind_labeled_stmt: {
  164. labeled_stmt x = CAST(labeled_stmt, n);
  165. AST_set_parent_list(&x->label, n);
  166. AST_set_parent_list(&x->stmt, n);
  167. break;
  168. }
  169. case kind_expression_stmt: {
  170. expression_stmt x = CAST(expression_stmt, n);
  171. AST_set_parent_list(&x->arg1, n);
  172. break;
  173. }
  174. case kind_conditional_stmt: case kind_dowhile_stmt: case kind_while_stmt: {
  175. conditional_stmt x = CAST(conditional_stmt, n);
  176. AST_set_parent_list(&x->condition, n);
  177. AST_set_parent_list(&x->stmt, n);
  178. break;
  179. }
  180. case kind_switch_stmt: {
  181. switch_stmt x = CAST(switch_stmt, n);
  182. AST_set_parent_list(&x->condition, n);
  183. AST_set_parent_list(&x->stmt, n);
  184. break;
  185. }
  186. case kind_for_stmt: {
  187. for_stmt x = CAST(for_stmt, n);
  188. AST_set_parent_list(&x->arg1, n);
  189. AST_set_parent_list(&x->arg2, n);
  190. AST_set_parent_list(&x->arg3, n);
  191. AST_set_parent_list(&x->stmt, n);
  192. break;
  193. }
  194. case kind_break_stmt: break;
  195. case kind_continue_stmt: break;
  196. case kind_return_stmt: {
  197. return_stmt x = CAST(return_stmt, n);
  198. AST_set_parent_list(&x->arg1, n);
  199. break;
  200. }
  201. case kind_goto_stmt: {
  202. goto_stmt x = CAST(goto_stmt, n);
  203. AST_set_parent_list(&x->id_label, n);
  204. break;
  205. }
  206. case kind_computed_goto_stmt: {
  207. computed_goto_stmt x = CAST(computed_goto_stmt, n);
  208. AST_set_parent_list(&x->arg1, n);
  209. break;
  210. }
  211. case kind_empty_stmt: break;
  212. case kind_unary: case kind_not: case kind_bitnot: case kind_conjugate: case kind_unary_plus: case kind_unary_minus: case kind_address_of: case kind_imagpart: case kind_realpart: case kind_alignof_expr: case kind_sizeof_expr: case kind_extension_expr: case kind_dereference: {
  213. unary x = CAST(unary, n);
  214. AST_set_parent_list(&x->arg1, n);
  215. break;
  216. }
  217. case kind_binary: case kind_oror: case kind_andand: case kind_bitxor: case kind_bitor: case kind_bitand: case kind_rshift: case kind_lshift: case kind_modulo: case kind_divide: case kind_times: case kind_minus: case kind_plus: case kind_array_ref: {
  218. binary x = CAST(binary, n);
  219. AST_set_parent_list(&x->arg1, n);
  220. AST_set_parent_list(&x->arg2, n);
  221. break;
  222. }
  223. case kind_comma: {
  224. comma x = CAST(comma, n);
  225. AST_set_parent_list(&x->arg1, n);
  226. break;
  227. }
  228. case kind_sizeof_type: {
  229. sizeof_type x = CAST(sizeof_type, n);
  230. AST_set_parent_list(&x->asttype, n);
  231. break;
  232. }
  233. case kind_alignof_type: {
  234. alignof_type x = CAST(alignof_type, n);
  235. AST_set_parent_list(&x->asttype, n);
  236. break;
  237. }
  238. case kind_label_address: {
  239. label_address x = CAST(label_address, n);
  240. AST_set_parent_list(&x->id_label, n);
  241. break;
  242. }
  243. case kind_cast: {
  244. cast x = CAST(cast, n);
  245. AST_set_parent_list(&x->arg1, n);
  246. AST_set_parent_list(&x->asttype, n);
  247. break;
  248. }
  249. case kind_cast_list: {
  250. cast_list x = CAST(cast_list, n);
  251. AST_set_parent_list(&x->asttype, n);
  252. AST_set_parent_list(&x->init_expr, n);
  253. break;
  254. }
  255. case kind_conditional: {
  256. conditional x = CAST(conditional, n);
  257. AST_set_parent_list(&x->condition, n);
  258. AST_set_parent_list(&x->arg1, n);
  259. AST_set_parent_list(&x->arg2, n);
  260. break;
  261. }
  262. case kind_identifier: break;
  263. case kind_compound_expr: {
  264. compound_expr x = CAST(compound_expr, n);
  265. AST_set_parent_list(&x->stmt, n);
  266. break;
  267. }
  268. case kind_function_call: {
  269. function_call x = CAST(function_call, n);
  270. AST_set_parent_list(&x->arg1, n);
  271. AST_set_parent_list(&x->args, n);
  272. break;
  273. }
  274. case kind_field_ref: {
  275. field_ref x = CAST(field_ref, n);
  276. AST_set_parent_list(&x->arg1, n);
  277. break;
  278. }
  279. case kind_increment: case kind_postdecrement: case kind_postincrement: case kind_predecrement: case kind_preincrement: {
  280. increment x = CAST(increment, n);
  281. AST_set_parent_list(&x->arg1, n);
  282. break;
  283. }
  284. case kind_comparison: case kind_ne: case kind_eq: case kind_gt: case kind_lt: case kind_geq: case kind_leq: {
  285. comparison x = CAST(comparison, n);
  286. AST_set_parent_list(&x->arg1, n);
  287. AST_set_parent_list(&x->arg2, n);
  288. break;
  289. }
  290. case kind_assignment: case kind_bitxor_assign: case kind_bitor_assign: case kind_bitand_assign: case kind_rshift_assign: case kind_lshift_assign: case kind_modulo_assign: case kind_divide_assign: case kind_times_assign: case kind_minus_assign: case kind_plus_assign: case kind_assign: {
  291. assignment x = CAST(assignment, n);
  292. AST_set_parent_list(&x->arg1, n);
  293. AST_set_parent_list(&x->arg2, n);
  294. break;
  295. }
  296. case kind_init_list: {
  297. init_list x = CAST(init_list, n);
  298. AST_set_parent_list(&x->args, n);
  299. break;
  300. }
  301. case kind_init_specific: {
  302. init_specific x = CAST(init_specific, n);
  303. AST_set_parent_list(&x->designator, n);
  304. AST_set_parent_list(&x->init_expr, n);
  305. break;
  306. }
  307. case kind_designator: break;
  308. case kind_designate_field: break;
  309. case kind_designate_index: {
  310. designate_index x = CAST(designate_index, n);
  311. AST_set_parent_list(&x->arg1, n);
  312. AST_set_parent_list(&x->arg2, n);
  313. break;
  314. }
  315. case kind_lexical_cst: break;
  316. case kind_string_cst: break;
  317. case kind_string: {
  318. string x = CAST(string, n);
  319. AST_set_parent_list(&x->strings, n);
  320. break;
  321. }
  322. case kind_id_label: break;
  323. case kind_case_label: {
  324. case_label x = CAST(case_label, n);
  325. AST_set_parent_list(&x->arg1, n);
  326. AST_set_parent_list(&x->arg2, n);
  327. break;
  328. }
  329. case kind_default_label: break;
  330. case kind_word: break;
  331. case kind_asm_operand: {
  332. asm_operand x = CAST(asm_operand, n);
  333. AST_set_parent_list(&x->word1, n);
  334. AST_set_parent_list(&x->string, n);
  335. AST_set_parent_list(&x->arg1, n);
  336. break;
  337. }
  338. case kind_nesc_decl: {
  339. nesc_decl x = CAST(nesc_decl, n);
  340. AST_set_parent_list(&x->word1, n);
  341. AST_set_parent_list(&x->attributes, n);
  342. break;
  343. }
  344. case kind_interface: {
  345. interface x = CAST(interface, n);
  346. AST_set_parent_list(&x->word1, n);
  347. AST_set_parent_list(&x->attributes, n);
  348. AST_set_parent_list(&x->decls, n);
  349. break;
  350. }
  351. case kind_component: {
  352. component x = CAST(component, n);
  353. AST_set_parent_list(&x->word1, n);
  354. AST_set_parent_list(&x->attributes, n);
  355. AST_set_parent_list(&x->parms, n);
  356. AST_set_parent_list(&x->decls, n);
  357. AST_set_parent_list(&x->implementation, n);
  358. break;
  359. }
  360. case kind_implementation: break;
  361. case kind_configuration: {
  362. configuration x = CAST(configuration, n);
  363. AST_set_parent_list(&x->decls, n);
  364. break;
  365. }
  366. case kind_module: {
  367. module x = CAST(module, n);
  368. AST_set_parent_list(&x->decls, n);
  369. break;
  370. }
  371. case kind_binary_component: break;
  372. case kind_rp_interface: {
  373. rp_interface x = CAST(rp_interface, n);
  374. AST_set_parent_list(&x->decls, n);
  375. break;
  376. }
  377. case kind_interface_ref: {
  378. interface_ref x = CAST(interface_ref, n);
  379. AST_set_parent_list(&x->word1, n);
  380. AST_set_parent_list(&x->args, n);
  381. AST_set_parent_list(&x->word2, n);
  382. AST_set_parent_list(&x->gparms, n);
  383. AST_set_parent_list(&x->attributes, n);
  384. break;
  385. }
  386. case kind_component_ref: {
  387. component_ref x = CAST(component_ref, n);
  388. AST_set_parent_list(&x->word1, n);
  389. AST_set_parent_list(&x->word2, n);
  390. AST_set_parent_list(&x->args, n);
  391. break;
  392. }
  393. case kind_connection: case kind_eq_connection: case kind_rp_connection: {
  394. connection x = CAST(connection, n);
  395. AST_set_parent_list(&x->ep1, n);
  396. AST_set_parent_list(&x->ep2, n);
  397. break;
  398. }
  399. case kind_endpoint: {
  400. endpoint x = CAST(endpoint, n);
  401. AST_set_parent_list(&x->ids, n);
  402. break;
  403. }
  404. case kind_parameterised_identifier: {
  405. parameterised_identifier x = CAST(parameterised_identifier, n);
  406. AST_set_parent_list(&x->word1, n);
  407. AST_set_parent_list(&x->args, n);
  408. break;
  409. }
  410. case kind_generic_declarator: {
  411. generic_declarator x = CAST(generic_declarator, n);
  412. AST_set_parent_list(&x->declarator, n);
  413. AST_set_parent_list(&x->parms, n);
  414. break;
  415. }
  416. case kind_generic_call: {
  417. generic_call x = CAST(generic_call, n);
  418. AST_set_parent_list(&x->arg1, n);
  419. AST_set_parent_list(&x->args, n);
  420. break;
  421. }
  422. case kind_interface_ref_declarator: {
  423. interface_ref_declarator x = CAST(interface_ref_declarator, n);
  424. AST_set_parent_list(&x->declarator, n);
  425. AST_set_parent_list(&x->word1, n);
  426. break;
  427. }
  428. case kind_interface_deref: {
  429. interface_deref x = CAST(interface_deref, n);
  430. AST_set_parent_list(&x->arg1, n);
  431. break;
  432. }
  433. case kind_component_deref: {
  434. component_deref x = CAST(component_deref, n);
  435. AST_set_parent_list(&x->arg1, n);
  436. break;
  437. }
  438. case kind_component_typeref: break;
  439. case kind_atomic_stmt: {
  440. atomic_stmt x = CAST(atomic_stmt, n);
  441. AST_set_parent_list(&x->stmt, n);
  442. break;
  443. }
  444. case kind_nesc_attribute: {
  445. nesc_attribute x = CAST(nesc_attribute, n);
  446. AST_set_parent_list(&x->word1, n);
  447. AST_set_parent_list(&x->arg1, n);
  448. break;
  449. }
  450. case kind_type_parm_decl: break;
  451. case kind_type_argument: {
  452. type_argument x = CAST(type_argument, n);
  453. AST_set_parent_list(&x->asttype, n);
  454. break;
  455. }