xref: /minix3/usr.bin/msgc/msgparse.y (revision d44a5ed1c177718aebe860f2bd736ea12fb19804)
1*d44a5ed1SThomas Cort /*	$NetBSD: msgparse.y,v 1.5 2012/03/06 16:26:01 mbalmer Exp $	*/
2*d44a5ed1SThomas Cort 
3*d44a5ed1SThomas Cort /*
4*d44a5ed1SThomas Cort  * Copyright 1997 Piermont Information Systems Inc.
5*d44a5ed1SThomas Cort  * All rights reserved.
6*d44a5ed1SThomas Cort  *
7*d44a5ed1SThomas Cort  * Written by Philip A. Nelson for Piermont Information Systems Inc.
8*d44a5ed1SThomas Cort  *
9*d44a5ed1SThomas Cort  * Redistribution and use in source and binary forms, with or without
10*d44a5ed1SThomas Cort  * modification, are permitted provided that the following conditions
11*d44a5ed1SThomas Cort  * are met:
12*d44a5ed1SThomas Cort  * 1. Redistributions of source code must retain the above copyright
13*d44a5ed1SThomas Cort  *    notice, this list of conditions and the following disclaimer.
14*d44a5ed1SThomas Cort  * 2. Redistributions in binary form must reproduce the above copyright
15*d44a5ed1SThomas Cort  *    notice, this list of conditions and the following disclaimer in the
16*d44a5ed1SThomas Cort  *    documentation and/or other materials provided with the distribution.
17*d44a5ed1SThomas Cort  * 3. The name of Piermont Information Systems Inc. may not be used to endorse
18*d44a5ed1SThomas Cort  *    or promote products derived from this software without specific prior
19*d44a5ed1SThomas Cort  *    written permission.
20*d44a5ed1SThomas Cort  *
21*d44a5ed1SThomas Cort  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
22*d44a5ed1SThomas Cort  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23*d44a5ed1SThomas Cort  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24*d44a5ed1SThomas Cort  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
25*d44a5ed1SThomas Cort  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26*d44a5ed1SThomas Cort  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27*d44a5ed1SThomas Cort  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28*d44a5ed1SThomas Cort  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29*d44a5ed1SThomas Cort  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30*d44a5ed1SThomas Cort  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31*d44a5ed1SThomas Cort  * THE POSSIBILITY OF SUCH DAMAGE.
32*d44a5ed1SThomas Cort  *
33*d44a5ed1SThomas Cort  */
34*d44a5ed1SThomas Cort 
35*d44a5ed1SThomas Cort %{
36*d44a5ed1SThomas Cort 
37*d44a5ed1SThomas Cort #include <sys/cdefs.h>
38*d44a5ed1SThomas Cort 
39*d44a5ed1SThomas Cort #if defined(__RCSID) && !defined(lint)
40*d44a5ed1SThomas Cort __RCSID("$NetBSD: msgparse.y,v 1.5 2012/03/06 16:26:01 mbalmer Exp $");
41*d44a5ed1SThomas Cort #endif
42*d44a5ed1SThomas Cort 
43*d44a5ed1SThomas Cort 
44*d44a5ed1SThomas Cort #include "defs.h"
45*d44a5ed1SThomas Cort 
46*d44a5ed1SThomas Cort %}
47*d44a5ed1SThomas Cort 
48*d44a5ed1SThomas Cort %union {
49*d44a5ed1SThomas Cort 	char *s_value;
50*d44a5ed1SThomas Cort }
51*d44a5ed1SThomas Cort 
52*d44a5ed1SThomas Cort 
53*d44a5ed1SThomas Cort %token MESSAGE
54*d44a5ed1SThomas Cort %token <s_value> NAME VALUE
55*d44a5ed1SThomas Cort 
56*d44a5ed1SThomas Cort %start list
57*d44a5ed1SThomas Cort 
58*d44a5ed1SThomas Cort %%
59*d44a5ed1SThomas Cort 
60*d44a5ed1SThomas Cort list	: /* empty */
61*d44a5ed1SThomas Cort 	| list msg
62*d44a5ed1SThomas Cort 	;
63*d44a5ed1SThomas Cort 
64*d44a5ed1SThomas Cort 
65*d44a5ed1SThomas Cort msg	: MESSAGE NAME VALUE
66*d44a5ed1SThomas Cort 		{ define_msg ($2, $3); }
67