17c478bd9Sstevel@tonic-gate %{ 27c478bd9Sstevel@tonic-gate /* 37c478bd9Sstevel@tonic-gate * CDDL HEADER START 47c478bd9Sstevel@tonic-gate * 57c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 6*fe0e7ec4Smaheshvs * Common Development and Distribution License (the "License"). 7*fe0e7ec4Smaheshvs * You may not use this file except in compliance with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate * 22*fe0e7ec4Smaheshvs * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 23*fe0e7ec4Smaheshvs * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate #include <locale.h> 297c478bd9Sstevel@tonic-gate #include "y.tab.h" 307c478bd9Sstevel@tonic-gate 31*fe0e7ec4Smaheshvs extern int base; 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate int cmd_no = 1; 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate %} 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate %e 2000 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate WS [ \t] 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate %% 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate \n { cmd_no++; return NL; } 447c478bd9Sstevel@tonic-gate \. { return DOT; } 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*base{WS}* { return BASE; } 477c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*base{WS}* { return BASE; } 487c478bd9Sstevel@tonic-gate {WS}*:{WS}*block{WS}* { return BLOCK; } 497c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*cd { return CD; } 507c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*cd { return CD; } 517c478bd9Sstevel@tonic-gate :{WS}*directory{WS}* { return DIRECTORY; } 527c478bd9Sstevel@tonic-gate :{WS}*file{WS}* { return TFILE; } 537c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*find{WS}* { return FIND; } 547c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*find{WS}* { return FIND; } 557c478bd9Sstevel@tonic-gate {WS}*:{WS}*fill{WS}* { return FILL; } 567c478bd9Sstevel@tonic-gate :{WS}*inode{WS}* { return INODE; } 577c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*ls { return LS; } 587c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*ls { return LS; } 597c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*override{WS}* { return OVERRIDE; } 607c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*override{WS}* { return OVERRIDE; } 617c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*prompt{WS}* { return PROMPT; } 627c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*prompt{WS}* { return PROMPT; } 637c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*pwd{WS}* { return PWD; } 647c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*pwd{WS}* { return PWD; } 657c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*quit{WS}* { return QUIT; } 667c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*quit{WS}* { return QUIT; } 677c478bd9Sstevel@tonic-gate :{WS}*tag{WS}* { return TAG; } 687c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*!{WS}* { return BANG; } 697c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*!{WS}* { return BANG; } 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate :{WS}*avd { return AVD; } 737c478bd9Sstevel@tonic-gate :{WS}*mvds { return MVDS; } 747c478bd9Sstevel@tonic-gate :{WS}*rvds { return RVDS; } 757c478bd9Sstevel@tonic-gate :{WS}*ints { return INTS; } 767c478bd9Sstevel@tonic-gate :{WS}*fsds { return FSDS; } 777c478bd9Sstevel@tonic-gate :{WS}*root { return ROOT; } 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate :{WS}*attz { return ATTZ; } 807c478bd9Sstevel@tonic-gate :{WS}*atye { return ATYE; } 817c478bd9Sstevel@tonic-gate :{WS}*atmo { return ATMO; } 827c478bd9Sstevel@tonic-gate :{WS}*atda { return ATDA; } 837c478bd9Sstevel@tonic-gate :{WS}*atho { return ATHO; } 847c478bd9Sstevel@tonic-gate :{WS}*atmi { return ATMI; } 857c478bd9Sstevel@tonic-gate :{WS}*atse { return ATSE; } 867c478bd9Sstevel@tonic-gate :{WS}*atce { return ATCE; } 877c478bd9Sstevel@tonic-gate :{WS}*athu { return ATHU; } 887c478bd9Sstevel@tonic-gate :{WS}*atmic { return ATMIC; } 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate :{WS}*cttz { return CTTZ; } 917c478bd9Sstevel@tonic-gate :{WS}*ctye { return CTYE; } 927c478bd9Sstevel@tonic-gate :{WS}*ctmo { return CTMO; } 937c478bd9Sstevel@tonic-gate :{WS}*ctda { return CTDA; } 947c478bd9Sstevel@tonic-gate :{WS}*ctho { return CTHO; } 957c478bd9Sstevel@tonic-gate :{WS}*ctmi { return CTMI; } 967c478bd9Sstevel@tonic-gate :{WS}*ccte { return CTSE; } 977c478bd9Sstevel@tonic-gate :{WS}*ctce { return CTCE; } 987c478bd9Sstevel@tonic-gate :{WS}*cthu { return CTHU; } 997c478bd9Sstevel@tonic-gate :{WS}*ctmic { return CTMIC; } 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate :{WS}*mttz { return MTTZ; } 1027c478bd9Sstevel@tonic-gate :{WS}*mtye { return MTYE; } 1037c478bd9Sstevel@tonic-gate :{WS}*mtmo { return MTMO; } 1047c478bd9Sstevel@tonic-gate :{WS}*mtda { return MTDA; } 1057c478bd9Sstevel@tonic-gate :{WS}*mtho { return MTHO; } 1067c478bd9Sstevel@tonic-gate :{WS}*mtmi { return MTMI; } 1077c478bd9Sstevel@tonic-gate :{WS}*mtse { return MTSE; } 1087c478bd9Sstevel@tonic-gate :{WS}*mtce { return MTCE; } 1097c478bd9Sstevel@tonic-gate :{WS}*mthu { return MTHU; } 1107c478bd9Sstevel@tonic-gate :{WS}*mtmic { return MTMIC; } 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate 1137c478bd9Sstevel@tonic-gate :{WS}*gid { return GID; } 1147c478bd9Sstevel@tonic-gate :{WS}*ln { return LN; } 1157c478bd9Sstevel@tonic-gate :{WS}*md { return MD; } 1167c478bd9Sstevel@tonic-gate :{WS}*maj { return MAJ; } 1177c478bd9Sstevel@tonic-gate :{WS}*min { return MIO; } 1187c478bd9Sstevel@tonic-gate :{WS}*nm { return NM; } 1197c478bd9Sstevel@tonic-gate :{WS}*sz { return SZ; } 1207c478bd9Sstevel@tonic-gate :{WS}*uid { return UID; } 1217c478bd9Sstevel@tonic-gate :{WS}*uniq { return UNIQ; } 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate [-0-9a-zA-Z._]+ { yylval.strval = yytext; return WORD; } 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate . { return yytext[0]; } 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gate %% 1297c478bd9Sstevel@tonic-gate 130*fe0e7ec4Smaheshvs void 1317c478bd9Sstevel@tonic-gate yyerror() 1327c478bd9Sstevel@tonic-gate { 1337c478bd9Sstevel@tonic-gate fprintf(stderr, 1347c478bd9Sstevel@tonic-gate gettext("Syntax error line : %d token : %s \n"), 1357c478bd9Sstevel@tonic-gate cmd_no, yytext); 1367c478bd9Sstevel@tonic-gate } 1377c478bd9Sstevel@tonic-gate 1387c478bd9Sstevel@tonic-gate /* 1397c478bd9Sstevel@tonic-gate :{WS}*fsds { return FSDS; } 1407c478bd9Sstevel@tonic-gate :{WS}*root { return ROOT; } 1417c478bd9Sstevel@tonic-gate */ 142