Next: , Previous: A Simple Lisp Like Language, Up: A Simple Lisp Like Language


2.7.4.1 Syntax

silly has no reserved words, but it has equals signs, commas and parentheses built in. A concise but ambiguous grammar for it can be given as follows.

     
     program ::= declaration*
     
     declaration ::= identifier = expression
     

The real grammar is consistent with this one but enforces right associativity for binary operations and higher precedence for juxtaposition without intervening white space.

The declaration of any identifier must be unique and must precede its occurrence in any expression. Hence, cyclic dependences between declarations and “recursive” declarations are not allowed.