Information technology - C# Language Specification

ISO/IEC 23270:2003 specifies the form and establishes the interpretation of programs written in the C# programming language. It specifies: the representation of C# programs; the syntax and constraints of the C# language; the semantic rules for interpreting C# programs; the restrictions and limits imposed by a conforming implementation of C#. ISO/IEC 23270:2003 does not specify: the mechanism by which C# programs are transformed for use by a data-processing system; the mechanism by which C# applications are invoked for use by a data-processing system; the mechanism by which input data are transformed for use by a C# application; the mechanism by which output data are transformed after being produced by a C# application; the size or complexity of a program and its data that will exceed the capacity of any specific data-processing system or the capacity of a particular processor; all minimal requirements of a data-processing system that is capable of supporting a conforming implementation.

Technologies de l'information — Spécification du langage C#

General Information

Status
Withdrawn
Publication Date
27-Mar-2003
Withdrawal Date
27-Mar-2003
Current Stage
9599 - Withdrawal of International Standard
Start Date
23-Aug-2006
Completion Date
30-Oct-2025
Ref Project

Relations

Standard
ISO/IEC 23270:2003 - Information technology -- C# Language Specification
English language
471 pages
sale 15% off
Preview
sale 15% off
Preview

Frequently Asked Questions

ISO/IEC 23270:2003 is a standard published by the International Organization for Standardization (ISO). Its full title is "Information technology - C# Language Specification". This standard covers: ISO/IEC 23270:2003 specifies the form and establishes the interpretation of programs written in the C# programming language. It specifies: the representation of C# programs; the syntax and constraints of the C# language; the semantic rules for interpreting C# programs; the restrictions and limits imposed by a conforming implementation of C#. ISO/IEC 23270:2003 does not specify: the mechanism by which C# programs are transformed for use by a data-processing system; the mechanism by which C# applications are invoked for use by a data-processing system; the mechanism by which input data are transformed for use by a C# application; the mechanism by which output data are transformed after being produced by a C# application; the size or complexity of a program and its data that will exceed the capacity of any specific data-processing system or the capacity of a particular processor; all minimal requirements of a data-processing system that is capable of supporting a conforming implementation.

ISO/IEC 23270:2003 specifies the form and establishes the interpretation of programs written in the C# programming language. It specifies: the representation of C# programs; the syntax and constraints of the C# language; the semantic rules for interpreting C# programs; the restrictions and limits imposed by a conforming implementation of C#. ISO/IEC 23270:2003 does not specify: the mechanism by which C# programs are transformed for use by a data-processing system; the mechanism by which C# applications are invoked for use by a data-processing system; the mechanism by which input data are transformed for use by a C# application; the mechanism by which output data are transformed after being produced by a C# application; the size or complexity of a program and its data that will exceed the capacity of any specific data-processing system or the capacity of a particular processor; all minimal requirements of a data-processing system that is capable of supporting a conforming implementation.

ISO/IEC 23270:2003 is classified under the following ICS (International Classification for Standards) categories: 35.060 - Languages used in information technology. The ICS classification helps identify the subject area and facilitates finding related standards.

ISO/IEC 23270:2003 has the following relationships with other standards: It is inter standard links to ISO/IEC 23270:2006. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.

You can purchase ISO/IEC 23270:2003 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.

Standards Content (Sample)


INTERNATIONAL ISO/IEC
STANDARD 23270
First edition
2003-04-01
Information technology — C# Language
Specification
Technologies de l'information — Spécification du langage C#

Reference number
©
ISO/IEC 2003
PDF disclaimer
This PDF file may contain embedded typefaces. In accordance with Adobe's licensing policy, this file may be printed or viewed but
shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In
downloading this file, parties accept therein the responsibility of not infringing Adobe's licensing policy. The ISO Central Secretariat
accepts no liability in this area.
Adobe is a trademark of Adobe Systems Incorporated.
Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation
parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In
the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below.

©  ISO/IEC 2003
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or
ISO's member body in the country of the requester.
ISO copyright office
Case postale 56 • CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Published in Switzerland
ii © ISO/IEC 2003 – All rights reserved

