Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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