20100923

20100923 - = CS 441 Fall 2010 - JWJ Pre-class notes - do...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
============================ CS 441 Fall 2010 -- JWJ Pre-class notes - do not distribute Thursday, September 23, 2010 ============================ Scope: FIRST and FOLLOW Sets (Part 2 -- FOLLOW sets) Outline: FIRST and FOLLOW sets -- solving symbolic equations Two grammars for arithmetical expressions ----------- left-recursive after removing left recursion E --> E + T | T E --> T E' E' --> + T E' | epsilon T --> T * F | F T --> F T' T' --> * F T' | epsilon F --> (E) | id | num F --> (E) | id | num FIRST sets: FIRST sets include terminals (tokens) or epsilon for nullable nonterminals. The tokens in the FIRST(X), where X is a nonterminal, are the only valid starting terminals for strings derived from X. For the above grammar for expressions, a valid expression may begin with '(', 'id" or 'num' and these three tokens are members of FIRST(E). For nullable nonterminals, epsilon is a member of their FIRST sets. FIRST sets can be computed based on the productions of the grammar,
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 12/14/2010.

Page1 / 2

20100923 - = CS 441 Fall 2010 - JWJ Pre-class notes - do...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online