Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 962c0a1a7c090461b11b26cc6a6b38bf > files > 113

yodl-1.31.18-8mdk.ppc.rpm

<! banner_id >

The Yodl program has three built-in macros to send literal text to the output 
file. The macros are listed in the above section ?? and are 
furthermore described here.

<dl>

<li > The <code>CHAR</code> macro takes one argument: the ASCII number of a 
    character or the character itself. The character is sent to the output 
    file without being translated with the currently active character 
    translation table.

<li > The <code>NOTRANS</code> macro takes one argument: the text in question. The 
    text is neither parsed (i.e., macros in it are not expanded), nor 
    translated with the current character translation table.

The <code>NOTRANS</code> macro is conceptually like a series of <code>CHAR</code> macros.

<li > The <code>NOEXPAND</code> macro takes one argument: the text in question. The 
    text is not parsed, but it <strong>is</strong> translated with the current character 
    translation table.

</dl>

To illustrate the need for the distinction between <code>NOTRANS</code> and 
<code>NOEXPAND</code>, consider the following. The <code>HTML</code> converter (described in  
chapter ??) must be able to send HTML commands to the output 
file, but must also be able to send literal text (e.g., a source file 
listing). The HTML commands of course must be neither translated with any 
character table, nor must they be expanded in regard to macros. In contrast, a 
source file listing must be subject to character translations: the <code>&amp;</code>, 
<code>&lt;</code> and <code>&gt;</code> characters can cause difficulties. Two possible macros for a 
HTML converter are:

<pre>
COMMENT(--- htmlcommand(cmd) sends its argument as a HTML command 
            to the output ---)
DEFINEMACRO(htmlcommand)(1)(NOTRANS(ARG1))
    
COMMENT(--- verb(listing) sends the listing to the output ---)
DEFINECHARTABLE(list)(
    '&amp;'     =   "&amp;amp;"
    '&lt;'     =   "&amp;lt;"
    '&gt;'     =   "&amp;gt;"
)

DEFINEMACRO(verb)(1)( \ 
    USECHARTABLE(list) \ 
    NOTRANS(&lt;listing&gt;) \ 
    NOEXPAND(ARG1) \ 
    NOTRANS(&lt;/listing&gt;) \ 
    USECHARTABLE(standard))
</pre>

<p>In this example it is assumed that a character translation table <code>standard</code> 
exists, defining the `normal' translations. This table is re-activated in the 
<code>verb</code> macro.
<!--

if this file ./Documentation/footer.html.in is present, it is included

automatically by add-html-footer, and replaces the simple standard
footer substitutions:

 * index,
 * package name
 * package name
 * ENV:WEBMASTER,
 * ENV:WEBMASTER

-->

<hr>
Go <a href=>back</a> to index of Yodl.

<p>
Please send Yodl questions and comments to 

<a href="mailto:yodl@icce.rug.nl">
<em>yodl@icce.rug.nl</em></a>.
<p>

<!-- package Yodl Yodl -->

Please send comments on these web pages to 
<a href="mailto:(address unknown)"><em>(address unknown)</em></a>



<p>

Copyright (c) 1997, 1998, 1999 Karel Kubat and Jan Nieuwenhuizen.

<p>

Verbatim copying and distribution of this entire article is 
permitted in any medium, provided this notice is preserved.<p>

<hr><font size=-1>
This page was built from Yodl-1.31.18 by 
<address><br>Stew Benedict &lt<a href=\"mailto:(address unknown)\">(address unknown)</a>&gt,  Sat Jan 18 18:43:45 2003 EST.</address><p></font></BODY>
</html>