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