[comp.sys.3b1] more than 126 tokens in YACC ?

jms@wzlr.UUCP (Jack Stephens) (06/05/91)

Well, I got the scanner to work like a champ. Couldn't use lex, as it
generated a 486K *executable* but that's another story.  I now have a
hand coded 32K screamer that does the trick nicely.

I went to begin the grammar that is supposed to be driven by this thing
and decided to start slow. Nothing more than a list of "%token KEYWORD"
pairs and a trailing "%%".  Issued a "yacc -d grammar.y" to make sure that
y.tab.h would agree with the hand tooled version I had been using and I
get:

 fatal error: too many terminals, limit 127, line 125

 Will some kind soul tell me this is all a bad dream ?  Failing that,
 how 'bout a work around ?

 Jack

-- 
/-----------------------------------------------------------------------------\
|Jack Stephens (jms@infmx -or- jms@wzlr)         'Cannons to the left of them,| 
|Unix Systems Programmer                          Nikons to the right of them,| 
|Informix Software, Menlo Park CA                and nobody remembered film !'| 

tkacik@hobbes.cs.gmr.com (Tom Tkacik CS/50) (06/05/91)

In article <1214@wzlr.UUCP>, jms@wzlr.UUCP (Jack Stephens) writes:
|> 
|>  fatal error: too many terminals, limit 127, line 125
|> 
|>  Will some kind soul tell me this is all a bad dream ?  Failing that,
|>  how 'bout a work around ?

Get Berkeley yacc (byacc), posted to comp.sources.unix,
from your local archive site.

--
Tom Tkacik
GM Research Labs
tkacik@hobbes.cs.gmr.com
tkacik@kyzyl.mi.org

david@wmms.UUCP (David R. Mayne) (06/08/91)

In article <1214@wzlr.UUCP>, jms@wzlr.UUCP (Jack Stephens) writes:
> 
> 
> I went to begin the grammar that is supposed to be driven by this thing
> and decided to start slow. Nothing more than a list of "%token KEYWORD"
> pairs and a trailing "%%".  Issued a "yacc -d grammar.y" to make sure that
> y.tab.h would agree with the hand tooled version I had been using and I
> get:
> 
>  fatal error: too many terminals, limit 127, line 125
> 
>  Will some kind soul tell me this is all a bad dream ?  Failing that,
>  how 'bout a work around ?

This question pops up from time to time.

The work around is to get byacc (Berkeley yacc).
Having the source code allows you to set the number of symbols
availible in the symbol table, and simply recompile, if
necessary. No changes are needed to compile this package on the 3b1.
As a bonus, byacc operates faster than the stock yacc.

You can get byacc at some of the archive sites around; 
one source is skeeve.

Best of luck,

David
-- 
David R. Mayne         1364 Normandy Dr. NE             Atlanta, GA 30306
david@wmms             (404) 876-0943        ...!gatech!bagend!wmms!david

tkacik@hobbes.cs.gmr.com (Tom Tkacik CS/50) (06/13/91)

In article <297@wmms.UUCP>, david@wmms.UUCP (David R. Mayne) writes:
|> In article <1214@wzlr.UUCP>, jms@wzlr.UUCP (Jack Stephens) writes:
|> >  fatal error: too many terminals, limit 127, line 125
|> > 
|> >  Will some kind soul tell me this is all a bad dream ?  Failing that,
|> >  how 'bout a work around?
|> 
|> The work around is to get byacc (Berkeley yacc).
|> Having the source code allows you to set the number of symbols
|> availible in the symbol table, and simply recompile, if
|> necessary.

There is no need to change the surce code to increase anything, as byacc
grows its tables dynamically.

|>             No changes are needed to compile this package on the 3b1.

Right.  I found byacc very easy to get working on my 3b1.  There isn't
even a file like /usr/lib/yaccpar to worry about, it's built
into the executable.

--
Tom Tkacik
GM Research Labs
tkacik@hobbes.cs.gmr.com
tkacik@kyzyl.mi.org