|
|
1.1 ! root 1: %{ ! 2: ! 3: /* ! 4: * Copyright (c) 1983 Regents of the University of California. ! 5: * All rights reserved. ! 6: * ! 7: * Redistribution and use in source and binary forms are permitted ! 8: * provided that the above copyright notice and this paragraph are ! 9: * duplicated in all such forms and that any documentation, ! 10: * advertising materials, and other materials related to such ! 11: * distribution and use acknowledge that the software was developed ! 12: * by the University of California, Berkeley. The name of the ! 13: * University may not be used to endorse or promote products derived ! 14: * from this software without specific prior written permission. ! 15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 16: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 17: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 18: */ ! 19: ! 20: #ifndef lint ! 21: static char sccsid[] = "@(#)scan.l 5.6 (Berkeley) 6/18/88"; ! 22: #endif /* not lint */ ! 23: ! 24: #include "htable.h" ! 25: %} ! 26: ! 27: BLANK [ \t] ! 28: DIGIT [0-9] ! 29: ALPHA [A-Za-z] ! 30: ANUM [0-9A-Za-z] ! 31: NAMECHR [0-9A-Za-z./-] ! 32: ! 33: %% ! 34: "NET" { ! 35: yylval.number = KW_NET; ! 36: return (KEYWORD); ! 37: } ! 38: ! 39: "GATEWAY" { ! 40: yylval.number = KW_GATEWAY; ! 41: return (KEYWORD); ! 42: } ! 43: ! 44: "HOST" { ! 45: yylval.number = KW_HOST; ! 46: return (KEYWORD); ! 47: } ! 48: ! 49: {ALPHA}{NAMECHR}*{ANUM} { ! 50: yylval.namelist = newname(yytext); ! 51: return (NAME); ! 52: } ! 53: ! 54: {ALPHA} { ! 55: yylval.namelist = newname(yytext); ! 56: return (NAME); ! 57: } ! 58: ! 59: {DIGIT}+{ALPHA}{NAMECHR}* { ! 60: fprintf(stderr, "Warning: nonstandard name \"%s\"\n", ! 61: yytext); ! 62: yylval.namelist = newname(yytext); ! 63: return (NAME); ! 64: } ! 65: ! 66: {DIGIT}+ { ! 67: yylval.number = atoi(yytext); ! 68: return (NUMBER); ! 69: } ! 70: ! 71: "." return ('.'); ! 72: ":" return (':'); ! 73: "," return (','); ! 74: "/" return ('/'); ! 75: ";".* ; ! 76: "\n"{BLANK}+ ; ! 77: {BLANK}+ ; ! 78: "\n" return (END); ! 79: . fprintf(stderr, "Illegal char: '%s'\n", yytext); ! 80: ! 81: %% ! 82: ! 83: yywrap() ! 84: { ! 85: return (1); ! 86: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.