Someone
public text v1 · immutable%{
#include <stdlib.h>
void yyerror(char *);
#include "y.tab.h"
extern int yylval;
%}
id [a-z]
%%
{id} {
yylval = *yytext - 'a';
return VARIABLE;
}
[0-9]+ {
yylval = atoi(yytext);
return INTEGER;
}
[-+()=/*\n] { return *yytext; }
/* skip whitespace */
[ \t] ;
/* anything else is an error */
. yyerror("invalid character");
%%
int yywrap(void) {
return 1;
}