/* C declarations */ /* vi: set et ts=4: */ %{ #include #include "y.tab.h" /* extern C declarations */ #if defined(__cplusplus) extern "C" { #endif /* should be defined in stdio.h */ extern int fileno(FILE *); #if defined(__cplusplus) } #endif int c; extern int yylval; %} %option nounput /* Patterns */ %% " " ; "PI" { return PI; } "(" { return OPEN_PAREN; } ")" { return CLOSE_PAREN; } "**" { return EXPONENT; } [0-9] { c = yytext[0]; yylval = c - '0'; return DIGIT; } [^0-9\b] { c = yytext[0]; return c; } %%