1270096Strasz%{ 2270096Strasz/*- 3270096Strasz * Copyright (c) 2014 The FreeBSD Foundation 4270096Strasz * All rights reserved. 5270096Strasz * 6270096Strasz * This software was developed by Edward Tomasz Napierala under sponsorship 7270096Strasz * from the FreeBSD Foundation. 8270096Strasz * 9270096Strasz * Redistribution and use in source and binary forms, with or without 10270096Strasz * modification, are permitted provided that the following conditions 11270096Strasz * are met: 12270096Strasz * 1. Redistributions of source code must retain the above copyright 13270096Strasz * notice, this list of conditions and the following disclaimer. 14270096Strasz * 2. Redistributions in binary form must reproduce the above copyright 15270096Strasz * notice, this list of conditions and the following disclaimer in the 16270096Strasz * documentation and/or other materials provided with the distribution. 17270096Strasz * 18270096Strasz * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19270096Strasz * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20270096Strasz * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21270096Strasz * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22270096Strasz * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23270096Strasz * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24270096Strasz * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25270096Strasz * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26270096Strasz * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27270096Strasz * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28270096Strasz * SUCH DAMAGE. 29270096Strasz * 30270096Strasz * $FreeBSD: releng/10.3/usr.sbin/autofs/token.l 274499 2014-11-14 10:53:55Z trasz $ 31270096Strasz */ 32270096Strasz 33270096Strasz#include <stdio.h> 34270096Strasz#include <stdint.h> 35270096Strasz#include <string.h> 36270096Strasz 37270096Strasz#include "common.h" 38270096Strasz 39270096Straszint lineno; 40270096Strasz 41270096Strasz#define YY_DECL int yylex(void) 42270096Straszextern int yylex(void); 43270096Strasz 44270096Strasz%} 45270096Strasz 46270096Strasz%option noinput 47270096Strasz%option nounput 48270096Strasz%option noyywrap 49270096Strasz 50270096Strasz%% 51271704Strasz\"[^"]+\" { yytext++; yytext[strlen(yytext) - 1] = '\0'; return STR; }; 52274499Strasz[a-zA-Z0-9\.\+-_/\:\[\]$&%{}]+ { return STR; } 53270096Strasz#.*\n { lineno++; return NEWLINE; }; 54270096Strasz\\\n { lineno++; }; 55270096Strasz\n { lineno++; return NEWLINE; } 56270096Strasz[ \t]+ /* ignore whitespace */; 57270096Strasz. { return STR; } 58270096Strasz%% 59