1 /* rpcgen - Generate XDR bindings automatically. -*- text -*-
2 * Copyright (C) 2008 Red Hat Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "rpcgen_int.h"
25 extern void yyerror (const char *str);
54 /* This is sometimes lumped together with the other types, but
55 * the special keyword void can only occur after "default:" in
75 stmt : ENUM IDENT '{' enum_values '}'
76 | STRUCT IDENT '{' decls '}'
77 | UNION IDENT SWITCH '(' decl ')' '{' union_cases '}'
79 | CONST IDENT '=' const
83 /* Declarations used inside structs and unions. eg. "int foo;" */
99 : type_ident IDENT '[' const ']'
103 : type_ident IDENT '<' const '>'
104 | type_ident IDENT '<' '>'
108 : type_ident '*' IDENT
114 | enum_values ',' enum_value
122 /* Case list inside a union. */
125 | union_cases union_case ';'
129 : CASE const ':' decl
134 /* Constants, which may be integer literals or refer to previously
135 * defined constants (using "const" keyword).
136 * XXX In future we should probably allow computed constants.
167 yyerror (const char *str)