/usr/share/mozart/doc/compiler/node2.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>2 Directives</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node1.html#chapter.intro"><< Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="node3.html#chapter.applications">Next >></A></TD></TR></TABLE><DIV id="chapter.directives"><H1><A name="chapter.directives">2 Directives</A></H1><DIV class="apropos"><P class="margin">Directive Syntax</P><P> The Mozart compiler understands the full syntax of Oz programs. Additionally, it also accepts <EM>directives</EM> in its input. A directive can start anywhere on a line and is introduced by a backslash; it always extends until the end of the line. </P></DIV><P> Directives come in two flavors. So-called <EM>compiler directives</EM> provide a way to change the compiler's switches, whereas <EM>macro directives</EM> can be used for inserting files or performing compilation conditionally. While macro directives may appear between any two tokens in the input, the use of compiler directives underlies restrictions as described below. </P><DIV class="apropos"><P class="margin">Compilation Units</P><P> A single input file is split into a number of compilation units as follows: </P><UL><LI><P>Each compiler directive forms a compilation unit. </P></LI><LI><P>Each <CODE><SPAN class="keyword">declare</SPAN></CODE> statement starts a compilation unit, which includes all following non-<CODE><SPAN class="keyword">declare</SPAN></CODE> statements. </P></LI><LI><P>A sequence of statements without <CODE><SPAN class="keyword">declare</SPAN></CODE> forms a compilation unit. </P></LI></UL><P> Note that this implies that compiler directives can only appear between top-level Oz statements. </P></DIV><P> All compilation units in a file are processed sequentially. </P><H2><A name="label2">2.1 Compiler Directives</A></H2><P> </P><DL><DT><CODE><SPAN class="reference">\switch</SPAN></CODE> ( <SPAN class="terminal">"+"</SPAN> <<I>switchname</I>> | <SPAN class="terminal">"-"</SPAN> <<I>switchname</I>> )* </DT><DD><P>Set (<SPAN class="terminal">"+"</SPAN>) resp. reset (<SPAN class="terminal">"-"</SPAN>) the specified switches. The values for <<I>switchname</I>> the compiler understands are described in <A href="node5.html#appendix.switches">Appendix A</A>. Case matters. </P></DD><DT><CODE><SPAN class="reference">\pushSwitches</SPAN></CODE> </DT><DD><P>Save the current settings of all switches onto the internal switch state stack. </P></DD><DT><CODE><SPAN class="reference">\popSwitches</SPAN></CODE> </DT><DD><P>Restore all switch settings from the topmost element of the internal switch state stack, provided it is not empty, else do nothing. </P></DD><DT><CODE><SPAN class="reference">\localSwitches</SPAN></CODE> </DT><DD><P>Save the current settings of all switches as well as the internal switch state stack if no <CODE><SPAN class="reference">\localSwitches</SPAN></CODE> has occurred in the current input before, else do nothing. They are automatically restored after the last compilation unit of the current input has been processed. </P></DD></DL><P> </P><DIV id="section.directives.macro"><H2><A name="section.directives.macro">2.2 Macro Directives</A></H2><P> </P><DL><DT><CODE><SPAN class="reference">\line</SPAN></CODE> <<I>filename</I>> </DT><DT><CODE><SPAN class="reference">\line</SPAN></CODE> <<I>int</I>> <<I>filename</I>> </DT><DD><P>sets the internal file name (and the line number of the subsequent line) to the given values. This data will appear in the error messages and debug information generated by the compiler. </P></DD><DT><CODE><SPAN class="reference">\insert</SPAN></CODE> <<I>filename</I>> </DT><DD><P>is substituted by the contents of the referenced file. The <CODE>~user</CODE> syntax is supported under Unix for absolute file names. If the file name is relative, it is first resolved against the directory in which the file containing the <CODE><SPAN class="reference">\insert</SPAN></CODE> resides, then against all directories named in the <CODE>OZPATH</CODE> environment variable (which has standard <CODE>PATH</CODE> syntax). </P><P> Note that surrounding the filename by single quotes avoids indentation problems of the OPI. </P></DD></DL><P> </P><DIV class="apropos"><P class="margin">Macro Names</P><P> Note that although macro names have the same syntax as Oz variables, there is absolutely no connection between macro names and Oz variables. </P><DL><DT><CODE><SPAN class="reference">\define</SPAN></CODE> <<I>variable</I>> </DT><DD><P>adjoins <<I>variable</I>> to the set of macro names. </P></DD><DT><CODE><SPAN class="reference">\undef</SPAN></CODE> <<I>variable</I>> </DT><DD><P>removes <<I>variable</I>> from the set of macro names. </P></DD><DT><CODE><SPAN class="reference">\ifdef</SPAN></CODE> <<I>variable</I>> </DT><DD><P>causes the text until the next balanced <CODE><SPAN class="reference">\else</SPAN></CODE> or <CODE><SPAN class="reference">\endif</SPAN></CODE> only to be compiled if <<I>variable</I>> is a macro name. </P></DD><DT><CODE><SPAN class="reference">\ifndef</SPAN></CODE> <<I>variable</I>> </DT><DD><P>caused the text until the next balanced <CODE><SPAN class="reference">\else</SPAN></CODE> or <CODE><SPAN class="reference">\endif</SPAN></CODE> to be ignored if <<I>variable</I>> is a macro name. </P></DD><DT><CODE><SPAN class="reference">\else</SPAN></CODE> </DT><DD><P>causes the text until the next balanced <CODE><SPAN class="reference">\endif</SPAN></CODE> to be </P><UL><LI><P>ignored, if the <CODE><SPAN class="reference">\else</SPAN></CODE> occurs after a text region that was being compiled; </P></LI><LI><P>compiled, if the <CODE><SPAN class="reference">\else</SPAN></CODE> occurs after a text region that was being ignored. </P></LI></UL><P> </P></DD><DT><CODE><SPAN class="reference">\endif</SPAN></CODE> </DT><DD><P>terminates the active <CODE><SPAN class="reference">\ifdef</SPAN></CODE> or <CODE><SPAN class="reference">\ifndef</SPAN></CODE>. Every <CODE><SPAN class="reference">\ifdef</SPAN></CODE> and every <CODE><SPAN class="reference">\ifndef</SPAN></CODE> must be terminated by a corresponding <CODE><SPAN class="reference">\endif</SPAN></CODE>. </P></DD></DL><P></P></DIV></DIV></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node1.html#chapter.intro"><< Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="node3.html#chapter.applications">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~kornstae/">Leif Kornstaedt</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|