diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/README.md b/README.md index f8c52f3..587f82c 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,13 @@ ``` program := defn* + defn := VAL type ID ; | VAL type ID expr ; - -expr := atom atom* ; + +type := ID | [] | [type] | [ type* ARROW type? ] + +expr := atom atom* atom := ID | NUM @@ -40,10 +43,9 @@ atom := ID | dereference stmt := defn - | expr - - -stmt := defn | st - - + | expr ; // expr statement + | return expr ; // return statement + | $ ID expr ; // assignment statement + | if expr compound ; // if statement + | if expr compound else compound ; // if-else statement ``` \ No newline at end of file diff --git a/include/parse.h b/include/parse.h new file mode 100644 index 0000000..e69de29 diff --git a/src/parse.c b/src/parse.c new file mode 100644 index 0000000..6bca26c --- /dev/null +++ b/src/parse.c @@ -0,0 +1,4 @@ +#include "parse.h" + +#include +