|
|
|
@ -1,13 +1,12 @@
|
|
|
|
|
#lang brag
|
|
|
|
|
b-program : [b-line] (/NEWLINE [b-line])* | b-statement /NEWLINE
|
|
|
|
|
b-line : b-line-num b-statements [b-rem]
|
|
|
|
|
b-line : b-line-num [b-statement] (/":" [b-statement])* [b-rem]
|
|
|
|
|
@b-line-num : INTEGER
|
|
|
|
|
b-rem : REM
|
|
|
|
|
@b-statements : [b-statement] (/":" [b-statement])*
|
|
|
|
|
@b-statement : b-end | b-print | b-goto
|
|
|
|
|
| b-let | b-input | b-if
|
|
|
|
|
| b-gosub | b-return | b-for | b-next
|
|
|
|
|
| b-def | b-require | b-expr
|
|
|
|
|
| b-def | b-require
|
|
|
|
|
b-end : /"end"
|
|
|
|
|
b-print : /"print" [b-printable] (/";" [b-printable])*
|
|
|
|
|
@b-printable : STRING | b-expr
|
|
|
|
@ -37,4 +36,5 @@ b-expt : [b-expt ("^")] b-value
|
|
|
|
|
@b-value : b-number | b-id | /"(" b-expr /")" | b-func
|
|
|
|
|
b-func : ID /"(" b-input-list /")"
|
|
|
|
|
@b-input-list : (ID | b-expr) [/"," (ID | b-expr)]*
|
|
|
|
|
@b-number : INTEGER | DECIMAL
|
|
|
|
|
@b-number : INTEGER | DECIMAL
|
|
|
|
|
b-repl : (b-statement | b-expr) (/":" [b-repl])*
|