From: | Martin Rodgers <mcr@wildcard.demon.co.uk> |
Newsgroups: | comp.compilers |
Date: | Tue, 18 Jan 2011 14:20:45 +0000 |
Organization: | Compilers Central |
References: | 10-12-040 10-12-043 11-01-005 11-01-025 11-01-038 11-01-041 11-01-049 11-01-072 |
Keywords: | syntax, design |
Posted-Date: | 18 Jan 2011 10:29:35 EST |
Gene Wirchenko wrote:
>> BBC Basic was also irritating to me because, unlike the earlier Basic
>> implementations that I knew on on micros, the ROM was large enough
>> to support both control structures, so why pick just one?
>
> Microsoft BASIC 5 had WHILE but not UNTIL.
Yes, that struck me as odd at the time.
> I always look for the philosophy of a programming language.
Yes, that's useful too. I like Paul Graham's question about the problems a
language is intended to solve. That's part of the philosophy, I guess.
We could probably ask similar questions about compilers...Error reporting
and recovery has always fascinated me, probably because I was frequently
frustrated by the unhelpfulness of the error msgs given by so many tools.
My first lexer buffered text at the line level and counted the
characters and lines read so far, then provided them to the error
reporting code so that the line number and the line itself could be
given to the user, along with a '^' under the character at which the
error was detected.
This only worked in my compiler because it ran in a single pass. When
I began writing multipass compilers, I had to save the line and offset
numbers in the parse and/or syntax trees. Yes, it does require extra
effort, but several decades later my compilers still use this
technique. The line text itself, however, was only ever used in error
msgs in my first compiler.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.