flex-bison-in-action/analyzers/polynomials/polynomials.l

13 lines
255 B
Plaintext

%{
#include "polynomials.tab.h"
%}
%%
[0-9]+ { yylval = atoi(yytext); return NUMBER; }
[-+*^()] { return yytext[0]; }
[ \t] ;
\n { return 0; }
. { printf("unknown: %s\n", yytext); exit(0); }
%%
int yywrap() { return 1; }