CSCI 310 Spring 2005, Day 3
- Project 1 questions.
- Lexical Analysis
- 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.
- This allows the parser to deal with the grammar without
worrying about things like whitespace, comments and any
other unnecessary stuff.
- What are tokens? Make a list...
- Reminders: what is a
- Finite automaton
- Regular expression.
- Task: Give regular expressions or FAs for
- identifiers
- integers
- floats
- if
- else
- while
- How do regular expressions relate to finite automatons?
- How do the FAs get implemented?
- How can we combine them to make a single scanner?
- is "ifta" two tokens or one?
- Can we teach an FA to decide which one? Do we need to
add info (and what info)?
- What if there are two longest matches?
- 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