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