Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!topaz!bentley!kwh From: kwh@bentley.UUCP (KW Heuer) Newsgroups: net.lang.c Subject: Re: using indentation rather than braces Message-ID: <838@bentley.UUCP> Date: Mon, 19-May-86 12:09:45 EDT Article-I.D.: bentley.838 Posted: Mon May 19 12:09:45 1986 Date-Received: Tue, 20-May-86 07:52:07 EDT References: <968@umd5.UUCP> Organization: AT&T Bell Laboratories, Liberty Corner Lines: 18 In article <968@umd5.UUCP> umd5!zben (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... Slightly harder, but still not all that difficult. Instead of outputting a left brace, the program increments a variable; instead of a right brace, it decrements. Then each output line is preceded by that many blanks. Of course, I'm assuming some support would be built into yacc and lex. They would automatically add the indentation level of your code blocks to that of the automatically-generated blocks. Btw, how would such a language interpret a one-liner like "if (c) a; b;"? Would that be "if (c) {a;} b;" or "if (c) {a; b;}" or just illegal? Karl W. Z. Heuer (ihnp4!bentley!kwh), The Walking Lint