/usr/share/mozart/doc/notation/node5.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>5 Translation of Oz Programs to Oz Core Programs</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="node4.html#chapter.core"><< Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="bib.html#label42">Next >></A></TD></TR></TABLE><DIV id="chapter.translation"><H1><A name="chapter.translation">5 Translation of Oz Programs to Oz Core Programs</A></H1><P> Oz programs are translated to Oz core programs by repeatedly applying the rules given in this chapter to subtrees of the parse tree, replacing the subtree with the result of the rule. A rule consists of the following: </P><DL><DT>A set of nonterminals.</DT><DD><P>The rule is only applicable to subtrees generated by a rule of one of these nonterminals. </P></DD><DT>A left-hand side.</DT><DD><P>The rule is only applicable if the subtree's structure matches the left-hand side pattern. Additionally, variables are introduced. Some parts may be left out (replaced by an ellipsis) if they reappear unmodified in the output. </P></DD><DT>A right-hand side.</DT><DD><P>When the rule is applied to a subtree, the latter is replaced by the subtree specified by the right-hand side. This may contain variables written as <CODE><I>X</I></CODE>, <CODE><I>Y</I></CODE>, or <CODE><I>Z</I></CODE> not appearing in the left-hand side: These variables are supposed to be fresh such that no capturing can occur. </P></DD><DT>Optionally, a side condition.</DT><DD><P>The rule is only applicable if the side-condition is satisfied. </P></DD></DL><P> </P><DIV class="apropos"><P class="margin">Meta Variables</P><P> Inside rewrite rules, we use meta variables for terminals and phrases generated by nonterminals as shown in the following table: </P><TABLE align="center" bgcolor="#f0f0e0"><TR valign="top"><TH><P>Meta Variables</P></TH><TH><P>Corresponding Terminals and Nonterminals</P></TH></TR><TR valign="top"><TD><P><I>x</I>, <I>x1</I>, ..., <I>xn</I></P></TD><TD><P><<I>variable</I>></P></TD></TR><TR valign="top"><TD><P><I>D</I></P></TD><TD><P><<I>declaration part</I>></P></TD></TR><TR valign="top"><TD><P><I>S</I></P></TD><TD><P><<I>statement</I>></P></TD></TR><TR valign="top"><TD><P><I>E</I>, <I>E1</I>, ..., <I>Ek</I>, <I>En</I></P></TD><TD><P><<I>expression</I>></P></TD></TR><TR valign="top"><TD><P><I>SE</I></P></TD><TD><P><<I>statement</I>> or <<I>expression</I>></P></TD></TR><TR valign="top"><TD><P><I>P</I>, <I>P1</I>, ..., <I>Pk</I>, <I>Pn</I></P></TD><TD><P><<I>pattern</I>></P></TD></TR><TR valign="top"><TD><P><I>EP</I>, <I>EP1</I>, ..., <I>EPn</I></P></TD><TD><P><<I>expression</I>> or <<I>pattern</I>></P></TD></TR><TR valign="top"><TD><P><I>C</I>, <I>C1</I>, ..., <I>Cn</I></P></TD><TD><P><<I>case statement clause</I>> or <<I>case expression clause</I>></P></TD></TR><TR valign="top"><TD><P><I>L</I>, <I>L1</I>, ..., <I>Ln</I></P></TD><TD><P><<I>cond statement clause</I>> or <<I>cond expression clause</I>> or <<I>dis statement clause</I>></P></TD></TR><TR valign="top"><TD><P><I>l</I></P></TD><TD><P><<I>label</I>></P></TD></TR><TR valign="top"><TD><P><I>f1</I>, ..., <I>fn</I></P></TD><TD><P><<I>feature</I>></P></TD></TR><TR valign="top"><TD><P><I>s1</I>, ..., <I>sn</I></P></TD><TD><P><<I>subtree</I>> or <<I>subpattern</I>></P></TD></TR></TABLE><P> </P></DIV><DIV class="apropos"><P class="margin">Core Variables</P><P> The result of the transformation may have references to so-called <EM>Core variables</EM>. We indicate this by writing them in backquotes; they are not bound lexically, but are looked up in static environment. Examples are <CODE><SPAN class="string">`List.toRecord`</SPAN></CODE> and <CODE><SPAN class="string">`RaiseDebugCheck`</SPAN></CODE>. If the print name of a Core variable contains a dot, then it is supposed to be looked up (without the backquotes) in the Base Environment (see <A href="../base/index.html">``The Oz Base Environment''</A>). </P></DIV><DIV class="apropos"><P class="margin">Errors</P><P> When no rule is applicable and the program is not an Oz Core program, we speak of a <EM>syntax error</EM>. Such a program is not a valid Oz program. </P></DIV><HR><UL class="toc"><LI><A href="node6.html#section.translation.base">5.1 The Base Language</A><UL class="toc"><LI><A href="node6.html#label20">Declarations</A></LI><LI><A href="node6.html#label21">Grouping</A></LI><LI><A href="node6.html#label22">Procedure Definitions</A></LI><LI><A href="node6.html#label23">Applications</A></LI><LI><A href="node6.html#label24">Boolean and Pattern-Matching Conditionals</A></LI><LI><A href="node6.html#label25">Locks</A></LI><LI><A href="node6.html#label26">Threads</A></LI><LI><A href="node6.html#label27">Exception Handling</A></LI><LI><A href="node6.html#label28">Exception Raising</A></LI><LI><A href="node6.html#label29">Equations</A></LI><LI><A href="node6.html#label30">Operators</A></LI><LI><A href="node6.html#label31">Records</A></LI><LI><A href="node6.html#label32">Uniform State</A></LI><LI><A href="node6.html#label33">Wildcard</A></LI><LI><A href="node6.html#label34">Named Constants</A></LI></UL></LI></UL><UL class="toc"><LI><A href="node7.html#section.translation.constraints">5.2 Constraint Extensions and Combinators</A><UL class="toc"><LI><A href="node7.html#label35">Operators</A></LI><LI><A href="node7.html#label36">Failure</A></LI><LI><A href="node7.html#label37">Combinators</A></LI></UL></LI></UL><UL class="toc"><LI><A href="node8.html#section.translation.classes">5.3 Class Extensions</A><UL class="toc"><LI><A href="node8.html#label38">Classes</A></LI><LI><A href="node8.html#label39">Method Names</A></LI><LI><A href="node8.html#label40">Locks</A></LI><LI><A href="node8.html#label41">Operators</A></LI></UL></LI></UL><UL class="toc"><LI><A href="node9.html#section.translation.functors">5.4 Functor Extensions</A></LI></UL></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node4.html#chapter.core"><< Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="bib.html#label42">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.iscs.nus.edu.sg/~henz">Martin Henz</A> and <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>
|