$PTOLEMY/src/domains/cg/kerneldirectory. Not all classes in that directory are covered in this document. We instead concentrate on how to generate and organize the code, and which methods to use. There is a basic code generation domain, designated CG, from which other code generation domains are derived. The CG domain can be used by itself for the purpose of studying issues in control constructs and scheduling, without needing to generate code in any particular programming language.
A segment of code is formed in an instance of class CodeStream. Each CGTarget will have a list of CodeStreams, and will assemble them to generate the final code. A CGStar uses instances of class CodeBlock to form a code segment, which can be added to a CodeStream of the CGTarget after some processing.
A set of macros are defined which a star programmer may use in order to refer to variables without being concerned about resource allocation. For example, we may refer to the portholes of a star without knowing what physical resources are allocated to them.