%{
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "gnu_msgfmt.h"
#include "gnu_lex.h"
static int plural_index;
%}
%union {
char *str;
int num;
struct ch c;
}
%%
start :
;
| domain
| body
;
{
handle_domain($2);
}
;
{
handle_comment($1);
}
{
clear_state();
}
{
char *id_str;
och2 = $6;
clear_state();
}
{
/* NOTREACHED */
}
{
/* NOTRECHED */
}
{
/* NOTREACHED */
}
;
{
$$.str = $1;
}
{
char *str;
/* $1.len includes null-termination */
/* len doesn't include null-termination */
free($2);
}
;
{
$$ = $1;
}
{
char *plural_str;
int no;
$$.str = plural_str;
}
;
{
if ($3 != plural_index) {
/* NOTREACHED */
}
plural_index++;
$$.no = 1;
$$.num = $1;
}
;
%%
void
{
exit(1);
}