summaryrefslogtreecommitdiff
path: root/chapter09/docs
diff options
context:
space:
mode:
Diffstat (limited to 'chapter09/docs')
-rw-r--r--chapter09/docs/09-grammar.md20
-rw-r--r--chapter09/docs/09-graph1.gv2
-rw-r--r--chapter09/docs/09-graph2.gv2
-rw-r--r--chapter09/docs/09-graph3.gv2
-rw-r--r--chapter09/docs/09-graph6.gv2
5 files changed, 14 insertions, 14 deletions
diff --git a/chapter09/docs/09-grammar.md b/chapter09/docs/09-grammar.md
index c603f335..4c61bfd7 100644
--- a/chapter09/docs/09-grammar.md
+++ b/chapter09/docs/09-grammar.md
@@ -10,7 +10,7 @@ program
statement
: returnStatement
| declStatement
- | blockStatment
+ | blockStatment
| expressionStatement
| ifStatement
| whileStatement
@@ -26,10 +26,10 @@ whileStatement
breakStatement
: 'break' ';'
;
-
+
continueStatement
: 'continue' ';'
- ;
+ ;
ifStatement
: 'if' '(' expression ')' statement ('else' statement)?
@@ -58,15 +58,15 @@ returnStatement
expression
: comparisonExpression
;
-
+
comparisonExpression
: additiveExpression (('==' | '!='| '>'| '<'| '>='| '<=') additiveExpression)*
;
-
+
additiveExpression
- : multiplicativeExpression (('+' | '-') multiplicativeExpression)*
+ : multiplicativeExpression (('+' | '-') multiplicativeExpression)*
;
-
+
multiplicativeExpression
: unaryExpression (('*' | '/') unaryExpression)*
;
@@ -88,11 +88,11 @@ INTEGER_LITERAL
: [1-9][0-9]*
| [0]
;
-
+
IDENTIFIER
: NON_DIGIT (NON_DIGIT | DIGIT)*
;
-
+
NON_DIGIT: [a-zA-Z_];
DEC_DIGIT: [0-9];
-``` \ No newline at end of file
+```
diff --git a/chapter09/docs/09-graph1.gv b/chapter09/docs/09-graph1.gv
index 4f712c2d..e6d1851a 100644
--- a/chapter09/docs/09-graph1.gv
+++ b/chapter09/docs/09-graph1.gv
@@ -64,4 +64,4 @@ return x;
Add21 -> Con_20[taillabel=2];
Return24 -> If11:p1[taillabel=0 color=red];
Return24 -> Add21[taillabel=1];
-} \ No newline at end of file
+}
diff --git a/chapter09/docs/09-graph2.gv b/chapter09/docs/09-graph2.gv
index 9f921cc0..1a1f7a29 100644
--- a/chapter09/docs/09-graph2.gv
+++ b/chapter09/docs/09-graph2.gv
@@ -60,4 +60,4 @@ return x;
Add20 -> Con_21[taillabel=2];
Return24 -> If11:p1[taillabel=0 color=red];
Return24 -> Add20[taillabel=1];
-} \ No newline at end of file
+}
diff --git a/chapter09/docs/09-graph3.gv b/chapter09/docs/09-graph3.gv
index 9df55c1c..37bb1c53 100644
--- a/chapter09/docs/09-graph3.gv
+++ b/chapter09/docs/09-graph3.gv
@@ -34,4 +34,4 @@ return arg*arg-arg*arg;
Sub8 -> Mul7[taillabel=2];
Return9 -> Start2:p0[taillabel=0 color=red];
Return9 -> Sub8[taillabel=1];
-} \ No newline at end of file
+}
diff --git a/chapter09/docs/09-graph6.gv b/chapter09/docs/09-graph6.gv
index 492c320e..56dc6ada 100644
--- a/chapter09/docs/09-graph6.gv
+++ b/chapter09/docs/09-graph6.gv
@@ -57,4 +57,4 @@ return arg;
Return21 -> Phi_arg9[taillabel=1];
Add25 -> Phi_arg9[taillabel=1];
Add25 -> Con_24[taillabel=2];
-} \ No newline at end of file
+}