The essential idea is that a literate program is the combination of documentation and source code in a form suitable for reading by human beings. The TeX source to this book and the C++ source code it documents are combined in common files. A literate programming tool which I wrote, called loma, weaves the the files into the TeX source that produced this book and into the C++ source programs which can be compiled to produce the executable program.
The source to this book is not in the public domain. However, the C++ source code for the simulator is available. The C++ source code is cross-referenced with this book, so that you can easily find the page in the book that defines and describes the code.