Get rid if --header-file argument for lex
[fio.git] / exp / expression-parser.l
index 11eb833063993e531b08cc069fd08bdaf532808d..856596acfa21aee603f0dc81fba70b7ca5ee03af 100644 (file)
 
 #define YYSTYPE PARSER_VALUE_TYPE
 
-extern int lexer_input(char* buffer, int *nbytes, int buffersize);
+extern int lexer_input(char *buffer, unsigned int *nbytes, int buffersize);
 
 #undef YY_INPUT
-#define YY_INPUT(buffer, bytes_read, bytes_requested) \
-               lexer_input((buffer), &(bytes_read), (bytes_requested))
+#define YY_INPUT(buffer, bytes_read, bytes_requested)                  \
+({                                                                     \
+       int __ret;                                                      \
+       unsigned int __bread = bytes_read;                              \
+       __ret = lexer_input((buffer), &__bread, (bytes_requested));     \
+       bytes_read = __bread;                                           \
+       __ret;                                                          \
+})
 
 extern int yyerror(long long *result, double *dresult,
                int *has_error, int *units_specified, const char *msg);
 
-static void __attribute__((unused)) yyunput(int c,char *buf_ptr);
+static void __attribute__((unused)) yyunput(int c, char *buf_ptr);
 static int __attribute__((unused)) input(void);
 
 #define set_suffix_value(yylval, i_val, d_val, has_d_val) \
@@ -109,7 +115,7 @@ static int __attribute__((unused)) input(void);
                }
 [ \t] ; /* ignore whitespace */
 [#:,].* ; /* ignore comments, and everything after colons and commas */
-[0-9]*[.][0-9]+ {
+[0-9]*[.][0-9]+|[0-9]*[.]?[0-9]+[eE][-+]*[0-9]+ {
                        int rc;
                        double dval;