Written work 4
Due on February 22nd @ 3:00 PM (in class, to Drew, or at Engineering front office)
Not accepted late
Question 1

Draw the SLR parser table corresponding to the following grammar

	X ::= a X b
	X ::= X c Y
	Y ::= d
	Y ::= k X
	

Question 2

Is the above grammar parseable by an SLR parser? What evidence do you have of that?

Question 3

Draw the AST for the following Jeff program, using the recommended AST node types suggested in the P3 inheritance diagram.

int a;
int func(bool b){
	if (b){
		return 1;
	}
	return 3;
}
int main(){
	a = 7;
	return a * func(false);
}
Question 4

List the FIRST and FOLLOW sets for the following grammar (do not transform the grammar):

	L ::= v m L
	L ::= ε
	L ::= C
	L ::= D
	C ::= ε
	C ::= C k
	D ::= C
	C ::= m L