Compiler Construction
Fall 1998
Assignment II

Due : September 29.

1. Using the Ada grammar as specified in sinfo.ads, write the parse tree for
the following:

     procedure incr (x : in out vec) is
     begin
         for J in x'range loop
            x (J) := x (J) + 1;
         end loop;
     end;

2. From text: problems 4.1 (p. 267) and 4.11 (part a only).

3. Write the grammar for logical expressions in C++ or Java (it's ok to look
it up). Include the conditional operator ("?"). Write the parse tree for
some expression with four or more operators.