From 6e9ae382b8f780b07438998b917ce9e2e970a025 Mon Sep 17 00:00:00 2001 From: stanzhai Date: Sun, 8 Jun 2014 22:53:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E8=AF=AD=E6=B3=95=E6=80=BB=E8=AE=A1]?= =?UTF-8?q?=E5=8D=A0=E5=9D=91=20=E7=AC=AC=E4=B8=89=E7=AB=A0=20Summary=20of?= =?UTF-8?q?=20the=20Grammar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/chapter3/09_Summary_of_the_Grammar.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/chapter3/09_Summary_of_the_Grammar.md b/source/chapter3/09_Summary_of_the_Grammar.md index e69de29b..41790bf9 100644 --- a/source/chapter3/09_Summary_of_the_Grammar.md +++ b/source/chapter3/09_Summary_of_the_Grammar.md @@ -0,0 +1,4 @@ +# 语法总结 (Summary of the Grammar) + +## 语句 + From 7028c806286c49ef9426791d47697af85c2b2758 Mon Sep 17 00:00:00 2001 From: stanzhai Date: Mon, 9 Jun 2014 00:08:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=95=B4=E7=90=86=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E5=88=97=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*]() +