Skip to content

Commit 347f330

Browse files
committed
Provide more extensive overview of irept itself
1 parent 5f15042 commit 347f330

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/architectural/central-data-structures.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,17 @@ each node is expected to contain a string/ID and may have child nodes stored in
166166
both a sequence of child nodes and a map of strings/IDs to child nodes. This
167167
enables the singular `irept` data structure to be used to model graphs such as
168168
ASTs, CFGs, etc.
169+
170+
The classes extending `irept` define how the higher level concepts are mapped
171+
onto the underlying tree data structure. For this reason it is usually advised
172+
that the member functions of the sub-classes should be used to access the data
173+
held, rather than the member functions of the base `irept` class. This aids
174+
potential future restructuring and associates accesses of the data with the
175+
member functions which have the doxygen explaining what the data is.
176+
177+
The strings/IDs held within `irept` are of type `irep_idt`. These can be
178+
converted to `std::string` using the `id2string` function. There is a mechanism
179+
provided for casting expressions and types in
180+
[`src/util/expr_cast.h`](../../src/util/expr_cast.h). In depth documentation
181+
of the `irept` class itself can be found in
182+
[`src/util/irep.h`](../../src/util/irep.h).

0 commit comments

Comments
 (0)