This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
<!DOCTYPE html>
<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>JContext (infer.JavaFrontend.JContext)</title><linkrel="stylesheet"href="../../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.0"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><scriptsrc="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><divclass="content"><header><nav><ahref="../index.html">Up</a>–<ahref="../../index.html">infer</a>»<ahref="../index.html">JavaFrontend</a>» JContext</nav><h1>Module <code>JavaFrontend.JContext</code></h1></header><dl><dtclass="spec type"id="type-jump_kind"><ahref="#type-jump_kind"class="anchor"></a><code><spanclass="keyword">type</span> jump_kind</code><code> = </code><tableclass="variant"><trid="type-jump_kind.Next"class="anchored"><tdclass="def constructor"><ahref="#type-jump_kind.Next"class="anchor"></a><code>| </code><code><spanclass="constructor">Next</span></code></td></tr><trid="type-jump_kind.Jump"class="anchored"><tdclass="def constructor"><ahref="#type-jump_kind.Jump"class="anchor"></a><code>| </code><code><spanclass="constructor">Jump</span><spanclass="keyword">of</span> int</code></td></tr><trid="type-jump_kind.Exit"class="anchored"><tdclass="def constructor"><ahref="#type-jump_kind.Exit"class="anchor"></a><code>| </code><code><spanclass="constructor">Exit</span></code></td></tr></table></dt><dd><p>data structure for representing whether an instruction is a goto, a return or a standard instruction.</p></dd></dl><dl><dtclass="spec module"id="module-NodeTbl"><ahref="#module-NodeTbl"class="anchor"></a><code><spanclass="keyword">module</span> NodeTbl : <ahref="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Caml.Hashtbl.S <spanclass="keyword">with</span><spanclass="keyword">type</span><ahref="index.html#module-NodeTbl">NodeTbl</a>.key = <ahref="../../IR/Procdesc/Node/index.html#type-t">IR.Procdesc.Node.t</a></code></dt><dd><p>Hastable for storing nodes that correspond to if-instructions. These are used when adding the edges in the contrl flow graph.</p></dd></dl><dl><dtclass="spec type"id="type-icfg"><ahref="#type-icfg"class="anchor"></a><code><spanclass="keyword">type</span> icfg</code><code> = </code><code>{</code><tableclass="record"><trid="type-icfg.tenv"class="anchored"><tdclass="def field"><ahref="#type-icfg.tenv"class="anchor"></a><code>tenv : <ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a>;</code></td></tr><trid="type-icfg.cfg"class="anchored"><tdclass="def field"><ahref="#type-icfg.cfg"class="anchor"></a><code>cfg : <ahref="../../IR/Cfg/index.html#type-t">IR.Cfg.t</a>;</code></td></tr></table><code>}</code></dt><dd><p>data structure for saving the three structures tht contain the intermediate representation of a file: the type environment, the control graph and the control flow graph</p></dd></dl><dl><dtclass="spec type"id="type-t"><ahref="#type-t"class="anchor"></a><code><spanclass="keyword">type</span> t</code><code> = <spanclass="keyword">private</span></code><code>{</code><tableclass="record"><trid="type-t.icfg"class="anchored"><tdclass="def field"><ahref="#type-t.icfg"class="anchor"></a><code>icfg : <ahref="index.html#type-icfg">icfg</a>;</code></td></tr><trid="type-t.procdesc"class="anchored"><tdclass="def field"><ahref="#type-t.procdesc"class="anchor"></a><code>procdesc : <ahref="../../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a>;</code></td></tr><trid="type-t.impl"class="anchored"><tdclass="def field"><ahref="#type-t.impl"class="anchor"></a><code>impl : Sawja_pack.JBir.t;</code></td></tr><trid="type-t.var_map"class="anchored"><tdclass="def field"><ahref="#type-t.var_map"class="anchor"></a><code><spanclass="keyword">mutable</span> var_map : <span><span>(<ahref="../../IR/Pvar/index.html#type-t">IR.Pvar.t</a> * <ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a> * <ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a>)</span> Sawja_pack.JBir.VarMap.t</span>;</code></td></tr><trid="type-t.if_jumps"class="anchored"><tdclass="def field"><ahref="#type-t.if_jumps"class="anchor"></a><code>if_jumps : <span>int <ahref="index.html#module-NodeTbl">NodeTbl</a>.t</span>;</code></td></tr><trid="type-t.goto_jumps"class="anchored"><tdclass="def field"><ahref="#type-t.goto_jumps"class="anchor"></a><code>goto_jumps : <span><span>(int,<ahref="index.html#type-jump_kind">jump_kind</a>)</span><ahref="../../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Caml.Hashtbl.t</span>;</code></td></tr><trid="type-t.cn"class="anchored"><tdclass="def field"><ahref="#type-t.cn"class="anchor"></a><code>cn : Javalib_pack.JBasics.class_name;</code></td></tr><trid="type-t.source_file"class="anchored"><tdclass="def field"><ahref="#type-t.source_file"class="anchor"></a><code>source_file : <ahref="../../IBase/SourceFile/index.html#type-t">IBase.SourceFile.t</a>;</code></td></tr><trid="type-t.program"class="anchored"><tdclass="def field"><ahref="#type-t.program"class="anchor"></a><code>program : <ahref="../JClasspath/index.html#type-program">JClasspath.program</a>;</code></td></tr></table><code>}</code></dt><dd><p>data structure for storing the context elements.</p></dd></dl><dl><dtclass="spec value"id="val-create_context"><ahref="#val-create_context"class="anchor"></a><code><spanclass="keyword">val</span> create_context : <ahref="index.html#type-icfg">icfg</a><span>-></span><ahref="../../IR/Procdesc/index.html#type-t">IR.Procdesc.t</a><span>-></span> Sawja_pack.JBir.t <span>-></span> Javalib_pack.JBasics.class_name <span>-></span><ahref="../../IBase/SourceFile/index.html#type-t">IBase.SourceFile.t</a><span>-></span><ahref="../JClasspath/index.html#type-program">JClasspath.program</a><span>-></span><ahref="index.html#type-t">t</a></code></dt><dd><p>cretes a context for a given method.</p></dd></dl><dl><dtclass="spec value"id="val-get_tenv"><ahref="#val-get_tenv"class="anchor"></a><code><spanclass="keyword">val</span> get_tenv : <ahref="index.html#type-t">t</a><span>-></span><ahref="../../IR/Tenv/index.html#type-t">IR.Tenv.t</a></code></dt><dd><p>returns the type environment that corresponds to the current file.</p></dd></dl><dl><dtclass="spec value"id="val-add_if_jump"><ahref="#val-add_if_jump"class="anchor"></a><code><spanclass="keyword">val</span> add_if_jump : <ahref="index.html#type-t">t</a><span>-></span><ahref="../../IR/Procdesc/Node/index.html#type-t">IR.Procdesc.Node.t</a><span>-></span> int <span>-></span> unit</code></dt><dd><p>adds to the context the line that an if-node will jump to</p></dd></dl><dl><dtclass="spec value"id="val-get_if_jump"><ahref="#val-get_if_jump"class="anchor"></a><code><spanclass="keyword">val</span> get_if_jump : <ahref="index.html#type-t">t</a><span>-></span><ahref="../../IR/Procdesc/Node/index.html#type-t">IR.Procdesc.Node.t</a><span>-></span><span>int option</span></code></dt><dd><p>returns whether the given node corresponds to an if-instruction</p></dd></dl><dl><dtclass="spec value"id="val-add_goto_jump"><ahref="#val-add_goto_jump"class="anchor"></a><code><spanclass="keyword">val</span> add_goto_jump : <ahref="index.html#type-t">t</a><span>-></span> int <span>-></span><ahref="index.html#type-jump_kind">jump_kind</a><span>-></span> unit</code></dt><dd><p>adds to the context the line that the node in the given line will jump to.</p></dd></dl><dl><dtclass="spec value"id="val-get_goto_jump"><ahref="#val-get_goto_jump"class="anchor"></a><code><spanclass="keyword">val</span> get_goto_jump : <ahref="index.html#type-t">t</a><span>-></span> int <span>-></span><ahref="index.html#type-jump_kind">jump_kind</a></code></dt><dd><p>if the given line corresponds to a goto instruction, then returns the line where it jumps to, otherwise returns the next line.</p></dd></dl><dl><dtclass="spec value"id="val-is_goto_jump"><ahref="#val-is_goto_jump"class="anchor"></a><code><spanclass="keyword">val</span> is_goto_jump : <ahref="index.html#type-t">t</a><span>-></span> int <span>-></span> bool</code></dt><dd><p>returns whether the given line corresponds to a goto instruction.</p></dd></dl><dl><dtclass="spec value"id="val-set_pvar"><ahref="#val-set_pvar"class="anchor"></a><code><spanclass="keyword">val</span> set_pvar : <ahref="index.html#type-t">t</a><span>-></span> Sawja_pack.JBir.var <span>-></span><ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a><span>-></span><ahref="../../IR/Pvar/index.html#type-t">IR.Pvar.t</a></code></dt><dd><p><code>set_pvar context var type</code> adds a variable with a type to the context</p></dd></dl><dl><dtclass="spec value"id="val-get_var_type"><ahref="#val-get_var_type"class="anchor"></a><code><spanclass="keyword">val</span> get_var_type : <ahref="index.html#type-t">t</a><span>-></span> Sawja_pack.JBir.var <span>-></span><span><ahref="../../IR/Typ/index.html#type-t">IR.Typ.t</a> option</span></code></dt><dd><p><code>get_var_type context var</code> returns the type of the variable, if the variable is in the context</p></dd></dl><dl><dtclass="spec value"id="val-reset_pvar_type"><ahref="#val-reset_pvar_type"class="anchor"></a><code><spanclass="keyword">val</span> reset_pvar_type : <ahref="index.html#type-t">t</a><span>-></span> unit</code></dt><dd><p>resets the dynamic type of the variables in the context.</p></dd></dl><dl><dtclass="spec value"id="val-reset_exn_node_table"><ahref="#val-reset_exn_node_table"class="anchor"></a><code><spanclass="keyword">val</span> reset_exn_node_table : unit <span>-></span> unit</code></dt><dd><p>resets the hashtable mapping methods to their exception nodes</p></dd></dl><dl><dtclass="spec value"id="val-add_exn_node"><ahref="#val-add_exn_node"class="anchor"></a><code><spanclass="keyword">val</span> add_exn_node : <ahref="../../IR/Procname/index.html#type-t">IR.Procname.t</a><span>-></span><ahref="../../IR/Procdesc/Node/index.html#type-t">IR.Procdesc.Node.t</a><span>-></span> unit</code></dt><dd><p>adds the exception node for a given method</p></dd></dl></div></body></html>