Wed, Apr 13, 2005
For Windows people
While the code is a little complicated by the need to keep track of declared variables and indentation, really all it does is use the grammar the way Chomsky intended, in "reverse", to generate new programs.
Note too that while the programs are syntactically correct and obey the rules that I set down in the assignment for the use of identifiers, they're completely meaningless.
should beWHILE i < 9 OR i = 9 DO
You're only allowed to leave off the parentheses if there's a single expression (as in the fibonacci program). What can I can say? Writing programs without a parser to check them isn't easy.WHILE (i < 9) OR (i = 9) DO