소스 검색

Merge pull request #14249 from ghalliday/issue24888

HPCC-24888 Support bison 3.7

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 4 년 전
부모
커밋
80e7af3b8c
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      ecl/hql/hqlgram.y

+ 8 - 1
ecl/hql/hqlgram.y

@@ -13208,6 +13208,13 @@ int yyuntranslate(int token)
     return '?';
 }
 
+//Recent versions of bison have switched to using an enumerated type
+#ifdef YYTERROR
+#define BISON_ERROR_TOKEN YYTERROR
+#else
+#define BISON_ERROR_TOKEN YYSYMBOL_YYerror
+#endif
+
 /* Cloned and modified from the verbose yyerror implementation */
 static void eclsyntaxerror(HqlGram * parser, const char * s, short yystate, int token)
 {
@@ -13229,7 +13236,7 @@ static void eclsyntaxerror(HqlGram * parser, const char * s, short yystate, int
   int curExpected = 0;
   for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
   {
-    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+    if (yycheck[yyx + yyn] == yyx && yyx != BISON_ERROR_TOKEN)
         expected[curExpected++] = yyuntranslate(yyx);
   }
   expected[curExpected++] = 0;