Computer Science & Electrical Engineering

Compiler Construction – SMD163



Homework assignment 2

1. Manually identify the tokens (and associated attributes) in the following Java program:

int max(int i1, int i2) {  // Compute some sick kind of max.
     if ((i1 < i2) && (i1 < 20)) 
        return i1;
     i2 += i1;
     return i1;
}  

2. Give regular expressions to describe the following:

3. What languages do the regular expressions a?*a**a+* represent? 


Report via email to .  Subject line: SMD163 - 2.  Deadline is Jan 30, 14.45.




Homework assignments are carried out individually.

Oral discussion is good, copying files is not
!