C preprocessing

Rob Carriere rob at raksha.eng.ohio-state.edu
Tue Sep 25 04:35:34 AEST 1990


In article <223 at srchtec.UUCP> johnb at srchtec.UUCP (John T. Baldwin) writes:
>#1  Why does the program have to be processed as a one-dimensional string
>    of tokens?
>
>It doesn't.
>
>At least, programs in general do not have to be processed this
>way.  Your C programs are, because the language has been defined that way.
>The reason why language designers like to do this is because it makes it
>easier to write the compiler (i.e. the lexer and parser are easier).

There is at least one other reason.  Many people (especially those who have
been exposed to FORTRAN) consider formatted languages to be A Bad Thing.  The
reason being that my idea of legible formatting need not coincide with the
language designer's.  In a free-form language like C or Pascal, this doesn't
matter, I can format the program any way I want.  Similarly, if you have to
maintain my code and you don't like my formatting, a beautifying tool will
take care of the problem.  With a 2-D language, we would all have to use Big
Brothers Approved Format.

Of course, a lint (or a linting option on a compiler) that takes formatting
into account is a different matter altogether.  I have nothing against
warnings, as long as they follow Heuer's Law.

SR
---



More information about the Comp.lang.c mailing list