CSCI 5220
Homework Set 1

Due: Feb 18, at the beginning of class.

  1. Exercise 4.35.

  2. Exercise 4.50. For the expressions, use the following grammar. Use precedence rules to resolve conflicts so that * has higher precedence than +, and both + and * are left-associative. Note that all tokens for this grammar are single characters, so you can make yylex() just return the next input character. Digit indicates a single decimal digit.

         E -> E + E
         E -> E * E
         E -> ( E )
         E -> digit