Table of Contents
1. Scope. 1
2. Conformance . 3
3. References . 5
4. Definitions . 7
5. Notational conventions. 9
6. Acronyms and abbreviations . 11
7. General description. 13
8. Language Overview . 15
8.1 Getting started . 15
8.2 Types . 16
8.2.1 Predefined types.17
8.2.2 Conversions .19
8.2.3 Array types.20
8.2.4 Type system unification.21
8.3 Variables and parameters. 22
8.4 Automatic memory management. 25
8.5 Expressions. 27
8.6 Statements. 28
8.7 Classes . 31
8.7.1 Constants.32
8.7.2 Fields.33
8.7.3 Methods .34
8.7.4 Properties .35
8.7.5 Events.36
8.7.6 Operators.37
8.7.7 Indexers.38
8.7.8 Instance constructors.39
8.7.9 Destructors .39
8.7.10 Static constructors.40
8.7.11 Inheritance .40
8.8 Structs. 41
8.9 Interfaces . 42
8.10 Delegates . 43
8.11 Enums. 44
8.12 Namespaces and assemblies . 45
8.13 Versioning . 46
8.14 Attributes . 48
9. Lexical structure. 51
9.1 Programs. 51
9.2 Grammars . 51
9.2.1 Lexical grammar .51
9.2.2 Syntactic grammar .51
9.3 Lexical analysis . 52
9.3.1 Line terminators.52
9.3.2 Comments .53
©ISO/IEC 2003 – All rights reserved iii

9.3.3 White space.54
9.4 Tokens . 54
9.4.1 Unicode escape sequences .54
9.4.2 Identifiers.55
9.4.3 Keywords.56
9.4.4 Literals .57
9.4.5 Operators and punctuators .62
9.5 Pre-processing directives. 62
9.5.1 Conditional compilation symbols .63
9.5.2 Pre-processing expressions .63
9.5.3 Declaration directives .64
9.5.4 Conditional compilation directives .65
9.5.5 Diagnostic directives.67
9.5.6 Region control.67
9.5.7 Line directives.68
10. Basic concepts . 69
10.1 Application startup . 69
10.2 Application termination. 69
10.3 Declarations. 70
10.4 Members. 72
10.4.1 Namespace members .72
10.4.2 Struct members .72
10.4.3 Enumeration members .73
10.4.4 Class members .73
10.4.5 Interface members.73
10.4.6 Array members .73
10.4.7 Delegate members.73
10.5 Member access . 73
10.5.1 Declared accessibility .74
10.5.2 Accessibility domains .74
10.5.3 Protected access for instance members.77
10.5.4 Accessibility constraints .77
10.6 Signatures and overloading . 78
10.7 Scopes. 79
10.7.1 Name hiding.81
10.8 Namespace and type names. 83
10.8.1 Fully qualified names.84
10.9 Automatic memory management. 85
10.10 Execution order . 87
11. Types . 89
11.1 Value types . 89
11.1.1 Default constructors.90
11.1.2 Struct types .90
11.1.3 Simple types.91
11.1.4 Integral types.91
11.1.5 Floating point types.92
11.1.6 The decimal type.94
11.1.7 The bool type.94
11.1.8 Enumeration types .94
11.2 Reference types . 94
11.2.1 Class types .95
11.2.2 The object type.95
11.2.3 The string type.95
iv ©ISO/IEC 2003 – All rights reserved

11.2.4 Interface types.96
11.2.5 Array types.96
11.2.6 Delegate types.96
11.3 Boxing and unboxing . 96
11.3.1 Boxing conversions.96
11.3.2 Unboxing conversions .97
12. Variables . 99
12.1 Variable categories . 99
12.1.1 Static variables.99
12.1.2 Instance variables.99
12.1.3 Array elements.100
12.1.4 Value parameters .100
12.1.5 Reference parameters.100
12.1.6 Output parameters.100
12.1.7 Local variables.101
12.2 Default values. 101
12.3 Definite assignment . 102
12.3.1 Initially assigned variables.102
12.3.2 Initially unassigned variables.103
12.3.3 Precise rules for determining definite assignment .103
12.4 Variable references. 112
12.5 Atomicity of variable references . 112
13. Conversions. 113
13.1 Implicit conversions . 113
13.1.1 Identity conversion .113
13.1.2 Implicit numeric conversions.113
13.1.3 Implicit enumeration conversions.114
13.1.4 Implicit reference conversions.114
13.1.5 Boxing conversions.114
13.1.6 Implicit constant expression conversions .114
13.1.7 User-defined implicit conversions .115
13.2 Explicit conversions . 115
13.2.1 Explicit numeric conversions.115
13.2.2 Explicit enumeration conversions.117
13.2.3 Explicit reference conversions.117
13.2.4 Unboxing conversions .117
13.2.5 User-defined explicit conversions.118
13.3 Standard conversions. 118
13.3.1 Standard implicit conversions.118
13.3.2 Standard explicit conversions .118
13.4 User-defined conversions . 118
13.4.1 Permitted user-defined conversions.118
13.4.2 Evaluation of user-defined conversions.119
13.4.3 User-defined implicit conversions .119
13.4.4 User-defined explicit conversions.120
14. Expressions . 123
14.1 Expression classifications. 123
14.1.1 Values of expressions .124
14.2 Operators . 124
14.2.1 Operator precedence and associativity.124
14.2.2 Operator overloading .125
14.2.3 Unary operator overload resolution .126
14.2.4 Binary operator overload resolution .127
©ISO/IEC 2003 – All rights reserved v

