Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / docs / ecma334 / 19.1.xml
1 <?xml version="1.0"?>
2 <clause number="19.1" title="Array types">
3   <paragraph>An array type is written as a <non_terminal where="19.1">non-array-type</non_terminal> followed by one or more rank-specifiers: <grammar_production><name><non_terminal where="19.1">array-type</non_terminal></name> : <rhs><non_terminal where="19.1">non-array-type</non_terminal><non_terminal where="19.1">rank-specifiers</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="19.1">non-array-type</non_terminal></name> : <rhs><non_terminal where="11">type</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="19.1">rank-specifier</non_terminal>s</name> : <rhs><non_terminal where="19.1">rank-specifier</non_terminal></rhs><rhs><non_terminal where="19.1">rank-specifiers</non_terminal><non_terminal where="19.1">rank-specifier</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="19.1">rank-specifier</non_terminal></name> : <rhs><terminal>[</terminal><non_terminal where="19.1">dim-separators</non_terminal><opt/><terminal>]</terminal></rhs></grammar_production><grammar_production><name><non_terminal where="19.1">dim-separators</non_terminal></name> : <rhs><terminal>,</terminal></rhs><rhs><non_terminal where="19.1">dim-separators</non_terminal><terminal>,</terminal></rhs></grammar_production></paragraph>
4   <paragraph>A <non_terminal where="19.1">non-array-type</non_terminal> is any type that is not itself an <non_terminal where="19.1">array-type</non_terminal>. </paragraph>
5   <paragraph>The rank of an array type is given by the leftmost <non_terminal where="19.1">rank-specifier</non_terminal> in the array-type: A <non_terminal where="19.1">rank-specifier</non_terminal> indicates that the array is an array with a rank of one plus the number of &quot;,&quot; tokens in the <non_terminal where="19.1">rank-specifier</non_terminal>. </paragraph>
6   <paragraph>The element type of an array type is the type that results from deleting the leftmost rank-specifier: <list><list_item> An array type of the form T[R] is an array with rank R and a non-array element type T. </list_item><list_item> An array type of the form T[R][R1]...[RN] is an array with rank R and an element type T[R1]...[RN]. </list_item></list></paragraph>
7   <paragraph>In effect, the <non_terminal where="19.1">rank-specifier</non_terminal>s are read from left to right before the final non-array element type. <example>[Example: The type int[][,,][,] is a single-dimensional array of three-dimensional arrays of two-dimensional arrays of <keyword>int</keyword>. end example]</example> </paragraph>
8   <paragraph>At run-time, a value of an array type can be null or a reference to an instance of that array type. </paragraph>
9 </clause>