| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| <link rel="stylesheet" type="text/css" href="../css/ot.css" /> |
| <link rel="stylesheet" type="text/css" href="../css/otjld.css" /> |
| <title>OT/J Language Definition v1.3</title> |
| </head> |
| <body class="otdt"> |
| <div id="content"> |
| <table class="nav"> |
| <tr> |
| <td class="back"><a id="top"></a><a href="sA.0.html" rel="prev"><< §A.0 Keywords</a></td> |
| <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| <td class="next"><a href="sA.2.html" rel="next">§A.2 Modifiers >></a></td> |
| </tr> |
| </table> |
| <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">§A OT/J Syntax</a></div> |
| <div class="sect depth2" id="sA.1"> |
| <h2 class="sect">§A.1 Class definitions<a class="img" href="sA.1.html" |
| title="PermaLink to §A.1 Class definitions"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| alt="" /></a></h2> |
| <p>Class definitions add two new keywords <code>team</code> and |
| <code>playedBy</code>. Classes which use these keywords are called |
| <strong>teams</strong> and <strong>bound roles</strong>, respectively. |
| Any class that inherits from a bound role class (either by an |
| <code>extends</code> clause or by implicit inheritance, cf. |
| <a href="s1.3.1.c.html" |
| title="§1.3.1.(c) Overriding and implicit inheritance" |
| class="sect">§1.3.1.(c)</a>) is again a bound role class. |
| |
| </p> |
| <table class="syntaxrule" id="sA.1.1"> |
| <tr> |
| <td class="sect">§ A.1.1</td> |
| <td class="rule"><span class="title">ClassDeclaration</span><br /><em>[Modifiers] </em><strong class="blue"><em>[</em>team<em>]</em></strong> class <em>Identifier [</em>extends <em>Type] [</em>implements <em>TypeList]</em><br /><span class="indent5"></span><strong class="blue"><em>[</em>playedBy <em>Type] [Guard]</em></strong><em> ClassBody</em></td> |
| </tr> |
| </table> |
| <div class="constraints"> |
| <h5 class="constraints">Contextual constraints:</h5> |
| <ol class="constraints"> |
| <li>A class which has a <code>playedBy</code> clause (a <strong>bound |
| role</strong> class) may not be declared static and |
| must be directly contained in a class that has the |
| <code>team</code> modifier (a <strong>team</strong> class). |
| </li> |
| <li>A class which inherits from a team class must have the |
| <code>team</code> modifier, too. |
| </li> |
| <li>A class which has a guard (see <a href="s5.4.html" title="§5.4 Guard predicates" class="sect">§5.4</a>) |
| must be a team or a role. |
| </li> |
| </ol> |
| </div> |
| </div> |
| <table class="nav"> |
| <tr> |
| <td class="back"><a href="sA.0.html" rel="prev"><< §A.0 Keywords</a></td> |
| <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| <td class="next"><a href="sA.2.html" rel="next">§A.2 Modifiers >></a></td> |
| </tr> |
| </table> |
| <div class="breadcrumb"><a class="nav" href="sA.html" rel="section">§A OT/J Syntax</a></div> |
| </div> |
| <div id="footer"> |
| <hr /><a class="w3c img" href="http://jigsaw.w3.org/css-validator/check/referer" |
| shape="rect"><img src="../images/valid-css2-blue.png" alt="Valid CSS!" height="31" width="88" /></a><a class="w3c img" href="http://validator.w3.org/check?uri=referer" shape="rect"><img src="../images/valid-xhtml10-blue.png" alt="Valid XHTML 1.0 Strict" height="31" |
| width="88" /></a><address>© Stephan Herrmann, Christine Hundt, Marco Mosconi</address> |
| OT/J version 1.3 — last modified: 2010-06-08 |
| </div> |
| </body> |
| </html> |