9nodes.html
来自「Visual C++ has been one of most effectiv」· HTML 代码 · 共 22 行
HTML
22 行
<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" tppabs="http://www.relisoft.com/book/rs.css">
</head>
<body background="margin.gif" tppabs="http://www.relisoft.com/book/images/margin.gif" bgcolor="#FFFFDC">
<!-- Main Table -->
<table cellpadding="6">
<tr>
<td width="78">
<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 + =
减小字号Ctrl + -
显示快捷键?