Tiny BASIC - Tiny BASIC Grammar

Tiny BASIC Grammar

The grammar is listed below in Backus-Naur form. In the listing, an asterisk ("*") denotes zero or more of the object to its left — except for the first asterisk in the definition of "term", which is the multiplication operator; parentheses group objects; and an epsilon ("ε") signifies the empty set. As is common in computer language grammar notation, the vertical bar ("|") distinguishes alternatives, as does their being listed on separate lines. The symbol "CR" denotes a carriage return (usually generated by a keyboard's "Enter" key).


line ::= number statement CR | statement CR statement ::= PRINT expr-list IF expression relop expression THEN statement GOTO expression INPUT var-list LET var = expression GOSUB expression RETURN CLEAR LIST RUN END expr-list ::= (string|expression) (, (string|expression) )* var-list ::= var (, var)* expression ::= (+|-|ε) term ((+|-) term)* term ::= factor ((*|/) factor)* factor ::= var | number | (expression) var ::= A | B | C .... | Y | Z number ::= digit digit* digit ::= 0 | 1 | 2 | 3 | ... | 8 | 9 relop ::= < (>|=|ε) | > (<|=|ε) | = A BREAK from the console will interrupt execution of the program

Source: Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Volume 1, Number 1, 1976, p.9.

Read more about this topic:  Tiny BASIC

Famous quotes containing the words tiny, basic and/or grammar:

    My children cause me the most exquisite suffering of which I have any experience. It is the suffering of ambivalence: the murderous alternation between bitter resentment and raw-edged nerves, and blissful gratification and tenderness. Sometimes I seem to myself, in my feelings toward these tiny guiltless beings, a monster of selfishness and intolerance.
    Adrienne Rich (b. 1929)

    The man who is admired for the ingenuity of his larceny is almost always rediscovering some earlier form of fraud. The basic forms are all known, have all been practicised. The manners of capitalism improve. The morals may not.
    John Kenneth Galbraith (b. 1908)

    Like everything metaphysical the harmony between thought and reality is to be found in the grammar of the language.
    Ludwig Wittgenstein (1889–1951)