|Questions about Yacc (YYMAXDEPTH) srini@synopsys.Synopsys.COM (1991-03-05)|
|Re: Questions about Yacc (YYMAXDEPTH) email@example.com (1991-03-07)|
|Re: Questions about Yacc (YYMAXDEPTH) firstname.lastname@example.org (1991-03-08)|
|Re: Questions about Yacc (YYMAXDEPTH) email@example.com (Kathy Harris) (1991-03-13)|
|From:||firstname.lastname@example.org (Dipankar Gupta)|
|Organization:||Hewlett-Packard Laboratories, Bristol, England|
|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
> YYMAXDEPTH ?
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.
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]
Return to the
Search the comp.compilers archives again.