Definition
include_stm : include " filename " ;
Purpose
An include_stm copies the declarations found in a file into the current context. This means the file itself must contain a syntactically correct program. The present file and the included file are parsed separately, so a grammar production cannot be "finished" by the included file or vice versa. However, the declarations are semantically analyzed as though they existed in the present context. This is quite different than the "blind copy" approach used by the C language.
This acts independently of the label under which the statement falls. As properly-formatted source files contain a decl_body with labels of its own, the labels therein will be applied. The language itself is structured such that a single file could easily serve as the contents of a module.
It is not the intention of the language designer for this statement to serve the same purpose as the corresponding statement in C. Rather, it is indended as a mechanism for adding fleixbility and reuse to the language, permitting the creation of libraries that can be both compiled into a form which interfaces with outside languages AND used as modules, and possibly as a means of describing a whole program spread across multiple source files. Additionally, it is intended to make easier the use of templates, which must be defined in whole, unlike other program constructs, which do not share such restrictions.