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