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

Bison 3 no longer supports YYPARSE_PARAM and YYPARSE_PARAM_TYPE. #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions libasn1parser/asn1p_y.y
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
%parse-param { void **param }

%{

#include <stdlib.h>
Expand All @@ -8,12 +10,10 @@

#include "asn1parser.h"

#define YYPARSE_PARAM param
#define YYPARSE_PARAM_TYPE void **
#define YYERROR_VERBOSE

int yylex(void);
int yyerror(const char *msg);
int yyerror(void **param, const char *msg);
#ifdef YYBYACC
int yyparse(void **param); /* byacc does not produce a prototype */
#endif
Expand Down Expand Up @@ -42,7 +42,7 @@ static asn1p_module_t *currentModule;

#define checkmem(ptr) do { \
if(!(ptr)) \
return yyerror("Memory failure"); \
return yyerror(param, "Memory failure"); \
} while(0)

#define CONSTRAINT_INSERT(root, constr_type, arg1, arg2) do { \
Expand Down Expand Up @@ -594,7 +594,7 @@ Assignment:
* Erroneous attemps
*/
| BasicString {
return yyerror(
return yyerror(param,
"Attempt to redefine a standard basic string type, "
"please comment out or remove this type redefinition.");
}
Expand All @@ -612,7 +612,7 @@ optImports:
ImportsDefinition:
TOK_IMPORTS optImportsBundleSet ';' {
if(!saved_aid && 0)
return yyerror("Unterminated IMPORTS FROM, "
return yyerror(param, "Unterminated IMPORTS FROM, "
"expected semicolon ';'");
saved_aid = 0;
$$ = $2;
Expand All @@ -621,7 +621,7 @@ ImportsDefinition:
* Some error cases.
*/
| TOK_IMPORTS TOK_FROM /* ... */ {
return yyerror("Empty IMPORTS list");
return yyerror(param, "Empty IMPORTS list");
}
;

Expand Down Expand Up @@ -2448,7 +2448,7 @@ _fixup_anonymous_identifier(asn1p_expr_t *expr) {
}

int
yyerror(const char *msg) {
yyerror(void **param, const char *msg) {
extern char *asn1p_text;
fprintf(stderr,
"ASN.1 grammar parse error "
Expand Down