[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] understanding groff's source code
From: |
Ralph Corderoy |
Subject: |
Re: [Groff] understanding groff's source code |
Date: |
Mon, 29 Sep 2014 09:05:48 +0100 |
Hi Ulrich,
> In case of questions, should one ask on the list
I'd say ask here; answers would be part of the public record. These
answers are all based on a quick look; I don't know they're correct.
> However, not so for extract().
node *node_list::extract()
{
node *temp = head;
head = tail = 0;
return temp;
}
The list is extracted, not a node; a pointer to the first element, if
any, is returned. The caller can walk the list themselves. The
node_list forgets about those elements.
> Are memory leaks generated?
After extract(), that's the responsbility of the extractor who now has
the list.
> Why is delete_node_list() not called?
Because we haven't finished with the node_list, we just want to extract
what we've appended so far, and then may well come around again to
append more nodes.
> why is node_list in input.cpp but delete_node_list() in node.cpp?
Don't know.
> what does a node-object represent?
A thing representing something in input? Browse src/roff/troff/node.h.
$ grep '^class\>.*\<public node\>' src/roff/troff/node.h |
> awk '{print $2}' | fmt
line_start_node space_node diverted_space_node diverted_copy_file_node
extra_size_node vertical_size_node hmotion_node vmotion_node
hline_node vline_node dummy_node transparent_dummy_node zero_width_node
left_italic_corrected_node overstrike_node bracket_node special_node
suppress_node tag_node draw_node
$
Cheers, Ralph.