1 (* Expanding or extracting macros, at the token level *)
3 (* corresponds to what is in the yacfe configuration file (e.g. standard.h) *)
4 type define_def
= string * define_param
* define_body
7 | Params
of string list
9 | DefineBody
of Parser_c.token list
10 | DefineHint
of parsinghack_hint
12 (* strongly corresponds to the TMacroXxx in the grammar and lexer and the
13 * MacroXxx in the ast.
15 and parsinghack_hint
=
21 | HintMacroIdentBuilder
23 val string_of_define_def
: define_def
-> string
25 (* This function work by side effect and may generate new tokens
26 * in the new_tokens_before field of the token_extended in the
27 * paren_grouped list. So don't forget to recall
28 * Token_views_c.rebuild_tokens_extented after this call, as well
29 * as probably insert_virtual_positions as new tokens
32 * note: it does not do some fixpoint, so the generated code may also
33 * contain some macros names.
36 msg_apply_known_macro
:(string -> unit) ->
37 msg_apply_known_macro_hint
:(string -> unit) ->
38 ?evaluate_concatop
:bool ->
39 ?inplace_when_single
:bool ->
40 (string, define_def
) Hashtbl.t
->
41 Token_views_c.paren_grouped list
-> unit
43 (* extracting define_def, e.g. from a standard.h; assume have called
44 * fix_tokens_define before to have the TDefEol *)
46 Parser_c.token list
-> (string, define_def
) Common.assoc