mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
0d18307afc
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.
20 lines
373 B
Plaintext
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;
|
|
}
|
|
}
|