1%{ 2/*- 3 * Copyright (c) 2009-2010 The FreeBSD Foundation 4 * All rights reserved. 5 * 6 * This software was developed by Pawel Jakub Dawidek under sponsorship from 7 * the FreeBSD Foundation. 8 * --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/sbin/hastd/token.l 207371 2010-04-29 15:36:32Z pjd $ |
31 */ 32 33#include <stdio.h> 34#include <string.h> 35 36#include "hast.h" 37 38#include "y.tab.h" --- 4 unchanged lines hidden (view full) --- 43#define DP do { } while (0) 44%} 45 46%% 47control { DP; return CONTROL; } 48listen { DP; return LISTEN; } 49port { DP; return PORT; } 50replication { DP; return REPLICATION; } |
51timeout { DP; return TIMEOUT; } |
52resource { DP; return RESOURCE; } 53name { DP; return NAME; } 54local { DP; return LOCAL; } 55remote { DP; return REMOTE; } 56on { DP; return ON; } 57fullsync { DP; return FULLSYNC; } 58memsync { DP; return MEMSYNC; } 59async { DP; return ASYNC; } 60[0-9]+ { DP; yylval.num = atoi(yytext); return NUM; } 61[a-zA-Z0-9\.\-_/\:]+ { DP; yylval.str = strdup(yytext); return STR; } 62\{ { DP; depth++; return OB; } 63\} { DP; depth--; return CB; } 64#.*$ /* ignore comments */; 65\n { lineno++; } 66[ \t]+ /* ignore whitespace */; 67%% |