Newsgroups: | comp.compilers |
From: | plong@perf.com (Paul Long) |
Keywords: | syntax, design |
Organization: | Performance Computing Inc., Beaverton, OR |
References: | 95-04-193 95-05-027 |
Date: | Tue, 9 May 1995 17:38:11 GMT |
lutz@KaPRE.COM writes:
>schrod@iti.informatik.th-darmstadt.de (Joachim Schrod) writes:
>> [indentation syntax makes it hard to generate programs]
>
>Could you provide some more details? I've heard this argument
>before, but it's not clear to me that it would be any harder to
>generate N tabs than to generate block delimeters correctly. How
>hard is it to keep a global tab counter?
I assume he means that generating proper indention is not as easy as
generating a basically unindented program but with proper syntax. I can
see his point, but I agree with you. I wrote an article for _The Journal
of C Language Translation_ (vol. 3, no. 1, June '91) called "Emitting
C Source" that presents an emitter that makes the generation of properly
indented code as easy as unindented code.
[snip]
>The point is that compilers should be able to use all the information
>communicated by the programmer (indentation, end-lines), rather than
>forcing extra, error-prone tokens.
When developing new languages, I've tinkered with indention-sensitive
grammars (ISGs?) but have always stopped short of implementing them. Maybe
it's just that they seem so foreign to me. Also, the problem of what
characters are used for indention has seemed messier than the benefit
of ISGs.
Paul Long
plong@perf.com
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.