xref: /illumos-gate/usr/src/cmd/fs.d/udfs/fsdb/fsdb_lex.l (revision 2a8bcb4e)
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 #include <locale.h>
277c478bd9Sstevel@tonic-gate #include "y.tab.h"
287c478bd9Sstevel@tonic-gate 
29*fe0e7ec4Smaheshvs extern int base;
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate int	cmd_no = 1;
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate %}
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate %e 2000
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate WS	[ \t]
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate %%
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate \n		{ cmd_no++; return NL; }
427c478bd9Sstevel@tonic-gate \.		{ return DOT; }
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*base{WS}*			{ return BASE; }
457c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*base{WS}*			{ return BASE; }
467c478bd9Sstevel@tonic-gate {WS}*:{WS}*block{WS}*			{ return BLOCK; }
477c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*cd				{ return CD; }
487c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*cd				{ return CD; }
497c478bd9Sstevel@tonic-gate :{WS}*directory{WS}*			{ return DIRECTORY; }
507c478bd9Sstevel@tonic-gate :{WS}*file{WS}*			{ return TFILE; }
517c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*find{WS}*			{ return FIND; }
527c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*find{WS}*			{ return FIND; }
537c478bd9Sstevel@tonic-gate {WS}*:{WS}*fill{WS}*			{ return FILL; }
547c478bd9Sstevel@tonic-gate :{WS}*inode{WS}*			{ return INODE; }
557c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*ls			{ return LS; }
567c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*ls			{ return LS; }
577c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*override{WS}*		{ return OVERRIDE; }
587c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*override{WS}*		{ return OVERRIDE; }
597c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*prompt{WS}*		{ return PROMPT; }
607c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*prompt{WS}*		{ return PROMPT; }
617c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*pwd{WS}*			{ return PWD; }
627c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*pwd{WS}*			{ return PWD; }
637c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*quit{WS}*			{ return QUIT; }
647c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*quit{WS}*			{ return QUIT; }
657c478bd9Sstevel@tonic-gate :{WS}*tag{WS}*			{ return TAG; }
667c478bd9Sstevel@tonic-gate ;{WS}*:{WS}*!{WS}*			{ return BANG; }
677c478bd9Sstevel@tonic-gate ^{WS}*:{WS}*!{WS}*			{ return BANG; }
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate :{WS}*avd			{ return AVD; }
717c478bd9Sstevel@tonic-gate :{WS}*mvds			{ return MVDS; }
727c478bd9Sstevel@tonic-gate :{WS}*rvds			{ return RVDS; }
737c478bd9Sstevel@tonic-gate :{WS}*ints			{ return INTS; }
747c478bd9Sstevel@tonic-gate :{WS}*fsds			{ return FSDS; }
757c478bd9Sstevel@tonic-gate :{WS}*root			{ return ROOT; }
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate :{WS}*attz			{ return ATTZ; }
787c478bd9Sstevel@tonic-gate :{WS}*atye			{ return ATYE; }
797c478bd9Sstevel@tonic-gate :{WS}*atmo			{ return ATMO; }
807c478bd9Sstevel@tonic-gate :{WS}*atda			{ return ATDA; }
817c478bd9Sstevel@tonic-gate :{WS}*atho			{ return ATHO; }
827c478bd9Sstevel@tonic-gate :{WS}*atmi			{ return ATMI; }
837c478bd9Sstevel@tonic-gate :{WS}*atse			{ return ATSE; }
847c478bd9Sstevel@tonic-gate :{WS}*atce			{ return ATCE; }
857c478bd9Sstevel@tonic-gate :{WS}*athu			{ return ATHU; }
867c478bd9Sstevel@tonic-gate :{WS}*atmic			{ return ATMIC; }
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate :{WS}*cttz			{ return CTTZ; }
897c478bd9Sstevel@tonic-gate :{WS}*ctye			{ return CTYE; }
907c478bd9Sstevel@tonic-gate :{WS}*ctmo			{ return CTMO; }
917c478bd9Sstevel@tonic-gate :{WS}*ctda			{ return CTDA; }
927c478bd9Sstevel@tonic-gate :{WS}*ctho			{ return CTHO; }
937c478bd9Sstevel@tonic-gate :{WS}*ctmi			{ return CTMI; }
947c478bd9Sstevel@tonic-gate :{WS}*ccte			{ return CTSE; }
957c478bd9Sstevel@tonic-gate :{WS}*ctce			{ return CTCE; }
967c478bd9Sstevel@tonic-gate :{WS}*cthu			{ return CTHU; }
977c478bd9Sstevel@tonic-gate :{WS}*ctmic			{ return CTMIC; }
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate :{WS}*mttz			{ return MTTZ; }
1007c478bd9Sstevel@tonic-gate :{WS}*mtye			{ return MTYE; }
1017c478bd9Sstevel@tonic-gate :{WS}*mtmo			{ return MTMO; }
1027c478bd9Sstevel@tonic-gate :{WS}*mtda			{ return MTDA; }
1037c478bd9Sstevel@tonic-gate :{WS}*mtho			{ return MTHO; }
1047c478bd9Sstevel@tonic-gate :{WS}*mtmi			{ return MTMI; }
1057c478bd9Sstevel@tonic-gate :{WS}*mtse			{ return MTSE; }
1067c478bd9Sstevel@tonic-gate :{WS}*mtce			{ return MTCE; }
1077c478bd9Sstevel@tonic-gate :{WS}*mthu			{ return MTHU; }
1087c478bd9Sstevel@tonic-gate :{WS}*mtmic			{ return MTMIC; }
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate :{WS}*gid			{ return GID; }
1127c478bd9Sstevel@tonic-gate :{WS}*ln			{ return LN; }
1137c478bd9Sstevel@tonic-gate :{WS}*md			{ return MD; }
1147c478bd9Sstevel@tonic-gate :{WS}*maj			{ return MAJ; }
1157c478bd9Sstevel@tonic-gate :{WS}*min			{ return MIO; }
1167c478bd9Sstevel@tonic-gate :{WS}*nm			{ return NM; }
1177c478bd9Sstevel@tonic-gate :{WS}*sz			{ return SZ; }
1187c478bd9Sstevel@tonic-gate :{WS}*uid			{ return UID; }
1197c478bd9Sstevel@tonic-gate :{WS}*uniq			{ return UNIQ; }
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate 
1227c478bd9Sstevel@tonic-gate [-0-9a-zA-Z._]+		{ yylval.strval = yytext; return WORD; }
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate .		{ return yytext[0]; }
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate %%
1277c478bd9Sstevel@tonic-gate 
128*fe0e7ec4Smaheshvs void
1297c478bd9Sstevel@tonic-gate yyerror()
1307c478bd9Sstevel@tonic-gate {
1317c478bd9Sstevel@tonic-gate 	fprintf(stderr,
1327c478bd9Sstevel@tonic-gate 		gettext("Syntax error line : %d token : %s \n"),
1337c478bd9Sstevel@tonic-gate 		cmd_no, yytext);
1347c478bd9Sstevel@tonic-gate }
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate /*
1377c478bd9Sstevel@tonic-gate :{WS}*fsds			{ return FSDS; }
1387c478bd9Sstevel@tonic-gate :{WS}*root			{ return ROOT; }
1397c478bd9Sstevel@tonic-gate */
140