CSCI 5220
Program Translation
Spring 2009
Exercise Set 1
- Exercise 3.3.2(a), page 125. (Answer)
- Exercise 3.3.4, page 125. (Answer)
- Exercise 3.3.5(a), page 125. (I think it means that the string must
have each of a,e,i,o,u exactly once, in that order.)
(Answer)
- Give a regular expression that describes the set of
all strings of length 1 or more that start with a letter
and that contain only letters and digits.
(Answer)
- What is the difference between a token and a lexeme? (Answer)
- Why do some tokens require attributes? (Answer)
- Why don't all tokens require attributes? (Answer)
- Exercise 3.5.1(a-d), page 146. (Answer)
- Exercise 3.5.2, page 146. Make the string be an attribute of the token, and
assume that it should be put into yylval.str.
(Answer)