Review for the Midterm. Overview (Chapter 1): What are the phases in a compiler?

3
• Review for the Midterm. – Overview (Chapter 1): • What are the phases in a compiler? • What do we do in each phase?

description

Review for the Midterm. Overview (Chapter 1): What are the phases in a compiler? What do we do in each phase?. Review for the Midterm. Lexical analyzer (chapter 3): Regular expression definition Use regular expression to express an pattern How to recognize regular expression? NFA DFA - PowerPoint PPT Presentation

Transcript of Review for the Midterm. Overview (Chapter 1): What are the phases in a compiler?

Page 1: Review for the Midterm. Overview (Chapter 1): What are the phases in a compiler?

• Review for the Midterm.– Overview (Chapter 1):

• What are the phases in a compiler?

• What do we do in each phase?

Page 2: Review for the Midterm. Overview (Chapter 1): What are the phases in a compiler?

• Review for the Midterm.– Lexical analyzer (chapter 3):

• Regular expression definition

• Use regular expression to express an pattern

• How to recognize regular expression?– NFA

– DFA

– minimize the DFA

Page 3: Review for the Midterm. Overview (Chapter 1): What are the phases in a compiler?

• Review for the Midterm.– Syntax analysis (chapter 4)

• context free grammar– use it to specify a language

• top-down parsing– LL(1) (What is an LL(1) grammar?)

– How an LL(1) parser works?

– How to construct an LL(1) parsing table for a grammar.

» (First, Follow)

• Bottom parsing– SLR, LR(1), LALR

– How an LR(1) parser works

– How to construct an SLR/LR(1)/LALR(1) parsing table?

– What are the major differences among these parsers?