9.5.2 Pre-processing expressions

王朝other·作者佚名  2006-01-10
窄屏简体版  字體: |||超大  

9.5.2 Pre-processing expressions

Pre-processing expressions can occur in #if and #elif directives. The

operators !, ==, !=, && and || are

permitted in pre-processing expressions, and parentheses may be used for

grouping.

pp-expression::

whitespaceopt pp-or-expression whitespaceopt

pp-or-expression::

pp-and-expression

pp-or-expression whitespaceopt || whitespaceopt pp-and-expression

pp-and-expression::

pp-equality-expression

pp-and-expression whitespaceopt && whitespaceopt pp-equality-expression

pp-equality-expression::

pp-unary-expression

pp-equality-expression whitespaceopt == whitespaceopt pp-unary-expression

pp-equality-expression whitespaceopt != whitespaceopt pp-unary-expression

pp-unary-expression::

pp-primary-expression

! whitespaceopt pp-unary-expression

C# LANGUAGE SPECIFICATION

64

pp-primary-expression::

true

false

conditional-symbol

( whitespaceopt pp-expression whitespaceopt )

When referenced in a pre-processing expression, a defined conditional

compilation symbol has the boolean value

true, and an undefined conditional compilation symbol has the boolean value

false.

Evaluation of a pre-processing expression always yields a boolean value.

The rules of evaluation for a preprocessing

expression are the same as those for a constant expression (§14.15),

except that the only user-defined

entities that can be referenced are conditional compilation symbols.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航