blob: eba0bbfa528c5e06095ea0639b04b84057c53d3f [file] [log] [blame]
<html>
<head>
<meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see http://www.eclipse.org/legal/epl-v10.html" />
<link rel=stylesheet type="text/css" href="../css/book.css">
<link rel=stylesheet type="text/css" href="otguide.css">
<title>Compiling Object Teams programs</title>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<h1>Compiling Object Teams programs</h1>
<p>
Object Teams programs are compiled <span class="underline">automatically</span> and <span class="underline">incrementally</span> using
an <b><a href="builder.html">extended Java builder</a></b>.
</p>
<p>The language accepted by the compiler is defined in the <a href="otjld/def/index.html">OTJLD</a>
(OT/J Language Definition), which is bundled with the OTDT.
<p>Problems detected by the compiler are classified as either <b><i>warnings</i></b> or
<b><i>errors</i></b>.<br />
The existence of a warning does not prohibit the execution of the program;
some warnings only signal a programming style that is not recommended,
others may report situations that are potentially unsafe such that an undeclared
exception might occur at runtime.<br />
Compile-time errors (as specified by the OT/J Language Specification) imply
that byte code generation was incomplete (it may be possible to run even programs with
compile errors, but the program will terminate as soon as it tries to execute an
erroneous method).
<p>
<h3>Configuring Diagnostics</h3>
<p>
For a number of problems you can specify if you want the OT/J compiler
to report them as warnings, errors or to ignore them.
To change the default settings, use the <span class="ui">Window > Preferences > Java >
Compiler (OT/J)</span> preference page (or change the project properties to specify
project specific settings).<br />
For easy reference, on the preference page each group of diagnostics
mentions the paragraph in the language definition that defines the issue at hand.</p>
Also note that many of these diagnostics can be fixed using a <a href="quickfix.html">quick fix</a>.
<h3>Consulting the language definition on problems</h3>
<p>When viewing OT/J-specific error/warning messages in the <b>Problems</b> view, the context menu
offers a &nbsp;<img src="../images/ot_paragraph.png"> <span class="ui">Go To Language Definition</span> &nbsp;link,
taking you directly to the paragraph
that defines the rule which is being violated by the compiled source code. For presenting the
language definition the internal HTML-browser is used to allow easy navigation within the
language definition.</p>
<img style="margin-left:10px;" title="Language Definition Integrated in the OTDT" src="images/screenshots/langdef.png"/>
<p>
Alternatively, the same action <span class="ui">Go to Language Definition</span> can be invoked
without using the <b>Problems</b> view:
<p><span class="underline">Using the context menu on the problem marker in the editor's left gutter:</span></p>
<img style="margin-left:10px;" title="Language Definition from the left gutter" src="images/screenshots/GoToLangDefGutter.png"/>
<p><span class="underline">Using a button in the problem hover in the editor:</span></p>
<img style="margin-left:10px;" title="Language Definition from the left gutter" src="images/screenshots/GoToLangDefHover.png"/>
</body>
</html>