blob: 7e1c2248d336dcfe68ab1ed223e146f9f1c3f6bc [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>1.2.1.&nbsp;GTASM Machine Definition</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_MachineDefinition.html" title="1.2.&nbsp;Machine Definition"><link rel="prev" href="sec_MachineDefinition.html" title="1.2.&nbsp;Machine Definition"><link rel="next" href="def_Annotation.html" title="1.2.2.&nbsp;Annotation"></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">1.2.1.&nbsp;GTASM Machine Definition</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="sec_MachineDefinition.html">Prev</a>&nbsp;</td><th align="center" width="60%">1.2.&nbsp;Machine Definition</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="def_Annotation.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="def_Machine"></a>1.2.1.&nbsp;GTASM Machine Definition</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_Machine_Description"></a>Description</th></tr><tr><td valign="top" align="left"><p>
A GTASM machine (transformation) is the basic unit of execution. It consists of ASM rules,
ASM functions, graph transformation rules and graph transformation patterns.
</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_Machine_Syntax"></a>Syntax</th></tr><tr><td valign="top" align="left"><p>
<pre class="programlisting">
GTASMDefAST ::= <a href="def_Annotation.html" title="1.2.2.&nbsp;Annotation">OptAnnotationsAST</a> <span class="token">machine</span> <a href="def_ModelElementName.html" title="5.7.1.&nbsp;Model Element Name">TypeNameAST</a> <span class="token">{</span> MachineContentsAST <span class="token">}</span>
MachineContentsAST ::= MachineContentAST
| MachineContentsAST MachineContentAST
MachineContentAST ::= <a href="def_GraphPatternDef.html" title="2.1.1.&nbsp;Graph Pattern Definition">GraphPatternDefAST</a>
| <a href="def_GTRuleDef.html" title="3.1.1.&nbsp;Graph Transformation Rule Definition">GTRuleDefAST</a>
| <a href="def_AsmFunctionDef.html" title="5.5.1.&nbsp;ASM Function Definition">AsmFunctionDefAST</a>
| <a href="def_AsmRuleDef.html" title="4.1.1.&nbsp;ASM Rule Definition">AsmRuleDefAST</a>
</pre>
</p><p>
A GTASM transformation is identified by its <span class="emphasis"><em>local name</em></span>; the fully
qualified name of a machine is composed of the namespace defined in the
container <a href="def_VtclFile.html" title="1.1.1.&nbsp;VTCL file">VTCL file</a> and this name.
</p><p>
A GTASM transformation contains two types of components: abstract state machine (ASM)
related components and graph transformation (GT) related components.
</p><p>
An ASM related component can be the <a href="def_AsmRuleDef.html" title="4.1.1.&nbsp;ASM Rule Definition">definition of an ASM rule</a>
or the <a href="def_AsmFunctionDef.html" title="5.5.1.&nbsp;ASM Function Definition">definition of an ASM function</a>.
The control flow of a GTASM machine is defined by ASM rules (starting from <span class="emphasis"><em>main</em></span>).
</p><p>
A graph transformation related component can be the
<a href="def_GTRuleDef.html" title="3.1.1.&nbsp;Graph Transformation Rule Definition">definition of a graph transformation rule</a>
or a <a href="def_GraphPatternDef.html" title="2.1.1.&nbsp;Graph Pattern Definition">graph pattern definition</a>;
the set of these compose the model query and manipulation part of the GTASM transformation.
</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_Machine_Semantics"></a>Semantics</th></tr><tr><td valign="top" align="left"><p>
The entry point of the control flow is a special rule called <span class="emphasis"><em>main</em></span>
just similarly to the C or Java languages.
</p></td></tr></table></div><div class="example"><a name="def_Machine_Example"></a><p class="title"><b>Example&nbsp;2.2.&nbsp;Hello World Machine</b></p><div class="example-contents"><p>
<pre class="programlisting">
namespace hello;
machine helloWorld {
rule main () = println("Hello world!");
}
</pre>
</p></div><p></p></div><br class="example-break"><div class="highlights"><a name="def_Machine_DefinedIn"></a><p><b>Defined in:&nbsp;</b>
<a href="def_VtclFile.html" title="1.1.1.&nbsp;VTCL file">VTCL File</a>
</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="sec_MachineDefinition.html">Prev</a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="sec_MachineDefinition.html">Up</a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="def_Annotation.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">1.2.&nbsp;Machine Definition&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;1.2.2.&nbsp;Annotation</td></tr></table></div></body></html>