From db6c3975ccfc1c617de9039d66226039b76b5363 Mon Sep 17 00:00:00 2001 From: Max Khon Date: Fri, 5 Feb 2016 17:51:14 +0600 Subject: [PATCH] Bison 3 no longer supports YYPARSE_PARAM and YYPARSE_PARAM_TYPE. --- libasn1parser/asn1p_y.y | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libasn1parser/asn1p_y.y b/libasn1parser/asn1p_y.y index aae339bb2..27327f193 100644 --- a/libasn1parser/asn1p_y.y +++ b/libasn1parser/asn1p_y.y @@ -1,3 +1,5 @@ +%parse-param { void **param } + %{ #include @@ -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 @@ -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 { \ @@ -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."); } @@ -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; @@ -621,7 +621,7 @@ ImportsDefinition: * Some error cases. */ | TOK_IMPORTS TOK_FROM /* ... */ { - return yyerror("Empty IMPORTS list"); + return yyerror(param, "Empty IMPORTS list"); } ; @@ -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 "