/usr/share/mozart/doc/op/node9.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>4.1 Expanding TAB Characters Revisited</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="node8.html">- Up -</A></TD></TR></TABLE><DIV id="section.text.expand"><H2><A name="section.text.expand">4.1 Expanding TAB Characters Revisited</A></H2><P>In <A href="node9.html#prog-opprog-expandi">Program 4.1</A> the revised formulation of the <CODE>Expand</CODE> procedure is shown. As before the file objects are created, but now both files inherit from <CODE>Open<SPAN class="keyword">.</SPAN>text</CODE> as well. This class provides methods for buffered input and output.</P><P><A name="label71"></A> </P><DIV class="program" id="prog-opprog-expandi"><HR><P><A name="prog-opprog-expandi"></A></P></DIV><DL class="anonymous"><DD class="code"><CODE><SPAN class="keyword">local</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Insert</SPAN> N Is}<BR> <SPAN class="keyword">if</SPAN> N<SPAN class="keyword">></SPAN>0 <SPAN class="keyword">then</SPAN> {Insert N<SPAN class="keyword">-</SPAN>1 <SPAN class="string">& </SPAN><SPAN class="keyword">|</SPAN>Is} <SPAN class="keyword">else</SPAN> Is <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">ScanLine</SPAN> Is Tab N}<BR> <SPAN class="keyword">case</SPAN> Is <SPAN class="keyword">of</SPAN> nil <SPAN class="keyword">then</SPAN> nil<BR> <SPAN class="keyword">[]</SPAN> I<SPAN class="keyword">|</SPAN>Ir <SPAN class="keyword">then</SPAN> <BR> <SPAN class="keyword">case</SPAN> I <BR> <SPAN class="keyword">of</SPAN> <SPAN class="string">&\t</SPAN> <SPAN class="keyword">then</SPAN> M=Tab<SPAN class="keyword">-</SPAN>(N <SPAN class="keyword">mod</SPAN> Tab) <SPAN class="keyword">in</SPAN> {Insert M {ScanLine Ir Tab M<SPAN class="keyword">+</SPAN>N}}<BR> <SPAN class="keyword">[]</SPAN> <SPAN class="string">&\b</SPAN> <SPAN class="keyword">then</SPAN> I<SPAN class="keyword">|</SPAN>{ScanLine Ir Tab {Max 0 N<SPAN class="keyword">-</SPAN>1}}<BR> <SPAN class="keyword">else</SPAN> I<SPAN class="keyword">|</SPAN>{ScanLine Ir Tab N<SPAN class="keyword">+</SPAN>1}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Scan</SPAN> Tab IF OF}<BR> Is={IF getS($)} <BR> <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">if</SPAN> Is<SPAN class="keyword">==false</SPAN> <SPAN class="keyword">then</SPAN> <BR> {IF close} {OF close}<BR> <SPAN class="keyword">else</SPAN> <BR> {OF putS({ScanLine Is Tab 0})}<BR> {Scan Tab IF OF}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">class</SPAN> <SPAN class="type">TextFile</SPAN> <BR> <SPAN class="keyword">from</SPAN><SPAN class="type"> Open.file Open.text</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR><SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Expand</SPAN> Tab IN ON}<BR> {Scan Tab <BR> {New TextFile init(name:IN)}<BR> {New TextFile init(name: ON <BR> flags: [write create truncate])}}<BR> <SPAN class="keyword">end</SPAN> <BR><SPAN class="keyword">end</SPAN></CODE></DD></DL><DIV class="program"><P class="caption"><STRONG>Program 4.1:</STRONG> The Incremental <CODE>Expand</CODE> Procedure</P><HR></DIV><P> The procedure <CODE>Scan</CODE> applies the input file object <CODE>IF</CODE> to the message <CODE>getS($)</CODE>. It yields either <CODE><SPAN class="keyword">false</SPAN></CODE>, in case the end of the file is reached, or a string. This string contains exactly one line of the input file (without a newline character).</P><P>The expansion of TAB characters is done in the function <CODE>ScanLine</CODE> as before. The expanded lines are written with the <CODE>putS</CODE> method.</P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node8.html">- Up -</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~schulte/">Christian Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|