Compilation Units
CompilationUnit is the goal symbol for the syntactic grammar of
Java programs. It is defined by the following productions:
CompilationUnit:
PackageDeclarationopt
ImportDeclarationsopt
TypeDeclarationsopt
ImportDeclarations:
ImportDeclaration
ImportDeclarations ImportDeclaration
TypeDeclarations:
TypeDeclaration
TypeDeclarations TypeDeclaration
Types declared in different compilation units can depend on each other, circularly.
A Java compiler must arrange to compile all such types at the same time.
A compilation unit consists of three parts, each of which is optional:
• A package declaration , giving the fully qualified name of the
package to which the compilation unit belongs. A compilation unit that has no
package declaration is part of an unnamed package .
• import declarations that allow types from other packages and static
members of types to be referred to using their simple names
• Top level type declarations of class and interface types
Which compilation units are observable is determined by the host system.
However, all the compilation units of the package java and its subpackages lang
buy the java book
CompilationUnit is the goal symbol for the syntactic grammar of
Java programs. It is defined by the following productions:
CompilationUnit:
PackageDeclarationopt
ImportDeclarationsopt
TypeDeclarationsopt
ImportDeclarations:
ImportDeclaration
ImportDeclarations ImportDeclaration
TypeDeclarations:
TypeDeclaration
TypeDeclarations TypeDeclaration
Types declared in different compilation units can depend on each other, circularly.
A Java compiler must arrange to compile all such types at the same time.
A compilation unit consists of three parts, each of which is optional:
• A package declaration , giving the fully qualified name of the
package to which the compilation unit belongs. A compilation unit that has no
package declaration is part of an unnamed package .
• import declarations that allow types from other packages and static
members of types to be referred to using their simple names
• Top level type declarations of class and interface types
Which compilation units are observable is determined by the host system.
However, all the compilation units of the package java and its subpackages lang
buy the java book
0 comments:
Post a Comment