From a7eaa6f83b51cf756b8525f8b01d5a970bc8b151 Mon Sep 17 00:00:00 2001 From: stanzhai Date: Mon, 9 Jun 2014 00:08:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E8=AF=AD=E5=8F=A5=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/chapter3/09_Summary_of_the_Grammar.md | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/source/chapter3/09_Summary_of_the_Grammar.md b/source/chapter3/09_Summary_of_the_Grammar.md index 41790bf9..148607a5 100644 --- a/source/chapter3/09_Summary_of_the_Grammar.md +++ b/source/chapter3/09_Summary_of_the_Grammar.md @@ -2,3 +2,56 @@ ## 语句 +> 语句 +*statement* → [*expression*]() ; opt +*statement* → [*declaration*]() ; opt +*statement* → [*loop-statement*]() ; opt +*statement* → [*branch-statement*]() ; opt +*statement* → [*labeled-statement*]() +*statement* → [*control-transfer-statement*]() ; opt +*statements* → [*statement statement*]() opt + +

+ +> 循环语句 +> *loop-statement* → [*for-statement*]() +> *loop-statement* → [*for-in-statement*]() +> *loop-statement* → [*while-statement*]() +> *loop-statement* → [*do-while-statement*]() + +

+ +> for 循环 +> *for-statement* → **for** [*for-init*]() opt ; [*expression*]() opt ; [*expression*]() opt [*code-block*]() +> *for-statement* → **for** ( [*for-init*]() opt ; [*expression*]() opt ; [*expression*]() opt ) [*code-block*]() +> *for-init* → [*variable-declaration*]() | [*expression-list*]() + +

+ +> for-in 循环 +> *for-in-statement* → **for** [*pattern*]() **in** [*expression*]() [*code-block*]() + +

+ +> while 循环 +> *while-statement* → **while** [*while-condition*]() [*code-block*]() +> *while-condition* → [*expression*]() | [*declaration*]() + +

+ +> do-while 循环 +> *do-while-statement* → **do** [*code-block*]() **while** [*while-condition*]() + +

+ +> 判断语句(Branch Statement) +> *branch-statement* → [*if-statement*]() +> *branch-statement* → [*switch-statement*]() + +

+ +> if 语句 +> *if-statement* → **if** [*if-condition*]() [*code-block*]() [*else-clause*]() opt +> *if-condition* → [*expression*]() | [*declaration*]() +> *else-clause* → **else** [*code-block*]() | **else** [*if-statement*]() +