4.3BSD manual page from sam
[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
2de3e885 9static char sccsid[] = "@(#)scan.l 5.2 (Berkeley) %G%";
528b0614 10#endif not lint
408c6ae3
SL
11
12#include "y.tab.h"
13#include "htable.h"
14%}
15
16BLANK [ \t]
17DIGIT [0-9]
18ALPHA [A-Z]
19ANUM [0-9A-Z]
20NAMECHR [0-9A-Z./-]
21
22%%
23"NET" {
24 yylval.number = KW_NET;
25 return (KEYWORD);
26 }
27
28"GATEWAY" {
29 yylval.number = KW_GATEWAY;
30 return (KEYWORD);
31 }
32
33"HOST" {
34 yylval.number = KW_HOST;
35 return (KEYWORD);
36 }
37
38{ALPHA}{NAMECHR}*{ANUM} {
39 yylval.namelist = newname(yytext);
40 return (NAME);
41 }
42
295f3778
RC
43{ALPHA} {
44 yylval.namelist = newname(yytext);
45 return (NAME);
46 }
408c6ae3
SL
47
48{DIGIT}+ {
49 yylval.number = atoi(yytext);
50 return (NUMBER);
51 }
52
53"." return ('.');
54":" return (':');
55"," return (',');
56"/" return ('/');
57";".* ;
58"\n"{BLANK}+ ;
59{BLANK}+ ;
60"\n" return (END);
61. fprintf(stderr, "Illegal char: '%s'\n", yytext);
62
63%%
64
65yywrap()
66{
67 return (1);
68}