HyriseSQLParser/lemon_example/flex_scanner.l

23 lines
379 B
Plaintext
Raw Normal View History

%{
2014-10-17 17:43:57 +02:00
#include "lemon_parser.h"
#include <stdlib.h>
#include "token_def.h"
%}
%option reentrant
%option noyywrap
2014-10-17 17:43:57 +02:00
%option bison-bridge
%%
2014-10-17 17:43:57 +02:00
[0-9]+|[0-9]+.[0-9]+ { yylval->fval = atof(yytext); return NUMBER; }
[+] return PLUS;
[\n] return NL;
[ \t] ; /* skip whitespace */
. {printf("Unknown character '%c'\n", yytext[0]); return 0;}
%%