<program>   ::= <function> + .

<function>  ::= name "(" ")" <block> .

<block>     ::= "{" <statment> * "}" .

<statment>  ::= <command> ";"
              | "if" "(" <condition> ")" <statment> ( "else" <statment> ) ?
              | "while" "(" <condition> ")" <statment>
              | "loop" <statment>
              | "repeat" "(" number ")" <statment>
              | <block>
              .

<command>   ::= "left"
              | "move"
              | "put"
              | "take"
              | "break"
              | "continue"
              | "return"
              | "stop"
              | name "(" ")"
              |
              .

<condition> ::= "!" * ( "north"
                      | "wall"
                      | "have"
                      | "find"
                      ) .