-(* Copyright (C) 2007, 2008 Yoann Padioleau
+(* Yoann Padioleau
+ *
+ * Copyright (C) 2007, 2008, 2009 Ecole des Mines de Nantes
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License (GPL)
-
+(* really strip, do not keep position nor anything specificities, true
+ * abstracted form. *)
let real_strip_info_visitor _ =
{ Visitor_c.default_visitor_c_s with
Visitor_c.kinfo_s = (fun (k,_) i ->
(Ast_c.pos_of_info min, Ast_c.pos_of_info max + String.length strmax)
with _ ->
None
+
+
+(*****************************************************************************)
+(* Ast getters *)
+(*****************************************************************************)
+
+let names_of_parameters_in_def def =
+ match def.Ast_c.f_old_c_style with
+ | Some _ ->
+ pr2_once "names_of_parameters_in_def: f_old_c_style not handled";
+ []
+ | None ->
+ let ftyp = def.Ast_c.f_type in
+ let (ret, (params, bwrap)) = ftyp in
+ params +> Common.map_filter (fun (param,ii) ->
+ Ast_c.name_of_parameter param
+ )
+
+let names_of_parameters_in_macro xs =
+ xs +> List.map (fun (xx, ii) ->
+ let (s, ii2) = xx in
+ s
+ )