Programming Language Principles Homework 6 1. Build the functional graph for the binary number 101.101, according to the attribute grammar for binary numbers developed in class. Be sure to show the value propagation through the tree clearly. 2. Build the AST for the following Tiny program: program sum: assign s:=0; assign i:=1; while not (i=10) do assign s:=s+read; assign i:=i+1; od output s end sum Place next to each tree node the necessary attributes. To simplify things, limit this to the 'code', 'next', and 'top' attributes, as illustrated in the example shown at the end of Lecture 3. Keep inherited attributes on each tree node's left, and synthesized attributes on the right. Write down the actual values of the attributes, i.e. show the result of propagating the values through the functional graph. DO NOT depict the functional graph itself. As suggested in class, depict the code file "on the side", i.e. don't make a copy of the code file at each tree node. Instead, at each tree node, indicate the line number of the machine instruction (if any) that is being added to the code file. 3. Modify the attribute grammar for Tiny, so that "read" is no longer an intrinsic function, but instead a statement. Instead of assign i := read; we would have read(i); The read statement would handle exactly ONE indentifier.