using indentation rather than braces

Frank Adams franka at mmintl.UUCP
Wed May 21 09:05:03 AEST 1986


In article <968 at umd5.UUCP> zben at umd5.UUCP (Ben Cranston) writes:
>
>Forgive me if this is too obvious to mention, but it seems to me that using
>the indentation information makes life much harder for programs like YACC
>and LEX that act by creating C source code.  Now they have to keep track of
>what column they are outputting to...

This isn't all that hard.  Such programs must implicitly keep track of depth,
frequently by recursion.  Adding the additional machinery to make this
explicit is not bad.  One global variable, and update it every time you
enter or exit a block in the generated code.

>I just remember doing some assembly macros that tried to make their
>expansion obvious by "display"ing the code they were generating to the
>listing before actually generating it.  There was real gore in getting the
>columns lined up right, and in getting meaningful comments...

Dealing with such issues in the macro processing portion of an assembler is
another matter entirely.

Frank Adams                           ihnp4!philabs!pwa-b!mmintl!franka
Multimate International    52 Oakland Ave North    E. Hartford, CT 06108



More information about the Comp.lang.c mailing list