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

22 lines
275 B
Plaintext

%{
#include "test.tab.h"
#include <stdio.h>
#include <string.h>
int yylineno;
%}
%%
"{" { return LBRACE; }
"}" { return RBRACE; }
\n { yylineno++; }
[^{}]+ {
yylval.str = strdup(yytext);
return TEXT;
}
%%
int yywrap() {
return 1;
}