xref: /onnv-gate/usr/src/cmd/agents/snmp/agent/config.l (revision 0:68f95e015346)
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 1996 Sun Microsystems, Inc.  All Rights Reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /***** DEFINES *****/
30 
31 /*
32 #define DEBUG_LEX printf("\tLEX: %s(%d) at line %d\n", yytext, yyval, yylineno);
33 */
34 #define DEBUG_LEX
35 
36 
37 /***** STATIC VARIABLES *****/
38 
39 static int token_value;
40 
41 
42 %}
43 
44 %%
45 
46 #.*\n					{ ; }
47 [ \t\n]*				{ ; }
48 
49 \{					{ DEBUG_LEX return OPENBRACKET; }
50 \}					{ DEBUG_LEX return CLOSEBRACKET; }
51 =					{ DEBUG_LEX return EQUAL; }
52 \,					{ DEBUG_LEX return COMA; }
53 
54 [cC][oO][mM][mM][uU][nN][iI][tT][iI][eE][sS] { DEBUG_LEX return COMMUNITIES; }
55 [rR][eE][aA][dD][-][oO][nN][lL][yY]	{ DEBUG_LEX return READONLY; }
56 [rR][eE][aA][dD][-][wW][rR][iI][tT][eE]	{ DEBUG_LEX return READWRITE; }
57 
58 [mM][aA][nN][aA][gG][eE][rR][sS]	{ DEBUG_LEX return MANAGERS; }
59 
60 [tT][rR][aA][pP][-][cC][oO][mM][mM][uU][nN][iI][tT][yY] { DEBUG_LEX return TRAPCOMMUNITY; }
61 [tT][rR][aA][pP][-][rR][eE][cC][iI][pP][iI][eE][nN][tT][sS] { DEBUG_LEX return TRAPDESTINATORS; }
62 
63 [a-zA-Z][_a-zA-Z0-9-]*			{ DEBUG_LEX return IDENTIFIER; }
64 
65 .					{ error_exit("syntax error in %s at line %d: the token %s is not valid",
66 						config_file, yylineno, yytext);
67 					}
68 
69 
70 %%
71 
72 #undef input
73 #undef unput
74 #undef output
75 
76 /*
77 # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
78 # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
79 # define output(c) (void)putc(c,yyout)
80 */
81 
82 #define input() (((yytchar=*lexinput++)=='\n'?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
83 #define unput(c) {yytchar= (c); if(yytchar=='\n')yylineno--;*--lexinput = yytchar;}
84 #define output(c)
85 
86 /*************************************************************************/
87 
88