/usr/share/doc/libstarlink-ast-doc/node42.html is in libstarlink-ast-doc 8.6.2+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--Converted with LaTeX2HTML 2008 (1.71)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>AST Pointer Contexts--Begin and End</TITLE>
<META NAME="description" CONTENT="AST Pointer Contexts--Begin and End">
<META NAME="keywords" CONTENT="sun211">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="sun211.css">
<LINK REL="next" HREF="node43.html">
<LINK REL="previous" HREF="node41.html">
<LINK REL="up" HREF="node32.html">
<LINK REL="next" HREF="node43.html">
</HEAD>
<BODY >
<DIV CLASS="navigation"><!--Navigation Panel-->
<A NAME="tex2html849"
HREF="node43.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/share/latex2html/icons/next.png"></A>
<A NAME="tex2html847"
HREF="node32.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/share/latex2html/icons/up.png"></A>
<A NAME="tex2html841"
HREF="node41.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/share/latex2html/icons/prev.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html850"
HREF="node43.html">Exporting, Importing and Exempting</A>
<B> Up:</B> <A NAME="tex2html848"
HREF="node32.html">An AST Object Primer</A>
<B> Previous:</B> <A NAME="tex2html842"
HREF="node41.html">Managing Object Pointers</A>
<BR>
<BR></DIV>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION000410000000000000000"></A><A NAME="ss:contexts"></A>
<BR>
AST Pointer Contexts--Begin and End
</H2>
<P>
The use of astAnnulastAnnul (§<A HREF="node41.html#ss:annullingpointers">4.9</A>) is not completely
foolproof, however. Consider the following:
<P>
<SMALL CLASS="SMALL">
<BR>
<IMG
WIDTH="298" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
SRC="img58.png"
ALT="\begin{terminalv}
astShow( astZoomMap( 2, 5.0, '''' ) );
\end{terminalv}">
<BR>
</SMALL>
<P>
This creates a ZoomMapZoomMap and displays it on standard output
(§<A HREF="node36.html#ss:displayingobjects">4.4</A>). Using function invocations as
arguments to other functions in this way is very convenient because it
avoids the need for intermediate pointer variables. However, the
pointer generated by astZoomMapastZoomMap is still active, and since we have not
stored its value, we cannot use astAnnul to annul it. The ZoomMap will
therefore stay around until the end of the program.
<P>
A simple way to avoid this problem is to enclose all use of AST
functions between invocations of astBeginastBegin and astEndastEnd, for example:
<P>
<SMALL CLASS="SMALL">
<BR>
<IMG
WIDTH="298" HEIGHT="52" ALIGN="BOTTOM" BORDER="0"
SRC="img59.png"
ALT="\begin{terminalv}
astBegin;
astShow( astZoomMap( 2, 5.0, '''' ) );
astEnd;
\end{terminalv}">
<BR>
</SMALL>
<P>
When the expansion of astEnd (which is a macro) executes, every ObjectObject
pointer created since the previous use of astBegin (also a macro) is
automatically annulled and any Objects left without pointers are
deleted. This provides a simple solution to managing Objects and their
pointers, and allows you to create Objects very freely without needing
to keep detailed track of each one. Because this is so convenient, we
implicitly assume that astBegin and astEnd are used in most of the
examples given in this document. Pointer management is not generally
shown explicitly unless it is particularly relevant to the point being
illustrated.
<P>
If necessary, astBegin and astEnd may be nested, like blocks delimited
by ``{...}'' in C, to define a series of AST pointer
contexts. Each use of astEnd will then annul only those Object
pointers created since the matching use of astBegin.
<P>
<DIV CLASS="navigation"><HR>
<!--Navigation Panel-->
<A NAME="tex2html849"
HREF="node43.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/share/latex2html/icons/next.png"></A>
<A NAME="tex2html847"
HREF="node32.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/share/latex2html/icons/up.png"></A>
<A NAME="tex2html841"
HREF="node41.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/share/latex2html/icons/prev.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html850"
HREF="node43.html">Exporting, Importing and Exempting</A>
<B> Up:</B> <A NAME="tex2html848"
HREF="node32.html">An AST Object Primer</A>
<B> Previous:</B> <A NAME="tex2html842"
HREF="node41.html">Managing Object Pointers</A></DIV>
<!--End of Navigation Panel-->
</BODY>
</HTML>
|