Skip to content

question: is a long line still a problem in current bison version?#95

Open
quinte17 wants to merge 1 commit intoakimd:masterfrom
quinte17:longline
Open

question: is a long line still a problem in current bison version?#95
quinte17 wants to merge 1 commit intoakimd:masterfrom
quinte17:longline

Conversation

@quinte17
Copy link

if you have a grammar with many tokens, it can happen that a line gets longer than 16k-bytes.
this is a problem on some compilers, but could get fixed with this "hack".

old output c++ output:
YYASSERT (tok == token::sym1 || tok == token::sym2 || ...) // and many more

new output c++ output:

bool _inlist = false;
if ( tok == token::sym1 ) {
  _inlist = true;
}
if ( tok == token::sym2 ) {
  _inlist = true;
}
... // and many more
YYASSERT (_inlist);

maybe this could get even nicer if using a switch instead of that if...

this exceeds 16k limit on some compilers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant