Release coccinelle-0.2.1-rc1
[bpt/coccinelle.git] / parsing_c / cpp_token_c.mli
index 6d5cb99..0cbae1d 100644 (file)
@@ -1,22 +1,18 @@
-(*
- * Do stuff involving cpp macros, like expanding some macros, 
- * or try to parse well the body of the define by finding the end of
- * define virtual end-of-line token.
- *)
+(* Expanding or extracting macros, at the token level *)
 
 (* corresponds to what is in the yacfe configuration file (e.g. standard.h) *)
-type define_def = string * define_param * define_body 
- and define_param = 
+type define_def = string * define_param * define_body
+ and define_param =
    | NoParam
    | Params of string list
- and define_body = 
+ and define_body =
    | DefineBody of Parser_c.token list
    | DefineHint of parsinghack_hint
 
    (* strongly corresponds to the TMacroXxx in the grammar and lexer and the
     * MacroXxx in the ast.
     *)
-   and parsinghack_hint = 
+   and parsinghack_hint =
      | HintIterator
      | HintDeclarator
      | HintMacroString
@@ -24,23 +20,27 @@ type define_def = string * define_param * define_body
      | HintAttribute
      | HintMacroIdentBuilder
 
+val string_of_define_def: define_def -> string
+
 (* This function work by side effect and may generate new tokens
  * in the new_tokens_before field of the token_extended in the
- * paren_grouped list. So don't forget to recall 
+ * paren_grouped list. So don't forget to recall
  * Token_views_c.rebuild_tokens_extented after this call, as well
- * as probably parsing_hacks.insert_virtual_positions as new tokens
+ * as probably insert_virtual_positions as new tokens
  * are generated.
+ *
+ * note: it does not do some fixpoint, so the generated code may also
+ * contain some macros names.
  *)
-val apply_macro_defs: 
+val apply_macro_defs:
   msg_apply_known_macro:(string -> unit) ->
   msg_apply_known_macro_hint:(string -> unit) ->
+  ?evaluate_concatop:bool ->
+  ?inplace_when_single:bool ->
   (string, define_def) Hashtbl.t ->
   Token_views_c.paren_grouped list -> unit
 
-(* generate virtual end-of-line token *)
-val fix_tokens_define : 
-  Parser_c.token list -> Parser_c.token list
-
-val extract_cpp_define : 
+(* extracting define_def, e.g. from a standard.h; assume have called
+ * fix_tokens_define before to have the TDefEol *)
+val extract_macros :
   Parser_c.token list -> (string, define_def) Common.assoc
-