1 / 4

Guided Notes Ch. 4 Syntax

Guided Notes Ch. 4 Syntax. Syntax Description methods Parsing Methods Parser generators. Syntax Description Methods. BNF = CFG EBNF = extended BNF: { }, [ ] Syntax Diagrams Related concepts: (for unambiguous grammar, predictive parser) precedence cascade left-recursive (left-associate)

heller
Download Presentation

Guided Notes Ch. 4 Syntax

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. Guided Notes Ch. 4Syntax Syntax Description methods Parsing Methods Parser generators

  2. Syntax Description Methods • BNF = CFG • EBNF = extended BNF: { }, [ ] • Syntax Diagrams • Related concepts: (for unambiguous grammar, predictive parser) • precedence cascade • left-recursive (left-associate) • first set, follow set

  3. Parsing Methods • Top-down: nonterminals are expanded • Bottom-up: right-hand side is reduced to the nonterminal on the left • Recursive-decent: turning the nonterminals into a group of mutually recursive procedures whose actions are based on the right-hand sides of the BNFs

  4. Review questions • What are the 3 syntax description methods? Explain the main motivations for each method. • What are the 3 parsing techniques we discussed ? Describe the characteristics of each. • Give formal definitions of First set and Follow set. • What are the 2 requirements for a predictive parser to be able to distinguish between choices in grammar rule? • Define an unambiguous grammar for expression with multi-level operators (Sebesta #7 Ch12). • What is a parser generator? Give an example.

More Related