blob: 606bdbd5273a9f5fb0cb06b181d8d506f9d3f1ca [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>1.2.2.&nbsp;Annotation</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="def_Machine.html" title="1.2.1.&nbsp;GTASM Machine Definition"><link rel="next" href="sec_GraphPatterns.html" title="2.&nbsp;Graph Patterns"></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.2.&nbsp;Annotation</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="def_Machine.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="sec_GraphPatterns.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="def_Annotation"></a>1.2.2.&nbsp;Annotation</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_Annotation_Description"></a>Description</th></tr><tr><td valign="top" align="left"><p>
An <span class="strong"><strong>annotation</strong></span>
<a name="N10249" class="indexterm"></a>
allows the transformation designers to fine-tune runtime settings.
Currently, only few runtime annotations are supported in VIATRA to select
the appropriate pattern matching engine, and to switch between batch and
live transformations.
</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_Annotation_Syntax"></a>Syntax</th></tr><tr><td valign="top" align="left"><pre class="programlisting">
OptAnnotationsAST ::= $empty | AnnotationsAST
AnnotationsAST ::= AnnotationAST
| AnnotationsAST AnnotationAST
AnnotationAST ::= AnnotationNameAST
| AnnotationNameAST <span class="token">(</span> AnnotationBodyAST <span class="token">)</span>
AnnotationBodyAST ::= KeyValuePairAST
| AnnotationBodyAST <span class="token">,</span> KeyValuePairAST
KeyValuePairAST ::= <a href="def_ModelElementName.html" title="5.7.1.&nbsp;Model Element Name">TypeNameAST</a> <span class="token">=</span> <a href="def_ModelElementName.html" title="5.7.1.&nbsp;Model Element Name">TypeNameAST</a>
AnnotationNameAST ::= <a href="def_AnnotationLiteral.html" title="6.2.5.&nbsp;Annotation Literal">AnnotationLiteral</a>
</pre><p>
An <span class="strong"><strong>annotation</strong></span> has a name which is prefixed by <code class="computeroutput">@</code>.
It may have an optional body defined in the form of key-value pairs within parentheses.
The keys and values are restricted well-formed <a href="def_ModelElementName.html" title="5.7.1.&nbsp;Model Element Name">local names</a>,
although they are not required to point to actual model elements (i.e. it is only
a syntactic restriction).
</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_Annotation_Semantics"></a>Semantics</th></tr><tr><td valign="top" align="left"><p>
Currently, the VIATRA interpreter accepts three annotations.
<div class="itemizedlist"><ul type="disc"><li><p>
<code class="computeroutput">incremental</code>: this can be attached to
<a href="def_GraphPatternDef.html" title="2.1.1.&nbsp;Graph Pattern Definition">graph pattern definitions</a>,
<a href="def_Machine.html" title="1.2.1.&nbsp;GTASM Machine Definition">machines</a>.
</p><p>
In case of graph patterns, it prescribes that the annotated pattern and all dependent patterns accessed
by <a href="def_PatternComposition.html" title="2.1.5.&nbsp;Pattern Composition">pattern composition</a>
should be executed using the incremental pattern matcher engine.
</p><p>
When a machine is annotated, it prescribes that all patterns defined in the machine
should be executed by the incremental pattern matcher.
</p></li><li><code class="computeroutput">localsearch</code>: this can be also attached to
<a href="def_GraphPatternDef.html" title="2.1.1.&nbsp;Graph Pattern Definition">graph pattern definitions</a>,
<a href="def_Machine.html" title="1.2.1.&nbsp;GTASM Machine Definition">machines</a>. The effect of this annotation is same as
above, except for selecting the local search based pattern matching engine.
</li><li><p>
<code class="computeroutput">trigger</code>: this can be also attached to a
GT rule, and it defines that the corresponding GT rule is interpreted as a
<a href="">trigger</a>.
</p></li></ul></div>
</p></td></tr></table></div><div class="highlights"><a name="def_Annotation_Remark"></a><p><b>Remark.&nbsp;</b>
Note that in most cases, the incremental pattern matcher engine has
significantly better performance. However, the default annotation
for a pattern is <code class="computeroutput">@localsearch</code>.
</p></div><div class="highlights"><a name="def_Annotation_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_GraphPatternDef.html" title="2.1.1.&nbsp;Graph Pattern Definition">graph pattern definition</a>,
<a href="def_Machine.html" title="1.2.1.&nbsp;GTASM Machine Definition">machine</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_Machine.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="sec_GraphPatterns.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">1.2.1.&nbsp;GTASM 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;2.&nbsp;Graph Patterns</td></tr></table></div></body></html>