blob: f2c0eee79d83b3a3a3a4918f958cbea362a222dd [file] [log] [blame]
Stephan Herrmann01664412010-04-01 20:28:43 +00001<html>
2 <head>
3 <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" />
4 <link rel=stylesheet type="text/css" href="../css/book.css">
5 <link rel=stylesheet type="text/css" href="otguide.css">
6 <title>Compiling Object Teams programs</title>
7 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
8 </head>
9 <body>
10 <h1>Compiling Object Teams programs</h1>
11 <p>
12 Object Teams programs are compiled <u>automatically</u> and <u>incrementally</u> using
13 an <b><a href="builder.html">extended Java builder</a></b>.
14 </p>
15 <p>The language accepted by the compiler is defined in the <a href="otjld/def/index.html">OTJLD</a>
16 (OT/J Language Definition), which is bundled with the OTDT.
17 <p>Problems detected by the compiler are classified as either <b><i>warnings</i></b> or
18 <b><i>errors</i></b>.<br />
19 The existence of a warning does not prohibit the execution of the program;
20 some warnings only signal a programming style that is not recommended,
21 others may report situations that are potentially unsafe such that an undeclared
22 exception might occur at runtime.<br />
23 Compile-time errors (as specified by the OT/J Language Specification) imply
24 that byte code generation was incomplete (it may be possible to run even programs with
25 compile errors, but the program will terminate as soon as it tries to execute an
26 erroneous method).
27 <p>
28 <h3>Configuring Diagnostics</h3>
29 For a number of problems you can specify if you want the OT/J compiler
30 to report them as warnings, errors or to ignore them.
31 To change the default settings, use the <span class="ui">Window > Preferences > Java >
32 Compiler (OT/J)</span> preference page (or change the project properties to specify
33 project specific settings).<br />
34 For easy reference, on the preference page each group of diagnostics
35 mentions the paragraph in the language definition that defines the issue at hand.</p>
36 Also note that many of these diagnostics can be fixed using a <a href="quickfix.html">quick fix</a>.
38 <h3>Consulting the language definition on problems</h3>
Stephan Herrmann8daca692010-07-01 18:34:01 +000039 <p>When viewing OT/J-specific error/warning messages in the <b>Problems</b> view, the context menu
Stephan Herrmann01664412010-04-01 20:28:43 +000040 offers a &nbsp;<img src="../icons/ot_paragraph.gif"> <span class="ui">Go To Language Definition</span> &nbsp;link,
41 taking you directly to the paragraph
42 that defines the rule which is being violated by the compiled source code. For presenting the
43 language definition the internal HTML-browser is used to allow easy navigation within the
44 language definition.</p>
Stephan Herrmann8daca692010-07-01 18:34:01 +000045 <img style="margin-left:10px;" title="Language Definition Integrated in the OTDT" src="images/screenshots/langdef.png"/>
46 </p>
47 <p>
48 Alternatively, the same action <span class="ui">Go to Language Definition</span> can be invoked
49 without using the <b>Problems</b> view:
50 <p><u>Using the context menu on the problem marker in the editor's left gutter:</u></p>
51 <img style="margin-left:10px;" title="Language Definition from the left gutter" src="images/screenshots/GoToLangDefGutter.png"/>
52 <p><u>Using a button in the problem hover in the editor:</u></p>
53 <img style="margin-left:10px;" title="Language Definition from the left gutter" src="images/screenshots/GoToLangDefHover.png"/>
54 </p>
Stephan Herrmann01664412010-04-01 20:28:43 +000055 </body>