Path: utzoo!attcan!uunet!mcsun!hp4nl!eurtrx!euraiv1!reino From: reino@cs.eur.nl (Reino de Boer) Newsgroups: comp.software-eng Subject: Re: Theory vs. Practice in CS Education Message-ID: <1989Nov21.141820.5263@cs.eur.nl> Date: 21 Nov 89 14:18:20 GMT References: <4967@ae.sei.cmu.edu> <1989Nov17.090716.11068@cs.eur.nl> <4994@ae.sei.cmu.edu> Organization: Erasmus Universiteit Rotterdam, dept. CS (Informatica) Lines: 40 rsd@sei.cmu.edu (Richard S D'Ippolito) writes: >In article <1989Nov17.090716.11068@cs.eur.nl> Reino de Boer writes: >-Although a compiler course is relevant to software engineers, if only to >-understand more about designing languages and their implementation. >-Didn't someone once say: >- each program is in fact an interpreter for a language (where the >- language defines all legal input to the program, and the semantics >- of the various inputs) >-If noone ever said it, how about your comments ? >I'm sorry -- If this is directed to me, I am unable to answer you as I do >not understand the point you are trying to make. The point I'm trying to make is maybe best given in a simple example: Suppose we need a program to take the sum of 5 numbers, where these 5 numbers are the only input to the program. Futhermore, let's assume we want each input number to be positive and less than 1000. Each number will be entered on a line by itself. The program we will write can be viewed as an interpreter for a language with the following syntax: ::= ::= [ [ ] ] | 0 ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ::= the representation of the terminating newline. The (informal) semantics can then be described as follows: The output of the interpreter consists of the sum of the numbers resulting from conversion of the numerals. Hope this explains -- reino -- Reino R. A. de Boer Erasmus University Rotterdam ( Informatica ) e-mail: reino@cs.eur.nl