CIT 594 Errata #2 for Bugs Grammar (and Code)
Spring 2008, David Matuszek |
I never defined <direction>. It should just be <expression>.
| Was: |
<turn action> ::= "turn" <direction> <eol>
<turnto action> ::= "turnto" <direction> <eol> |
| Now: |
<turn action> ::= "turn" <expression> <eol>
<turnto action> ::= "turnto" <expression> <eol> |
Line breaks are significant in this language, and I left one out of the definition of <switch statement>.
In addition, I've defined commands to include both statements and actions, and I did not mean to exclude the latter.
| Was: |
<switch statement> ::= "switch" "{" <eol>
{ "case" <expression>
{ <statement> } }
"}" <eol> |
| Now: |
<switch statement> ::= "switch" "{" <eol>
{ "case" <expression> <eol>
{ <command> } }
"}" <eol> |
I left the keywords var and initially out of the list of keywords in Token.java. Please add them in. In a related matter, I forgot to provide a definition for <initialization block>.
| Now: |
<initialization block> ::= "initially" <block> |
I left off the <eol> at the end of <bug definition>.
| Was: |
<bug definition> ::= "Bug" <name> "{" <eol>
{ <var declaration> }
[ <initialization block> ]
<command>
{ <command> }
{ <function definition> }
"}" |
| Now: |
<bug definition> ::= "Bug" <name> "{" <eol>
{ <var declaration> }
[ <initialization block> ]
<command>
{ <command> }
{ <function definition> }
"}" <eol> |
I have finished writing and debugging the Recognizer for the Bugs language, correcting the grammar as I go, so there should not be many additional changes for a while. When we begin work on the next parts (the Parser and the Interpreter), a couple more corrections will probably be needed.