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.
beautiful-racket/beautiful-racket-demo/algebra-demo/grammar.rkt

10 lines
222 B
Racket

#lang brag
top : (func-def | func-app)*
func-def : /"fun" var /"(" vars /")" /"=" expr
/vars : var [/"," var]
expr : var "+" var | value
@value : var | INT | func-app
func-app : var /"(" value [/"," value] /")"
@var : ID