xref: /onnv-gate/usr/src/cmd/agents/snmp/agent/config.l (revision 0:68f95e015346)
1*0Sstevel@tonic-gate %{
2*0Sstevel@tonic-gate /*
3*0Sstevel@tonic-gate  * CDDL HEADER START
4*0Sstevel@tonic-gate  *
5*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
6*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
7*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
8*0Sstevel@tonic-gate  * with the License.
9*0Sstevel@tonic-gate  *
10*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
12*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
13*0Sstevel@tonic-gate  * and limitations under the License.
14*0Sstevel@tonic-gate  *
15*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
16*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
18*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
19*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
20*0Sstevel@tonic-gate  *
21*0Sstevel@tonic-gate  * CDDL HEADER END
22*0Sstevel@tonic-gate  *
23*0Sstevel@tonic-gate  * Copyright 1996 Sun Microsystems, Inc.  All Rights Reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*0Sstevel@tonic-gate 
29*0Sstevel@tonic-gate /***** DEFINES *****/
30*0Sstevel@tonic-gate 
31*0Sstevel@tonic-gate /*
32*0Sstevel@tonic-gate #define DEBUG_LEX printf("\tLEX: %s(%d) at line %d\n", yytext, yyval, yylineno);
33*0Sstevel@tonic-gate */
34*0Sstevel@tonic-gate #define DEBUG_LEX
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate 
37*0Sstevel@tonic-gate /***** STATIC VARIABLES *****/
38*0Sstevel@tonic-gate 
39*0Sstevel@tonic-gate static int token_value;
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate 
42*0Sstevel@tonic-gate %}
43*0Sstevel@tonic-gate 
44*0Sstevel@tonic-gate %%
45*0Sstevel@tonic-gate 
46*0Sstevel@tonic-gate #.*\n					{ ; }
47*0Sstevel@tonic-gate [ \t\n]*				{ ; }
48*0Sstevel@tonic-gate 
49*0Sstevel@tonic-gate \{					{ DEBUG_LEX return OPENBRACKET; }
50*0Sstevel@tonic-gate \}					{ DEBUG_LEX return CLOSEBRACKET; }
51*0Sstevel@tonic-gate =					{ DEBUG_LEX return EQUAL; }
52*0Sstevel@tonic-gate \,					{ DEBUG_LEX return COMA; }
53*0Sstevel@tonic-gate 
54*0Sstevel@tonic-gate [cC][oO][mM][mM][uU][nN][iI][tT][iI][eE][sS] { DEBUG_LEX return COMMUNITIES; }
55*0Sstevel@tonic-gate [rR][eE][aA][dD][-][oO][nN][lL][yY]	{ DEBUG_LEX return READONLY; }
56*0Sstevel@tonic-gate [rR][eE][aA][dD][-][wW][rR][iI][tT][eE]	{ DEBUG_LEX return READWRITE; }
57*0Sstevel@tonic-gate 
58*0Sstevel@tonic-gate [mM][aA][nN][aA][gG][eE][rR][sS]	{ DEBUG_LEX return MANAGERS; }
59*0Sstevel@tonic-gate 
60*0Sstevel@tonic-gate [tT][rR][aA][pP][-][cC][oO][mM][mM][uU][nN][iI][tT][yY] { DEBUG_LEX return TRAPCOMMUNITY; }
61*0Sstevel@tonic-gate [tT][rR][aA][pP][-][rR][eE][cC][iI][pP][iI][eE][nN][tT][sS] { DEBUG_LEX return TRAPDESTINATORS; }
62*0Sstevel@tonic-gate 
63*0Sstevel@tonic-gate [a-zA-Z][_a-zA-Z0-9-]*			{ DEBUG_LEX return IDENTIFIER; }
64*0Sstevel@tonic-gate 
65*0Sstevel@tonic-gate .					{ error_exit("syntax error in %s at line %d: the token %s is not valid",
66*0Sstevel@tonic-gate 						config_file, yylineno, yytext);
67*0Sstevel@tonic-gate 					}
68*0Sstevel@tonic-gate 
69*0Sstevel@tonic-gate 
70*0Sstevel@tonic-gate %%
71*0Sstevel@tonic-gate 
72*0Sstevel@tonic-gate #undef input
73*0Sstevel@tonic-gate #undef unput
74*0Sstevel@tonic-gate #undef output
75*0Sstevel@tonic-gate 
76*0Sstevel@tonic-gate /*
77*0Sstevel@tonic-gate # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
78*0Sstevel@tonic-gate # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
79*0Sstevel@tonic-gate # define output(c) (void)putc(c,yyout)
80*0Sstevel@tonic-gate */
81*0Sstevel@tonic-gate 
82*0Sstevel@tonic-gate #define input() (((yytchar=*lexinput++)=='\n'?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
83*0Sstevel@tonic-gate #define unput(c) {yytchar= (c); if(yytchar=='\n')yylineno--;*--lexinput = yytchar;}
84*0Sstevel@tonic-gate #define output(c)
85*0Sstevel@tonic-gate 
86*0Sstevel@tonic-gate /*************************************************************************/
87*0Sstevel@tonic-gate 
88