diff options
Diffstat (limited to 'chapter12')
| -rw-r--r-- | chapter12/docs/12-grammar.md | 9 |
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 ';' ; |
