You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
17 KiB
7 lines
17 KiB
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>PatternMatch (infer.InferModules.PatternMatch)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="generator" content="doc-ock-html v1.0.0-1-g1fc9bf0"/></head><body><nav id="top"><a href="../index.html">Up</a> — <span class="package">package <a href="../../index.html">infer</a></span></nav><header><h1><span class="keyword">Module</span> <span class="module-path">InferModules.PatternMatch</span></h1></header><p>Module for Pattern matching.</p><div class="spec val" id="val-get_this_type"><a href="#val-get_this_type" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_this_type : <a href="../../../InferIR/InferIR/ProcAttributes/index.html#type-t">InferIR.ProcAttributes.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/index.html#type-t">InferIR.Typ.t</a> option</code></div><div class="doc"><p>Get the this type of a procedure</p></div></div><div class="spec val" id="val-get_type_name"><a href="#val-get_type_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_type_name : <a href="../../../InferIR/InferIR/Typ/index.html#type-t">InferIR.Typ.t</a> <span class="keyword">‑></span> string</code></div><div class="doc"><p>Get the name of a type</p></div></div><div class="spec val" id="val-get_vararg_type_names"><a href="#val-get_vararg_type_names" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_vararg_type_names : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Procdesc/Node/index.html#type-t">InferIR.Procdesc.Node.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Pvar/index.html#type-t">InferIR.Pvar.t</a> <span class="keyword">‑></span> string list</code></div><div class="doc"><p>Get the type names of a variable argument</p></div></div><div class="spec val" id="val-method_is_initializer"><a href="#val-method_is_initializer" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>method_is_initializer : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/ProcAttributes/index.html#type-t">InferIR.ProcAttributes.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>Check if the method is one of the known initializer methods.</p></div></div><div class="spec val" id="val-is_getter"><a href="#val-is_getter" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_getter : <a href="../../../InferIR/InferIR/Typ/Procname/Java/index.html#type-t">InferIR.Typ.Procname.Java.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>Is this a getter proc name?</p></div></div><div class="spec val" id="val-is_subtype"><a href="#val-is_subtype" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_subtype : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>Is the type a transitive subtype of the typename?</p></div></div><div class="spec val" id="val-is_subtype_of_str"><a href="#val-is_subtype_of_str" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_subtype_of_str : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> string <span class="keyword">‑></span> bool</code></div><div class="doc"><p>Resolve <code class="code">typ_str</code> in <code class="code">tenv</code>, then check <code class="code">typ</code> <: <code class="code">typ_str</code></p></div></div><div class="spec val" id="val-supertype_exists"><a href="#val-supertype_exists" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>supertype_exists : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> (<a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Struct/index.html#type-t">InferIR.Typ.Struct.t</a> <span class="keyword">‑></span> bool) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>Holds iff the predicate holds on a supertype of the named type, including the type itself</p></div></div><div class="spec val" id="val-supertype_find_map_opt"><a href="#val-supertype_find_map_opt" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>supertype_find_map_opt : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> (<a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> <span class="type-var">'a</span> option) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> <span class="type-var">'a</span> option</code></div><div class="doc"><p>Return the first non-None result found when applying the given function to supertypes of the
|
|
named type, including the type itself</p></div></div><div class="spec val" id="val-java_get_const_type_name"><a href="#val-java_get_const_type_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>java_get_const_type_name : <a href="../../../InferIR/InferIR/Const/index.html#type-t">InferIR.Const.t</a> <span class="keyword">‑></span> string</code></div><div class="doc"><p>Get the name of the type of a constant</p></div></div><div class="spec val" id="val-java_get_vararg_values"><a href="#val-java_get_vararg_values" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>java_get_vararg_values : <a href="../../../InferIR/InferIR/Procdesc/Node/index.html#type-t">InferIR.Procdesc.Node.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Pvar/index.html#type-t">InferIR.Pvar.t</a> <span class="keyword">‑></span> <a href="../Idenv/index.html#type-t">Idenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Exp/index.html#type-t">InferIR.Exp.t</a> list</code></div><div class="doc"><p>Get the values of a vararg parameter given the pvar used to assign the elements.</p></div></div><div class="spec val" id="val-proc_calls"><a href="#val-proc_calls" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>proc_calls : (<a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/ProcAttributes/index.html#type-t">InferIR.ProcAttributes.t</a> option) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Procdesc/index.html#type-t">InferIR.Procdesc.t</a> <span class="keyword">‑></span> (<a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/ProcAttributes/index.html#type-t">InferIR.ProcAttributes.t</a> <span class="keyword">‑></span> bool) <span class="keyword">‑></span> (<a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a><span class="keyword"> * </span><a href="../../../InferIR/InferIR/ProcAttributes/index.html#type-t">InferIR.ProcAttributes.t</a>) list</code></div><div class="doc"><p>Return the callees that satisfy <code class="code">filter</code>.</p></div></div><div class="spec val" id="val-override_find"><a href="#val-override_find" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>override_find : ?⁠check_current_type:bool <span class="keyword">‑></span> (<a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> bool) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> option</code></div><div class="doc"><p>Return a method which overrides <code class="code">procname</code> and satisfies <code class="code">f</code> (including <code class="code">procname</code> itself when <code class="code">check_current_type</code> is true, which it is by default).</p></div></div><div class="spec val" id="val-override_exists"><a href="#val-override_exists" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>override_exists : ?⁠check_current_type:bool <span class="keyword">‑></span> (<a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> bool) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>Return true if applying the given predicate to an override of <code class="code">procname</code> (including <code class="code">procname</code> itself when <code class="code">check_current_type</code> is true, which it is by default) returns true.</p></div></div><div class="spec val" id="val-override_iter"><a href="#val-override_iter" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>override_iter : (<a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> unit) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> unit</code></div><div class="doc"><p>Apply the given predicate to procname and each override of <code class="code">procname</code>. For the moment, this only
|
|
works for Java</p></div></div><div class="spec val" id="val-type_get_annotation"><a href="#val-type_get_annotation" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>type_get_annotation : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/index.html#type-t">InferIR.Typ.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Annot/Item/index.html#type-t">InferIR.Annot.Item.t</a> option</code></div><div class="doc"></div></div><div class="spec val" id="val-type_get_class_name"><a href="#val-type_get_class_name" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>type_get_class_name : <a href="../../../InferIR/InferIR/Typ/index.html#type-t">InferIR.Typ.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> option</code></div><div class="doc"><p>Get the class name of the type</p></div></div><div class="spec val" id="val-type_is_class"><a href="#val-type_is_class" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>type_is_class : <a href="../../../InferIR/InferIR/Typ/index.html#type-t">InferIR.Typ.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>Is the type a class type</p></div></div><div class="spec val" id="val-type_is_object"><a href="#val-type_is_object" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>type_is_object : <a href="../../../InferIR/InferIR/Typ/index.html#type-t">InferIR.Typ.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>Is the type java.lang.Object</p></div></div><div class="spec val" id="val-get_fields_nullified"><a href="#val-get_fields_nullified" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>get_fields_nullified : <a href="../../../InferIR/InferIR/Procdesc/index.html#type-t">InferIR.Procdesc.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR__Typ/Fieldname/index.html#module-Set">InferIR.Typ.Fieldname.Set</a>.t</code></div><div class="doc"><p>return the set of instance fields that are assigned to a null literal in <code class="code">procdesc</code></p></div></div><div class="spec val" id="val-is_throwable"><a href="#val-is_throwable" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_throwable : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p><code class="code">is_throwable tenv class_name</code> checks if class_name is of type java.lang.Throwable</p></div></div><div class="spec val" id="val-is_runtime_exception"><a href="#val-is_runtime_exception" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_runtime_exception : <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p><code class="code">is_runtime_exception tenv class_name</code> checks if classname is
|
|
of type java.lang.RuntimeException</p></div></div><div class="spec val" id="val-check_class_attributes"><a href="#val-check_class_attributes" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>check_class_attributes : (<a href="../../../InferIR/InferIR/Annot/Item/index.html#type-t">InferIR.Annot.Item.t</a> <span class="keyword">‑></span> bool) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>tests whether any class attributes (e.g.,</p><ul class="at-tag"><li><span class="at-tag ThreadSafe">@ThreadSafe</span> ) pass check of first argument,
|
|
including supertypes</li></ul></div></div><div class="spec val" id="val-check_current_class_attributes"><a href="#val-check_current_class_attributes" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>check_current_class_attributes : (<a href="../../../InferIR/InferIR/Annot/Item/index.html#type-t">InferIR.Annot.Item.t</a> <span class="keyword">‑></span> bool) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Procname/index.html#type-t">InferIR.Typ.Procname.t</a> <span class="keyword">‑></span> bool</code></div><div class="doc"><p>tests whether any class attributes (e.g.,</p><ul class="at-tag"><li><span class="at-tag ThreadSafe">@ThreadSafe</span> ) pass check of first argument,
|
|
for current class only</li></ul></div></div><div class="spec val" id="val-find_superclasses_with_attributes"><a href="#val-find_superclasses_with_attributes" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>find_superclasses_with_attributes : (<a href="../../../InferIR/InferIR/Annot/Item/index.html#type-t">InferIR.Annot.Item.t</a> <span class="keyword">‑></span> bool) <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Tenv/index.html#type-t">InferIR.Tenv.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> <span class="keyword">‑></span> <a href="../../../InferIR/InferIR/Typ/Name/index.html#type-t">InferIR.Typ.Name.t</a> list</code></div><div class="doc"><p>find superclasss with attributes (e.g.,</p><ul class="at-tag"><li><span class="at-tag ThreadSafe">@ThreadSafe</span> ), including current class</li></ul></div></div></body></html> |