|
|
|
@ -8,25 +8,25 @@
|
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
|
(** Module for Procedure Names *)
|
|
|
|
|
(** Module for Procedure Names. *)
|
|
|
|
|
|
|
|
|
|
(** Type of java procedure names *)
|
|
|
|
|
(** Type of java procedure names. *)
|
|
|
|
|
type java
|
|
|
|
|
|
|
|
|
|
(** Type of C function names *)
|
|
|
|
|
type c_function
|
|
|
|
|
(** Type of c procedure names. *)
|
|
|
|
|
type c
|
|
|
|
|
|
|
|
|
|
(** Type of Objective C and C++ method names *)
|
|
|
|
|
type objc_cpp_method
|
|
|
|
|
(** Type of Objective C and C++ procedure names. *)
|
|
|
|
|
type objc_cpp
|
|
|
|
|
|
|
|
|
|
(** Type of Objective C block names *)
|
|
|
|
|
(** Type of Objective C block names. *)
|
|
|
|
|
type block
|
|
|
|
|
|
|
|
|
|
(** Type of procedure names *)
|
|
|
|
|
(** Type of procedure names. *)
|
|
|
|
|
type t =
|
|
|
|
|
| Java of java
|
|
|
|
|
| C of c_function
|
|
|
|
|
| ObjC_Cpp of objc_cpp_method
|
|
|
|
|
| C of c
|
|
|
|
|
| ObjC_Cpp of objc_cpp
|
|
|
|
|
| Block of block
|
|
|
|
|
|
|
|
|
|
type java_type = string option * string
|
|
|
|
@ -39,62 +39,84 @@ type objc_method_kind =
|
|
|
|
|
| Instance_objc_method (* for instance methods in ObjC *)
|
|
|
|
|
| Class_objc_method (* for class methods in ObjC *)
|
|
|
|
|
|
|
|
|
|
val empty : t
|
|
|
|
|
(** Hash tables with proc names as keys. *)
|
|
|
|
|
module Hash : Hashtbl.S with type key = t
|
|
|
|
|
|
|
|
|
|
(** Mangled string for method types *)
|
|
|
|
|
val mangled_of_objc_method_kind : objc_method_kind -> string option
|
|
|
|
|
(** Maps from proc names. *)
|
|
|
|
|
module Map : Map.S with type key = t
|
|
|
|
|
|
|
|
|
|
(** Create ObjC method type from a bool is_instance *)
|
|
|
|
|
val objc_method_kind_of_bool : bool -> objc_method_kind
|
|
|
|
|
(** Sets of proc names. *)
|
|
|
|
|
module Set : Set.S with type elt = t
|
|
|
|
|
|
|
|
|
|
(** Create a C procedure name from plain and mangled name. *)
|
|
|
|
|
val c : string -> string -> c
|
|
|
|
|
|
|
|
|
|
(** Comparison for proc names *)
|
|
|
|
|
(** Comparison for proc names. *)
|
|
|
|
|
val compare : t -> t -> int
|
|
|
|
|
|
|
|
|
|
(** Equality for proc names *)
|
|
|
|
|
(** Empty block name. *)
|
|
|
|
|
val empty_block : t
|
|
|
|
|
|
|
|
|
|
(** Equality for proc names. *)
|
|
|
|
|
val equal : t -> t -> bool
|
|
|
|
|
|
|
|
|
|
(** Convert a string to a proc name *)
|
|
|
|
|
(** Convert a string to a proc name. *)
|
|
|
|
|
val from_string_c_fun : string -> t
|
|
|
|
|
|
|
|
|
|
(** Create a Java procedure name from its
|
|
|
|
|
class_name method_name args_type_name return_type_name method_kind *)
|
|
|
|
|
val java : java_type -> java_type option -> string -> java_type list -> method_kind -> java
|
|
|
|
|
(** Return the language of the procedure. *)
|
|
|
|
|
val get_language : t -> Config.language
|
|
|
|
|
|
|
|
|
|
(** Create a C++ procedure name from plain and mangled name *)
|
|
|
|
|
val mangled_c_fun : string -> string -> t
|
|
|
|
|
(** Return the method/function of a procname. *)
|
|
|
|
|
val get_method : t -> string
|
|
|
|
|
|
|
|
|
|
(** Create an objc procedure name from a class_name and method_name. *)
|
|
|
|
|
val mangled_c_method : string -> string -> string option -> t
|
|
|
|
|
(** Hash function for procname. *)
|
|
|
|
|
val hash_pname : t -> int
|
|
|
|
|
|
|
|
|
|
(** Create an objc block name. *)
|
|
|
|
|
val mangled_objc_block : string -> t
|
|
|
|
|
(** Check if a class string is an anoynmous inner class name. *)
|
|
|
|
|
val is_anonymous_inner_class_name : string -> bool
|
|
|
|
|
|
|
|
|
|
(** Check if this is an Objective-C/C++ method name. *)
|
|
|
|
|
val is_c_method : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Check if this is a constructor. *)
|
|
|
|
|
val is_constructor : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Return true if this is a Java procedure name *)
|
|
|
|
|
(** Check if this is a Java procedure name. *)
|
|
|
|
|
val is_java : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Return true if this is an Objective-C/C++ method name *)
|
|
|
|
|
val is_c_method : t -> bool
|
|
|
|
|
(** Check if this is a dealloc method in Objective-C. *)
|
|
|
|
|
val is_objc_dealloc : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Replace package and classname of a java procname. *)
|
|
|
|
|
val java_replace_class : t -> string -> t
|
|
|
|
|
(** Create a Java procedure name from its
|
|
|
|
|
class_name method_name args_type_name return_type_name method_kind. *)
|
|
|
|
|
val java : java_type -> java_type option -> string -> java_type list -> method_kind -> java
|
|
|
|
|
|
|
|
|
|
(** Replace the parameters of a java procname. *)
|
|
|
|
|
val java_replace_parameters : t -> java_type list -> t
|
|
|
|
|
val java_replace_parameters : java -> java_type list -> java
|
|
|
|
|
|
|
|
|
|
(** Replace the method of a java procname. *)
|
|
|
|
|
val java_replace_return_type : t -> java_type -> t
|
|
|
|
|
val java_replace_return_type : java -> java_type -> java
|
|
|
|
|
|
|
|
|
|
(** Replace the class name of an Objective-C procedure name. *)
|
|
|
|
|
val c_method_replace_class : t -> string -> t
|
|
|
|
|
(** Create an objc block name. *)
|
|
|
|
|
val mangled_objc_block : string -> t
|
|
|
|
|
|
|
|
|
|
(** Mangled string for method types. *)
|
|
|
|
|
val mangled_of_objc_method_kind : objc_method_kind -> string option
|
|
|
|
|
|
|
|
|
|
(** Create an objc procedure name from a class_name and method_name. *)
|
|
|
|
|
val objc_cpp : string -> string -> string option -> objc_cpp
|
|
|
|
|
|
|
|
|
|
(** Get the class name of a Objective-C/C++ procedure name. *)
|
|
|
|
|
val c_get_class : t -> string
|
|
|
|
|
val objc_cpp_get_class_name : objc_cpp -> string
|
|
|
|
|
|
|
|
|
|
(** Create ObjC method type from a bool is_instance. *)
|
|
|
|
|
val objc_method_kind_of_bool : bool -> objc_method_kind
|
|
|
|
|
|
|
|
|
|
(** Return the class name of a java procedure name. *)
|
|
|
|
|
val java_get_class : java -> string
|
|
|
|
|
val java_get_class_name : java -> string
|
|
|
|
|
|
|
|
|
|
(** Return the simple class name of a java procedure name. *)
|
|
|
|
|
val java_get_simple_class : java -> string
|
|
|
|
|
val java_get_simple_class_name : java -> string
|
|
|
|
|
|
|
|
|
|
(** Return the package name of a java procedure name. *)
|
|
|
|
|
val java_get_package : java -> string option
|
|
|
|
@ -102,48 +124,18 @@ val java_get_package : java -> string option
|
|
|
|
|
(** Return the method name of a java procedure name. *)
|
|
|
|
|
val java_get_method : java -> string
|
|
|
|
|
|
|
|
|
|
(** Return the method of a objc/c++ procname. *)
|
|
|
|
|
val c_get_method : t -> string
|
|
|
|
|
|
|
|
|
|
(** Replace the method name of an existing java procname. *)
|
|
|
|
|
val java_replace_method : t -> string -> t
|
|
|
|
|
|
|
|
|
|
(** Return the return type of a java procedure name. *)
|
|
|
|
|
val java_get_return_type : java -> string
|
|
|
|
|
|
|
|
|
|
(** Return the parameters of a java procedure name. *)
|
|
|
|
|
val java_get_parameters : t -> java_type list
|
|
|
|
|
val java_get_parameters : java -> java_type list
|
|
|
|
|
|
|
|
|
|
(** Return the parameters of a java procname as strings. *)
|
|
|
|
|
val java_get_parameters_as_strings : t -> string list
|
|
|
|
|
|
|
|
|
|
(** Return true if the java procedure is static *)
|
|
|
|
|
val java_is_static : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Check if the last parameter is a hidden inner class, and remove it if present.
|
|
|
|
|
This is used in private constructors, where a proxy constructor is generated
|
|
|
|
|
with an extra parameter and calls the normal constructor. *)
|
|
|
|
|
val java_remove_hidden_inner_class_parameter : t -> t option
|
|
|
|
|
val java_get_parameters_as_strings : java -> string list
|
|
|
|
|
|
|
|
|
|
(** Check if a class string is an anoynmous inner class name *)
|
|
|
|
|
val is_anonymous_inner_class_name : string -> bool
|
|
|
|
|
|
|
|
|
|
(** [is_constructor pname] returns true if [pname] is a constructor *)
|
|
|
|
|
val is_constructor : t -> bool
|
|
|
|
|
|
|
|
|
|
(** [is_objc_dealloc pname] returns true if [pname] is the dealloc method in Objective-C *)
|
|
|
|
|
val is_objc_dealloc : t -> bool
|
|
|
|
|
|
|
|
|
|
(** [java_is_close pname] returns true if the method name is "close" *)
|
|
|
|
|
val java_is_close : t -> bool
|
|
|
|
|
|
|
|
|
|
(** [is_class_initializer pname] returns true if [pname] is a class initializer *)
|
|
|
|
|
val is_class_initializer : t -> bool
|
|
|
|
|
|
|
|
|
|
(** [is_infer_undefined pn] returns true if [pn] is a special Infer undefined proc *)
|
|
|
|
|
val is_infer_undefined : t -> bool
|
|
|
|
|
|
|
|
|
|
val split_classname : string -> string option * string
|
|
|
|
|
(** Check if the procedure name is an acess method (e.g. access$100 used to
|
|
|
|
|
access private members from a nested class. *)
|
|
|
|
|
val java_is_access_method : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Check if the procedure belongs to an anonymous inner class. *)
|
|
|
|
|
val java_is_anonymous_inner_class : t -> bool
|
|
|
|
@ -151,47 +143,55 @@ val java_is_anonymous_inner_class : t -> bool
|
|
|
|
|
(** Check if the procedure name is an anonymous inner class constructor. *)
|
|
|
|
|
val java_is_anonymous_inner_class_constructor : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Check if the procedure name is an acess method (e.g. access$100 used to
|
|
|
|
|
access private members from a nested class. *)
|
|
|
|
|
val java_is_access_method : t -> bool
|
|
|
|
|
(** Check if the method name is "close". *)
|
|
|
|
|
val java_is_close : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Check if the java procedure is static. *)
|
|
|
|
|
val java_is_static : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Check if the proc name has the type of a java vararg.
|
|
|
|
|
Note: currently only checks that the last argument has type Object[]. *)
|
|
|
|
|
val java_is_vararg : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Convert a proc name to a string for the user to see *)
|
|
|
|
|
val to_string : t -> string
|
|
|
|
|
|
|
|
|
|
(** Convert a proc name into a easy string for the user to see in an IDE *)
|
|
|
|
|
val to_simplified_string : ?withclass: bool -> t -> string
|
|
|
|
|
(** Check if the last parameter is a hidden inner class, and remove it if present.
|
|
|
|
|
This is used in private constructors, where a proxy constructor is generated
|
|
|
|
|
with an extra parameter and calls the normal constructor. *)
|
|
|
|
|
val java_remove_hidden_inner_class_parameter : t -> t option
|
|
|
|
|
|
|
|
|
|
(** Convert a proc name into a unique identifier *)
|
|
|
|
|
val to_unique_id : t -> string
|
|
|
|
|
(** Replace the method name of an existing java procname. *)
|
|
|
|
|
val java_replace_method : java -> string -> java
|
|
|
|
|
|
|
|
|
|
(** Convert a java type to a string. *)
|
|
|
|
|
val java_type_to_string : java_type -> string
|
|
|
|
|
|
|
|
|
|
(** Convert a proc name to a filename *)
|
|
|
|
|
val to_filename : t -> string
|
|
|
|
|
(** Check if this is a class initializer. *)
|
|
|
|
|
val is_class_initializer : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Pretty print a proc name *)
|
|
|
|
|
(** Check if this is a special Infer undefined procedure. *)
|
|
|
|
|
val is_infer_undefined : t -> bool
|
|
|
|
|
|
|
|
|
|
(** Pretty print a proc name. *)
|
|
|
|
|
val pp : Format.formatter -> t -> unit
|
|
|
|
|
|
|
|
|
|
(** hash function for procname *)
|
|
|
|
|
val hash_pname : t -> int
|
|
|
|
|
(** Pretty print a set of proc names. *)
|
|
|
|
|
val pp_set : Format.formatter -> Set.t -> unit
|
|
|
|
|
|
|
|
|
|
(** hash tables with proc names as keys *)
|
|
|
|
|
module Hash : Hashtbl.S with type key = t
|
|
|
|
|
(** Replace the class name component of a procedure name.
|
|
|
|
|
In case of Java, replace package and class name. *)
|
|
|
|
|
val replace_class : t -> string -> t
|
|
|
|
|
|
|
|
|
|
(** maps from proc names *)
|
|
|
|
|
module Map : Map.S with type key = t
|
|
|
|
|
(** Given a package.class_name string, look for the latest dot and split the string
|
|
|
|
|
in two (package, class_name). *)
|
|
|
|
|
val split_classname : string -> string option * string
|
|
|
|
|
|
|
|
|
|
(** sets of proc names *)
|
|
|
|
|
module Set : Set.S with type elt = t
|
|
|
|
|
(** Convert a proc name to a string for the user to see. *)
|
|
|
|
|
val to_string : t -> string
|
|
|
|
|
|
|
|
|
|
(** Pretty print a set of proc names *)
|
|
|
|
|
val pp_set : Format.formatter -> Set.t -> unit
|
|
|
|
|
(** Convert a proc name into a easy string for the user to see in an IDE. *)
|
|
|
|
|
val to_simplified_string : ?withclass: bool -> t -> string
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
(** Replace the method of a java procname. *)
|
|
|
|
|
val java_replace_method : t -> string -> t
|
|
|
|
|
*)
|
|
|
|
|
(** Convert a proc name into a unique identifier. *)
|
|
|
|
|
val to_unique_id : t -> string
|
|
|
|
|
|
|
|
|
|
(** Convert a proc name to a filename. *)
|
|
|
|
|
val to_filename : t -> string
|
|
|
|
|