6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 15.1.3 But eventually, we need a process for unwinding all of those Why do we need an interpreter? abstractions, to get the value that corresponds to an expression's. Abstractions let us bury details and focus on use of meaning. That means we need to implement semantics of modules to sole large systems Interpreting expressions Need to unwind abstractions at execution time to deduce Why do we need an interpreter? Slide 15.1. 4 Abstractions let us bury details and focus on use of Notice the words I used. I said, "we need a process for modules to sole large systems unwinding those abstractions".If we can have such a process, Need to unwind abstractions at execution time to deduce hen we should be able to describe it in a procedure: that is our meaning language for describing processes Have seen such a process- Environment Model In fact, you have already seen a version of this description, just not as a procedure. what was the description?.the ow want to describe that process as a procedure environment model! If you think about it that makes sense. The environment model just described the process for how to determine a meaning I associated with an expression, which in turn just unwrapped the abstractions down to the primitive operations. Today, we want to talk about how to actually build an evaluator as a procedure rather than as that abstract environment model Slide 15.1 Stages of an interpreter First, what are the stages of an interpreter? For the kind of Lexical analy? languages we are considering, Scheme or Lisp like languages, typically there are five stages. There is a lexical analyzer, a Parse parser, an evaluator that typically works hand-in-hand with an environment, and there is a printer Evaluator Let's look at what goes on in each of these at a high level, before we build them evironment6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 15.1.3 But eventually, we need a process for unwinding all of those abstractions, to get the value that corresponds to an expression’s meaning. That means we need to implement semantics of interpreting expressions. Slide 15.1.4 Notice the words I used. I said, "we need a process for unwinding those abstractions". If we can have such a process, then we should be able to describe it in a procedure: that is our language for describing processes. In fact, you have already seen a version of this description, just not as a procedure. What was the description? ... the environment model! If you think about it, that makes sense. The environment model just described the process for how to determine a meaning associated with an expression, which in turn just unwrapped the abstractions down to the primitive operations. Today, we want to talk about how to actually build an evaluator as a procedure rather than as that abstract environment model. Slide 15.1.5 First, what are the stages of an interpreter? For the kind of languages we are considering, Scheme or Lisp like languages, typically there are five stages. There is a lexical analyzer, a parser, an evaluator that typically works hand-in-hand with an environment, and there is a printer. Let's look at what goes on in each of these at a high level, before we build them