Annotation of 43BSD/etc/htable/scan.l, revision 1.1

1.1     ! root        1: %{
        !             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
        !             9: static char sccsid[] = "@(#)scan.l     5.4 (Berkeley) 4/19/86";
        !            10: #endif not lint
        !            11: 
        !            12: #include "y.tab.h"
        !            13: #include "htable.h"
        !            14: %}
        !            15: 
        !            16: BLANK  [ \t]
        !            17: DIGIT  [0-9]
        !            18: ALPHA  [A-Za-z]
        !            19: ANUM   [0-9A-Za-z]
        !            20: NAMECHR        [0-9A-Za-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: 
        !            43: {ALPHA}                {
        !            44:                        yylval.namelist = newname(yytext);
        !            45:                        return (NAME);
        !            46:                }
        !            47: 
        !            48: {DIGIT}+{ALPHA}{NAMECHR}* {
        !            49:                        fprintf(stderr, "Warning: nonstandard name \"%s\"\n",
        !            50:                                yytext);
        !            51:                        yylval.namelist = newname(yytext);
        !            52:                        return (NAME);
        !            53:                }
        !            54: 
        !            55: {DIGIT}+       {
        !            56:                        yylval.number = atoi(yytext);
        !            57:                        return (NUMBER);
        !            58:                }
        !            59: 
        !            60: "."            return ('.');
        !            61: ":"            return (':');
        !            62: ","            return (',');
        !            63: "/"            return ('/');
        !            64: ";".*          ;
        !            65: "\n"{BLANK}+   ;
        !            66: {BLANK}+       ;
        !            67: "\n"           return (END);
        !            68: .              fprintf(stderr, "Illegal char: '%s'\n", yytext);
        !            69: 
        !            70: %%
        !            71: 
        !            72: yywrap()
        !            73: {
        !            74:        return (1);
        !            75: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.