blob: c44f8a4898136d27353f274a5e73d1773fa50081 [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.8.2.&nbsp;Directed Formal Parameters</title><link href="style.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.72.0" name="generator"><link rel="start" href="index.html" title="The VIATRA2 Model Transformation Framework"><link rel="up" href="sec_Parameters.html" title="5.8.&nbsp;Parameters and Variable Lists"><link rel="prev" href="def_FormalParameter.html" title="5.8.1.&nbsp;Formal Parameters"><link rel="next" href="def_ActualParameter.html" title="5.8.3.&nbsp;Actual Parameters"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">5.8.2.&nbsp;Directed Formal Parameters</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="def_FormalParameter.html">Prev</a>&nbsp;</td><th align="center" width="60%">5.8.&nbsp;Parameters and Variable Lists</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="def_ActualParameter.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="def_DirectedFormalParameter"></a>5.8.2.&nbsp;Directed Formal Parameters</h4></div></div></div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Description"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left"><a name="def_DirectedFormalParameter_Description"></a>Description</th></tr><tr><td valign="top" align="left"><p>
<span class="strong"><strong>Directed formal parameters</strong></span>
<a name="N12FC7" class="indexterm"></a>
<a name="N12FCC" class="indexterm"></a>
define the interface of a <a href="def_GTRuleDef.html" title="3.1.1.&nbsp;Graph Transformation Rule Definition">GT rule</a> or an
<a href="def_AsmRuleDef.html" title="4.1.1.&nbsp;ASM Rule Definition">ASM rule</a> by a list of
<a href="def_Variable.html" title="5.7.2.&nbsp;Variable">ASM variables</a>.
</p></td></tr></table></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Syntax"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Important]" src="images/important.png"></td><th align="left"><a name="def_DirectedFormalParameter_Syntax"></a>Syntax</th></tr><tr><td valign="top" align="left"><pre class="programlisting">
DirectedFormalParamsAST ::= DirectionKindAST <a href="def_Variable.html" title="5.7.2.&nbsp;Variable">VariableDefAST</a>
| DirectedFormalParamsAST <span class="token">,</span> DirectionKindAST <a href="def_Variable.html" title="5.7.2.&nbsp;Variable">VariableDefAST</a>
DirectionKindAST ::= <span class="token">in</span> | <span class="token">out</span> | <span class="token">inout</span>
</pre><p>
<span class="strong"><strong>Directed formal parameters</strong></span> are defined by
is a comma-separated list of variables (each having a direction specification).
It can contain an arbitrary number of variables (including none).
In contrast to the <a href="def_FormalParameter.html" title="5.8.1.&nbsp;Formal Parameters">formal parameters</a>,
it defines a direction for each parameter, namely either <code class="computeroutput">in</code>,
<code class="computeroutput">out</code> or <code class="computeroutput">inout</code>.
</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note: Semantics"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left"><a name="def_DirectedFormalParameter_Semantics"></a>Semantics</th></tr><tr><td valign="top" align="left"><p>
An <span class="emphasis"><em>input-only variable</em></span> (with tag <code class="computeroutput">in</code>) takes the value of the
actual parameter, but at the end of the execution of the rule the value of
the actual parameter is not updated.
</p><p>
An <span class="emphasis"><em>output-only variable</em></span>(with tag <code class="computeroutput">out</code>) does not take the value of
the actual parameter: it is considered as undefined having the
<a href="def_UndefinedValue.html" title="5.4.2.&nbsp;Undefined Value">undefined value</a> (<code class="computeroutput">undef</code>).
At the end of the execution of the rule, the value of the actual parameter is overwritten with the value
of the variable defined as formal parameter.
</p><p>
An <span class="emphasis"><em>input-output variable</em></span>(with tag <code class="computeroutput">inout</code>) takes the value of the
actual parameter, and at the end of the execution of the rule the value of
the actual parameter is updated with the value of the variable defined as
formal parameter.
</p></td></tr></table></div><div class="highlights"><a name="def_DirectedFormalParameter_UsedBy"></a><p><b>Used By:&nbsp;</b>
<a href="def_GTRuleDef.html" title="3.1.1.&nbsp;Graph Transformation Rule Definition">GT rule definition</a>,
<a href="def_AsmRuleDef.html" title="4.1.1.&nbsp;ASM Rule Definition">ASM rule definition</a>
</p></div><div class="highlights"><a name="def_DirectedFormalParameter_SeeAlso"></a><p><b>See Also:&nbsp;</b>
<a href="def_FormalParameter.html" title="5.8.1.&nbsp;Formal Parameters">formal parameters</a>,
<a href="def_ActualParameter.html" title="5.8.3.&nbsp;Actual Parameters">actual parameter</a>,
<a href="def_UndefinedValue.html" title="5.4.2.&nbsp;Undefined Value">undefined value</a>
</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="def_FormalParameter.html">Prev</a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="sec_Parameters.html">Up</a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="def_ActualParameter.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">5.8.1.&nbsp;Formal Parameters&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;5.8.3.&nbsp;Actual Parameters</td></tr></table></div></body></html>