diff options
Diffstat (limited to 'chapter04/docs')
| -rw-r--r-- | chapter04/docs/04-grammar.md | 16 | ||||
| -rw-r--r-- | chapter04/docs/04-post-peephole.gv | 2 | ||||
| -rw-r--r-- | chapter04/docs/04-pre-peephole.gv | 2 | ||||
| -rw-r--r-- | chapter04/docs/build-graphs.sh | 1 | ||||
| -rw-r--r-- | chapter04/docs/lattice.gv | 2 |
5 files changed, 11 insertions, 12 deletions
diff --git a/chapter04/docs/04-grammar.md b/chapter04/docs/04-grammar.md index 51d5dbea..48facd4c 100644 --- a/chapter04/docs/04-grammar.md +++ b/chapter04/docs/04-grammar.md @@ -10,7 +10,7 @@ program statement : returnStatement | declStatement - | blockStatment + | blockStatment | expressionStatement | metaStatement ; @@ -38,15 +38,15 @@ returnStatement expression : comparisonExpression ; - + comparisonExpression : additiveExpression (('==' | '!='| '>'| '<'| '>='| '<=') additiveExpression)* ; - + additiveExpression - : multiplicativeExpression (('+' | '-') multiplicativeExpression)* + : multiplicativeExpression (('+' | '-') multiplicativeExpression)* ; - + multiplicativeExpression : unaryExpression (('*' | '/') unaryExpression)* ; @@ -66,11 +66,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/chapter04/docs/04-post-peephole.gv b/chapter04/docs/04-post-peephole.gv index 51e176bc..0a9f8e93 100644 --- a/chapter04/docs/04-post-peephole.gv +++ b/chapter04/docs/04-post-peephole.gv @@ -40,4 +40,4 @@ return 1+arg+2; #showGraph; Return12 -> Add11[taillabel=1]; edge [style=dashed color=cornflowerblue]; Scope1_0:"Scope1_0_arg" -> Start2:p1; -}
\ No newline at end of file +} diff --git a/chapter04/docs/04-pre-peephole.gv b/chapter04/docs/04-pre-peephole.gv index b6fefc2d..aefd81c4 100644 --- a/chapter04/docs/04-pre-peephole.gv +++ b/chapter04/docs/04-pre-peephole.gv @@ -44,4 +44,4 @@ return 1+arg+2; #showGraph; Return9 -> Add8[taillabel=1]; edge [style=dashed color=cornflowerblue]; Scope1_0:"Scope1_0_arg" -> Start2:p1; -}
\ No newline at end of file +} diff --git a/chapter04/docs/build-graphs.sh b/chapter04/docs/build-graphs.sh index d8038602..e736a386 100644 --- a/chapter04/docs/build-graphs.sh +++ b/chapter04/docs/build-graphs.sh @@ -1,2 +1 @@ dot -Tsvg lattice.gv > lattice.svg - diff --git a/chapter04/docs/lattice.gv b/chapter04/docs/lattice.gv index 2644448e..1f286530 100644 --- a/chapter04/docs/lattice.gv +++ b/chapter04/docs/lattice.gv @@ -60,4 +60,4 @@ digraph Lattice { INT_MAX; TUPLE} {rank=same; INT_BOT} {rank=same; BOT;} -}
\ No newline at end of file +} |
