2 * Do stuff involving cpp macros, like expanding some macros,
3 * or try to parse well the body of the define by finding the end of
4 * define virtual end-of-line token.
7 (* corresponds to what is in the yacfe configuration file (e.g. standard.h) *)
8 type define_def
= string * define_param
* define_body
11 | Params
of string list
13 | DefineBody
of Parser_c.token list
14 | DefineHint
of parsinghack_hint
16 (* strongly corresponds to the TMacroXxx in the grammar and lexer and the
17 * MacroXxx in the ast.
19 and parsinghack_hint
=
25 | HintMacroIdentBuilder
27 (* This function work by side effect and may generate new tokens
28 * in the new_tokens_before field of the token_extended in the
29 * paren_grouped list. So don't forget to recall
30 * Token_views_c.rebuild_tokens_extented after this call, as well
31 * as probably parsing_hacks.insert_virtual_positions as new tokens
35 msg_apply_known_macro
:(string -> unit) ->
36 msg_apply_known_macro_hint
:(string -> unit) ->
37 (string, define_def
) Hashtbl.t
->
38 Token_views_c.paren_grouped list
-> unit
40 (* generate virtual end-of-line token *)
41 val fix_tokens_define
:
42 Parser_c.token list
-> Parser_c.token list
44 val extract_cpp_define
:
45 Parser_c.token list
-> (string, define_def
) Common.assoc