install with -s
[unix-history] / usr / src / old / htable / scan.l
CommitLineData
408c6ae3 1%{
528b0614
DF
2/*
3 * Copyright (c) 1983 Regents of the University of California.
4 * All rights reserved. The Berkeley software License Agreement
5 * specifies the terms and conditions for redistribution.
6 */
7
8#ifndef lint
9char copyright[] =
10"@(#) Copyright (c) 1983 Regents of the University of California.\n\
11 All rights reserved.\n";
12#endif not lint
13
408c6ae3 14#ifndef lint
528b0614
DF
15static char sccsid[] = "@(#)scan.l 5.1 (Berkeley) %G%";
16#endif not lint
408c6ae3
SL
17
18#include "y.tab.h"
19#include "htable.h"
20%}
21
22BLANK [ \t]
23DIGIT [0-9]
24ALPHA [A-Z]
25ANUM [0-9A-Z]
26NAMECHR [0-9A-Z./-]
27
28%%
29"NET" {
30 yylval.number = KW_NET;
31 return (KEYWORD);
32 }
33
34"GATEWAY" {
35 yylval.number = KW_GATEWAY;
36 return (KEYWORD);
37 }
38
39"HOST" {
40 yylval.number = KW_HOST;
41 return (KEYWORD);
42 }
43
44{ALPHA}{NAMECHR}*{ANUM} {
45 yylval.namelist = newname(yytext);
46 return (NAME);
47 }
48
295f3778
RC
49{ALPHA} {
50 yylval.namelist = newname(yytext);
51 return (NAME);
52 }
408c6ae3
SL
53
54{DIGIT}+ {
55 yylval.number = atoi(yytext);
56 return (NUMBER);
57 }
58
59"." return ('.');
60":" return (':');
61"," return (',');
62"/" return ('/');
63";".* ;
64"\n"{BLANK}+ ;
65{BLANK}+ ;
66"\n" return (END);
67. fprintf(stderr, "Illegal char: '%s'\n", yytext);
68
69%%
70
71yywrap()
72{
73 return (1);
74}