Skip to content

Commit

Permalink
syntax bnf
Browse files Browse the repository at this point in the history
  • Loading branch information
zazed committed Oct 23, 2023
1 parent 122e59c commit bb521e7
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,35 @@ A type inferred, statically-typed functional programming language inspired by OC

## Documentation

- TODO
### Syntax
```bnf
<ident> ::= words
<expr> ::= <const>
| <expr> <bop> <expr>
| "let" <ident> (<ident>*)? "=" <expr>
| "let" <ident> "=" <expr> "in" <expr>
| "if" <expr> "then" <expr> "else" <expr>
| "fun" <ident>+ "->" <expr>
| <const> (<const>)+
<bop> ::= "+" | "++" | "-" | "*" | "/" | "%" | "@" | "::" | "==" | "!=" | "<" | "<=" | ">" | ">="
<const> ::= <simple_expr>
| <ident>
| "[" <expr_list>? "]"
| int ".." int
| "(" <expr> ")"
<expr_list> ::= <expr> (";" <expr_list>)?
<simple_expr> ::= int
| char
| str
| unit
| true
| false
```

## Running

Expand Down

0 comments on commit bb521e7

Please sign in to comment.