Skip to content
Snippets Groups Projects
Commit 20009529 authored by Wilma Krutrök's avatar Wilma Krutrök
Browse files

Update HOME_EXAM.md

parent 868000c6
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,7 @@ The implemented langugage is desciribed usign EBNF grammar below. The language i
#### EBNF
```ebnf
Program
:Programs
:Program*
|Function
|Decl
|Expr
......@@ -95,8 +95,7 @@ Program
```ebnf
Stmt
:Function
|"if" Expr BlockExpr "else"? BlockExpr?
:"if" Expr BlockExpr ("else" BlockExpr)?
|"while" Expr BlockExpr
|Decl
|Expr
......@@ -105,14 +104,14 @@ Stmt
```ebnf
Function
:"fn" Id "(" Args ")" "->" Type BlockExpr
:"fn" Id "(" Arg* ")" "->" Type BlockExpr
|"fn" Id "()" "->" "()" BlockExpr
;
```
```ebnf
BlockExpr
:"{" Stmts "}"
:"{" Stmt* "}"
;
```
......@@ -134,18 +133,11 @@ Arg
Expr
:Expr ExprOp Factor
|Expr LogicOp Factor
|Id "(" Exprs ")"
|PrefixOp "(" Expr ")"
|Id "(" Expr* ")"
|Factor
;
```
```ebnf
Prefix
:"-"
;
```
```ebnf
ExprOp
:"+"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment