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/basic-demo/parser.rkt

15 lines
365 B
Racket

#lang brag
b-program : b-line*
b-line : @b-line-number b-statement (/":" b-statement)*
b-line-number : INTEGER
@b-statement : b-rem
| b-print
| b-goto
| b-end
b-rem : REM
b-print : /"print" (STRING | b-expr)*
b-goto : /"goto" b-expr
b-expr : b-sum
b-sum : (b-number /"+")* b-number
@b-number : INTEGER | DECIMAL
b-end : /"end"