[comp.unix.questions] yacc limitations

mike@hpfcdc.HP.COM (Mike McNelly) (09/20/88)

> I am trying to expand an already large yacc grammar.  Unfortunately,
> I have hit a limit on the number of terminal tokens.  Does anybody
> know a way around this?  On VAX Ultrix the default limit appears to
> be 127 as shown in the following excerpt from the y.output file.
> This also appears to be the limit on HP, but Pyramid allows for up to
> 600 terminals.  Can I either increase or bypass this limit somehow?

This limit is usually hard set in the code.  Yacc on HP workstations has
been modified so that many of the limits are configurable at run time.
A few, like the limit on the number of terminals, are still hard coded,
but the limits have been bumped up to large values.  After release 5.2
(circa 1986) the number of allowed terminals is 2000.

Mike McNelly
Hewlett Packard Co.
hplabs!hpfcla!mike

mikpe@mina.liu.se (Mikael Pettersson) (09/26/88)

In article <5740029@hpfcdc.HP.COM> mike@hpfcdc.HP.COM (Mike McNelly) writes:
[someone else wrote the >> part]
>> I am trying to expand an already large yacc grammar.  Unfortunately,
>> I have hit a limit on the number of terminal tokens.  Does anybody
>> know a way around this?

You could

1) get Bison (unless you can't get alloca() for your machine)

2) if serveral tokens are used in exactly the same way in the
   grammar you can hack the scanner to return a `meta'-token
   and put the real token in yylval.whatever.

/Mike
-- 
Mikael Pettersson           ! Internet:mpe@ida.liu.se
Dept of Comp & Info Science ! UUCP:    mpe@liuida.uucp  -or-
University of Linkoping     !          {mcvax,munnari,uunet}!enea!liuida!mpe
Sweden                      ! ARPA:    mpe%ida.liu.se@uunet.uu.net