spinoza1111said:
I do, yes.
I don't dispute this.
I do, however, dispute this.
As has been pointed out, it is certainly possible to blur the
distinction between compilers and interpreters, and it appears that
this is what you are trying to do. The Dragon Book puts it like this:
"Simply stated, a compiler is a program that reads a program written
in one language - the source language - and translates it into an
equivalent program in another language - the target language."
"The target language" is not identified, on p 4 of the Dragon Book
Second Edition, as object code. In fact, later on we read that "a Java
source program may be ** compiled ** [emphasis mine] into an
intermediate form called bytecodes".
The root form of compiler and interpreter is a verb and not a noun.
The Dragon Book describes as an "interpreter" a program which takes
source code and input and executes the source code. For clarity of
exposition, they are describing a rather rare artifact: a program
which executes source code directly, or a one for one encoding of
source directly.
But for clarity, they omit the fact, that they know, that inside what
appears to be and for all intents is an "interpreter" is a compiler of
some sort, that is, a parser which translates the raw source into
encoded form...unless the SOURCE language is Forth-like and does not
need to be parsed!
Even if as in the case of a source language using Reverse Polish
notation there is no parsing, the language still has to be lexically
analyzed, and lexical analysis is what compilers do. A "pure"
interpreter is a limit or ideal case where the interpreter does not
and need not do either lexical or syntax analusis.
For example, I wrote a "pure" interpreter in 1979 for the Mouse
programming language (in 1K of storage) to run on Texas Instruments
TI-79 programmable calculators. This wasn't a compiler since
individual "statements" of Mouse are single characters represented as
floating point numbers on the TI 79, and the language was Reverse
Polish.
Whereas to COMPILE IBM 1401 Fortran-II into something that could be
executed, in 8K, the IBM compiler contained 99 passes to COMPILE
things.
Most "interpreters" are also "compilers" insofar as they have a
parsing front end.
Even if you wrote a program to directly execute a subset of C, your
program would still on the fly be a compiler according to the dragon
book, since either in a single pass, or as a coroutine with the
interpreter, your program will have to parse C. Since compilation is a
verb, a hypothetical compiler that uses recursive descent to transform
C statements into p-code, and passes this material to an interpretive
coroutine, is doing compilation while being an almost pure
interpreter: it is in fact a prejudice that a compiler needs to
transform all source code into a parse tree, and then walk the tree to
generate either object code or p-code.
The narrower meaning of "interpreter" refers only to a program which
accepts an encoding and simulates a computer, but Aho et al. don't
present that meaning.
In other words, just like Schildt, they are producing a text with
hermeneutics.
However, you are still trying to destroy Schildt, so you'll say
anything to advance this cause. I hope he drags you into a British
court and takes your house.
Later, we find: "Instead of producing a target program as a
translation, an interpreter performs the operations implied by the
source program."
No, I've just queried the claim that he wrote a compiler. So far, no
evidence to support such a claim has been produced.
Learn how to ask questions politely. The answer, by the way, is that I
have done so, using both recursive descent and other techniques.
Blow me, scumbag. You state and you imply falsehoods with malicious
intent because you're an unsuccessful author. You got nothing coming,
and I ain't gonna be polite to you. I acknowledged your suggestions in
the text of my code, because on the details you made useful
suggestions, but when you start campaigns of personal destruction, I
ain't your pal.