Deleted Added
full compact
lexer.l (62638) lexer.l (78064)
1/* $KAME$ */
1/* $KAME: lexer.l,v 1.7 2000/11/08 02:40:53 itojun Exp $ */
2
3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 13 unchanged lines hidden (view full) ---

23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
2
3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 13 unchanged lines hidden (view full) ---

23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * $FreeBSD: head/usr.sbin/rrenumd/lexer.l 62638 2000-07-05 11:12:53Z kris $
31 * $FreeBSD: head/usr.sbin/rrenumd/lexer.l 78064 2001-06-11 12:39:29Z ume $
32 */
33
34%{
32 */
33
34%{
35#define YY_NO_UNPUT
36
35#include <sys/param.h>
36#include <sys/ioctl.h>
37#include <sys/socket.h>
37#include <sys/param.h>
38#include <sys/ioctl.h>
39#include <sys/socket.h>
40#include <sys/queue.h>
38
39#include <string.h>
40
41#include <net/if.h>
42#if defined(__FreeBSD__) && __FreeBSD__ >= 3
43#include <net/if_var.h>
44#endif /* __FreeBSD__ >= 3 */
45

--- 4 unchanged lines hidden (view full) ---

50#include <arpa/inet.h>
51
52#include "y.tab.h"
53
54int lineno = 1;
55
56#define LINEBUF_SIZE 1000
57char linebuf[LINEBUF_SIZE];
41
42#include <string.h>
43
44#include <net/if.h>
45#if defined(__FreeBSD__) && __FreeBSD__ >= 3
46#include <net/if_var.h>
47#endif /* __FreeBSD__ >= 3 */
48

--- 4 unchanged lines hidden (view full) ---

53#include <arpa/inet.h>
54
55#include "y.tab.h"
56
57int lineno = 1;
58
59#define LINEBUF_SIZE 1000
60char linebuf[LINEBUF_SIZE];
61
62int parse __P((FILE **));
63void yyerror __P((const char *));
64int yylex __P((void));
58%}
59
60/* common section */
61nl \n
62ws [ \t]+
63digit [0-9]
64letter [0-9A-Za-z]
65hexdigit [0-9A-Fa-f]

--- 177 unchanged lines hidden (view full) ---

243 yylval.cs.cp = yytext;
244 yylval.cs.len = yyleng;
245 return HOSTNAME;
246 }
247%%
248
249int parse(FILE **fp)
250{
65%}
66
67/* common section */
68nl \n
69ws [ \t]+
70digit [0-9]
71letter [0-9A-Za-z]
72hexdigit [0-9A-Fa-f]

--- 177 unchanged lines hidden (view full) ---

250 yylval.cs.cp = yytext;
251 yylval.cs.len = yyleng;
252 return HOSTNAME;
253 }
254%%
255
256int parse(FILE **fp)
257{
258 extern int yyparse __P((void));
259
251 yyin = *fp;
252
260 yyin = *fp;
261
253 if(yyparse())
262 if (yyparse())
254 return(-1);
255
256 return(0);
257
258}
259
260void
261yyerror(const char *s)
262{
263 printf("%s: at %s in line %d\n", s, yytext, lineno);
264}
263 return(-1);
264
265 return(0);
266
267}
268
269void
270yyerror(const char *s)
271{
272 printf("%s: at %s in line %d\n", s, yytext, lineno);
273}