freebsd-dev/lib/libforms/lex.l
Paul Richards 0d18307afc The start of a forms editor library. Currently implements text and
input fields. It reads a template file passed to init_forms(char *)
and creates a curses based form editor. See the examples directory
for a basic demo.
1994-11-13 06:45:44 +00:00

20 lines
373 B
Plaintext

%{
#include "y.tab.h"
%}
%%
"Form template:" { yylval.ival = FORM; return FORM; }
Input { yylval.ival = INPUT; return INPUT; }
Text { yylval.ival = TEXT; return TEXT; }
[0-9]+ { yylval.ival = atoi(yytext); return NUMBER; }
\"[^"]* {
if (yytext[yyleng-1] == '\\') {
yymore();
} else {
input();
yylval.sval = yytext+1;
return STRING;
}
}