NetBSD/sbin/veriexecctl/veriexecctl_conf.l
2005-01-19 20:42:04 +00:00

53 lines
718 B
Plaintext

%{
/*
* Configuration file lexer for Verified exec
*
*
*/
#include <stdio.h>
#include <string.h>
#include "veriexecctl_parse.h"
int lineno = 1;
void yyerror(const char *message);
void warning(const char *message);
int yylex(void);
%}
%%
path { return PATH; }
string { return STRING; }
eol { return EOL; }
\/[^ ]+ {
yylval.string = strdup(yytext);
return PATH;
}
[0-9a-zA-Z]+ {
yylval.string = strdup(yytext);
return STRING;
}
\n {
lineno++; /* for error reporting */
return EOL;
}
[ \t\r] ; /* eat white ones */
#.* ; /* comment */
. yyerror("invalid character");
%%
void yyerror(const char *string)
{
fprintf(stderr, "%d: %s at %s\n", lineno, string, yytext);
}