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

cfg-grammar.y: add location reporting to bison debug #138

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

bazsi
Copy link
Member

@bazsi bazsi commented Jun 3, 2024

This will add location information to the grammar debug output.

@bazsi bazsi force-pushed the yy-debug-location-reporting branch from 7fe6df7 to 17b1683 Compare June 3, 2024 14:59
@alltilla
Copy link
Member

alltilla commented Jun 4, 2024

This did not work for me at all.

To make it work I had to set the YY_LOCATION_PRINT macro instead of YYLOCATION_PRINT, and had to change the signature as well from main_location_print (FILE *yyo, YYLTYPE const * const yylocp) to main_location_print (FILE *yyo, YYLTYPE yylocp).

I can see that YYLOCATION_PRINT is documented, but my generated c code used YY_LOCATION_PRINT everywhere.

@bazsi Have you read anything about this?

FTR:

$ bison --version
bison (GNU Bison) 3.7.6
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@bazsi
Copy link
Member Author

bazsi commented Jun 4, 2024 via email

@bazsi bazsi force-pushed the yy-debug-location-reporting branch from 17b1683 to 67e793d Compare June 6, 2024 09:32
@bazsi
Copy link
Member Author

bazsi commented Jun 6, 2024

@alltilla added bison dependency check as requested IRL.

@bazsi bazsi force-pushed the yy-debug-location-reporting branch from 67e793d to 69ed8cc Compare June 6, 2024 12:45
@alltilla
Copy link
Member

alltilla commented Jun 6, 2024

I have tested the old bison version, it behaves as expected.

alltilla
alltilla previously approved these changes Jun 6, 2024
@alltilla
Copy link
Member

alltilla commented Jun 6, 2024

@bazsi Feel free to merge this if it works for your bison version.

@bazsi bazsi force-pushed the yy-debug-location-reporting branch from 69ed8cc to 6de67fb Compare June 6, 2024 16:57
@alltilla alltilla merged commit 0a8d715 into axoflow:main Jun 7, 2024
22 checks passed
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.

2 participants