Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!sdcsvax!ucbvax!decvax!linus!necntc!necis!mrst!sdti!wmm From: wmm@sdti.UUCP (William M. Miller) Newsgroups: comp.lang.c++ Subject: Stack overflow compiling y.tab.c Message-ID: <131@sdti.UUCP> Date: Wed, 30-Sep-87 01:29:56 EDT Article-I.D.: sdti.131 Posted: Wed Sep 30 01:29:56 1987 Date-Received: Mon, 5-Oct-87 07:14:53 EDT Reply-To: wmm@sdti.UUCP (William M. Miller) Organization: Software Development Technologies, Sudbury MA Lines: 35 A couple of weeks ago, someone posted an article saying that they had pretty much succesfully ported cfront, except that when they ran it on the y.tab file it bombed with a stack overflow. I posted a reply at that time, but have only recently found out that our net feed was swallowing our postings. I am hence reposting the information; unfortunately I have lost the original message and cannot give a reference. I had the same experience when porting cfront to OS/2. What I eventually ended up doing was to split the huge switch statement in yyparse into a bunch of 32-case pieces, i.e., switch(yytmp) { case 1: ... case 254:... } became if (yytmp < 32) switch(yytmp) { case 1: ... case 31:... } else if (yytmp < 64) switch(yytmp) { case 32: etc. It's not pretty, but at least it compiles without stack overflow now. (I haven't any idea *why* large switch statements use up lots of stack space, but they do.) -- Non-disclaimer: My boss and I always see eye-to-eye (every time I look in the mirror). ...!genrad!mrst!sdti!wmm