From leavens@larch.cs.iastate.edu Sat Apr 16 10:43:21 2005 Date: Sat, 16 Apr 2005 10:43:21 -0500 (CDT) From: Gary T. Leavens To: Com S 342 , Com S 342 TAs -- Brian Patterson , Daniel Patanroi , kuang-yao Lee Subject: Grammar help for homework 10, problem 9 Hi all, If you have difficulty with the SLLGEN parser generator with the grammar that you create for the problem 9 of homework 10, please: - Make sure you are using syntactic keywords, such as "for" to both start and separate the various parts of your statement syntax. You might also have to add a syntactic keyword, like "end". - That doesn't work, please write us an e-mail and we will help you get around the difficulty. It's not an important part of the course for you to know how to work with parser generators like SLLGEN, so feel free to let us know as soon as you have problems that you can't resolve by taking the step above. Don't wait till the last minute to start on this. Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 ---------------- From leavens@larch.cs.iastate.edu Sun Apr 17 17:50:44 2005 Date: Sun, 17 Apr 2005 17:50:44 -0500 (CDT) From: Gary T. Leavens To: Kendra Schmid Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: Re: 342 HW10, Q8 Hi Kendra, On Sun, 17 Apr 2005, Kendra Schmid wrote: > Question 8 has the phrase "should not be able to change the values of any > variable locations that exist before the execution of E. " > > Does this mean that if an expression tries to change values that the program > should stop, or should the program continue to run and simply create a shadow of > the variable for the scope of the expression? What I mean is that doing so should simply be impossible for a program. It won't be an error, because the programmer won't be able to write it an expression with such a side effect. Note that this is about a grammar change... Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 --------------------- From leavens@larch.cs.iastate.edu Mon Apr 18 23:05:36 2005 Date: Mon, 18 Apr 2005 23:05:36 -0500 (CDT) From: Gary T. Leavens To: Matthew J. Ring Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: RE: Strange error on for-loop Hi Matt, On Mon, 18 Apr 2005, Matthew J. Ring wrote: > Now, it parses, Good. (Getting the test data right is half of testing, isn't it?) > but it doesn't execute my update expression correctly. > Instead, it remembers the initial value and loops forever. ... > So, my initial question: Should I be remembering a new environment or should > my existing environment remember the changes to the update? That depends on what you want the for-loop to do. Is the loop supposed to create a new locations that is updated, or does the location have to already exist and is just initialized and updated in the loop? You have to decide, and the answer should answer that question you have. Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 -------------------- From leavens@larch.cs.iastate.edu Mon Apr 18 23:07:46 2005 Date: Mon, 18 Apr 2005 23:07:46 -0500 (CDT) From: Gary T. Leavens To: Brice Lambi Cc: Com S 342 TAs -- Brian Patterson , Daniel Patanroi Subject: Re: Problem 4 Hi Brice, On Mon, 18 Apr 2005, Brice Lambi wrote: > Hello, > I'm having trouble with problem 4 on hw 10. To use procedural > representation we need to make a closure in the conz case of apply-primitive. > My question is how do we create the closure? I don't understand how to > create the body expression for the closure. In the book they do a proc(m) if > m then x else y, but how are we going to make an expression that depends on > values we don't have yet? You could make an abstract syntax tree for that code. Think about what the interpreter does when it parses and evaluates proc(m) if m then x else y Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 --------------------