Release coccinelle-0.2.5-rc1
[bpt/coccinelle.git] / parsing_c / visitor_c.mli
CommitLineData
34e49164
C
1open Ast_c
2
3type visitor_c = {
4 kexpr : (expression -> unit) * visitor_c -> expression -> unit;
5 kstatement : (statement -> unit) * visitor_c -> statement -> unit;
6 ktype : (fullType -> unit) * visitor_c -> fullType -> unit;
b1b2de81 7
34e49164 8 kdecl : (declaration -> unit) * visitor_c -> declaration -> unit;
951c7801
C
9 konedecl : (onedecl -> unit) * visitor_c -> onedecl -> unit;
10 kparam : (parameterType -> unit) * visitor_c -> parameterType -> unit;
34e49164 11 kdef : (definition -> unit) * visitor_c -> definition -> unit;
b1b2de81
C
12 kname : (name -> unit) * visitor_c -> name -> unit;
13
34e49164 14 kini : (initialiser -> unit) * visitor_c -> initialiser -> unit;
b1b2de81
C
15 kfield : (field -> unit) * visitor_c -> field -> unit;
16
485bce71 17 kcppdirective: (cpp_directive -> unit) * visitor_c -> cpp_directive -> unit;
b1b2de81 18 kdefineval : (define_val -> unit) * visitor_c -> define_val -> unit;
485bce71 19 kstatementseq: (statement_sequencable -> unit) * visitor_c -> statement_sequencable -> unit;
0708f913
C
20
21
ae4735db 22 knode:
34e49164
C
23 (Control_flow_c.node -> unit) * visitor_c -> Control_flow_c.node -> unit;
24 ktoplevel: (toplevel -> unit) * visitor_c -> toplevel -> unit;
b1b2de81 25
485bce71 26 kinfo : (info -> unit) * visitor_c -> info -> unit;
34e49164
C
27}
28
29val default_visitor_c : visitor_c
30
31val vk_expr : visitor_c -> expression -> unit
32val vk_statement : visitor_c -> statement -> unit
002099fc 33val vk_statement_sequencable : visitor_c -> statement_sequencable -> unit
34e49164
C
34val vk_type : visitor_c -> fullType -> unit
35val vk_decl : visitor_c -> declaration -> unit
91eba41f 36val vk_onedecl : visitor_c -> onedecl -> unit
34e49164 37val vk_ini : visitor_c -> initialiser -> unit
c491d8ee
C
38val vk_inis_splitted :
39 visitor_c -> (initialiser, il) Common.either list -> unit
b1b2de81 40val vk_name : visitor_c -> name -> unit
34e49164
C
41val vk_def : visitor_c -> definition -> unit
42val vk_node : visitor_c -> Control_flow_c.node -> unit
43val vk_info : visitor_c -> info -> unit
485bce71
C
44val vk_toplevel : visitor_c -> toplevel -> unit
45val vk_program : visitor_c -> program -> unit
34e49164
C
46
47val vk_argument : visitor_c -> argument -> unit
faf9a90c 48val vk_argument_list : visitor_c -> argument wrap2 list -> unit
34e49164
C
49val vk_args_splitted : visitor_c -> (argument, il) Common.either list -> unit
50val vk_param : visitor_c -> parameterType -> unit
faf9a90c 51val vk_param_list : visitor_c -> parameterType wrap2 list -> unit
ae4735db 52val vk_params_splitted :
34e49164
C
53 visitor_c -> (parameterType, il) Common.either list -> unit
54
413ffc02 55val vk_struct_field : visitor_c -> field -> unit
485bce71
C
56val vk_struct_fields : visitor_c -> field list -> unit
57val vk_struct_fieldkinds : visitor_c -> fieldkind wrap list -> unit
c491d8ee
C
58val vk_enum_fields : visitor_c -> enumType -> unit
59val vk_enum_fields_splitted :
60 visitor_c -> (oneEnumType, il) Common.either list -> unit
34e49164
C
61
62val vk_cst : visitor_c -> ((constant, string) Common.either wrap) -> unit
63
ae4735db 64val vk_define_params_splitted :
34e49164
C
65 visitor_c -> (string Ast_c.wrap, il) Common.either list -> unit
66
67
68
b1b2de81 69(* ------------------------------------------------------------------------ *)
34e49164
C
70type 'a inout = 'a -> 'a
71type visitor_c_s = {
72 kexpr_s : expression inout * visitor_c_s -> expression inout;
73 kstatement_s : statement inout * visitor_c_s -> statement inout;
74 ktype_s : fullType inout * visitor_c_s -> fullType inout;
b1b2de81 75
34e49164
C
76 kdecl_s : declaration inout * visitor_c_s -> declaration inout;
77 kdef_s : definition inout * visitor_c_s -> definition inout;
b1b2de81
C
78 kname_s : name inout * visitor_c_s -> name inout;
79
485bce71 80 kini_s : initialiser inout * visitor_c_s -> initialiser inout;
b1b2de81 81
485bce71
C
82 kcppdirective_s : (cpp_directive inout * visitor_c_s) -> cpp_directive inout;
83 kdefineval_s : (define_val inout * visitor_c_s) -> define_val inout;
84 kstatementseq_s: (statement_sequencable inout * visitor_c_s) -> statement_sequencable inout;
ae4735db 85 kstatementseq_list_s:
485bce71 86 (statement_sequencable list inout * visitor_c_s) -> statement_sequencable list inout;
b1b2de81 87
ae4735db 88 knode_s :
34e49164 89 Control_flow_c.node inout * visitor_c_s -> Control_flow_c.node inout;
485bce71 90 ktoplevel_s : toplevel inout * visitor_c_s -> toplevel inout;
b1b2de81 91
34e49164
C
92 kinfo_s : info inout * visitor_c_s -> info inout;
93 }
94
95val default_visitor_c_s : visitor_c_s
96
97val vk_expr_s : visitor_c_s -> expression -> expression
98val vk_argument_s : visitor_c_s -> argument -> argument
99val vk_statement_s : visitor_c_s -> statement -> statement
485bce71 100val vk_statement_sequencable_s : visitor_c_s -> statement_sequencable -> statement_sequencable
34e49164
C
101val vk_type_s : visitor_c_s -> fullType -> fullType
102val vk_decl_s : visitor_c_s -> declaration -> declaration
103val vk_ini_s : visitor_c_s -> initialiser -> initialiser
c491d8ee
C
104
105val vk_inis_splitted_s :
106 visitor_c_s ->
107 (initialiser, il) Common.either list ->
108 (initialiser, il) Common.either list
109
34e49164 110val vk_def_s : visitor_c_s -> definition -> definition
c491d8ee 111val vk_name_s : visitor_c_s -> name -> name
34e49164
C
112val vk_toplevel_s : visitor_c_s -> toplevel -> toplevel
113val vk_info_s : visitor_c_s -> info -> info
91eba41f 114val vk_ii_s : visitor_c_s -> info list -> info list
34e49164 115val vk_node_s : visitor_c_s -> Control_flow_c.node -> Control_flow_c.node
485bce71 116val vk_program_s : visitor_c_s -> program -> program
34e49164 117
ae4735db
C
118val vk_arguments_s :
119 visitor_c_s ->
34e49164
C
120 argument wrap2 list -> argument wrap2 list
121
ae4735db
C
122val vk_args_splitted_s :
123 visitor_c_s ->
124 (argument, il) Common.either list ->
34e49164
C
125 (argument, il) Common.either list
126
ae4735db
C
127val vk_params_s :
128 visitor_c_s ->
34e49164
C
129 parameterType wrap2 list -> parameterType wrap2 list
130
ae4735db
C
131val vk_params_splitted_s :
132 visitor_c_s ->
133 (parameterType, il) Common.either list ->
34e49164
C
134 (parameterType, il) Common.either list
135
136
137
138val vk_param_s : visitor_c_s -> parameterType -> parameterType
139
ae4735db
C
140val vk_define_params_splitted_s :
141 visitor_c_s ->
142 (string Ast_c.wrap, il) Common.either list ->
34e49164
C
143 (string Ast_c.wrap, il) Common.either list
144
c491d8ee
C
145val vk_enum_fields_s : visitor_c_s -> enumType -> enumType
146val vk_enum_fields_splitted_s : visitor_c_s ->
147 (oneEnumType, il) Common.either list ->
148 (oneEnumType, il) Common.either list
413ffc02 149val vk_struct_field_s : visitor_c_s -> field -> field
485bce71 150val vk_struct_fields_s : visitor_c_s -> field list -> field list
34e49164 151
ae4735db 152val vk_cst_s : visitor_c_s -> ((constant, string) Common.either wrap) inout