You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
328 B
Racket
12 lines
328 B
Racket
#lang brag
|
|
|
|
top : (fun | app)*
|
|
fun : /"fun" var /"(" argvars /")" /"=" expr
|
|
/argvars : [var (/"," var)*]
|
|
@expr : add-or-sub
|
|
add-or-sub : [add-or-sub ("+" | "-")] mult-or-div
|
|
mult-or-div : [mult-or-div ("*" | "/")] value
|
|
@value : var | int | app | /"(" expr /")"
|
|
int : ["-"] INT
|
|
app : var /"(" [expr (/"," expr)*] /")"
|
|
@var : ID |