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

Maybe support larger integer types for yylineno #6

Closed
krcurtis opened this issue Oct 17, 2023 · 1 comment
Closed

Maybe support larger integer types for yylineno #6

krcurtis opened this issue Oct 17, 2023 · 1 comment

Comments

@krcurtis
Copy link

It would be helpful to be able to specify different integer types for yylineno. I thought I'd try an Ada-based solution and was trying to use aflex and ayacc to verify a 270GB FASTA file (it is supposed to have a very regular structure). Unfortunately I got an exception:

raised CONSTRAINT_ERROR : scanfasta_lexer.adb:221 overflow check failed

For now, I'm manually forcing yylineno and yy_last_yylineno to be a custom type in the _dfa.ads file. It would be nice to be able to specify that in a different file that would not be overwritten during the build process.

Thanks!

stcarrez added a commit that referenced this issue Feb 11, 2024
- add support for %yydfa declaration block inserted in the _DFA package spec.
- use ${YYLINENOTYPE} variable for the yylineno variable
stcarrez added a commit that referenced this issue Feb 11, 2024
- update parser to recognize %yydfa code block,
- handle %option name=value with a value as a string,
- update template expander for %yydfa and yylinenotype variable,
- rebuild the templates by using the generator
@stcarrez
Copy link
Collaborator

Fixed in 1.7 version.
You can declare in the lexer file something like:

%option yylinenotype=Line_Number
%yydfa {
   subtype Line_Number is Long_Long_Integer;
}

The %yydfa code block is injected in the _dfa.ads package declaration before the declaration of the yylineno variables.

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

No branches or pull requests

2 participants