summaryrefslogtreecommitdiff
path: root/chapter12/docs/12-grammar.md
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-10-03 14:03:48 -0700
committerCliff Click <cliffc@acm.org>2026-10-03 14:03:48 -0700
commit22df891893d30e9906d0b14fc3ae5d8e67d500b2 (patch)
tree2bda142f92febc8b26f1cabd4bb0c46d1864f34b /chapter12/docs/12-grammar.md
parentc3958e34c0de21df52e57e47e4f47ffe6464f138 (diff)
downloadSimple-22df891893d30e9906d0b14fc3ae5d8e67d500b2.tar.gz
Simple-22df891893d30e9906d0b14fc3ae5d8e67d500b2.zip
Chapter renumber, and split ch 17
Renumber chapters 10a, 10b, 11, 12, 13, 14 -> 10, 11, 13, 12, [11,14]. Split ch 17 into a 17a and 17b; shuffle around im/mutable syntax to be consistent, and present it more slowly. THe new immutable syntax is pushed through all later chapters
Diffstat (limited to 'chapter12/docs/12-grammar.md')
-rw-r--r--chapter12/docs/12-grammar.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/chapter12/docs/12-grammar.md b/chapter12/docs/12-grammar.md
index 4c071a98..24199ede 100644
--- a/chapter12/docs/12-grammar.md
+++ b/chapter12/docs/12-grammar.md
@@ -11,21 +11,21 @@ statement
: returnStatement
| structDeclaration
| declStatement
- | blockStatment
+ | blockStatement
| expressionStatement
| ifStatement
| whileStatement
| breakStatement
- | continueStatment
+ | continueStatement
;
PRIMTYPE
: 'int'
- | 'flt'
;
field
: PRIMTYPE IDENTIFIER ';'
+ | structName ('?')? IDENTIFIER ';'
;
fields
@@ -102,7 +102,7 @@ newExpression
;
fieldExpression
- : primaryExpresson '.' IDENTIFIER
+ : primaryExpression '.' IDENTIFIER
;
primaryExpression
@@ -122,7 +122,7 @@ INTEGER_LITERAL
;
IDENTIFIER
- : NON_DIGIT (NON_DIGIT | DIGIT)*
+ : NON_DIGIT (NON_DIGIT | DEC_DIGIT)*
;
NON_DIGIT: [a-zA-Z_];