old-code/monodoc/ecma334/15.3.xml

26 строки
1.2 KiB
XML

<?xml version="1.0"?>
<clause number="15.3" title="The empty statement">
<paragraph>An <non_terminal where="15.3">empty-statement</non_terminal> does nothing. <grammar_production><name><non_terminal where="15.3">empty-statement</non_terminal></name> : <rhs><terminal>;</terminal></rhs></grammar_production></paragraph>
<paragraph>An empty statement is used when there are no operations to perform in a context where a statement is required. </paragraph>
<paragraph>Execution of an empty statement simply transfers control to the end point of the statement. Thus, the end point of an empty statement is reachable if the empty statement is reachable. </paragraph>
<paragraph>
<example>[Example: An empty statement can be used when writing a while statement with a null body: <code_example><![CDATA[
bool ProcessMessage() {...}
void ProcessMessages() {
while (ProcessMessage())
;
}
]]></code_example></example>
</paragraph>
<paragraph>
<example>Also, an empty statement can be used to declare a label just before the closing &quot;}&quot; of a block: <code_example><![CDATA[
void F() {
...
if (done) goto exit;
...
exit: ;
}
]]></code_example>end example]</example>
</paragraph>
</clause>