diff options
Diffstat (limited to 'chapter09/docs/09-grammar.md')
| -rw-r--r-- | chapter09/docs/09-grammar.md | 20 |
1 files changed, 10 insertions, 10 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 +``` |