14.2.5 Candidate user-defined operators .127
14.2.6 Numeric promotions .127
14.3 Member lookup . 129
14.3.1 Base types .129
14.4 Function members . 130
14.4.1 Argument lists.132
14.4.2 Overload resolution.134
14.4.3 Function member invocation .136
14.5 Primary expressions. 137
14.5.1 Literals .138
14.5.2 Simple names.138
14.5.3 Parenthesized expressions.139
14.5.4 Member access.140
14.5.5 Invocation expressions.141
14.5.6 Element access.143
14.5.7 This access .144
14.5.8 Base access .145
14.5.9 Postfix increment and decrement operators.145
14.5.10 The new operator.146
14.5.11 The typeof operator.150
14.5.12 The checked and unchecked operators .151
14.6 Unary expressions . 153
14.6.1 Unary plus operator.153
14.6.2 Unary minus operator .154
14.6.3 Logical negation operator .154
14.6.4 Bitwise complement operator .154
14.6.5 Prefix increment and decrement operators.155
14.6.6 Cast expressions.155
14.7 Arithmetic operators. 156
14.7.1 Multiplication operator .156
14.7.2 Division operator .157
14.7.3 Remainder operator.158
14.7.4 Addition operator.159
14.7.5 Subtraction operator.161
14.8 Shift operators . 162
14.9 Relational and type-testing operators . 163
14.9.1 Integer comparison operators.164
14.9.2 Floating-point comparison operators .165
14.9.3 Decimal comparison operators .165
14.9.4 Boolean equality operators .165
14.9.5 Enumeration comparison operators .166
14.9.6 Reference type equality operators.166
14.9.7 String equality operators.167
14.9.8 Delegate equality operators.167
14.9.9 The is operator .168
14.9.10 The as operator .168
14.10 Logical operators . 169
14.10.1 Integer logical operators .169
14.10.2 Enumeration logical operators .169
14.10.3 Boolean logical operators .170
14.11 Conditional logical operators. 170
14.11.1 Boolean conditional logical operators.170
14.11.2 User-defined conditional logical operators.171
14.12 Conditional operator. 171
14.13 Assignment operators . 172
vi ©ISO/IEC 2003 – All rights reserved

14.13.1 Simple assignment .172
14.13.2 Compound assignment.174
14.13.3 Event assignment .175
14.14 Expression . 175
14.15 Constant expressions . 175
14.16 Boolean expressions . 176
15. Statements. 177
15.1 End points and reachability . 177
15.2 Blocks. 179
15.2.1 Statement lists .179
15.3 The empty statement. 179
15.4 Labeled statements . 180
15.5 Declaration statements. 180
15.5.1 Local variable declarations .180
15.5.2 Local constant declarations.181
15.6 Expression statements . 182
15.7 Selection statements . 182
15.7.1 The if statement .182
15.7.2 The switch statement.183
15.8 Iteration statements. 186
15.8.1 The while statement.186
15.8.2 The do statement .187
15.8.3 The for statement.187
15.8.4 The foreach statement .188
15.9 Jump statements. 190
15.9.1 The break statement.191
15.9.2 The continue statement.192
15.9.3 The goto statement .192
15.9.4 The return statement.193
15.9.5 The throw statement.194
15.10 The try statement . 195
15.11 The checked and unchecked statements. 197
15.12 The lock statement. 198
15.13 The using statement. 198
16. Namespaces. 201
16.1 Compilation units . 201
16.2 Namespace declarations . 201
16.3 Using directives. 202
16.3.1 Using alias directives .203
16.3.2 Using namespace directives.205
16.4 Namespace members . 207
16.5 Type declarations. 207
17. Classes . 209
17.1 Class declarations . 209
17.1.1 Class modifiers .209
17.1.2 Class base specification .210
17.1.3 Class body.211
17.2 Class members. 212
17.2.1 Inheritance .213
17.2.2 The new modifier .213
17.2.3 Access modifiers.213
17.2.4 Constituent types.214
17.2.5 Static and instance members.214
©ISO/IEC 2003 – All rights reserved vii

17.2.6 Nested types.215
17.2.7 Reserved member names .217
17.3 Constants . 219
17.4 Fields . 220
17.4.1 Static and instance fields.221
17.4.2 Readonly fields .222
17.4.3 Volatile fields.223
17.4.4 Field initialization .224
17.4.5 Variable initializers.224
17.5 Methods . 227
17.5.1 Method parameters .228
17.5.2 Static and instance methods .233
17.5.3 Virtual methods.
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...