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-2a/parser.rkt

13 lines
394 B
Racket

8 years ago
#lang brag
b-program : [b-line] (/NEWLINE [b-line])*
8 years ago
b-line : b-line-num [b-statement] (/":" [b-statement])* [b-rem]
8 years ago
@b-line-num : INTEGER
8 years ago
@b-statement : b-end | b-print | b-goto
8 years ago
b-rem : REM
b-end : /"end"
b-print : /"print" [b-printable] (/";" [b-printable])*
@b-printable : STRING | b-expr
b-goto : /"goto" b-expr
b-expr : b-sum
b-sum : b-number (/"+" b-number)*
@b-number : INTEGER | DECIMAL