1 %{ 2 /* 3 * CDDL HEADER START 4 * 5 * The contents of this file are subject to the terms of the 6 * Common Development and Distribution License, Version 1.0 only 7 * (the "License"). You may not use this file except in compliance 8 * with the License. 9 * 10 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11 * or http://www.opensolaris.org/os/licensing. 12 * See the License for the specific language governing permissions 13 * and limitations under the License. 14 * 15 * When distributing Covered Code, include this CDDL HEADER in each 16 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17 * If applicable, add the following below this CDDL HEADER, with the 18 * fields enclosed by brackets "[]" replaced with your own identifying 19 * information: Portions Copyright [yyyy] [name of copyright owner] 20 * 21 * CDDL HEADER END 22 * 23 * Copyright (c) 1999 by Sun Microsystems, Inc. 24 * All rights reserved. 25 */ 26 27 #pragma ident "%Z%%M% %I% %E% SMI" 28 29 #include <locale.h> 30 #include "y.tab.h" 31 32 extern base; 33 34 int cmd_no = 1; 35 36 %} 37 38 %e 2000 39 40 WS [ \t] 41 42 %% 43 44 \n { cmd_no++; return NL; } 45 \. { return DOT; } 46 47 ;{WS}*:{WS}*base{WS}* { return BASE; } 48 ^{WS}*:{WS}*base{WS}* { return BASE; } 49 {WS}*:{WS}*block{WS}* { return BLOCK; } 50 ;{WS}*:{WS}*cd { return CD; } 51 ^{WS}*:{WS}*cd { return CD; } 52 :{WS}*directory{WS}* { return DIRECTORY; } 53 :{WS}*file{WS}* { return TFILE; } 54 ;{WS}*:{WS}*find{WS}* { return FIND; } 55 ^{WS}*:{WS}*find{WS}* { return FIND; } 56 {WS}*:{WS}*fill{WS}* { return FILL; } 57 :{WS}*inode{WS}* { return INODE; } 58 ;{WS}*:{WS}*ls { return LS; } 59 ^{WS}*:{WS}*ls { return LS; } 60 ;{WS}*:{WS}*override{WS}* { return OVERRIDE; } 61 ^{WS}*:{WS}*override{WS}* { return OVERRIDE; } 62 ;{WS}*:{WS}*prompt{WS}* { return PROMPT; } 63 ^{WS}*:{WS}*prompt{WS}* { return PROMPT; } 64 ;{WS}*:{WS}*pwd{WS}* { return PWD; } 65 ^{WS}*:{WS}*pwd{WS}* { return PWD; } 66 ;{WS}*:{WS}*quit{WS}* { return QUIT; } 67 ^{WS}*:{WS}*quit{WS}* { return QUIT; } 68 :{WS}*tag{WS}* { return TAG; } 69 ;{WS}*:{WS}*!{WS}* { return BANG; } 70 ^{WS}*:{WS}*!{WS}* { return BANG; } 71 72 73 :{WS}*avd { return AVD; } 74 :{WS}*mvds { return MVDS; } 75 :{WS}*rvds { return RVDS; } 76 :{WS}*ints { return INTS; } 77 :{WS}*fsds { return FSDS; } 78 :{WS}*root { return ROOT; } 79 80 :{WS}*attz { return ATTZ; } 81 :{WS}*atye { return ATYE; } 82 :{WS}*atmo { return ATMO; } 83 :{WS}*atda { return ATDA; } 84 :{WS}*atho { return ATHO; } 85 :{WS}*atmi { return ATMI; } 86 :{WS}*atse { return ATSE; } 87 :{WS}*atce { return ATCE; } 88 :{WS}*athu { return ATHU; } 89 :{WS}*atmic { return ATMIC; } 90 91 :{WS}*cttz { return CTTZ; } 92 :{WS}*ctye { return CTYE; } 93 :{WS}*ctmo { return CTMO; } 94 :{WS}*ctda { return CTDA; } 95 :{WS}*ctho { return CTHO; } 96 :{WS}*ctmi { return CTMI; } 97 :{WS}*ccte { return CTSE; } 98 :{WS}*ctce { return CTCE; } 99 :{WS}*cthu { return CTHU; } 100 :{WS}*ctmic { return CTMIC; } 101 102 :{WS}*mttz { return MTTZ; } 103 :{WS}*mtye { return MTYE; } 104 :{WS}*mtmo { return MTMO; } 105 :{WS}*mtda { return MTDA; } 106 :{WS}*mtho { return MTHO; } 107 :{WS}*mtmi { return MTMI; } 108 :{WS}*mtse { return MTSE; } 109 :{WS}*mtce { return MTCE; } 110 :{WS}*mthu { return MTHU; } 111 :{WS}*mtmic { return MTMIC; } 112 113 114 :{WS}*gid { return GID; } 115 :{WS}*ln { return LN; } 116 :{WS}*md { return MD; } 117 :{WS}*maj { return MAJ; } 118 :{WS}*min { return MIO; } 119 :{WS}*nm { return NM; } 120 :{WS}*sz { return SZ; } 121 :{WS}*uid { return UID; } 122 :{WS}*uniq { return UNIQ; } 123 124 125 [-0-9a-zA-Z._]+ { yylval.strval = yytext; return WORD; } 126 127 . { return yytext[0]; } 128 129 %% 130 131 yyerror() 132 { 133 fprintf(stderr, 134 gettext("Syntax error line : %d token : %s \n"), 135 cmd_no, yytext); 136 } 137 138 /* 139 :{WS}*fsds { return FSDS; } 140 :{WS}*root { return ROOT; } 141 */ 142