(* l02 - constant expressions with declarations (taking expressions) *) program = statement { ';' statement } '.' . statement = [ id '=' expression | '!' expression ] . expression = [ '+' | '-' ] term { ( '+' | '-' ) term } . term = factor { ( '*' | '/' ) factor } . factor = number | id | '(' expression ')' . (* terminals: number id ! = ( * / + - ) ; . In l01, declarations took a (non-negative) number, which is now changed to expression. While the expression evaluation in l01 was done at runtime only (i.e. expressions were treated as variable), l02 additionally requires compile time evaluation (for expressions within declarations). For not doubling the expression code within the parser, my first idea was to reuse the generator/interpreter code (Comp with switch). But this would make the interpreter a basic part of the compiler -- possibly not a good idea... After coding I find that this extension of l01 is not balanced. So l03 will be based on l01 again. *)