|
|
@ -1,13 +1,12 @@
|
|
|
|
#lang brag
|
|
|
|
#lang brag
|
|
|
|
b-program : [b-line] (/NEWLINE [b-line])* | b-statement /NEWLINE
|
|
|
|
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-line-num : INTEGER
|
|
|
|
b-rem : REM
|
|
|
|
b-rem : REM
|
|
|
|
@b-statements : [b-statement] (/":" [b-statement])*
|
|
|
|
|
|
|
|
@b-statement : b-end | b-print | b-goto
|
|
|
|
@b-statement : b-end | b-print | b-goto
|
|
|
|
| b-let | b-input | b-if
|
|
|
|
| b-let | b-input | b-if
|
|
|
|
| b-gosub | b-return | b-for | b-next
|
|
|
|
| b-gosub | b-return | b-for | b-next
|
|
|
|
| b-def | b-require | b-expr
|
|
|
|
| b-def | b-require
|
|
|
|
b-end : /"end"
|
|
|
|
b-end : /"end"
|
|
|
|
b-print : /"print" [b-printable] (/";" [b-printable])*
|
|
|
|
b-print : /"print" [b-printable] (/";" [b-printable])*
|
|
|
|
@b-printable : STRING | b-expr
|
|
|
|
@b-printable : STRING | b-expr
|
|
|
@ -38,3 +37,4 @@ b-expt : [b-expt ("^")] b-value
|
|
|
|
b-func : ID /"(" b-input-list /")"
|
|
|
|
b-func : ID /"(" b-input-list /")"
|
|
|
|
@b-input-list : (ID | b-expr) [/"," (ID | b-expr)]*
|
|
|
|
@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])*
|