The special YYerror token is supported in Bison 3.6 and above.
Fortunately, it is possible to emulate this functionality in older
versions as well.
Signed-off-by: Karel Zak <kzak@redhat.com>
%left T_OR T_AND
%left T_EQ T_NE T_LT T_LE T_GT T_GE T_REG T_NREG T_TRUE T_FALSE T_NEG
+%token T_INVALID_NUMBER
%destructor {
/* This destruct is called on error. The root node will be deallocated
bool x = false;
$$ = filter_new_param(fltr, SCOLS_DATA_BOOLEAN, 0, (void *) &x);
}
-
+ | T_INVALID_NUMBER { /* YYerror token is unsupported in old Bisons */
+ ignore_result( $$ ); /* supress "unset value" warning */
+ YYERROR; /* yyerror() already called by lex() */
+ }
;
yyerror(yyscanner, yyextra, "\"%s\" token error: %m", yytext);
else
yyerror(yyscanner, yyextra, "\"%s\" token error", yytext);
- return YYerror;
+ return T_INVALID_NUMBER;
}
if (res > ULLONG_MAX) {
yyerror(yyscanner, yyextra, "\"%s\" number too large", yytext);
- return YYerror;
+ return T_INVALID_NUMBER;
}
yylval->param_number = (unsigned long long) res;