mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-11-27 19:29:46 +03:00
43795ab11a
(An improved version in conjunction with ktcc can generate executable files.) git-svn-id: svn://kolibrios.org@8733 a494cfbc-eb01-0410-851d-a64ba20cac60
62 lines
1.1 KiB
BNF
62 lines
1.1 KiB
BNF
<line> ::=
|
|
<number> <statement> <EOL> | <statement> <EOL>
|
|
|
|
<statement> ::=
|
|
"REM" <printable-characters> |
|
|
"PRINT" <output-list> |
|
|
"IF" <expression> <relational-operator> <expression> "THEN" <statement> |
|
|
"GOTO" <expression> |
|
|
"INPUT" <variable-list> |
|
|
"LET" <variable> "=" <expression> |
|
|
"GOSUB" <expression> |
|
|
"RETURN" |
|
|
"END"
|
|
|
|
<printable-characters> ::=
|
|
<printable-character> | <printable-character> <printable-characters>
|
|
|
|
<printable-character> ::=
|
|
" " .. "~"
|
|
|
|
<output-list> ::=
|
|
<output-term> | <output-term> "," <output-list>
|
|
|
|
<output-term> ::=
|
|
<string> | <expression>
|
|
|
|
<variable-list> ::=
|
|
<variable> | <variable> "," <variable-list>
|
|
|
|
<expression> ::=
|
|
<term> |
|
|
<expression> "+" <expression> |
|
|
<expression> "-" <expression>
|
|
|
|
<term> ::=
|
|
<factor> |
|
|
<term> "*" <term> |
|
|
<term> "/" <term>
|
|
|
|
factor ::=
|
|
"-" <factor> |
|
|
"+" <factor> |
|
|
<variable> |
|
|
<number> |
|
|
"(" <expression> ")"
|
|
|
|
<variable> ::=
|
|
"A" .. "Z"
|
|
|
|
<number> ::=
|
|
<digit> | <digit> <number>
|
|
|
|
<digit> ::=
|
|
"0" .. "9"
|
|
|
|
<relational-operator> ::=
|
|
"<" | "=" | ">" | "<=" | "<>" | ">="
|
|
|
|
<string> ::=
|
|
'"' <printable-characters> '"'
|
|
|