large grammar causes "integer set overflow" in pyacc
Original Reporter info from Mantis: sethdgrover@gmail.com
-
Reporter name: Seth Grover
Original Reporter info from Mantis: sethdgrover@gmail.com
- Reporter name: Seth Grover
Description:
I use pyacc (http://wiki.freepascal.org/Plex_and_Pyacc) to generate a parser with quite a large grammar, which causes it to fail.
I've included a patch file to increase the sizes of the necessary arrays to support larger grammars. I haven't noticed any problems caused by the changes or extreme memory usage or anything like that.
I'll also include a sample .y file (sanitized) to illustrate the issue.
Steps to reproduce:
With the attached SQL.y example and the original pyacc:
$ pyacc SQL.y
TP Yacc Version 4.1a [April 2000], Copyright (c) 1990-2000 Albert Graef
parse ... sort ... closures ... first sets ...
FATAL: integer set overflow
With my patch:
$ pyacc SQL.y
TP Yacc Version 4.1a [April 2000], Copyright (c) 1990-2000 Albert Graef
parse ... sort ... closures ... first sets ... LR0 set ... lookaheads ...
code generation ... DONE
1262 lines, 618/900 rules, 1460/3000 s, 21915/40000 i, 20765/40000 t, 640/9600 r.
74 reduce/reduce conflicts.
Mantis conversion info:
- Mantis ID: 32273
- Fixed in version: 3.1.1
- Fixed in revision: 36922 (#586de3ed)
- Target version: 3.2.0