14.5 Primary expressions
来源:互联网 发布:mac操作说明 完全指南 编辑:程序博客网 时间:2024/05/17 12:24
Primary expressions include the simplest forms of expressions.
primary-expression:
array-creation-expression
primary-no-array-creation-expression
primary-no-array-creation-expression:
literal
simple-name
parenthesized-expression
member-access
invocation-expression
element-access
this-access
base-access
post-increment-expression
post-decrement-expression
object-creation-expression
delegate-creation-expression
typeof-expression
checked-expression
unchecked-expression
Primary expressions are divided between array-creation-expressions and
primary-no-array-creationexpressions.
Treating array-creation-expression in this way, rather than listing it
along with the other simple
expression forms, enables the grammar to disallow potentially confusing
code such as
C# LANGUAGE SPECIFICATION
138
object o = new int[3][1];
which would otherwise be interpreted as
object o = (new int[3])[1];
primary-expression:
array-creation-expression
primary-no-array-creation-expression
primary-no-array-creation-expression:
literal
simple-name
parenthesized-expression
member-access
invocation-expression
element-access
this-access
base-access
post-increment-expression
post-decrement-expression
object-creation-expression
delegate-creation-expression
typeof-expression
checked-expression
unchecked-expression
Primary expressions are divided between array-creation-expressions and
primary-no-array-creationexpressions.
Treating array-creation-expression in this way, rather than listing it
along with the other simple
expression forms, enables the grammar to disallow potentially confusing
code such as
C# LANGUAGE SPECIFICATION
138
object o = new int[3][1];
which would otherwise be interpreted as
object o = (new int[3])[1];
- 14.5 Primary expressions
- 14.5.3 Parenthesized expressions
- 14.5.5 Invocation expressions
- Expressions
- Expressions
- Expressions
- 14.5.10.1 Object creation expressions
- 14.5.10.2 Array creation expressions
- 14.5.10.3 Delegate creation expressions
- PRIMARY KEY
- Primary Arithmetic
- Primary Arithmetic
- Primary Instrument
- Primary Arithmetic
- C++ Primary
- Primary Arithmetic
- Regular Expressions
- Validating Expressions
- 14.4.2.1 Applicable function member
- 14.4.2.2 Better function member
- 14.4.2.3 Better conversion
- 14.4.3 Function member invocation
- 14.4.3.1 Invocations on boxed instances
- 14.5 Primary expressions
- 14.5.1 Literals
- 14.5.2 Simple names
- 14.5.3 Parenthesized expressions
- 14.5.4 Member access
- 14.5.5 Invocation expressions
- 14.5.6 Element access
- 14.5.7 This access
- 14.5.9 Postfix in- & decrement operators