Path: utzoo!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!iecc!compilers-sender From: bliss@sp64.csrd.uiuc.edu (Brian Bliss) Newsgroups: comp.compilers Subject: Re: Questions about Yacc (YYMAXDEPTH) Keywords: yacc Message-ID: <1991Mar8.203107.1327@csrd.uiuc.edu> Date: 8 Mar 91 20:31:07 GMT References: <694@synopsys.COM> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: bliss@sp64.csrd.uiuc.edu (Brian Bliss) Organization: Center for Supercomputing Research and Development Lines: 15 Approved: compilers@iecc.cambridge.ma.us In article <694@synopsys.COM>, srini@synopsys.Synopsys.COM (Srinivas Raghvendra) writes: |> I notice that Yacc uses a #define named YYMAXDEPTH and that this value has |> been set at 150. |> (1) I notice that even for moderately nested constructs, this seems |> insufficient. (I get a Yacc stack overflow). If you get overflows, you are probably using too many right-recursive productions in you grammar. change these to left-recursive productions and the stack won't grow without bound. (i.e. lemme see your grammar). bb -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.