You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
610 B
24 lines
610 B
ast = term
|
|
| "\", {ident, [":", tagged type], ","}, ident, [":", tagged type], ".", ast
|
|
| "let", {ident, [":", tagged type], ":=", ast, ","}, ident, [":", tagged type], ":=", ast, [","], "in", ast ;
|
|
|
|
term = ident
|
|
| constant
|
|
| "(", ast, ")"
|
|
| term, term ;
|
|
|
|
constant = nat | float | bool ;
|
|
|
|
tagged type = type tag, ident
|
|
| type tag, ident, "=>", tagged type
|
|
| type ;
|
|
|
|
type tag = "Num" | "Any" ;
|
|
|
|
type = basic type | arrow type ;
|
|
|
|
basic type = "Nat" | "Float" | "Bool" | ident ;
|
|
|
|
arrow type = "(", type, ")", "->", type
|
|
| basic type, "->", type ;
|