summaryrefslogtreecommitdiff
path: root/chapter13/docs
diff options
context:
space:
mode:
Diffstat (limited to 'chapter13/docs')
-rw-r--r--chapter13/docs/13-grammar.md10
1 files changed, 8 insertions, 2 deletions
diff --git a/chapter13/docs/13-grammar.md b/chapter13/docs/13-grammar.md
index 65611618..63871a39 100644
--- a/chapter13/docs/13-grammar.md
+++ b/chapter13/docs/13-grammar.md
@@ -20,8 +20,14 @@ statement
| metaStatement
;
+PRIMTYPE
+ : 'int'
+ | 'flt'
+ ;
+
field
- : 'int' IDENTIFIER ';'
+ : PRIMTYPE IDENTIFIER ';'
+ | structName IDENTIFIER ('?')? ';'
;
fields
@@ -66,7 +72,7 @@ structName
;
declStatement
- : 'int' IDENTIFIER '=' expression ';'
+ : PRIMTYPE IDENTIFIER '=' expression ';'
| structName IDENTIFIER ('?')? '=' expression ';'
;