#include "smartcolsP.h"
#include "filter-parser.h" /* define tokens (T_*) */
+void yyerror(yyscan_t *locp, struct libscols_filter *fltr, char const *fmt, ...);
+
%}
%option reentrant bison-bridge noyywrap noinput nounput
return T_FLOAT;
}
+{int}+([KMGTPEZY](iB)?) {
+ uintmax_t res;
+ int e;
+
+ errno = 0;
+ e = strtosize(yytext, &res);
+ if (e < 0) {
+ if (errno)
+ yyerror(yyscanner, yyextra, "\"%s\" token error: %m", yytext);
+ else
+ yyerror(yyscanner, yyextra, "\"%s\" token error", yytext);
+ return T_INVALID_NUMBER;
+ }
+
+ if (res > ULLONG_MAX) {
+ yyerror(yyscanner, yyextra, "\"%s\" number too large", yytext);
+ return T_INVALID_NUMBER;
+ }
+
+ yylval->param_number = (unsigned long long) res;
+ return T_NUMBER;
+}
+
{int}+ {
yylval->param_number = (int64_t) strtoumax(yytext, NULL, 10);
return T_NUMBER;