A compilation unit.
There are three kinds of compilation unit:
(Because it is the most commonly used, and also what most people associate with a “compilation unit”,
the first kind is simply called CompilationUnit
and this abstract class is called AnyCompilationUnit
,
rather than calling this CompilationUnit
and using RegularCompilationUnit
or CodeCompilationUnit
for regular compilation units.)
Every compilation unit starts with a (possibly empty) list of imports
.
Examples (separated by blank lines):
module tmp "1.0.0" {} package tmp; void run() { print("Hello, World!"); }
Anything
Object
AnyCompilationUnit
Node
Object
Anything
Initializer |
AnyCompilationUnit() |
Attributes | |
children | Source Codeshared formal <Import|Declaration|ModuleDescriptor|PackageDescriptor>[] children The child nodes of this node. Refines Node.children |
declarations | Source Codeshared formal Declaration[] declarations The declarations in this compilation unit. (This attribute is empty for non-regular compilation units.) |
imports | Source Codeshared formal Import[] imports The imports of this compilation unit. |
moduleDescriptor | Source Codeshared formal ModuleDescriptor? moduleDescriptor The module descriptor in this compilation unit. (This attribute is |
packageDescriptor | Source Codeshared formal PackageDescriptor? packageDescriptor The package descriptor in this compilation unit. (This attribute is |
Inherited Attributes |
Attributes inherited from: Node |
Attributes inherited from: Object hash , string |
Inherited Methods |
Methods inherited from: Node |
Methods inherited from: Object equals |