1 / 6

Homework #4: LL(1) and LR Parsing Table Construction - Due Dec 6, 2011

This homework assignment focuses on constructing parsing tables for specified grammars. In Chapter 5, part 5.2, you are required to create the LL(1) parse table for the grammar defined by the productions: Expr → -Expr | (Expr) | Var ExprTail, where ExprTail and Var are defined similarly. Subsequently, in Chapter 6, you'll build a CFSM for a provided grammar and demonstrate the LR parse table derived from it. Additionally, complete the SLR(1) construction for a grammar shown in Fig. 6.26, and submit a handwritten version in class by December 6, 2011.

beata
Télécharger la présentation

Homework #4: LL(1) and LR Parsing Table Construction - Due Dec 6, 2011

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Homework #4 J. H. Wang Nov. 15, 2011

  2. Homework #4 • Chap. 5 • 5.2 • Chap. 6 • 6.1 • 6.2 • 6.23

  3. 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 ) | λ

  4. 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

  5. 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.

  6. Submission • Hand-written exercises: hand in your paper version in class • Due: two weeks (Dec. 6, 2011)

More Related