Lecture 10 Notes

Regular expressions scanner spec grammar semantic

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of the specification in an appropriate specification language. regular expressions Scanner Spec grammar semantic rules Parser Spec Semantic Spec Parser Interpreter tokens Scanner program text syntax tree Front End answer Sometimes you can automatically generate the component from the specification (scanners, parsers), sometimes it’s impossible; occasionally it’s possible but better to do it by hand. But usually it’s better to use a tool. There are standard tools for generating scanners and parsers; we will use our own tool, called SLLGEN, for that. We will, however, write our interpreters by hand, in Scheme. It’s always important to distinguish between a language we are studying or implementing, sometimes called the object language, and the language we use to implement it, called the implementation language. We will have many small object languages, but our implementation language will always be Scheme. 3 1.2 The Four Questions When looking at a language, we will always ask four questions. As we proceed through the course, we will ask these questions in more and more sophisticated ways; I’ll show some of these subquestions now, even...
View Full Document

Ask a homework question - tutors are online