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

Using api.prefix{ ... } breaks yyerror() #90

Open
Hinderk opened this issue Jul 12, 2022 · 0 comments
Open

Using api.prefix{ ... } breaks yyerror() #90

Hinderk opened this issue Jul 12, 2022 · 0 comments

Comments

@Hinderk
Copy link

Hinderk commented Jul 12, 2022

A #define directive in the .tab.cpp file will replace yyerror with - for example - YBerror. However, a token named YBerror has been introduced already in the .tab.hpp file in the enumeration YBtokentype with the value 255. Under Linux this token will not be generated. Hence, there is no conflict in the Linux case. If no API prefix is used, the token features the name "YYerror". The #define will not be present and there is no conflict with the yyerror function thanks to case sensitivity.

There is a workaround which consists in undefining yyerror at the proper moment. In certain applications this will work. In other cases linker issues will arise as each parser creates the same yyerror symbol. The attached example illustrates the problem.

API Prefix Problem.zip

@Hinderk Hinderk changed the title Compilation problems when using api.prefix{YB} Compilation problems when using api.prefix{ ... } Jul 12, 2022
@Hinderk Hinderk changed the title Compilation problems when using api.prefix{ ... } Using api.prefix{ ... } breaks yyerror() Jul 19, 2022
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

1 participant