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

18 lines
247 B
Plaintext

%{
#include "echo.tab.h"
#include <string.h>
void yyerror(const char *s);
%}
%%
[ \t\n]+ { }
[a-zA-Z]+ { yylval.str = strdup(yytext); return TEXT; }
. { yyerror("Unexpected character"); }
%%
int yywrap() {
return 1;
}