70 likes | 199 Views
Homework #4. J. H. Wang Nov. 15, 2011. Homework #4. Chap. 5 5.2 Chap. 6 6.1 6.2 6.23. Chap. 5
E N D
Homework #4 J. H. Wang Nov. 15, 2011
Homework #4 • Chap. 5 • 5.2 • Chap. 6 • 6.1 • 6.2 • 6.23
Chap. 5 • 5.2: Construct the LL(1) parse table for the following grammar: Expr - Expr | ( Expr ) | Var ExprTail ExprTail - Expr | λ Var id VarTail VarTail ( Expr ) | λ
Chap. 6 • 6.1: Build the CFSM for the following grammar: Prog Block $ Block begin StmtList end StmtList StmtList semi Stmt | Stmt Stmt Block | Var assign Expr Var id | id lb Expr rb Expr Expr plus T | T T Var | lp Expr rp
6.2: Show the LR parse table for the CFSM constructed in 6.1. • 6.23: Complete the SLR(1) construction for the grammar shown in Fig. 6.26. Show the resulting parse table.
Submission • Hand-written exercises: hand in your paper version in class • Due: two weeks (Dec. 6, 2011)