Compiler Theory and Design: Week 3 Lecture Videos

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is a trait of well-defined Context Free Grammar?

At least one right-side option is non-recursive.

What are the traits of a NON-LL1 grammar? (5 of them)

1. left-recursive or ambiguous 2. no one token look ahead 3. parse tables have multiple entries 4. FIRST sets are not mutually disjoint 5. Some languages have no LL1 grammar that defines them

What is an LL1 grammar?

A context-free-grammar that can be parsed by an LL parser, which parses input from left-to-right, and constructs a leftmost derivation of the sentence.

What is a derivation?

A derivation is a proof that a "sentence" is in the language generated by the grammar. (Basically manually trace through a grammar rule set to verify whether an expression of your making does in fact follow the rules)

What is important to remember when conducting top-down parsing?

That the production NOT be left-recursive.

What is "mutually" disjoint, and how does it relate to LL1 grammar?

The above is an example of NOT mutually disjoint sentence. The first and third right-side begins with the same terminal (but they could each start with a different terminal and it would still be true) meaning they are not mutually disjoint, and thus it is not an LL1 grammar.

What are the two main properties that define a Context Free Grammar?

The language is defined by statements that have: 1. A left side that contains a single non-terminal 2. A right side that contains a sequence of one or more non-terminals and/or terminals (tokens)


Ensembles d'études connexes

IGGY - Ch. 56: IBS and Colorectal Cancer

View Set

Urban Hierarchy, Metropolitan Statistical Area, Micropolitan Statistical Area; Megalopolis; Function of Cities, Special Function Cities

View Set

9. As the worlds population increases

View Set

Multiple Regression & Correlation & Simple linear Regression

View Set