dnl userv - lexer.l.m4 dnl lexer, passed through m4 with defs from langauge.i4 /* * Copyright (C)1996-1997 Ian Jackson * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with userv; if not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ %{ include(language.i4) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "common.h" #include "daemon.h" #include "lib.h" #include "tokens.h" #define HYPHEN '-' static int lineno, atnewline, notedreferer; static int dequote(char *inplace); %} %option noyywrap %% dnl simple words undivert(3) changequote({*,*}) {* [\ \t]+ return tokv_lwsp; [\ \t]*\n atnewline= 1; lineno++; return tokv_newline; [\ \t]*\#[^\n]*\n atnewline= 1; lineno++; return tokv_newline; [\ \t]*\#[^\n]* atnewline= 0; parseerrprint("missing newline at eof after comment"); return tokv_error; [^\ \t\n]+ atnewline= 0; return tokv_barestring; <> return tokv_eof; \"([^\\\"\n]|\\[a-z]|\\[0-9]{3}|\\x[0-9a-f]{2}|\\[:punct:]|\\[ \t]*\n)*\" return dequote(yytext); \".* atnewline= 0; parseerrprint("misquoted or unterminated string"); return tokv_error; *} changequote(`,') %% ` #include "parser.c" ' divert(-1) undivert