summaryrefslogtreecommitdiff
path: root/chapter10/docs
diff options
context:
space:
mode:
Diffstat (limited to 'chapter10/docs')
-rw-r--r--chapter10/docs/10-grammar.md24
-rw-r--r--chapter10/docs/build-graphs.sh1
-rw-r--r--chapter10/docs/example2b.gv2
-rw-r--r--chapter10/docs/example2c.gv2
-rw-r--r--chapter10/docs/lattice.gv2
5 files changed, 15 insertions, 16 deletions
diff --git a/chapter10/docs/10-grammar.md b/chapter10/docs/10-grammar.md
index cb68df3d..01863e7f 100644
--- a/chapter10/docs/10-grammar.md
+++ b/chapter10/docs/10-grammar.md
@@ -11,7 +11,7 @@ statement
: returnStatement
| structDeclaration
| declStatement
- | blockStatment
+ | blockStatment
| expressionStatement
| ifStatement
| whileStatement
@@ -26,7 +26,7 @@ field
fields
: field+
- ;
+ ;
structDeclaration
: 'struct' IDENTIFIER '{' fields '}'
@@ -39,10 +39,10 @@ whileStatement
breakStatement
: 'break' ';'
;
-
+
continueStatement
: 'continue' ';'
- ;
+ ;
ifStatement
: 'if' '(' expression ')' statement ('else' statement)?
@@ -77,15 +77,15 @@ returnStatement
expression
: comparisonExpression
;
-
+
comparisonExpression
: additiveExpression (('==' | '!='| '>'| '<'| '>='| '<=') additiveExpression)*
;
-
+
additiveExpression
- : multiplicativeExpression (('+' | '-') multiplicativeExpression)*
+ : multiplicativeExpression (('+' | '-') multiplicativeExpression)*
;
-
+
multiplicativeExpression
: unaryExpression (('*' | '/') unaryExpression)*
;
@@ -96,7 +96,7 @@ unaryExpression
;
newExpression
- : 'new' IDENTIFIER
+ : 'new' IDENTIFIER
;
fieldExpression
@@ -118,11 +118,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/chapter10/docs/build-graphs.sh b/chapter10/docs/build-graphs.sh
index 8f6afed7..67dd302f 100644
--- a/chapter10/docs/build-graphs.sh
+++ b/chapter10/docs/build-graphs.sh
@@ -3,4 +3,3 @@ dot -Tsvg example2a.gv > example2a.svg
dot -Tsvg example2b.gv > example2b.svg
dot -Tsvg example2c.gv > example2c.svg
dot -Tsvg lattice.gv > lattice.svg
-
diff --git a/chapter10/docs/example2b.gv b/chapter10/docs/example2b.gv
index a7d4ac62..d732e874 100644
--- a/chapter10/docs/example2b.gv
+++ b/chapter10/docs/example2b.gv
@@ -53,4 +53,4 @@ return bar.a;
Return19 -> Store17[taillabel=2 color=blue];
Return19 -> Store13[taillabel=3 color=blue];
Return19 -> Start2:p4[taillabel=4 color=blue];
-} \ No newline at end of file
+}
diff --git a/chapter10/docs/example2c.gv b/chapter10/docs/example2c.gv
index 7bd21542..76db03bb 100644
--- a/chapter10/docs/example2c.gv
+++ b/chapter10/docs/example2c.gv
@@ -50,4 +50,4 @@ return bar.a;
Store13 -> Start2:p3[taillabel=1 color=blue];
Store13 -> new10[taillabel=2];
Store13 -> Con_11[taillabel=3];
-} \ No newline at end of file
+}
diff --git a/chapter10/docs/lattice.gv b/chapter10/docs/lattice.gv
index bf7403f7..c074f1a4 100644
--- a/chapter10/docs/lattice.gv
+++ b/chapter10/docs/lattice.gv
@@ -132,4 +132,4 @@ digraph Lattice {
{rank=same; PTR_S1OPT; PTR_SOPTDOTS; PTR_SNOPT; }
{rank=same; INT_BOT; CTRL; STRUCT_BOT; PTR_BOT; MEM_BOT;}
{rank=same; BOT;}
-} \ No newline at end of file
+}