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.
11 lines
284 B
Racket
11 lines
284 B
Racket
#lang brag
|
|
|
|
top : (fun | app)*
|
|
fun : /"fun" var /"(" argvars /")" /"=" expr
|
|
/argvars : [var (/"," var)*]
|
|
@expr : s-or-d
|
|
s-or-d : [s-or-d ("+" | "-")] p-or-q
|
|
p-or-q : [p-or-q ("*" | "/")] value
|
|
@value : var | INT | app | /"(" expr /")"
|
|
app : var /"(" [expr (/"," expr)*] /")"
|
|
@var : ID |