diff options
| author | horus_arch | 2016-09-09 12:30:02 +0200 |
|---|---|---|
| committer | horus_arch | 2016-09-09 12:30:02 +0200 |
| commit | 542b26d4dcc90f8186900d51960e3dfefaa0ad01 (patch) | |
| tree | fc29f80a69a0a20deec97bd5f00efef599a1d0ad /urlscanner.l | |
| parent | 32685cc367b86c81df3f025f63261aa91ea3cd8c (diff) | |
| download | uhttpd-542b26d4dcc90f8186900d51960e3dfefaa0ad01.tar.gz | |
Removes dependencies on cgo (flex + bison)
Diffstat (limited to 'urlscanner.l')
| -rw-r--r-- | urlscanner.l | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/urlscanner.l b/urlscanner.l deleted file mode 100644 index 79768b2..0000000 --- a/urlscanner.l +++ /dev/null @@ -1,52 +0,0 @@ -%option noyywrap -%option yylineno -%option nounput - -%{ -#include "urlscanner.h" -#include "string.h" -yystype yylval; -#define YY_NO_INPUT -%} - -%x ATAG_HREF -%x ATAG_BETWEEN -%x ATAG_DESC - -%% - -[^<]* { } - -"<a"[^>]*"href=\"" { BEGIN(ATAG_HREF); } - -<ATAG_HREF>[^\"]+ { - yylval = strdup(yytext); - BEGIN(ATAG_BETWEEN); - return TOKEN_URL; -} - -<ATAG_HREF>\" { - yylval = ""; - BEGIN(ATAG_BETWEEN); - return TOKEN_URL; -} - -<ATAG_BETWEEN>[^>]* { } - -<ATAG_BETWEEN>">" { BEGIN(ATAG_DESC); } - -<ATAG_DESC>[^<]* { - yylval = strdup(yytext); - BEGIN(INITIAL); - return TOKEN_TEXT; -} - -. { /* skip */ } - -<<EOF>> { return MYEOF; } - -%% - -void scan_string(const char* str) { - yy_switch_to_buffer(yy_scan_string(str)); -} |
