4 * Copyright 2000, International Business Machines Corporation and others.
7 * This software has been released under the terms of the IBM Public
8 * License. For details, see the LICENSE file in the top-level source
9 * directory or online at http://www.openafs.org/dl/license10.html
12 * Lexical definitions recognized by package, the AFS
13 * workstation configuration facility.
16 #include <afsconfig.h>
17 #include <afs/param.h>
22 #include <sys/types.h>
40 P ("./"|"../"|"/")[^ \t\n#=\^\|\(\)\{\};]+
43 {W}*{COM} { dbgprint((stderr, "COMMENT\n"));
46 ^{W}*\n { dbgprint((stderr, "BLANKLINE\n"));
49 {W}+ { dbgprint((stderr, "WHITESPACE\n"));
53 dbgprint((stderr, "FILETYPE %c\n", yytext[0]));
57 return(REGTYPE); /* regular file */
60 return(DIRTYPE); /* directory */
63 return(LNKTYPE); /* symbolic link */
66 return(BLKTYPE); /* block device */
69 return(CHRTYPE); /* character device */
72 return(SOCKTYPE); /* socket */
75 return(PIPETYPE); /* named pipe */
80 {L} { dbgprint((stderr, "LETTER %c\n", yytext[0]));
81 yylval.chval = yytext[0]; return(LETTER); }
83 {P} { dbgprint((stderr, "PATHNAME %s\n", yytext));
84 yylval.strval = stash(yytext); return(PATHNAME); }
86 \/ { dbgprint((stderr, "PATHNAME %s\n", yytext));
87 yylval.strval = stash(yytext); return(PATHNAME); }
89 {D} { dbgprint((stderr, "DIGIT %c\n", yytext[0]));
90 yylval.usval = (u_short)(yytext[0] - '0'); return(DIGIT); }
92 \n { dbgprint((stderr, "NEWLINE\n"));
100 * Save string away in memory and return a pointer to it. If
101 * no space could be found, quit with a fatal error.
107 ptr = emalloc((unsigned)(strlen(s) + 1));
108 return(strcpy(ptr, s));