⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 9nodes.html

📁 C ++ in action
💻 HTML
字号:
<html>
<head>
	<title>Nodes</title>
    <meta  name="description" content="Parse tree nodes">
    <meta name="keywords" content="parse tree, node, polymorphism, parsing, parser, tree, virtual">
	<link rel="stylesheet" href="../../rs.css">
</head>

<body background="../../images/margin.gif" bgcolor="#FFFFDC">

<!-- Main Table -->
<table cellpadding="6">
    <tr>
    <td width="78">
	&nbsp;
	<td>



<h3>Nodes</h3>

<p>We have to add a few more node types. Corresponding to built-in functions are the objects of type <var>FunNode</var>. A <var>FunNode</var> contains a pointer to function and a child node梩he argument to the function. I have a confession to make: When I was writing this program I forgot to add the destructor to <var>FunNode</var>. The program worked fine, it was just leaking memory. Every time a <var>FunNode</var> was constructed and then destroyed, it would leave its child node orphaned. The memory for the whole subnode would never be reclaimed. If you kept this program running for hours and hours (which I never did), it would eventually chew up all its memory and die. I caught this bug by instrumenting the memory allocator when I was writing the second part of the book

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -