CSCI 310 Spring 2005, Day 3

  1. Project 1 questions.

  2. Lexical Analysis
    1. What it is: breaking the program into a stream of tokens -- similar to what happens when we hear or read language, where we actually notice the distinct words.
    2. This allows the parser to deal with the grammar without worrying about things like whitespace, comments and any other unnecessary stuff.
    3. What are tokens? Make a list...
    4. Reminders: what is a
      1. Finite automaton
      2. Regular expression.

    5. Task: Give regular expressions or FAs for
      1. identifiers
      2. integers
      3. floats
      4. if
      5. else
      6. while
    6. How do regular expressions relate to finite automatons?
    7. How do the FAs get implemented?
    8. How can we combine them to make a single scanner?
    9. is "ifta" two tokens or one?
    10. Can we teach an FA to decide which one? Do we need to add info (and what info)?
    11. What if there are two longest matches?
    12. Summary task: give an outline of how we would automatically implement a lexer.

Gary Lewandowski
Last modified: Fri Jan 14 12:20:08 EST 2005