disable broken tests on net_4_0
[mcs.git] / docs / ecma334 / 16.1.xml
blob72467f98d69f71d0ba55fc5b4043f6838354a28f
1 <?xml version="1.0"?>
2 <clause number="16.1" title="Compilation units">
3   <paragraph>A <non_terminal where="16.1">compilation-unit</non_terminal> defines the overall structure of a source file. A compilation unit consists of zero or more <non_terminal where="16.3">using-directive</non_terminal>s followed by zero or more <non_terminal where="24.2">global-attributes</non_terminal> followed by zero or more  <non_terminal where="16.4">namespace-member-declaration</non_terminal>s. <grammar_production><name><non_terminal where="16.1">compilation-unit</non_terminal></name> : <rhs><non_terminal where="16.3">using-directives</non_terminal><opt/><non_terminal where="24.2">global-attributes</non_terminal><opt/><non_terminal where="16.4">namespace-member-declarations</non_terminal><opt/></rhs></grammar_production></paragraph>
4   <paragraph>A C# program consists of one or more compilation units, each contained in a separate source file. When a C# program is compiled, all of the compilation units are processed together. Thus, compilation units can depend on each other, possibly in a circular fashion. </paragraph>
5   <paragraph>The <non_terminal where="16.3">using-directive</non_terminal>s of a compilation unit affect the <non_terminal where="24.2">global-attributes</non_terminal> and <non_terminal where="16.4">namespace-member-declaration</non_terminal>s of that compilation unit, but have no effect on other compilation units. </paragraph>
6   <paragraph>The <non_terminal where="24.2">global-attributes</non_terminal> (<hyperlink>24</hyperlink>) of a compilation unit permit the specification of attributes for the target assembly. Assemblies act as physical containers for types. </paragraph>
7   <paragraph>The <non_terminal where="16.4">namespace-member-declaration</non_terminal>s of each compilation unit of a program contribute members to a single declaration space called the global namespace. <example>[Example: For example: File A.cs: <code_example><![CDATA[
8 class A {}  
9 ]]></code_example></example></paragraph>
10   <paragraph>
11     <example>File B.cs: <code_example><![CDATA[
12 class B {}  
13 ]]></code_example></example>
14   </paragraph>
15   <paragraph>
16     <example>The two compilation units contribute to the single global namespace, in this case declaring two classes with the fully qualified names A and B. Because the two compilation units contribute to the same declaration space, it would have been an error if each contained a declaration of a member with the same name. end example]</example>
17   </paragraph>
18 </clause>