Re: Questions about Yacc (YYMAXDEPTH) (Dipankar Gupta)
7 Mar 91 11:14:02 GMT

          From comp.compilers

Related articles
Questions about Yacc (YYMAXDEPTH) srini@synopsys.Synopsys.COM (1991-03-05)
Re: Questions about Yacc (YYMAXDEPTH) (1991-03-07)
Re: Questions about Yacc (YYMAXDEPTH) (1991-03-08)
Re: Questions about Yacc (YYMAXDEPTH) (Kathy Harris) (1991-03-13)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Dipankar Gupta)
Keywords: yacc
Organization: Hewlett-Packard Laboratories, Bristol, England
References: <694@synopsys.COM>
Date: 7 Mar 91 11:14:02 GMT

In article <694@synopsys.COM> srini@synopsys.Synopsys.COM (Srinivas Raghvendra) writes:
>This is a question about the standard Yacc tool distributed with Unix.
>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). Has anybody else faced
> the same problem ?
> (2) If the answer to (1) is Yes, what is a reasonable value for

You may want to use the __RUNTIME_YYMAXDEPTH option, which allows runtime
allocation of YACC stacks. You may choose a convenient value for
the increment YYINCREMENT. This uses malloc (3) routines to manage stacks.

The version of yacc that I have (on HP-UX 7.0) demands char *malloc (), which
may interfere with ANSI headers.

Dipankar Gupta
Hewlett-Packard India Software Operation, Bangalore, India
[This must be an HP-ism, it's not present in the SVR3 yacc parser. Personally,
I've always found the default depth to be plenty. What sort of grammars are
you parsing that overflow? -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.