From eab00131b086b379c9e983fa8165405f48738b6d Mon Sep 17 00:00:00 2001 From: Flavian Kaufmann Date: Wed, 21 May 2025 07:50:31 +0200 Subject: doc fix --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index bbab9ef..71e545c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ A small interpreter of the IMP programming language. + ## Build - `make all` to build interpreter. @@ -9,31 +10,41 @@ A small interpreter of the IMP programming language. - `make example` to interpret "example/example.imp". - `make clean` to remove build folder. + ## Dependencies - [flex](https://github.com/westes/flex) - [bison](https://www.gnu.org/software/bison) - [readline](https://tiswww.case.edu/php/chet/readline/rltop.html) + ## IMP [Syntax](/res/syntax.ebnf) + **Statement ``** + Variable assignment: + - ` := ` any variable not assigned, has the value 0. Local variable: + - `var := in end` Control flow: + - `if then else end` - `while do end` - `(; )` sequential composition, the first statement runs before the second - `skip`, nop + **Expression** + Arithmetic Expression ``: + - `` - `` - `( + )` @@ -41,6 +52,7 @@ Arithmetic Expression ``: - `( + )` Boolean Expression ``: + - `not ` - `( or )` - `( and )` @@ -51,8 +63,12 @@ Boolean Expression ``: - ` > ` - ` >= ` + **Variable ``** + - `[a-zA-Z][A-Za-z0-9]*` + **Numeral ``** + - `[0-9]+` -- cgit v1.2.3