&egrave;&macr;&shy;&aelig;&sup3;•&aring;ˆ†&aelig;žreview

# è¯­æ³•åˆ†æžreview

This preview shows pages 1–9. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
LL 1 语语语 The first “L” means we scan the input from left to right; the second “L” means we create a leftmost derivation; and the 1 means one input symbol of lookahead. A grammar G is LL(1) iff whenever A –> u | v are two distinct productions of G, the following conditions hold: - for no terminal a do both u and v derive strings beginning with a (i.e. first sets are disjoint) - at most one of u and v can derive the empty string - if v =>* ε then u does not derive any string beginning with a terminal in Follow(A)
The first set of a sequence of symbols u , written as First(u ) is the set of terminals which start all the sequences of symbols derivable from u . A bit more formally, consider all strings derivable from u by a leftmost derivation. If u =>* v , where v begins with some terminal, that terminal is in First(u). If u =>* ε , then ε is in First(u ). First

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Follow The follow set of a nonterminal A is the set of terminal symbols that can appear immediately to the right of A in a valid sentential form. A bit more formally, for every valid sentential form S =>* uAv , where v begins with some terminal, that terminal is in Follow(A).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/23/2011 for the course CS Compile taught by Professor Weizhong during the Spring '05 term at Fudan University.

### Page1 / 42

è¯­æ³•åˆ†æžreview

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online