1*5c2921b0SApple OSS Distributions /*
2*5c2921b0SApple OSS Distributions * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3*5c2921b0SApple OSS Distributions *
4*5c2921b0SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*5c2921b0SApple OSS Distributions *
6*5c2921b0SApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code
7*5c2921b0SApple OSS Distributions * as defined in and that are subject to the Apple Public Source License
8*5c2921b0SApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in
9*5c2921b0SApple OSS Distributions * compliance with the License. The rights granted to you under the License
10*5c2921b0SApple OSS Distributions * may not be used to create, or enable the creation or redistribution of,
11*5c2921b0SApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to
12*5c2921b0SApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any
13*5c2921b0SApple OSS Distributions * terms of an Apple operating system software license agreement.
14*5c2921b0SApple OSS Distributions *
15*5c2921b0SApple OSS Distributions * Please obtain a copy of the License at
16*5c2921b0SApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*5c2921b0SApple OSS Distributions *
18*5c2921b0SApple OSS Distributions * The Original Code and all software distributed under the License are
19*5c2921b0SApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*5c2921b0SApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*5c2921b0SApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*5c2921b0SApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*5c2921b0SApple OSS Distributions * Please see the License for the specific language governing rights and
24*5c2921b0SApple OSS Distributions * limitations under the License.
25*5c2921b0SApple OSS Distributions *
26*5c2921b0SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*5c2921b0SApple OSS Distributions */
28*5c2921b0SApple OSS Distributions
29*5c2921b0SApple OSS Distributions /* OSUnserialize.y created by rsulack on Nov 21 1998 */
30*5c2921b0SApple OSS Distributions
31*5c2921b0SApple OSS Distributions // "classic" parser for unserializing OSContainer objects
32*5c2921b0SApple OSS Distributions //
33*5c2921b0SApple OSS Distributions // XXX - this code should really be removed!
34*5c2921b0SApple OSS Distributions // - the XML format is now prefered
35*5c2921b0SApple OSS Distributions // - this code leaks on syntax errors, the XML doesn't
36*5c2921b0SApple OSS Distributions // - "classic" looks, reads, ... much better than XML :-(
37*5c2921b0SApple OSS Distributions // - well except the XML is more efficent on OSData
38*5c2921b0SApple OSS Distributions //
39*5c2921b0SApple OSS Distributions //
40*5c2921b0SApple OSS Distributions // to build :
41*5c2921b0SApple OSS Distributions // bison -p OSUnserialize OSUnserialize.y
42*5c2921b0SApple OSS Distributions // head -50 OSUnserialize.y > OSUnserialize.cpp
43*5c2921b0SApple OSS Distributions // sed -e "s/stdio.h/stddef.h/" < OSUnserialize.tab.c >> OSUnserialize.cpp
44*5c2921b0SApple OSS Distributions //
45*5c2921b0SApple OSS Distributions // when changing code check in both OSUnserialize.y and OSUnserialize.cpp
46*5c2921b0SApple OSS Distributions //
47*5c2921b0SApple OSS Distributions //
48*5c2921b0SApple OSS Distributions //
49*5c2921b0SApple OSS Distributions //
50*5c2921b0SApple OSS Distributions // DO NOT EDIT OSUnserialize.tab.cpp!
51*5c2921b0SApple OSS Distributions /* A Bison parser, made by GNU Bison 2.3. */
52*5c2921b0SApple OSS Distributions
53*5c2921b0SApple OSS Distributions /* Skeleton implementation for Bison's Yacc-like parsers in C
54*5c2921b0SApple OSS Distributions *
55*5c2921b0SApple OSS Distributions * Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
56*5c2921b0SApple OSS Distributions * Free Software Foundation, Inc.
57*5c2921b0SApple OSS Distributions *
58*5c2921b0SApple OSS Distributions * This program is free software; you can redistribute it and/or modify
59*5c2921b0SApple OSS Distributions * it under the terms of the GNU General Public License as published by
60*5c2921b0SApple OSS Distributions * the Free Software Foundation; either version 2, or (at your option)
61*5c2921b0SApple OSS Distributions * any later version.
62*5c2921b0SApple OSS Distributions *
63*5c2921b0SApple OSS Distributions * This program is distributed in the hope that it will be useful,
64*5c2921b0SApple OSS Distributions * but WITHOUT ANY WARRANTY; without even the implied warranty of
65*5c2921b0SApple OSS Distributions * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66*5c2921b0SApple OSS Distributions * GNU General Public License for more details.
67*5c2921b0SApple OSS Distributions *
68*5c2921b0SApple OSS Distributions * You should have received a copy of the GNU General Public License
69*5c2921b0SApple OSS Distributions * along with this program; if not, write to the Free Software
70*5c2921b0SApple OSS Distributions * Foundation, Inc., 51 Franklin Street, Fifth Floor,
71*5c2921b0SApple OSS Distributions * Boston, MA 02110-1301, USA. */
72*5c2921b0SApple OSS Distributions
73*5c2921b0SApple OSS Distributions /* As a special exception, you may create a larger work that contains
74*5c2921b0SApple OSS Distributions * part or all of the Bison parser skeleton and distribute that work
75*5c2921b0SApple OSS Distributions * under terms of your choice, so long as that work isn't itself a
76*5c2921b0SApple OSS Distributions * parser generator using the skeleton or a modified version thereof
77*5c2921b0SApple OSS Distributions * as a parser skeleton. Alternatively, if you modify or redistribute
78*5c2921b0SApple OSS Distributions * the parser skeleton itself, you may (at your option) remove this
79*5c2921b0SApple OSS Distributions * special exception, which will cause the skeleton and the resulting
80*5c2921b0SApple OSS Distributions * Bison output files to be licensed under the GNU General Public
81*5c2921b0SApple OSS Distributions * License without this special exception.
82*5c2921b0SApple OSS Distributions *
83*5c2921b0SApple OSS Distributions * This special exception was added by the Free Software Foundation in
84*5c2921b0SApple OSS Distributions * version 2.2 of Bison. */
85*5c2921b0SApple OSS Distributions
86*5c2921b0SApple OSS Distributions /* C LALR(1) parser skeleton written by Richard Stallman, by
87*5c2921b0SApple OSS Distributions * simplifying the original so-called "semantic" parser. */
88*5c2921b0SApple OSS Distributions
89*5c2921b0SApple OSS Distributions /* All symbols defined below should begin with yy or YY, to avoid
90*5c2921b0SApple OSS Distributions * infringing on user name space. This should be done even for local
91*5c2921b0SApple OSS Distributions * variables, as they might otherwise be expanded by user macros.
92*5c2921b0SApple OSS Distributions * There are some unavoidable exceptions within include files to
93*5c2921b0SApple OSS Distributions * define necessary library symbols; they are noted "INFRINGES ON
94*5c2921b0SApple OSS Distributions * USER NAME SPACE" below. */
95*5c2921b0SApple OSS Distributions
96*5c2921b0SApple OSS Distributions /* Identify Bison output. */
97*5c2921b0SApple OSS Distributions #define YYBISON 1
98*5c2921b0SApple OSS Distributions
99*5c2921b0SApple OSS Distributions /* Bison version. */
100*5c2921b0SApple OSS Distributions #define YYBISON_VERSION "2.3"
101*5c2921b0SApple OSS Distributions
102*5c2921b0SApple OSS Distributions /* Skeleton name. */
103*5c2921b0SApple OSS Distributions #define YYSKELETON_NAME "yacc.c"
104*5c2921b0SApple OSS Distributions
105*5c2921b0SApple OSS Distributions /* Pure parsers. */
106*5c2921b0SApple OSS Distributions #define YYPURE 0
107*5c2921b0SApple OSS Distributions
108*5c2921b0SApple OSS Distributions /* Using locations. */
109*5c2921b0SApple OSS Distributions #define YYLSP_NEEDED 0
110*5c2921b0SApple OSS Distributions
111*5c2921b0SApple OSS Distributions /* Substitute the variable and function names. */
112*5c2921b0SApple OSS Distributions #define yyparse OSUnserializeparse
113*5c2921b0SApple OSS Distributions #define yylex OSUnserializelex
114*5c2921b0SApple OSS Distributions #define yyerror OSUnserializeerror
115*5c2921b0SApple OSS Distributions #define yylval OSUnserializelval
116*5c2921b0SApple OSS Distributions #define yychar OSUnserializechar
117*5c2921b0SApple OSS Distributions #define yydebug OSUnserializedebug
118*5c2921b0SApple OSS Distributions #define yynerrs OSUnserializenerrs
119*5c2921b0SApple OSS Distributions
120*5c2921b0SApple OSS Distributions
121*5c2921b0SApple OSS Distributions /* Tokens. */
122*5c2921b0SApple OSS Distributions #ifndef YYTOKENTYPE
123*5c2921b0SApple OSS Distributions # define YYTOKENTYPE
124*5c2921b0SApple OSS Distributions /* Put the tokens into the symbol table, so that GDB and other debuggers
125*5c2921b0SApple OSS Distributions * know about them. */
126*5c2921b0SApple OSS Distributions enum yytokentype {
127*5c2921b0SApple OSS Distributions NUMBER = 258,
128*5c2921b0SApple OSS Distributions STRING = 259,
129*5c2921b0SApple OSS Distributions DATA = 260,
130*5c2921b0SApple OSS Distributions BOOLEAN = 261,
131*5c2921b0SApple OSS Distributions SYNTAX_ERROR = 262
132*5c2921b0SApple OSS Distributions };
133*5c2921b0SApple OSS Distributions #endif
134*5c2921b0SApple OSS Distributions /* Tokens. */
135*5c2921b0SApple OSS Distributions #define NUMBER 258
136*5c2921b0SApple OSS Distributions #define STRING 259
137*5c2921b0SApple OSS Distributions #define DATA 260
138*5c2921b0SApple OSS Distributions #define BOOLEAN 261
139*5c2921b0SApple OSS Distributions #define SYNTAX_ERROR 262
140*5c2921b0SApple OSS Distributions
141*5c2921b0SApple OSS Distributions
142*5c2921b0SApple OSS Distributions
143*5c2921b0SApple OSS Distributions
144*5c2921b0SApple OSS Distributions /* Copy the first part of user declarations. */
145*5c2921b0SApple OSS Distributions #line 60 "OSUnserialize.y"
146*5c2921b0SApple OSS Distributions
147*5c2921b0SApple OSS Distributions #include <libkern/c++/OSMetaClass.h>
148*5c2921b0SApple OSS Distributions #include <libkern/c++/OSContainers.h>
149*5c2921b0SApple OSS Distributions #include <libkern/c++/OSLib.h>
150*5c2921b0SApple OSS Distributions
151*5c2921b0SApple OSS Distributions typedef struct object {
152*5c2921b0SApple OSS Distributions struct object *next;
153*5c2921b0SApple OSS Distributions struct object *prev;
154*5c2921b0SApple OSS Distributions void *object;
155*5c2921b0SApple OSS Distributions int size; // for data
156*5c2921b0SApple OSS Distributions union {
157*5c2921b0SApple OSS Distributions void *key; // for dictionary
158*5c2921b0SApple OSS Distributions long long offset; // for offset
159*5c2921b0SApple OSS Distributions } u;
160*5c2921b0SApple OSS Distributions } object_t;
161*5c2921b0SApple OSS Distributions
162*5c2921b0SApple OSS Distributions static int yyerror(const char *s);
163*5c2921b0SApple OSS Distributions static int yylex();
164*5c2921b0SApple OSS Distributions
165*5c2921b0SApple OSS Distributions static object_t * newObject();
166*5c2921b0SApple OSS Distributions static void freeObject(object_t *o);
167*5c2921b0SApple OSS Distributions
168*5c2921b0SApple OSS Distributions static OSObject *buildOSDictionary(object_t *);
169*5c2921b0SApple OSS Distributions static OSObject *buildOSArray(object_t *);
170*5c2921b0SApple OSS Distributions static OSObject *buildOSSet(object_t *);
171*5c2921b0SApple OSS Distributions static OSObject *buildOSString(object_t *);
172*5c2921b0SApple OSS Distributions static OSObject *buildOSData(object_t *);
173*5c2921b0SApple OSS Distributions static OSObject *buildOSOffset(object_t *);
174*5c2921b0SApple OSS Distributions static OSObject *buildOSBoolean(object_t *o);
175*5c2921b0SApple OSS Distributions
176*5c2921b0SApple OSS Distributions static void rememberObject(int, object_t *);
177*5c2921b0SApple OSS Distributions static OSObject *retrieveObject(int);
178*5c2921b0SApple OSS Distributions
179*5c2921b0SApple OSS Distributions // temp variable to use during parsing
180*5c2921b0SApple OSS Distributions static object_t *oo;
181*5c2921b0SApple OSS Distributions
182*5c2921b0SApple OSS Distributions // resultant object of parsed text
183*5c2921b0SApple OSS Distributions static OSObject *parsedObject;
184*5c2921b0SApple OSS Distributions
185*5c2921b0SApple OSS Distributions #define YYSTYPE object_t *
186*5c2921b0SApple OSS Distributions
187*5c2921b0SApple OSS Distributions __BEGIN_DECLS
188*5c2921b0SApple OSS Distributions #include <kern/kalloc.h>
189*5c2921b0SApple OSS Distributions __END_DECLS
190*5c2921b0SApple OSS Distributions
191*5c2921b0SApple OSS Distributions // Omit from static analysis.
192*5c2921b0SApple OSS Distributions #ifndef __clang_analyzer__
193*5c2921b0SApple OSS Distributions
194*5c2921b0SApple OSS Distributions #define malloc(size) malloc_impl(size)
195*5c2921b0SApple OSS Distributions #define malloc_type(type) kalloc_type(type, Z_WAITOK)
196*5c2921b0SApple OSS Distributions static inline void *
malloc_impl(size_t size)197*5c2921b0SApple OSS Distributions malloc_impl(size_t size)
198*5c2921b0SApple OSS Distributions {
199*5c2921b0SApple OSS Distributions if (size == 0) {
200*5c2921b0SApple OSS Distributions return NULL;
201*5c2921b0SApple OSS Distributions }
202*5c2921b0SApple OSS Distributions return kalloc_data(size,
203*5c2921b0SApple OSS Distributions Z_VM_TAG_BT(Z_WAITOK_ZERO, VM_KERN_MEMORY_LIBKERN));
204*5c2921b0SApple OSS Distributions }
205*5c2921b0SApple OSS Distributions
206*5c2921b0SApple OSS Distributions #define free(addr) free_impl(addr)
207*5c2921b0SApple OSS Distributions #define free_type(type, addr) kfree_type(type, addr)
208*5c2921b0SApple OSS Distributions static inline void
free_impl(void * addr)209*5c2921b0SApple OSS Distributions free_impl(void *addr)
210*5c2921b0SApple OSS Distributions {
211*5c2921b0SApple OSS Distributions kfree_data_addr(addr);
212*5c2921b0SApple OSS Distributions }
213*5c2921b0SApple OSS Distributions static inline void
safe_free(void * addr,size_t size)214*5c2921b0SApple OSS Distributions safe_free(void *addr, size_t size)
215*5c2921b0SApple OSS Distributions {
216*5c2921b0SApple OSS Distributions kfree_data(addr, size);
217*5c2921b0SApple OSS Distributions }
218*5c2921b0SApple OSS Distributions
219*5c2921b0SApple OSS Distributions #define realloc(addr, osize, nsize) realloc_impl(addr, osize, nsize)
220*5c2921b0SApple OSS Distributions static inline void *
realloc_impl(void * addr,size_t osize,size_t nsize)221*5c2921b0SApple OSS Distributions realloc_impl(void *addr, size_t osize, size_t nsize)
222*5c2921b0SApple OSS Distributions {
223*5c2921b0SApple OSS Distributions return krealloc_data(addr, osize, nsize,
224*5c2921b0SApple OSS Distributions Z_VM_TAG_BT(Z_WAITOK_ZERO, VM_KERN_MEMORY_LIBKERN));
225*5c2921b0SApple OSS Distributions }
226*5c2921b0SApple OSS Distributions
227*5c2921b0SApple OSS Distributions
228*5c2921b0SApple OSS Distributions
229*5c2921b0SApple OSS Distributions /* Enabling traces. */
230*5c2921b0SApple OSS Distributions #ifndef YYDEBUG
231*5c2921b0SApple OSS Distributions # define YYDEBUG 0
232*5c2921b0SApple OSS Distributions #endif
233*5c2921b0SApple OSS Distributions
234*5c2921b0SApple OSS Distributions /* Enabling verbose error messages. */
235*5c2921b0SApple OSS Distributions #ifdef YYERROR_VERBOSE
236*5c2921b0SApple OSS Distributions # undef YYERROR_VERBOSE
237*5c2921b0SApple OSS Distributions # define YYERROR_VERBOSE 1
238*5c2921b0SApple OSS Distributions #else
239*5c2921b0SApple OSS Distributions # define YYERROR_VERBOSE 0
240*5c2921b0SApple OSS Distributions #endif
241*5c2921b0SApple OSS Distributions
242*5c2921b0SApple OSS Distributions /* Enabling the token table. */
243*5c2921b0SApple OSS Distributions #ifndef YYTOKEN_TABLE
244*5c2921b0SApple OSS Distributions # define YYTOKEN_TABLE 0
245*5c2921b0SApple OSS Distributions #endif
246*5c2921b0SApple OSS Distributions
247*5c2921b0SApple OSS Distributions #if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
248*5c2921b0SApple OSS Distributions typedef int YYSTYPE;
249*5c2921b0SApple OSS Distributions # define yystype YYSTYPE /* obsolescent; will be withdrawn */
250*5c2921b0SApple OSS Distributions # define YYSTYPE_IS_DECLARED 1
251*5c2921b0SApple OSS Distributions # define YYSTYPE_IS_TRIVIAL 1
252*5c2921b0SApple OSS Distributions #endif
253*5c2921b0SApple OSS Distributions
254*5c2921b0SApple OSS Distributions
255*5c2921b0SApple OSS Distributions
256*5c2921b0SApple OSS Distributions /* Copy the second part of user declarations. */
257*5c2921b0SApple OSS Distributions
258*5c2921b0SApple OSS Distributions
259*5c2921b0SApple OSS Distributions /* Line 216 of yacc.c. */
260*5c2921b0SApple OSS Distributions #line 229 "OSUnserialize.tab.c"
261*5c2921b0SApple OSS Distributions
262*5c2921b0SApple OSS Distributions #ifdef short
263*5c2921b0SApple OSS Distributions # undef short
264*5c2921b0SApple OSS Distributions #endif
265*5c2921b0SApple OSS Distributions
266*5c2921b0SApple OSS Distributions #ifdef YYTYPE_UINT8
267*5c2921b0SApple OSS Distributions typedef YYTYPE_UINT8 yytype_uint8;
268*5c2921b0SApple OSS Distributions #else
269*5c2921b0SApple OSS Distributions typedef unsigned char yytype_uint8;
270*5c2921b0SApple OSS Distributions #endif
271*5c2921b0SApple OSS Distributions
272*5c2921b0SApple OSS Distributions #ifdef YYTYPE_INT8
273*5c2921b0SApple OSS Distributions typedef YYTYPE_INT8 yytype_int8;
274*5c2921b0SApple OSS Distributions #elif (defined __STDC__ || defined __C99__FUNC__ \
275*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
276*5c2921b0SApple OSS Distributions typedef signed char yytype_int8;
277*5c2921b0SApple OSS Distributions #else
278*5c2921b0SApple OSS Distributions typedef short int yytype_int8;
279*5c2921b0SApple OSS Distributions #endif
280*5c2921b0SApple OSS Distributions
281*5c2921b0SApple OSS Distributions #ifdef YYTYPE_UINT16
282*5c2921b0SApple OSS Distributions typedef YYTYPE_UINT16 yytype_uint16;
283*5c2921b0SApple OSS Distributions #else
284*5c2921b0SApple OSS Distributions typedef unsigned short int yytype_uint16;
285*5c2921b0SApple OSS Distributions #endif
286*5c2921b0SApple OSS Distributions
287*5c2921b0SApple OSS Distributions #ifdef YYTYPE_INT16
288*5c2921b0SApple OSS Distributions typedef YYTYPE_INT16 yytype_int16;
289*5c2921b0SApple OSS Distributions #else
290*5c2921b0SApple OSS Distributions typedef short int yytype_int16;
291*5c2921b0SApple OSS Distributions #endif
292*5c2921b0SApple OSS Distributions
293*5c2921b0SApple OSS Distributions #ifndef YYSIZE_T
294*5c2921b0SApple OSS Distributions # ifdef __SIZE_TYPE__
295*5c2921b0SApple OSS Distributions # define YYSIZE_T __SIZE_TYPE__
296*5c2921b0SApple OSS Distributions # elif defined size_t
297*5c2921b0SApple OSS Distributions # define YYSIZE_T size_t
298*5c2921b0SApple OSS Distributions # elif !defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
299*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
300*5c2921b0SApple OSS Distributions # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
301*5c2921b0SApple OSS Distributions # define YYSIZE_T size_t
302*5c2921b0SApple OSS Distributions # else
303*5c2921b0SApple OSS Distributions # define YYSIZE_T unsigned int
304*5c2921b0SApple OSS Distributions # endif
305*5c2921b0SApple OSS Distributions #endif
306*5c2921b0SApple OSS Distributions
307*5c2921b0SApple OSS Distributions #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
308*5c2921b0SApple OSS Distributions
309*5c2921b0SApple OSS Distributions #ifndef YY_
310*5c2921b0SApple OSS Distributions # if defined YYENABLE_NLS && YYENABLE_NLS
311*5c2921b0SApple OSS Distributions # if ENABLE_NLS
312*5c2921b0SApple OSS Distributions # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
313*5c2921b0SApple OSS Distributions # define YY_(msgid) dgettext ("bison-runtime", msgid)
314*5c2921b0SApple OSS Distributions # endif
315*5c2921b0SApple OSS Distributions # endif
316*5c2921b0SApple OSS Distributions # ifndef YY_
317*5c2921b0SApple OSS Distributions # define YY_(msgid) msgid
318*5c2921b0SApple OSS Distributions # endif
319*5c2921b0SApple OSS Distributions #endif
320*5c2921b0SApple OSS Distributions
321*5c2921b0SApple OSS Distributions /* Suppress unused-variable warnings by "using" E. */
322*5c2921b0SApple OSS Distributions #if !defined lint || defined __GNUC__
323*5c2921b0SApple OSS Distributions # define YYUSE(e) ((void) (e))
324*5c2921b0SApple OSS Distributions #else
325*5c2921b0SApple OSS Distributions # define YYUSE(e) /* empty */
326*5c2921b0SApple OSS Distributions #endif
327*5c2921b0SApple OSS Distributions
328*5c2921b0SApple OSS Distributions /* Identity function, used to suppress warnings about constant conditions. */
329*5c2921b0SApple OSS Distributions #ifndef lint
330*5c2921b0SApple OSS Distributions # define YYID(n) (n)
331*5c2921b0SApple OSS Distributions #else
332*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
333*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
334*5c2921b0SApple OSS Distributions static int
YYID(int i)335*5c2921b0SApple OSS Distributions YYID(int i)
336*5c2921b0SApple OSS Distributions #else
337*5c2921b0SApple OSS Distributions static int
338*5c2921b0SApple OSS Distributions YYID(i)
339*5c2921b0SApple OSS Distributions int i;
340*5c2921b0SApple OSS Distributions #endif
341*5c2921b0SApple OSS Distributions {
342*5c2921b0SApple OSS Distributions return i;
343*5c2921b0SApple OSS Distributions }
344*5c2921b0SApple OSS Distributions #endif
345*5c2921b0SApple OSS Distributions
346*5c2921b0SApple OSS Distributions #if !defined yyoverflow || YYERROR_VERBOSE
347*5c2921b0SApple OSS Distributions
348*5c2921b0SApple OSS Distributions /* The parser invokes alloca or malloc; define the necessary symbols. */
349*5c2921b0SApple OSS Distributions
350*5c2921b0SApple OSS Distributions # ifdef YYSTACK_USE_ALLOCA
351*5c2921b0SApple OSS Distributions # if YYSTACK_USE_ALLOCA
352*5c2921b0SApple OSS Distributions # ifdef __GNUC__
353*5c2921b0SApple OSS Distributions # define YYSTACK_ALLOC __builtin_alloca
354*5c2921b0SApple OSS Distributions # elif defined __BUILTIN_VA_ARG_INCR
355*5c2921b0SApple OSS Distributions # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
356*5c2921b0SApple OSS Distributions # elif defined _AIX
357*5c2921b0SApple OSS Distributions # define YYSTACK_ALLOC __alloca
358*5c2921b0SApple OSS Distributions # elif defined _MSC_VER
359*5c2921b0SApple OSS Distributions # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
360*5c2921b0SApple OSS Distributions # define alloca _alloca
361*5c2921b0SApple OSS Distributions # else
362*5c2921b0SApple OSS Distributions # define YYSTACK_ALLOC alloca
363*5c2921b0SApple OSS Distributions # if !defined _ALLOCA_H && !defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
364*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
365*5c2921b0SApple OSS Distributions # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
366*5c2921b0SApple OSS Distributions # ifndef _STDLIB_H
367*5c2921b0SApple OSS Distributions # define _STDLIB_H 1
368*5c2921b0SApple OSS Distributions # endif
369*5c2921b0SApple OSS Distributions # endif
370*5c2921b0SApple OSS Distributions # endif
371*5c2921b0SApple OSS Distributions # endif
372*5c2921b0SApple OSS Distributions # endif
373*5c2921b0SApple OSS Distributions
374*5c2921b0SApple OSS Distributions # ifdef YYSTACK_ALLOC
375*5c2921b0SApple OSS Distributions /* Pacify GCC's `empty if-body' warning. */
376*5c2921b0SApple OSS Distributions # define YYSTACK_FREE(Ptr) do { /* empty */ ; } while (YYID (0))
377*5c2921b0SApple OSS Distributions # ifndef YYSTACK_ALLOC_MAXIMUM
378*5c2921b0SApple OSS Distributions /* The OS might guarantee only one guard page at the bottom of the stack,
379*5c2921b0SApple OSS Distributions * and a page size can be as small as 4096 bytes. So we cannot safely
380*5c2921b0SApple OSS Distributions * invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
381*5c2921b0SApple OSS Distributions * to allow for a few compiler-allocated temporary stack slots. */
382*5c2921b0SApple OSS Distributions # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
383*5c2921b0SApple OSS Distributions # endif
384*5c2921b0SApple OSS Distributions # else
385*5c2921b0SApple OSS Distributions # define YYSTACK_ALLOC YYMALLOC
386*5c2921b0SApple OSS Distributions # define YYSTACK_FREE YYFREE
387*5c2921b0SApple OSS Distributions # ifndef YYSTACK_ALLOC_MAXIMUM
388*5c2921b0SApple OSS Distributions # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
389*5c2921b0SApple OSS Distributions # endif
390*5c2921b0SApple OSS Distributions # if (defined __cplusplus && !defined _STDLIB_H \
391*5c2921b0SApple OSS Distributions && !((defined YYMALLOC || defined malloc) \
392*5c2921b0SApple OSS Distributions && (defined YYFREE || defined free)))
393*5c2921b0SApple OSS Distributions # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
394*5c2921b0SApple OSS Distributions # ifndef _STDLIB_H
395*5c2921b0SApple OSS Distributions # define _STDLIB_H 1
396*5c2921b0SApple OSS Distributions # endif
397*5c2921b0SApple OSS Distributions # endif
398*5c2921b0SApple OSS Distributions # ifndef YYMALLOC
399*5c2921b0SApple OSS Distributions # define YYMALLOC malloc
400*5c2921b0SApple OSS Distributions # if !defined malloc && !defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
401*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
402*5c2921b0SApple OSS Distributions void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
403*5c2921b0SApple OSS Distributions # endif
404*5c2921b0SApple OSS Distributions # endif
405*5c2921b0SApple OSS Distributions # ifndef YYFREE
406*5c2921b0SApple OSS Distributions # define YYFREE free
407*5c2921b0SApple OSS Distributions # if !defined free && !defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
408*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
409*5c2921b0SApple OSS Distributions void free(void *); /* INFRINGES ON USER NAME SPACE */
410*5c2921b0SApple OSS Distributions # endif
411*5c2921b0SApple OSS Distributions # endif
412*5c2921b0SApple OSS Distributions # endif
413*5c2921b0SApple OSS Distributions #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
414*5c2921b0SApple OSS Distributions
415*5c2921b0SApple OSS Distributions
416*5c2921b0SApple OSS Distributions #if (!defined yyoverflow \
417*5c2921b0SApple OSS Distributions && (!defined __cplusplus \
418*5c2921b0SApple OSS Distributions || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
419*5c2921b0SApple OSS Distributions
420*5c2921b0SApple OSS Distributions /* A type that is properly aligned for any stack member. */
421*5c2921b0SApple OSS Distributions union yyalloc {
422*5c2921b0SApple OSS Distributions yytype_int16 yyss;
423*5c2921b0SApple OSS Distributions YYSTYPE yyvs;
424*5c2921b0SApple OSS Distributions };
425*5c2921b0SApple OSS Distributions
426*5c2921b0SApple OSS Distributions /* The size of the maximum gap between one aligned stack and the next. */
427*5c2921b0SApple OSS Distributions # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
428*5c2921b0SApple OSS Distributions
429*5c2921b0SApple OSS Distributions /* The size of an array large to enough to hold all stacks, each with
430*5c2921b0SApple OSS Distributions * N elements. */
431*5c2921b0SApple OSS Distributions # define YYSTACK_BYTES(N) \
432*5c2921b0SApple OSS Distributions ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
433*5c2921b0SApple OSS Distributions + YYSTACK_GAP_MAXIMUM)
434*5c2921b0SApple OSS Distributions
435*5c2921b0SApple OSS Distributions /* Copy COUNT objects from FROM to TO. The source and destination do
436*5c2921b0SApple OSS Distributions * not overlap. */
437*5c2921b0SApple OSS Distributions # ifndef YYCOPY
438*5c2921b0SApple OSS Distributions # if defined __GNUC__ && 1 < __GNUC__
439*5c2921b0SApple OSS Distributions # define YYCOPY(To, From, Count) \
440*5c2921b0SApple OSS Distributions __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
441*5c2921b0SApple OSS Distributions # else
442*5c2921b0SApple OSS Distributions # define YYCOPY(To, From, Count) \
443*5c2921b0SApple OSS Distributions do \
444*5c2921b0SApple OSS Distributions { \
445*5c2921b0SApple OSS Distributions YYSIZE_T yyi; \
446*5c2921b0SApple OSS Distributions for (yyi = 0; yyi < (Count); yyi++) \
447*5c2921b0SApple OSS Distributions (To)[yyi] = (From)[yyi]; \
448*5c2921b0SApple OSS Distributions } \
449*5c2921b0SApple OSS Distributions while (YYID (0))
450*5c2921b0SApple OSS Distributions # endif
451*5c2921b0SApple OSS Distributions # endif
452*5c2921b0SApple OSS Distributions
453*5c2921b0SApple OSS Distributions /* Relocate STACK from its old location to the new one. The
454*5c2921b0SApple OSS Distributions * local variables YYSIZE and YYSTACKSIZE give the old and new number of
455*5c2921b0SApple OSS Distributions * elements in the stack, and YYPTR gives the new location of the
456*5c2921b0SApple OSS Distributions * stack. Advance YYPTR to a properly aligned location for the next
457*5c2921b0SApple OSS Distributions * stack. */
458*5c2921b0SApple OSS Distributions # define YYSTACK_RELOCATE(Stack) \
459*5c2921b0SApple OSS Distributions do \
460*5c2921b0SApple OSS Distributions { \
461*5c2921b0SApple OSS Distributions YYSIZE_T yynewbytes; \
462*5c2921b0SApple OSS Distributions YYCOPY (&yyptr->Stack, Stack, yysize); \
463*5c2921b0SApple OSS Distributions Stack = &yyptr->Stack; \
464*5c2921b0SApple OSS Distributions yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
465*5c2921b0SApple OSS Distributions yyptr += yynewbytes / sizeof (*yyptr); \
466*5c2921b0SApple OSS Distributions } \
467*5c2921b0SApple OSS Distributions while (YYID (0))
468*5c2921b0SApple OSS Distributions
469*5c2921b0SApple OSS Distributions #endif
470*5c2921b0SApple OSS Distributions
471*5c2921b0SApple OSS Distributions /* YYFINAL -- State number of the termination state. */
472*5c2921b0SApple OSS Distributions #define YYFINAL 30
473*5c2921b0SApple OSS Distributions /* YYLAST -- Last index in YYTABLE. */
474*5c2921b0SApple OSS Distributions #define YYLAST 80
475*5c2921b0SApple OSS Distributions
476*5c2921b0SApple OSS Distributions /* YYNTOKENS -- Number of terminals. */
477*5c2921b0SApple OSS Distributions #define YYNTOKENS 19
478*5c2921b0SApple OSS Distributions /* YYNNTS -- Number of nonterminals. */
479*5c2921b0SApple OSS Distributions #define YYNNTS 13
480*5c2921b0SApple OSS Distributions /* YYNRULES -- Number of rules. */
481*5c2921b0SApple OSS Distributions #define YYNRULES 28
482*5c2921b0SApple OSS Distributions /* YYNRULES -- Number of states. */
483*5c2921b0SApple OSS Distributions #define YYNSTATES 43
484*5c2921b0SApple OSS Distributions
485*5c2921b0SApple OSS Distributions /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
486*5c2921b0SApple OSS Distributions #define YYUNDEFTOK 2
487*5c2921b0SApple OSS Distributions #define YYMAXUTOK 262
488*5c2921b0SApple OSS Distributions
489*5c2921b0SApple OSS Distributions #define YYTRANSLATE(YYX) \
490*5c2921b0SApple OSS Distributions ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
491*5c2921b0SApple OSS Distributions
492*5c2921b0SApple OSS Distributions /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
493*5c2921b0SApple OSS Distributions static const yytype_uint8 yytranslate[] =
494*5c2921b0SApple OSS Distributions {
495*5c2921b0SApple OSS Distributions 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499*5c2921b0SApple OSS Distributions 13, 14, 2, 2, 17, 2, 2, 2, 2, 2,
500*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 18, 12,
501*5c2921b0SApple OSS Distributions 2, 11, 2, 2, 8, 2, 2, 2, 2, 2,
502*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504*5c2921b0SApple OSS Distributions 2, 15, 2, 16, 2, 2, 2, 2, 2, 2,
505*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507*5c2921b0SApple OSS Distributions 2, 2, 2, 9, 2, 10, 2, 2, 2, 2,
508*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520*5c2921b0SApple OSS Distributions 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
521*5c2921b0SApple OSS Distributions 5, 6, 7
522*5c2921b0SApple OSS Distributions };
523*5c2921b0SApple OSS Distributions
524*5c2921b0SApple OSS Distributions #if YYDEBUG
525*5c2921b0SApple OSS Distributions /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
526*5c2921b0SApple OSS Distributions * YYRHS. */
527*5c2921b0SApple OSS Distributions static const yytype_uint8 yyprhs[] =
528*5c2921b0SApple OSS Distributions {
529*5c2921b0SApple OSS Distributions 0, 0, 3, 4, 6, 8, 10, 12, 14, 16,
530*5c2921b0SApple OSS Distributions 18, 20, 22, 25, 29, 32, 36, 38, 41, 46,
531*5c2921b0SApple OSS Distributions 49, 53, 56, 60, 62, 66, 70, 72, 74
532*5c2921b0SApple OSS Distributions };
533*5c2921b0SApple OSS Distributions
534*5c2921b0SApple OSS Distributions /* YYRHS -- A `-1'-separated list of the rules' RHS. */
535*5c2921b0SApple OSS Distributions static const yytype_int8 yyrhs[] =
536*5c2921b0SApple OSS Distributions {
537*5c2921b0SApple OSS Distributions 20, 0, -1, -1, 21, -1, 7, -1, 22, -1,
538*5c2921b0SApple OSS Distributions 25, -1, 26, -1, 30, -1, 29, -1, 28, -1,
539*5c2921b0SApple OSS Distributions 31, -1, 8, 3, -1, 21, 8, 3, -1, 9,
540*5c2921b0SApple OSS Distributions 10, -1, 9, 23, 10, -1, 24, -1, 23, 24,
541*5c2921b0SApple OSS Distributions -1, 21, 11, 21, 12, -1, 13, 14, -1, 13,
542*5c2921b0SApple OSS Distributions 27, 14, -1, 15, 16, -1, 15, 27, 16, -1,
543*5c2921b0SApple OSS Distributions 21, -1, 27, 17, 21, -1, 3, 18, 3, -1,
544*5c2921b0SApple OSS Distributions 5, -1, 4, -1, 6, -1
545*5c2921b0SApple OSS Distributions };
546*5c2921b0SApple OSS Distributions
547*5c2921b0SApple OSS Distributions /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
548*5c2921b0SApple OSS Distributions static const yytype_uint16 yyrline[] =
549*5c2921b0SApple OSS Distributions {
550*5c2921b0SApple OSS Distributions 0, 168, 168, 169, 170, 173, 174, 175, 176, 177,
551*5c2921b0SApple OSS Distributions 178, 179, 180, 189, 197, 198, 201, 202, 205, 215,
552*5c2921b0SApple OSS Distributions 216, 219, 220, 223, 228, 239, 247, 252, 257
553*5c2921b0SApple OSS Distributions };
554*5c2921b0SApple OSS Distributions #endif
555*5c2921b0SApple OSS Distributions
556*5c2921b0SApple OSS Distributions #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
557*5c2921b0SApple OSS Distributions /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
558*5c2921b0SApple OSS Distributions * First, the terminals, then, starting at YYNTOKENS, nonterminals. */
559*5c2921b0SApple OSS Distributions static const char *const yytname[] =
560*5c2921b0SApple OSS Distributions {
561*5c2921b0SApple OSS Distributions "$end", "error", "$undefined", "NUMBER", "STRING", "DATA", "BOOLEAN",
562*5c2921b0SApple OSS Distributions "SYNTAX_ERROR", "'@'", "'{'", "'}'", "'='", "';'", "'('", "')'", "'['",
563*5c2921b0SApple OSS Distributions "']'", "','", "':'", "$accept", "input", "object", "dict", "pairs",
564*5c2921b0SApple OSS Distributions "pair", "array", "set", "elements", "offset", "data", "string",
565*5c2921b0SApple OSS Distributions "boolean", 0
566*5c2921b0SApple OSS Distributions };
567*5c2921b0SApple OSS Distributions #endif
568*5c2921b0SApple OSS Distributions
569*5c2921b0SApple OSS Distributions # ifdef YYPRINT
570*5c2921b0SApple OSS Distributions /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
571*5c2921b0SApple OSS Distributions * token YYLEX-NUM. */
572*5c2921b0SApple OSS Distributions static const yytype_uint16 yytoknum[] =
573*5c2921b0SApple OSS Distributions {
574*5c2921b0SApple OSS Distributions 0, 256, 257, 258, 259, 260, 261, 262, 64, 123,
575*5c2921b0SApple OSS Distributions 125, 61, 59, 40, 41, 91, 93, 44, 58
576*5c2921b0SApple OSS Distributions };
577*5c2921b0SApple OSS Distributions # endif
578*5c2921b0SApple OSS Distributions
579*5c2921b0SApple OSS Distributions /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
580*5c2921b0SApple OSS Distributions static const yytype_uint8 yyr1[] =
581*5c2921b0SApple OSS Distributions {
582*5c2921b0SApple OSS Distributions 0, 19, 20, 20, 20, 21, 21, 21, 21, 21,
583*5c2921b0SApple OSS Distributions 21, 21, 21, 21, 22, 22, 23, 23, 24, 25,
584*5c2921b0SApple OSS Distributions 25, 26, 26, 27, 27, 28, 29, 30, 31
585*5c2921b0SApple OSS Distributions };
586*5c2921b0SApple OSS Distributions
587*5c2921b0SApple OSS Distributions /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
588*5c2921b0SApple OSS Distributions static const yytype_uint8 yyr2[] =
589*5c2921b0SApple OSS Distributions {
590*5c2921b0SApple OSS Distributions 0, 2, 0, 1, 1, 1, 1, 1, 1, 1,
591*5c2921b0SApple OSS Distributions 1, 1, 2, 3, 2, 3, 1, 2, 4, 2,
592*5c2921b0SApple OSS Distributions 3, 2, 3, 1, 3, 3, 1, 1, 1
593*5c2921b0SApple OSS Distributions };
594*5c2921b0SApple OSS Distributions
595*5c2921b0SApple OSS Distributions /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
596*5c2921b0SApple OSS Distributions * STATE-NUM when YYTABLE doesn't specify something else to do. Zero
597*5c2921b0SApple OSS Distributions * means the default is an error. */
598*5c2921b0SApple OSS Distributions static const yytype_uint8 yydefact[] =
599*5c2921b0SApple OSS Distributions {
600*5c2921b0SApple OSS Distributions 2, 0, 27, 26, 28, 4, 0, 0, 0, 0,
601*5c2921b0SApple OSS Distributions 0, 3, 5, 6, 7, 10, 9, 8, 11, 0,
602*5c2921b0SApple OSS Distributions 12, 14, 0, 0, 16, 19, 23, 0, 21, 0,
603*5c2921b0SApple OSS Distributions 1, 0, 25, 0, 15, 17, 20, 0, 22, 13,
604*5c2921b0SApple OSS Distributions 0, 24, 18
605*5c2921b0SApple OSS Distributions };
606*5c2921b0SApple OSS Distributions
607*5c2921b0SApple OSS Distributions /* YYDEFGOTO[NTERM-NUM]. */
608*5c2921b0SApple OSS Distributions static const yytype_int8 yydefgoto[] =
609*5c2921b0SApple OSS Distributions {
610*5c2921b0SApple OSS Distributions -1, 10, 22, 12, 23, 24, 13, 14, 27, 15,
611*5c2921b0SApple OSS Distributions 16, 17, 18
612*5c2921b0SApple OSS Distributions };
613*5c2921b0SApple OSS Distributions
614*5c2921b0SApple OSS Distributions /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
615*5c2921b0SApple OSS Distributions * STATE-NUM. */
616*5c2921b0SApple OSS Distributions #define YYPACT_NINF -14
617*5c2921b0SApple OSS Distributions static const yytype_int8 yypact[] =
618*5c2921b0SApple OSS Distributions {
619*5c2921b0SApple OSS Distributions 12, -13, -14, -14, -14, -14, 9, 26, 39, -2,
620*5c2921b0SApple OSS Distributions 10, 20, -14, -14, -14, -14, -14, -14, -14, 35,
621*5c2921b0SApple OSS Distributions -14, -14, 38, 52, -14, -14, 20, 49, -14, 7,
622*5c2921b0SApple OSS Distributions -14, 37, -14, 65, -14, -14, -14, 65, -14, -14,
623*5c2921b0SApple OSS Distributions 14, 20, -14
624*5c2921b0SApple OSS Distributions };
625*5c2921b0SApple OSS Distributions
626*5c2921b0SApple OSS Distributions /* YYPGOTO[NTERM-NUM]. */
627*5c2921b0SApple OSS Distributions static const yytype_int8 yypgoto[] =
628*5c2921b0SApple OSS Distributions {
629*5c2921b0SApple OSS Distributions -14, -14, 0, -14, -14, 27, -14, -14, 42, -14,
630*5c2921b0SApple OSS Distributions -14, -14, -14
631*5c2921b0SApple OSS Distributions };
632*5c2921b0SApple OSS Distributions
633*5c2921b0SApple OSS Distributions /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
634*5c2921b0SApple OSS Distributions * positive, shift that token. If negative, reduce the rule which
635*5c2921b0SApple OSS Distributions * number is the opposite. If zero, do what YYDEFACT says.
636*5c2921b0SApple OSS Distributions * If YYTABLE_NINF, syntax error. */
637*5c2921b0SApple OSS Distributions #define YYTABLE_NINF -1
638*5c2921b0SApple OSS Distributions static const yytype_uint8 yytable[] =
639*5c2921b0SApple OSS Distributions {
640*5c2921b0SApple OSS Distributions 11, 1, 2, 3, 4, 19, 6, 7, 26, 26,
641*5c2921b0SApple OSS Distributions 30, 8, 20, 9, 28, 1, 2, 3, 4, 5,
642*5c2921b0SApple OSS Distributions 6, 7, 31, 38, 37, 8, 42, 9, 31, 1,
643*5c2921b0SApple OSS Distributions 2, 3, 4, 40, 6, 7, 21, 41, 32, 8,
644*5c2921b0SApple OSS Distributions 39, 9, 1, 2, 3, 4, 31, 6, 7, 33,
645*5c2921b0SApple OSS Distributions 35, 29, 8, 25, 9, 1, 2, 3, 4, 0,
646*5c2921b0SApple OSS Distributions 6, 7, 34, 36, 0, 8, 37, 9, 1, 2,
647*5c2921b0SApple OSS Distributions 3, 4, 0, 6, 7, 0, 0, 0, 8, 0,
648*5c2921b0SApple OSS Distributions 9
649*5c2921b0SApple OSS Distributions };
650*5c2921b0SApple OSS Distributions
651*5c2921b0SApple OSS Distributions static const yytype_int8 yycheck[] =
652*5c2921b0SApple OSS Distributions {
653*5c2921b0SApple OSS Distributions 0, 3, 4, 5, 6, 18, 8, 9, 8, 9,
654*5c2921b0SApple OSS Distributions 0, 13, 3, 15, 16, 3, 4, 5, 6, 7,
655*5c2921b0SApple OSS Distributions 8, 9, 8, 16, 17, 13, 12, 15, 8, 3,
656*5c2921b0SApple OSS Distributions 4, 5, 6, 33, 8, 9, 10, 37, 3, 13,
657*5c2921b0SApple OSS Distributions 3, 15, 3, 4, 5, 6, 8, 8, 9, 11,
658*5c2921b0SApple OSS Distributions 23, 9, 13, 14, 15, 3, 4, 5, 6, -1,
659*5c2921b0SApple OSS Distributions 8, 9, 10, 14, -1, 13, 17, 15, 3, 4,
660*5c2921b0SApple OSS Distributions 5, 6, -1, 8, 9, -1, -1, -1, 13, -1,
661*5c2921b0SApple OSS Distributions 15
662*5c2921b0SApple OSS Distributions };
663*5c2921b0SApple OSS Distributions
664*5c2921b0SApple OSS Distributions /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
665*5c2921b0SApple OSS Distributions * symbol of state STATE-NUM. */
666*5c2921b0SApple OSS Distributions static const yytype_uint8 yystos[] =
667*5c2921b0SApple OSS Distributions {
668*5c2921b0SApple OSS Distributions 0, 3, 4, 5, 6, 7, 8, 9, 13, 15,
669*5c2921b0SApple OSS Distributions 20, 21, 22, 25, 26, 28, 29, 30, 31, 18,
670*5c2921b0SApple OSS Distributions 3, 10, 21, 23, 24, 14, 21, 27, 16, 27,
671*5c2921b0SApple OSS Distributions 0, 8, 3, 11, 10, 24, 14, 17, 16, 3,
672*5c2921b0SApple OSS Distributions 21, 21, 12
673*5c2921b0SApple OSS Distributions };
674*5c2921b0SApple OSS Distributions
675*5c2921b0SApple OSS Distributions #define yyerrok (yyerrstatus = 0)
676*5c2921b0SApple OSS Distributions #define yyclearin (yychar = YYEMPTY)
677*5c2921b0SApple OSS Distributions #define YYEMPTY (-2)
678*5c2921b0SApple OSS Distributions #define YYEOF 0
679*5c2921b0SApple OSS Distributions
680*5c2921b0SApple OSS Distributions #define YYACCEPT goto yyacceptlab
681*5c2921b0SApple OSS Distributions #define YYABORT goto yyabortlab
682*5c2921b0SApple OSS Distributions #define YYERROR goto yyerrorlab
683*5c2921b0SApple OSS Distributions
684*5c2921b0SApple OSS Distributions
685*5c2921b0SApple OSS Distributions /* Like YYERROR except do call yyerror. This remains here temporarily
686*5c2921b0SApple OSS Distributions * to ease the transition to the new meaning of YYERROR, for GCC.
687*5c2921b0SApple OSS Distributions * Once GCC version 2 has supplanted version 1, this can go. */
688*5c2921b0SApple OSS Distributions
689*5c2921b0SApple OSS Distributions #define YYFAIL goto yyerrlab
690*5c2921b0SApple OSS Distributions
691*5c2921b0SApple OSS Distributions #define YYRECOVERING() (!!yyerrstatus)
692*5c2921b0SApple OSS Distributions
693*5c2921b0SApple OSS Distributions #define YYBACKUP(Token, Value) \
694*5c2921b0SApple OSS Distributions do \
695*5c2921b0SApple OSS Distributions if (yychar == YYEMPTY && yylen == 1) \
696*5c2921b0SApple OSS Distributions { \
697*5c2921b0SApple OSS Distributions yychar = (Token); \
698*5c2921b0SApple OSS Distributions yylval = (Value); \
699*5c2921b0SApple OSS Distributions yytoken = YYTRANSLATE (yychar); \
700*5c2921b0SApple OSS Distributions YYPOPSTACK (1); \
701*5c2921b0SApple OSS Distributions goto yybackup; \
702*5c2921b0SApple OSS Distributions } \
703*5c2921b0SApple OSS Distributions else \
704*5c2921b0SApple OSS Distributions { \
705*5c2921b0SApple OSS Distributions yyerror (YY_("syntax error: cannot back up")); \
706*5c2921b0SApple OSS Distributions YYERROR; \
707*5c2921b0SApple OSS Distributions } \
708*5c2921b0SApple OSS Distributions while (YYID (0))
709*5c2921b0SApple OSS Distributions
710*5c2921b0SApple OSS Distributions
711*5c2921b0SApple OSS Distributions #define YYTERROR 1
712*5c2921b0SApple OSS Distributions #define YYERRCODE 256
713*5c2921b0SApple OSS Distributions
714*5c2921b0SApple OSS Distributions
715*5c2921b0SApple OSS Distributions /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
716*5c2921b0SApple OSS Distributions * If N is 0, then set CURRENT to the empty location which ends
717*5c2921b0SApple OSS Distributions * the previous symbol: RHS[0] (always defined). */
718*5c2921b0SApple OSS Distributions
719*5c2921b0SApple OSS Distributions #define YYRHSLOC(Rhs, K) ((Rhs)[K])
720*5c2921b0SApple OSS Distributions #ifndef YYLLOC_DEFAULT
721*5c2921b0SApple OSS Distributions # define YYLLOC_DEFAULT(Current, Rhs, N) \
722*5c2921b0SApple OSS Distributions do \
723*5c2921b0SApple OSS Distributions if (YYID (N)) \
724*5c2921b0SApple OSS Distributions { \
725*5c2921b0SApple OSS Distributions (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
726*5c2921b0SApple OSS Distributions (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
727*5c2921b0SApple OSS Distributions (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
728*5c2921b0SApple OSS Distributions (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
729*5c2921b0SApple OSS Distributions } \
730*5c2921b0SApple OSS Distributions else \
731*5c2921b0SApple OSS Distributions { \
732*5c2921b0SApple OSS Distributions (Current).first_line = (Current).last_line = \
733*5c2921b0SApple OSS Distributions YYRHSLOC (Rhs, 0).last_line; \
734*5c2921b0SApple OSS Distributions (Current).first_column = (Current).last_column = \
735*5c2921b0SApple OSS Distributions YYRHSLOC (Rhs, 0).last_column; \
736*5c2921b0SApple OSS Distributions } \
737*5c2921b0SApple OSS Distributions while (YYID (0))
738*5c2921b0SApple OSS Distributions #endif
739*5c2921b0SApple OSS Distributions
740*5c2921b0SApple OSS Distributions
741*5c2921b0SApple OSS Distributions /* YY_LOCATION_PRINT -- Print the location on the stream.
742*5c2921b0SApple OSS Distributions * This macro was not mandated originally: define only if we know
743*5c2921b0SApple OSS Distributions * we won't break user code: when these are the locations we know. */
744*5c2921b0SApple OSS Distributions
745*5c2921b0SApple OSS Distributions #ifndef YY_LOCATION_PRINT
746*5c2921b0SApple OSS Distributions # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
747*5c2921b0SApple OSS Distributions # define YY_LOCATION_PRINT(File, Loc) \
748*5c2921b0SApple OSS Distributions fprintf (File, "%d.%d-%d.%d", \
749*5c2921b0SApple OSS Distributions (Loc).first_line, (Loc).first_column, \
750*5c2921b0SApple OSS Distributions (Loc).last_line, (Loc).last_column)
751*5c2921b0SApple OSS Distributions # else
752*5c2921b0SApple OSS Distributions # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
753*5c2921b0SApple OSS Distributions # endif
754*5c2921b0SApple OSS Distributions #endif
755*5c2921b0SApple OSS Distributions
756*5c2921b0SApple OSS Distributions
757*5c2921b0SApple OSS Distributions /* YYLEX -- calling `yylex' with the right arguments. */
758*5c2921b0SApple OSS Distributions
759*5c2921b0SApple OSS Distributions #ifdef YYLEX_PARAM
760*5c2921b0SApple OSS Distributions # define YYLEX yylex (YYLEX_PARAM)
761*5c2921b0SApple OSS Distributions #else
762*5c2921b0SApple OSS Distributions # define YYLEX yylex ()
763*5c2921b0SApple OSS Distributions #endif
764*5c2921b0SApple OSS Distributions
765*5c2921b0SApple OSS Distributions /* Enable debugging if requested. */
766*5c2921b0SApple OSS Distributions #if YYDEBUG
767*5c2921b0SApple OSS Distributions
768*5c2921b0SApple OSS Distributions # ifndef YYFPRINTF
769*5c2921b0SApple OSS Distributions # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
770*5c2921b0SApple OSS Distributions # define YYFPRINTF fprintf
771*5c2921b0SApple OSS Distributions # endif
772*5c2921b0SApple OSS Distributions
773*5c2921b0SApple OSS Distributions # define YYDPRINTF(Args) \
774*5c2921b0SApple OSS Distributions do { \
775*5c2921b0SApple OSS Distributions if (yydebug) \
776*5c2921b0SApple OSS Distributions YYFPRINTF Args; \
777*5c2921b0SApple OSS Distributions } while (YYID (0))
778*5c2921b0SApple OSS Distributions
779*5c2921b0SApple OSS Distributions # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
780*5c2921b0SApple OSS Distributions do { \
781*5c2921b0SApple OSS Distributions if (yydebug) \
782*5c2921b0SApple OSS Distributions { \
783*5c2921b0SApple OSS Distributions YYFPRINTF (stderr, "%s ", Title); \
784*5c2921b0SApple OSS Distributions yy_symbol_print (stderr, \
785*5c2921b0SApple OSS Distributions Type, Value); \
786*5c2921b0SApple OSS Distributions YYFPRINTF (stderr, "\n"); \
787*5c2921b0SApple OSS Distributions } \
788*5c2921b0SApple OSS Distributions } while (YYID (0))
789*5c2921b0SApple OSS Distributions
790*5c2921b0SApple OSS Distributions
791*5c2921b0SApple OSS Distributions /*--------------------------------.
792*5c2921b0SApple OSS Distributions | Print this symbol on YYOUTPUT. |
793*5c2921b0SApple OSS Distributions | `--------------------------------*/
794*5c2921b0SApple OSS Distributions
795*5c2921b0SApple OSS Distributions /*ARGSUSED*/
796*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
797*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
798*5c2921b0SApple OSS Distributions static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)799*5c2921b0SApple OSS Distributions yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
800*5c2921b0SApple OSS Distributions #else
801*5c2921b0SApple OSS Distributions static void
802*5c2921b0SApple OSS Distributions yy_symbol_value_print(yyoutput, yytype, yyvaluep)
803*5c2921b0SApple OSS Distributions FILE *yyoutput;
804*5c2921b0SApple OSS Distributions int yytype;
805*5c2921b0SApple OSS Distributions YYSTYPE const * const yyvaluep;
806*5c2921b0SApple OSS Distributions #endif
807*5c2921b0SApple OSS Distributions {
808*5c2921b0SApple OSS Distributions if (!yyvaluep) {
809*5c2921b0SApple OSS Distributions return;
810*5c2921b0SApple OSS Distributions }
811*5c2921b0SApple OSS Distributions # ifdef YYPRINT
812*5c2921b0SApple OSS Distributions if (yytype < YYNTOKENS) {
813*5c2921b0SApple OSS Distributions YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep);
814*5c2921b0SApple OSS Distributions }
815*5c2921b0SApple OSS Distributions # else
816*5c2921b0SApple OSS Distributions YYUSE(yyoutput);
817*5c2921b0SApple OSS Distributions # endif
818*5c2921b0SApple OSS Distributions switch (yytype) {
819*5c2921b0SApple OSS Distributions default:
820*5c2921b0SApple OSS Distributions break;
821*5c2921b0SApple OSS Distributions }
822*5c2921b0SApple OSS Distributions }
823*5c2921b0SApple OSS Distributions
824*5c2921b0SApple OSS Distributions
825*5c2921b0SApple OSS Distributions /*--------------------------------.
826*5c2921b0SApple OSS Distributions | Print this symbol on YYOUTPUT. |
827*5c2921b0SApple OSS Distributions | `--------------------------------*/
828*5c2921b0SApple OSS Distributions
829*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
830*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
831*5c2921b0SApple OSS Distributions static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)832*5c2921b0SApple OSS Distributions yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
833*5c2921b0SApple OSS Distributions #else
834*5c2921b0SApple OSS Distributions static void
835*5c2921b0SApple OSS Distributions yy_symbol_print(yyoutput, yytype, yyvaluep)
836*5c2921b0SApple OSS Distributions FILE *yyoutput;
837*5c2921b0SApple OSS Distributions int yytype;
838*5c2921b0SApple OSS Distributions YYSTYPE const * const yyvaluep;
839*5c2921b0SApple OSS Distributions #endif
840*5c2921b0SApple OSS Distributions {
841*5c2921b0SApple OSS Distributions if (yytype < YYNTOKENS) {
842*5c2921b0SApple OSS Distributions YYFPRINTF(yyoutput, "token %s (", yytname[yytype]);
843*5c2921b0SApple OSS Distributions } else {
844*5c2921b0SApple OSS Distributions YYFPRINTF(yyoutput, "nterm %s (", yytname[yytype]);
845*5c2921b0SApple OSS Distributions }
846*5c2921b0SApple OSS Distributions
847*5c2921b0SApple OSS Distributions yy_symbol_value_print(yyoutput, yytype, yyvaluep);
848*5c2921b0SApple OSS Distributions YYFPRINTF(yyoutput, ")");
849*5c2921b0SApple OSS Distributions }
850*5c2921b0SApple OSS Distributions
851*5c2921b0SApple OSS Distributions /*------------------------------------------------------------------.
852*5c2921b0SApple OSS Distributions | yy_stack_print -- Print the state stack from its BOTTOM up to its |
853*5c2921b0SApple OSS Distributions | TOP (included). |
854*5c2921b0SApple OSS Distributions | `------------------------------------------------------------------*/
855*5c2921b0SApple OSS Distributions
856*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
857*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
858*5c2921b0SApple OSS Distributions static void
yy_stack_print(yytype_int16 * bottom,yytype_int16 * top)859*5c2921b0SApple OSS Distributions yy_stack_print(yytype_int16 *bottom, yytype_int16 *top)
860*5c2921b0SApple OSS Distributions #else
861*5c2921b0SApple OSS Distributions static void
862*5c2921b0SApple OSS Distributions yy_stack_print(bottom, top)
863*5c2921b0SApple OSS Distributions yytype_int16 *bottom;
864*5c2921b0SApple OSS Distributions yytype_int16 *top;
865*5c2921b0SApple OSS Distributions #endif
866*5c2921b0SApple OSS Distributions {
867*5c2921b0SApple OSS Distributions YYFPRINTF(stderr, "Stack now");
868*5c2921b0SApple OSS Distributions for (; bottom <= top; ++bottom) {
869*5c2921b0SApple OSS Distributions YYFPRINTF(stderr, " %d", *bottom);
870*5c2921b0SApple OSS Distributions }
871*5c2921b0SApple OSS Distributions YYFPRINTF(stderr, "\n");
872*5c2921b0SApple OSS Distributions }
873*5c2921b0SApple OSS Distributions
874*5c2921b0SApple OSS Distributions # define YY_STACK_PRINT(Bottom, Top) \
875*5c2921b0SApple OSS Distributions do { \
876*5c2921b0SApple OSS Distributions if (yydebug) \
877*5c2921b0SApple OSS Distributions yy_stack_print ((Bottom), (Top)); \
878*5c2921b0SApple OSS Distributions } while (YYID (0))
879*5c2921b0SApple OSS Distributions
880*5c2921b0SApple OSS Distributions
881*5c2921b0SApple OSS Distributions /*------------------------------------------------.
882*5c2921b0SApple OSS Distributions | Report that the YYRULE is going to be reduced. |
883*5c2921b0SApple OSS Distributions | `------------------------------------------------*/
884*5c2921b0SApple OSS Distributions
885*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
886*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
887*5c2921b0SApple OSS Distributions static void
yy_reduce_print(YYSTYPE * yyvsp,int yyrule)888*5c2921b0SApple OSS Distributions yy_reduce_print(YYSTYPE *yyvsp, int yyrule)
889*5c2921b0SApple OSS Distributions #else
890*5c2921b0SApple OSS Distributions static void
891*5c2921b0SApple OSS Distributions yy_reduce_print(yyvsp, yyrule)
892*5c2921b0SApple OSS Distributions YYSTYPE *yyvsp;
893*5c2921b0SApple OSS Distributions int yyrule;
894*5c2921b0SApple OSS Distributions #endif
895*5c2921b0SApple OSS Distributions {
896*5c2921b0SApple OSS Distributions int yynrhs = yyr2[yyrule];
897*5c2921b0SApple OSS Distributions int yyi;
898*5c2921b0SApple OSS Distributions unsigned long int yylno = yyrline[yyrule];
899*5c2921b0SApple OSS Distributions YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n",
900*5c2921b0SApple OSS Distributions yyrule - 1, yylno);
901*5c2921b0SApple OSS Distributions /* The symbols being reduced. */
902*5c2921b0SApple OSS Distributions for (yyi = 0; yyi < yynrhs; yyi++) {
903*5c2921b0SApple OSS Distributions fprintf(stderr, " $%d = ", yyi + 1);
904*5c2921b0SApple OSS Distributions yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi],
905*5c2921b0SApple OSS Distributions &(yyvsp[(yyi + 1) - (yynrhs)])
906*5c2921b0SApple OSS Distributions );
907*5c2921b0SApple OSS Distributions fprintf(stderr, "\n");
908*5c2921b0SApple OSS Distributions }
909*5c2921b0SApple OSS Distributions }
910*5c2921b0SApple OSS Distributions
911*5c2921b0SApple OSS Distributions # define YY_REDUCE_PRINT(Rule) \
912*5c2921b0SApple OSS Distributions do { \
913*5c2921b0SApple OSS Distributions if (yydebug) \
914*5c2921b0SApple OSS Distributions yy_reduce_print (yyvsp, Rule); \
915*5c2921b0SApple OSS Distributions } while (YYID (0))
916*5c2921b0SApple OSS Distributions
917*5c2921b0SApple OSS Distributions /* Nonzero means print parse trace. It is left uninitialized so that
918*5c2921b0SApple OSS Distributions * multiple parsers can coexist. */
919*5c2921b0SApple OSS Distributions int yydebug;
920*5c2921b0SApple OSS Distributions #else /* !YYDEBUG */
921*5c2921b0SApple OSS Distributions # define YYDPRINTF(Args)
922*5c2921b0SApple OSS Distributions # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
923*5c2921b0SApple OSS Distributions # define YY_STACK_PRINT(Bottom, Top)
924*5c2921b0SApple OSS Distributions # define YY_REDUCE_PRINT(Rule)
925*5c2921b0SApple OSS Distributions #endif /* !YYDEBUG */
926*5c2921b0SApple OSS Distributions
927*5c2921b0SApple OSS Distributions
928*5c2921b0SApple OSS Distributions /* YYINITDEPTH -- initial size of the parser's stacks. */
929*5c2921b0SApple OSS Distributions #ifndef YYINITDEPTH
930*5c2921b0SApple OSS Distributions # define YYINITDEPTH 200
931*5c2921b0SApple OSS Distributions #endif
932*5c2921b0SApple OSS Distributions
933*5c2921b0SApple OSS Distributions /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
934*5c2921b0SApple OSS Distributions * if the built-in stack extension method is used).
935*5c2921b0SApple OSS Distributions *
936*5c2921b0SApple OSS Distributions * Do not make this value too large; the results are undefined if
937*5c2921b0SApple OSS Distributions * YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
938*5c2921b0SApple OSS Distributions * evaluated with infinite-precision integer arithmetic. */
939*5c2921b0SApple OSS Distributions
940*5c2921b0SApple OSS Distributions #ifndef YYMAXDEPTH
941*5c2921b0SApple OSS Distributions # define YYMAXDEPTH 10000
942*5c2921b0SApple OSS Distributions #endif
943*5c2921b0SApple OSS Distributions
944*5c2921b0SApple OSS Distributions
945*5c2921b0SApple OSS Distributions
946*5c2921b0SApple OSS Distributions #if YYERROR_VERBOSE
947*5c2921b0SApple OSS Distributions
948*5c2921b0SApple OSS Distributions # ifndef yystrlen
949*5c2921b0SApple OSS Distributions # if defined __GLIBC__ && defined _STRING_H
950*5c2921b0SApple OSS Distributions # define yystrlen strlen
951*5c2921b0SApple OSS Distributions # else
952*5c2921b0SApple OSS Distributions /* Return the length of YYSTR. */
953*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
954*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
955*5c2921b0SApple OSS Distributions static YYSIZE_T
yystrlen(const char * yystr)956*5c2921b0SApple OSS Distributions yystrlen(const char *yystr)
957*5c2921b0SApple OSS Distributions #else
958*5c2921b0SApple OSS Distributions static YYSIZE_T
959*5c2921b0SApple OSS Distributions yystrlen(yystr)
960*5c2921b0SApple OSS Distributions const char *yystr;
961*5c2921b0SApple OSS Distributions #endif
962*5c2921b0SApple OSS Distributions {
963*5c2921b0SApple OSS Distributions YYSIZE_T yylen;
964*5c2921b0SApple OSS Distributions for (yylen = 0; yystr[yylen]; yylen++) {
965*5c2921b0SApple OSS Distributions continue;
966*5c2921b0SApple OSS Distributions }
967*5c2921b0SApple OSS Distributions return yylen;
968*5c2921b0SApple OSS Distributions }
969*5c2921b0SApple OSS Distributions # endif
970*5c2921b0SApple OSS Distributions # endif
971*5c2921b0SApple OSS Distributions
972*5c2921b0SApple OSS Distributions # ifndef yystpcpy
973*5c2921b0SApple OSS Distributions # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
974*5c2921b0SApple OSS Distributions # define yystpcpy stpcpy
975*5c2921b0SApple OSS Distributions # else
976*5c2921b0SApple OSS Distributions /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
977*5c2921b0SApple OSS Distributions * YYDEST. */
978*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
979*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
980*5c2921b0SApple OSS Distributions static char *
yystpcpy(char * yydest,const char * yysrc)981*5c2921b0SApple OSS Distributions yystpcpy(char *yydest, const char *yysrc)
982*5c2921b0SApple OSS Distributions #else
983*5c2921b0SApple OSS Distributions static char *
984*5c2921b0SApple OSS Distributions yystpcpy(yydest, yysrc)
985*5c2921b0SApple OSS Distributions char *yydest;
986*5c2921b0SApple OSS Distributions const char *yysrc;
987*5c2921b0SApple OSS Distributions #endif
988*5c2921b0SApple OSS Distributions {
989*5c2921b0SApple OSS Distributions char *yyd = yydest;
990*5c2921b0SApple OSS Distributions const char *yys = yysrc;
991*5c2921b0SApple OSS Distributions
992*5c2921b0SApple OSS Distributions while ((*yyd++ = *yys++) != '\0') {
993*5c2921b0SApple OSS Distributions continue;
994*5c2921b0SApple OSS Distributions }
995*5c2921b0SApple OSS Distributions
996*5c2921b0SApple OSS Distributions return yyd - 1;
997*5c2921b0SApple OSS Distributions }
998*5c2921b0SApple OSS Distributions # endif
999*5c2921b0SApple OSS Distributions # endif
1000*5c2921b0SApple OSS Distributions
1001*5c2921b0SApple OSS Distributions # ifndef yytnamerr
1002*5c2921b0SApple OSS Distributions /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1003*5c2921b0SApple OSS Distributions * quotes and backslashes, so that it's suitable for yyerror. The
1004*5c2921b0SApple OSS Distributions * heuristic is that double-quoting is unnecessary unless the string
1005*5c2921b0SApple OSS Distributions * contains an apostrophe, a comma, or backslash (other than
1006*5c2921b0SApple OSS Distributions * backslash-backslash). YYSTR is taken from yytname. If YYRES is
1007*5c2921b0SApple OSS Distributions * null, do not copy; instead, return the length of what the result
1008*5c2921b0SApple OSS Distributions * would have been. */
1009*5c2921b0SApple OSS Distributions static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)1010*5c2921b0SApple OSS Distributions yytnamerr(char *yyres, const char *yystr)
1011*5c2921b0SApple OSS Distributions {
1012*5c2921b0SApple OSS Distributions if (*yystr == '"') {
1013*5c2921b0SApple OSS Distributions YYSIZE_T yyn = 0;
1014*5c2921b0SApple OSS Distributions char const *yyp = yystr;
1015*5c2921b0SApple OSS Distributions
1016*5c2921b0SApple OSS Distributions for (;;) {
1017*5c2921b0SApple OSS Distributions switch (*++yyp) {
1018*5c2921b0SApple OSS Distributions case '\'':
1019*5c2921b0SApple OSS Distributions case ',':
1020*5c2921b0SApple OSS Distributions goto do_not_strip_quotes;
1021*5c2921b0SApple OSS Distributions
1022*5c2921b0SApple OSS Distributions case '\\':
1023*5c2921b0SApple OSS Distributions if (*++yyp != '\\') {
1024*5c2921b0SApple OSS Distributions goto do_not_strip_quotes;
1025*5c2921b0SApple OSS Distributions }
1026*5c2921b0SApple OSS Distributions /* Fall through. */
1027*5c2921b0SApple OSS Distributions default:
1028*5c2921b0SApple OSS Distributions if (yyres) {
1029*5c2921b0SApple OSS Distributions yyres[yyn] = *yyp;
1030*5c2921b0SApple OSS Distributions }
1031*5c2921b0SApple OSS Distributions yyn++;
1032*5c2921b0SApple OSS Distributions break;
1033*5c2921b0SApple OSS Distributions
1034*5c2921b0SApple OSS Distributions case '"':
1035*5c2921b0SApple OSS Distributions if (yyres) {
1036*5c2921b0SApple OSS Distributions yyres[yyn] = '\0';
1037*5c2921b0SApple OSS Distributions }
1038*5c2921b0SApple OSS Distributions return yyn;
1039*5c2921b0SApple OSS Distributions }
1040*5c2921b0SApple OSS Distributions }
1041*5c2921b0SApple OSS Distributions do_not_strip_quotes:;
1042*5c2921b0SApple OSS Distributions }
1043*5c2921b0SApple OSS Distributions
1044*5c2921b0SApple OSS Distributions if (!yyres) {
1045*5c2921b0SApple OSS Distributions return yystrlen(yystr);
1046*5c2921b0SApple OSS Distributions }
1047*5c2921b0SApple OSS Distributions
1048*5c2921b0SApple OSS Distributions return yystpcpy(yyres, yystr) - yyres;
1049*5c2921b0SApple OSS Distributions }
1050*5c2921b0SApple OSS Distributions # endif
1051*5c2921b0SApple OSS Distributions
1052*5c2921b0SApple OSS Distributions /* Copy into YYRESULT an error message about the unexpected token
1053*5c2921b0SApple OSS Distributions * YYCHAR while in state YYSTATE. Return the number of bytes copied,
1054*5c2921b0SApple OSS Distributions * including the terminating null byte. If YYRESULT is null, do not
1055*5c2921b0SApple OSS Distributions * copy anything; just return the number of bytes that would be
1056*5c2921b0SApple OSS Distributions * copied. As a special case, return 0 if an ordinary "syntax error"
1057*5c2921b0SApple OSS Distributions * message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1058*5c2921b0SApple OSS Distributions * size calculation. */
1059*5c2921b0SApple OSS Distributions static YYSIZE_T
yysyntax_error(char * yyresult,int yystate,int yychar)1060*5c2921b0SApple OSS Distributions yysyntax_error(char *yyresult, int yystate, int yychar)
1061*5c2921b0SApple OSS Distributions {
1062*5c2921b0SApple OSS Distributions int yyn = yypact[yystate];
1063*5c2921b0SApple OSS Distributions
1064*5c2921b0SApple OSS Distributions if (!(YYPACT_NINF < yyn && yyn <= YYLAST)) {
1065*5c2921b0SApple OSS Distributions return 0;
1066*5c2921b0SApple OSS Distributions } else {
1067*5c2921b0SApple OSS Distributions int yytype = YYTRANSLATE(yychar);
1068*5c2921b0SApple OSS Distributions YYSIZE_T yysize0 = yytnamerr(0, yytname[yytype]);
1069*5c2921b0SApple OSS Distributions YYSIZE_T yysize = yysize0;
1070*5c2921b0SApple OSS Distributions YYSIZE_T yysize1;
1071*5c2921b0SApple OSS Distributions int yysize_overflow = 0;
1072*5c2921b0SApple OSS Distributions enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1073*5c2921b0SApple OSS Distributions char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1074*5c2921b0SApple OSS Distributions int yyx;
1075*5c2921b0SApple OSS Distributions
1076*5c2921b0SApple OSS Distributions # if 0
1077*5c2921b0SApple OSS Distributions /* This is so xgettext sees the translatable formats that are
1078*5c2921b0SApple OSS Distributions * constructed on the fly. */
1079*5c2921b0SApple OSS Distributions YY_("syntax error, unexpected %s");
1080*5c2921b0SApple OSS Distributions YY_("syntax error, unexpected %s, expecting %s");
1081*5c2921b0SApple OSS Distributions YY_("syntax error, unexpected %s, expecting %s or %s");
1082*5c2921b0SApple OSS Distributions YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1083*5c2921b0SApple OSS Distributions YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1084*5c2921b0SApple OSS Distributions # endif
1085*5c2921b0SApple OSS Distributions char *yyfmt;
1086*5c2921b0SApple OSS Distributions char const *yyf;
1087*5c2921b0SApple OSS Distributions static char const yyunexpected[] = "syntax error, unexpected %s";
1088*5c2921b0SApple OSS Distributions static char const yyexpecting[] = ", expecting %s";
1089*5c2921b0SApple OSS Distributions static char const yyor[] = " or %s";
1090*5c2921b0SApple OSS Distributions char yyformat[sizeof yyunexpected
1091*5c2921b0SApple OSS Distributions + sizeof yyexpecting - 1
1092*5c2921b0SApple OSS Distributions + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1093*5c2921b0SApple OSS Distributions * (sizeof yyor - 1))];
1094*5c2921b0SApple OSS Distributions char const *yyprefix = yyexpecting;
1095*5c2921b0SApple OSS Distributions
1096*5c2921b0SApple OSS Distributions /* Start YYX at -YYN if negative to avoid negative indexes in
1097*5c2921b0SApple OSS Distributions * YYCHECK. */
1098*5c2921b0SApple OSS Distributions int yyxbegin = yyn < 0 ? -yyn : 0;
1099*5c2921b0SApple OSS Distributions
1100*5c2921b0SApple OSS Distributions /* Stay within bounds of both yycheck and yytname. */
1101*5c2921b0SApple OSS Distributions int yychecklim = YYLAST - yyn + 1;
1102*5c2921b0SApple OSS Distributions int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1103*5c2921b0SApple OSS Distributions int yycount = 1;
1104*5c2921b0SApple OSS Distributions
1105*5c2921b0SApple OSS Distributions yyarg[0] = yytname[yytype];
1106*5c2921b0SApple OSS Distributions yyfmt = yystpcpy(yyformat, yyunexpected);
1107*5c2921b0SApple OSS Distributions
1108*5c2921b0SApple OSS Distributions for (yyx = yyxbegin; yyx < yyxend; ++yyx) {
1109*5c2921b0SApple OSS Distributions if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) {
1110*5c2921b0SApple OSS Distributions if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) {
1111*5c2921b0SApple OSS Distributions yycount = 1;
1112*5c2921b0SApple OSS Distributions yysize = yysize0;
1113*5c2921b0SApple OSS Distributions yyformat[sizeof yyunexpected - 1] = '\0';
1114*5c2921b0SApple OSS Distributions break;
1115*5c2921b0SApple OSS Distributions }
1116*5c2921b0SApple OSS Distributions yyarg[yycount++] = yytname[yyx];
1117*5c2921b0SApple OSS Distributions yysize1 = yysize + yytnamerr(0, yytname[yyx]);
1118*5c2921b0SApple OSS Distributions yysize_overflow |= (yysize1 < yysize);
1119*5c2921b0SApple OSS Distributions yysize = yysize1;
1120*5c2921b0SApple OSS Distributions yyfmt = yystpcpy(yyfmt, yyprefix);
1121*5c2921b0SApple OSS Distributions yyprefix = yyor;
1122*5c2921b0SApple OSS Distributions }
1123*5c2921b0SApple OSS Distributions }
1124*5c2921b0SApple OSS Distributions
1125*5c2921b0SApple OSS Distributions yyf = YY_(yyformat);
1126*5c2921b0SApple OSS Distributions yysize1 = yysize + yystrlen(yyf);
1127*5c2921b0SApple OSS Distributions yysize_overflow |= (yysize1 < yysize);
1128*5c2921b0SApple OSS Distributions yysize = yysize1;
1129*5c2921b0SApple OSS Distributions
1130*5c2921b0SApple OSS Distributions if (yysize_overflow) {
1131*5c2921b0SApple OSS Distributions return YYSIZE_MAXIMUM;
1132*5c2921b0SApple OSS Distributions }
1133*5c2921b0SApple OSS Distributions
1134*5c2921b0SApple OSS Distributions if (yyresult) {
1135*5c2921b0SApple OSS Distributions /* Avoid sprintf, as that infringes on the user's name space.
1136*5c2921b0SApple OSS Distributions * Don't have undefined behavior even if the translation
1137*5c2921b0SApple OSS Distributions * produced a string with the wrong number of "%s"s. */
1138*5c2921b0SApple OSS Distributions char *yyp = yyresult;
1139*5c2921b0SApple OSS Distributions int yyi = 0;
1140*5c2921b0SApple OSS Distributions while ((*yyp = *yyf) != '\0') {
1141*5c2921b0SApple OSS Distributions if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) {
1142*5c2921b0SApple OSS Distributions yyp += yytnamerr(yyp, yyarg[yyi++]);
1143*5c2921b0SApple OSS Distributions yyf += 2;
1144*5c2921b0SApple OSS Distributions } else {
1145*5c2921b0SApple OSS Distributions yyp++;
1146*5c2921b0SApple OSS Distributions yyf++;
1147*5c2921b0SApple OSS Distributions }
1148*5c2921b0SApple OSS Distributions }
1149*5c2921b0SApple OSS Distributions }
1150*5c2921b0SApple OSS Distributions return yysize;
1151*5c2921b0SApple OSS Distributions }
1152*5c2921b0SApple OSS Distributions }
1153*5c2921b0SApple OSS Distributions #endif /* YYERROR_VERBOSE */
1154*5c2921b0SApple OSS Distributions
1155*5c2921b0SApple OSS Distributions
1156*5c2921b0SApple OSS Distributions /*-----------------------------------------------.
1157*5c2921b0SApple OSS Distributions | Release the memory associated to this symbol. |
1158*5c2921b0SApple OSS Distributions | `-----------------------------------------------*/
1159*5c2921b0SApple OSS Distributions
1160*5c2921b0SApple OSS Distributions /*ARGSUSED*/
1161*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
1162*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
1163*5c2921b0SApple OSS Distributions static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)1164*5c2921b0SApple OSS Distributions yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1165*5c2921b0SApple OSS Distributions #else
1166*5c2921b0SApple OSS Distributions static void
1167*5c2921b0SApple OSS Distributions yydestruct(yymsg, yytype, yyvaluep)
1168*5c2921b0SApple OSS Distributions const char *yymsg;
1169*5c2921b0SApple OSS Distributions int yytype;
1170*5c2921b0SApple OSS Distributions YYSTYPE *yyvaluep;
1171*5c2921b0SApple OSS Distributions #endif
1172*5c2921b0SApple OSS Distributions {
1173*5c2921b0SApple OSS Distributions YYUSE(yyvaluep);
1174*5c2921b0SApple OSS Distributions
1175*5c2921b0SApple OSS Distributions if (!yymsg) {
1176*5c2921b0SApple OSS Distributions yymsg = "Deleting";
1177*5c2921b0SApple OSS Distributions }
1178*5c2921b0SApple OSS Distributions YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
1179*5c2921b0SApple OSS Distributions
1180*5c2921b0SApple OSS Distributions switch (yytype) {
1181*5c2921b0SApple OSS Distributions default:
1182*5c2921b0SApple OSS Distributions break;
1183*5c2921b0SApple OSS Distributions }
1184*5c2921b0SApple OSS Distributions }
1185*5c2921b0SApple OSS Distributions
1186*5c2921b0SApple OSS Distributions
1187*5c2921b0SApple OSS Distributions /* Prevent warnings from -Wmissing-prototypes. */
1188*5c2921b0SApple OSS Distributions
1189*5c2921b0SApple OSS Distributions #ifdef YYPARSE_PARAM
1190*5c2921b0SApple OSS Distributions #if defined __STDC__ || defined __cplusplus
1191*5c2921b0SApple OSS Distributions int yyparse(void *YYPARSE_PARAM);
1192*5c2921b0SApple OSS Distributions #else
1193*5c2921b0SApple OSS Distributions int yyparse();
1194*5c2921b0SApple OSS Distributions #endif
1195*5c2921b0SApple OSS Distributions #else /* ! YYPARSE_PARAM */
1196*5c2921b0SApple OSS Distributions #if defined __STDC__ || defined __cplusplus
1197*5c2921b0SApple OSS Distributions int yyparse(void);
1198*5c2921b0SApple OSS Distributions #else
1199*5c2921b0SApple OSS Distributions int yyparse();
1200*5c2921b0SApple OSS Distributions #endif
1201*5c2921b0SApple OSS Distributions #endif /* ! YYPARSE_PARAM */
1202*5c2921b0SApple OSS Distributions
1203*5c2921b0SApple OSS Distributions
1204*5c2921b0SApple OSS Distributions
1205*5c2921b0SApple OSS Distributions /* The look-ahead symbol. */
1206*5c2921b0SApple OSS Distributions int yychar;
1207*5c2921b0SApple OSS Distributions
1208*5c2921b0SApple OSS Distributions /* The semantic value of the look-ahead symbol. */
1209*5c2921b0SApple OSS Distributions YYSTYPE yylval;
1210*5c2921b0SApple OSS Distributions
1211*5c2921b0SApple OSS Distributions /* Number of syntax errors so far. */
1212*5c2921b0SApple OSS Distributions int yynerrs;
1213*5c2921b0SApple OSS Distributions
1214*5c2921b0SApple OSS Distributions
1215*5c2921b0SApple OSS Distributions
1216*5c2921b0SApple OSS Distributions /*----------.
1217*5c2921b0SApple OSS Distributions | yyparse. |
1218*5c2921b0SApple OSS Distributions | `----------*/
1219*5c2921b0SApple OSS Distributions
1220*5c2921b0SApple OSS Distributions #ifdef YYPARSE_PARAM
1221*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
1222*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
1223*5c2921b0SApple OSS Distributions int
yyparse(void * YYPARSE_PARAM)1224*5c2921b0SApple OSS Distributions yyparse(void *YYPARSE_PARAM)
1225*5c2921b0SApple OSS Distributions #else
1226*5c2921b0SApple OSS Distributions int
1227*5c2921b0SApple OSS Distributions yyparse(YYPARSE_PARAM)
1228*5c2921b0SApple OSS Distributions void *YYPARSE_PARAM;
1229*5c2921b0SApple OSS Distributions #endif
1230*5c2921b0SApple OSS Distributions #else /* ! YYPARSE_PARAM */
1231*5c2921b0SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
1232*5c2921b0SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
1233*5c2921b0SApple OSS Distributions int
1234*5c2921b0SApple OSS Distributions yyparse(void)
1235*5c2921b0SApple OSS Distributions #else
1236*5c2921b0SApple OSS Distributions int
1237*5c2921b0SApple OSS Distributions yyparse()
1238*5c2921b0SApple OSS Distributions
1239*5c2921b0SApple OSS Distributions #endif
1240*5c2921b0SApple OSS Distributions #endif
1241*5c2921b0SApple OSS Distributions {
1242*5c2921b0SApple OSS Distributions int yystate;
1243*5c2921b0SApple OSS Distributions int yyn;
1244*5c2921b0SApple OSS Distributions int yyresult;
1245*5c2921b0SApple OSS Distributions /* Number of tokens to shift before error messages enabled. */
1246*5c2921b0SApple OSS Distributions int yyerrstatus;
1247*5c2921b0SApple OSS Distributions /* Look-ahead token as an internal (translated) token number. */
1248*5c2921b0SApple OSS Distributions int yytoken = 0;
1249*5c2921b0SApple OSS Distributions #if YYERROR_VERBOSE
1250*5c2921b0SApple OSS Distributions /* Buffer for error messages, and its allocated size. */
1251*5c2921b0SApple OSS Distributions char yymsgbuf[128];
1252*5c2921b0SApple OSS Distributions char *yymsg = yymsgbuf;
1253*5c2921b0SApple OSS Distributions YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1254*5c2921b0SApple OSS Distributions #endif
1255*5c2921b0SApple OSS Distributions
1256*5c2921b0SApple OSS Distributions /* Three stacks and their tools:
1257*5c2921b0SApple OSS Distributions * `yyss': related to states,
1258*5c2921b0SApple OSS Distributions * `yyvs': related to semantic values,
1259*5c2921b0SApple OSS Distributions * `yyls': related to locations.
1260*5c2921b0SApple OSS Distributions *
1261*5c2921b0SApple OSS Distributions * Refer to the stacks thru separate pointers, to allow yyoverflow
1262*5c2921b0SApple OSS Distributions * to reallocate them elsewhere. */
1263*5c2921b0SApple OSS Distributions
1264*5c2921b0SApple OSS Distributions /* The state stack. */
1265*5c2921b0SApple OSS Distributions yytype_int16 yyssa[YYINITDEPTH];
1266*5c2921b0SApple OSS Distributions yytype_int16 *yyss = yyssa;
1267*5c2921b0SApple OSS Distributions yytype_int16 *yyssp;
1268*5c2921b0SApple OSS Distributions
1269*5c2921b0SApple OSS Distributions /* The semantic value stack. */
1270*5c2921b0SApple OSS Distributions YYSTYPE yyvsa[YYINITDEPTH];
1271*5c2921b0SApple OSS Distributions YYSTYPE *yyvs = yyvsa;
1272*5c2921b0SApple OSS Distributions YYSTYPE *yyvsp;
1273*5c2921b0SApple OSS Distributions
1274*5c2921b0SApple OSS Distributions
1275*5c2921b0SApple OSS Distributions
1276*5c2921b0SApple OSS Distributions #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1277*5c2921b0SApple OSS Distributions
1278*5c2921b0SApple OSS Distributions YYSIZE_T yystacksize = YYINITDEPTH;
1279*5c2921b0SApple OSS Distributions
1280*5c2921b0SApple OSS Distributions /* The variables used to return semantic value and location from the
1281*5c2921b0SApple OSS Distributions * action routines. */
1282*5c2921b0SApple OSS Distributions YYSTYPE yyval;
1283*5c2921b0SApple OSS Distributions
1284*5c2921b0SApple OSS Distributions
1285*5c2921b0SApple OSS Distributions /* The number of symbols on the RHS of the reduced rule.
1286*5c2921b0SApple OSS Distributions * Keep to zero when no symbol should be popped. */
1287*5c2921b0SApple OSS Distributions int yylen = 0;
1288*5c2921b0SApple OSS Distributions
1289*5c2921b0SApple OSS Distributions YYDPRINTF((stderr, "Starting parse\n"));
1290*5c2921b0SApple OSS Distributions
1291*5c2921b0SApple OSS Distributions yystate = 0;
1292*5c2921b0SApple OSS Distributions yyerrstatus = 0;
1293*5c2921b0SApple OSS Distributions yynerrs = 0;
1294*5c2921b0SApple OSS Distributions yychar = YYEMPTY; /* Cause a token to be read. */
1295*5c2921b0SApple OSS Distributions
1296*5c2921b0SApple OSS Distributions /* Initialize stack pointers.
1297*5c2921b0SApple OSS Distributions * Waste one element of value and location stack
1298*5c2921b0SApple OSS Distributions * so that they stay on the same level as the state stack.
1299*5c2921b0SApple OSS Distributions * The wasted elements are never initialized. */
1300*5c2921b0SApple OSS Distributions
1301*5c2921b0SApple OSS Distributions yyssp = yyss;
1302*5c2921b0SApple OSS Distributions yyvsp = yyvs;
1303*5c2921b0SApple OSS Distributions
1304*5c2921b0SApple OSS Distributions goto yysetstate;
1305*5c2921b0SApple OSS Distributions
1306*5c2921b0SApple OSS Distributions /*------------------------------------------------------------.
1307*5c2921b0SApple OSS Distributions | yynewstate -- Push a new state, which is found in yystate. |
1308*5c2921b0SApple OSS Distributions | `------------------------------------------------------------*/
1309*5c2921b0SApple OSS Distributions yynewstate:
1310*5c2921b0SApple OSS Distributions /* In all cases, when you get here, the value and location stacks
1311*5c2921b0SApple OSS Distributions * have just been pushed. So pushing a state here evens the stacks. */
1312*5c2921b0SApple OSS Distributions yyssp++;
1313*5c2921b0SApple OSS Distributions
1314*5c2921b0SApple OSS Distributions yysetstate:
1315*5c2921b0SApple OSS Distributions *yyssp = yystate;
1316*5c2921b0SApple OSS Distributions
1317*5c2921b0SApple OSS Distributions if (yyss + yystacksize - 1 <= yyssp) {
1318*5c2921b0SApple OSS Distributions /* Get the current used size of the three stacks, in elements. */
1319*5c2921b0SApple OSS Distributions YYSIZE_T yysize = yyssp - yyss + 1;
1320*5c2921b0SApple OSS Distributions
1321*5c2921b0SApple OSS Distributions #ifdef yyoverflow
1322*5c2921b0SApple OSS Distributions {
1323*5c2921b0SApple OSS Distributions /* Give user a chance to reallocate the stack. Use copies of
1324*5c2921b0SApple OSS Distributions * these so that the &'s don't force the real ones into
1325*5c2921b0SApple OSS Distributions * memory. */
1326*5c2921b0SApple OSS Distributions YYSTYPE *yyvs1 = yyvs;
1327*5c2921b0SApple OSS Distributions yytype_int16 *yyss1 = yyss;
1328*5c2921b0SApple OSS Distributions
1329*5c2921b0SApple OSS Distributions
1330*5c2921b0SApple OSS Distributions /* Each stack pointer address is followed by the size of the
1331*5c2921b0SApple OSS Distributions * data in use in that stack, in bytes. This used to be a
1332*5c2921b0SApple OSS Distributions * conditional around just the two extra args, but that might
1333*5c2921b0SApple OSS Distributions * be undefined if yyoverflow is a macro. */
1334*5c2921b0SApple OSS Distributions yyoverflow(YY_("memory exhausted"),
1335*5c2921b0SApple OSS Distributions &yyss1, yysize * sizeof(*yyssp),
1336*5c2921b0SApple OSS Distributions &yyvs1, yysize * sizeof(*yyvsp),
1337*5c2921b0SApple OSS Distributions
1338*5c2921b0SApple OSS Distributions &yystacksize);
1339*5c2921b0SApple OSS Distributions
1340*5c2921b0SApple OSS Distributions yyss = yyss1;
1341*5c2921b0SApple OSS Distributions yyvs = yyvs1;
1342*5c2921b0SApple OSS Distributions }
1343*5c2921b0SApple OSS Distributions #else /* no yyoverflow */
1344*5c2921b0SApple OSS Distributions # ifndef YYSTACK_RELOCATE
1345*5c2921b0SApple OSS Distributions goto yyexhaustedlab;
1346*5c2921b0SApple OSS Distributions # else
1347*5c2921b0SApple OSS Distributions /* Extend the stack our own way. */
1348*5c2921b0SApple OSS Distributions if (YYMAXDEPTH <= yystacksize) {
1349*5c2921b0SApple OSS Distributions goto yyexhaustedlab;
1350*5c2921b0SApple OSS Distributions }
1351*5c2921b0SApple OSS Distributions yystacksize *= 2;
1352*5c2921b0SApple OSS Distributions if (YYMAXDEPTH < yystacksize) {
1353*5c2921b0SApple OSS Distributions yystacksize = YYMAXDEPTH;
1354*5c2921b0SApple OSS Distributions }
1355*5c2921b0SApple OSS Distributions
1356*5c2921b0SApple OSS Distributions {
1357*5c2921b0SApple OSS Distributions yytype_int16 *yyss1 = yyss;
1358*5c2921b0SApple OSS Distributions union yyalloc *yyptr =
1359*5c2921b0SApple OSS Distributions (union yyalloc *) YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
1360*5c2921b0SApple OSS Distributions if (!yyptr) {
1361*5c2921b0SApple OSS Distributions goto yyexhaustedlab;
1362*5c2921b0SApple OSS Distributions }
1363*5c2921b0SApple OSS Distributions YYSTACK_RELOCATE(yyss);
1364*5c2921b0SApple OSS Distributions YYSTACK_RELOCATE(yyvs);
1365*5c2921b0SApple OSS Distributions
1366*5c2921b0SApple OSS Distributions # undef YYSTACK_RELOCATE
1367*5c2921b0SApple OSS Distributions if (yyss1 != yyssa) {
1368*5c2921b0SApple OSS Distributions YYSTACK_FREE(yyss1);
1369*5c2921b0SApple OSS Distributions }
1370*5c2921b0SApple OSS Distributions }
1371*5c2921b0SApple OSS Distributions # endif
1372*5c2921b0SApple OSS Distributions #endif /* no yyoverflow */
1373*5c2921b0SApple OSS Distributions
1374*5c2921b0SApple OSS Distributions yyssp = yyss + yysize - 1;
1375*5c2921b0SApple OSS Distributions yyvsp = yyvs + yysize - 1;
1376*5c2921b0SApple OSS Distributions
1377*5c2921b0SApple OSS Distributions
1378*5c2921b0SApple OSS Distributions YYDPRINTF((stderr, "Stack size increased to %lu\n",
1379*5c2921b0SApple OSS Distributions (unsigned long int) yystacksize));
1380*5c2921b0SApple OSS Distributions
1381*5c2921b0SApple OSS Distributions if (yyss + yystacksize - 1 <= yyssp) {
1382*5c2921b0SApple OSS Distributions YYABORT;
1383*5c2921b0SApple OSS Distributions }
1384*5c2921b0SApple OSS Distributions }
1385*5c2921b0SApple OSS Distributions
1386*5c2921b0SApple OSS Distributions YYDPRINTF((stderr, "Entering state %d\n", yystate));
1387*5c2921b0SApple OSS Distributions
1388*5c2921b0SApple OSS Distributions goto yybackup;
1389*5c2921b0SApple OSS Distributions
1390*5c2921b0SApple OSS Distributions /*-----------.
1391*5c2921b0SApple OSS Distributions | yybackup. |
1392*5c2921b0SApple OSS Distributions | `-----------*/
1393*5c2921b0SApple OSS Distributions yybackup:
1394*5c2921b0SApple OSS Distributions
1395*5c2921b0SApple OSS Distributions /* Do appropriate processing given the current state. Read a
1396*5c2921b0SApple OSS Distributions * look-ahead token if we need one and don't already have one. */
1397*5c2921b0SApple OSS Distributions
1398*5c2921b0SApple OSS Distributions /* First try to decide what to do without reference to look-ahead token. */
1399*5c2921b0SApple OSS Distributions yyn = yypact[yystate];
1400*5c2921b0SApple OSS Distributions if (yyn == YYPACT_NINF) {
1401*5c2921b0SApple OSS Distributions goto yydefault;
1402*5c2921b0SApple OSS Distributions }
1403*5c2921b0SApple OSS Distributions
1404*5c2921b0SApple OSS Distributions /* Not known => get a look-ahead token if don't already have one. */
1405*5c2921b0SApple OSS Distributions
1406*5c2921b0SApple OSS Distributions /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1407*5c2921b0SApple OSS Distributions if (yychar == YYEMPTY) {
1408*5c2921b0SApple OSS Distributions YYDPRINTF((stderr, "Reading a token: "));
1409*5c2921b0SApple OSS Distributions yychar = YYLEX;
1410*5c2921b0SApple OSS Distributions }
1411*5c2921b0SApple OSS Distributions
1412*5c2921b0SApple OSS Distributions if (yychar <= YYEOF) {
1413*5c2921b0SApple OSS Distributions yychar = yytoken = YYEOF;
1414*5c2921b0SApple OSS Distributions YYDPRINTF((stderr, "Now at end of input.\n"));
1415*5c2921b0SApple OSS Distributions } else {
1416*5c2921b0SApple OSS Distributions yytoken = YYTRANSLATE(yychar);
1417*5c2921b0SApple OSS Distributions YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
1418*5c2921b0SApple OSS Distributions }
1419*5c2921b0SApple OSS Distributions
1420*5c2921b0SApple OSS Distributions /* If the proper action on seeing token YYTOKEN is to reduce or to
1421*5c2921b0SApple OSS Distributions * detect an error, take that action. */
1422*5c2921b0SApple OSS Distributions yyn += yytoken;
1423*5c2921b0SApple OSS Distributions if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) {
1424*5c2921b0SApple OSS Distributions goto yydefault;
1425*5c2921b0SApple OSS Distributions }
1426*5c2921b0SApple OSS Distributions yyn = yytable[yyn];
1427*5c2921b0SApple OSS Distributions if (yyn <= 0) {
1428*5c2921b0SApple OSS Distributions if (yyn == 0 || yyn == YYTABLE_NINF) {
1429*5c2921b0SApple OSS Distributions goto yyerrlab;
1430*5c2921b0SApple OSS Distributions }
1431*5c2921b0SApple OSS Distributions yyn = -yyn;
1432*5c2921b0SApple OSS Distributions goto yyreduce;
1433*5c2921b0SApple OSS Distributions }
1434*5c2921b0SApple OSS Distributions
1435*5c2921b0SApple OSS Distributions if (yyn == YYFINAL) {
1436*5c2921b0SApple OSS Distributions YYACCEPT;
1437*5c2921b0SApple OSS Distributions }
1438*5c2921b0SApple OSS Distributions
1439*5c2921b0SApple OSS Distributions /* Count tokens shifted since error; after three, turn off error
1440*5c2921b0SApple OSS Distributions * status. */
1441*5c2921b0SApple OSS Distributions if (yyerrstatus) {
1442*5c2921b0SApple OSS Distributions yyerrstatus--;
1443*5c2921b0SApple OSS Distributions }
1444*5c2921b0SApple OSS Distributions
1445*5c2921b0SApple OSS Distributions /* Shift the look-ahead token. */
1446*5c2921b0SApple OSS Distributions YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
1447*5c2921b0SApple OSS Distributions
1448*5c2921b0SApple OSS Distributions /* Discard the shifted token unless it is eof. */
1449*5c2921b0SApple OSS Distributions if (yychar != YYEOF) {
1450*5c2921b0SApple OSS Distributions yychar = YYEMPTY;
1451*5c2921b0SApple OSS Distributions }
1452*5c2921b0SApple OSS Distributions
1453*5c2921b0SApple OSS Distributions yystate = yyn;
1454*5c2921b0SApple OSS Distributions *++yyvsp = yylval;
1455*5c2921b0SApple OSS Distributions
1456*5c2921b0SApple OSS Distributions goto yynewstate;
1457*5c2921b0SApple OSS Distributions
1458*5c2921b0SApple OSS Distributions
1459*5c2921b0SApple OSS Distributions /*-----------------------------------------------------------.
1460*5c2921b0SApple OSS Distributions | yydefault -- do the default action for the current state. |
1461*5c2921b0SApple OSS Distributions | `-----------------------------------------------------------*/
1462*5c2921b0SApple OSS Distributions yydefault:
1463*5c2921b0SApple OSS Distributions yyn = yydefact[yystate];
1464*5c2921b0SApple OSS Distributions if (yyn == 0) {
1465*5c2921b0SApple OSS Distributions goto yyerrlab;
1466*5c2921b0SApple OSS Distributions }
1467*5c2921b0SApple OSS Distributions goto yyreduce;
1468*5c2921b0SApple OSS Distributions
1469*5c2921b0SApple OSS Distributions
1470*5c2921b0SApple OSS Distributions /*-----------------------------.
1471*5c2921b0SApple OSS Distributions | yyreduce -- Do a reduction. |
1472*5c2921b0SApple OSS Distributions | `-----------------------------*/
1473*5c2921b0SApple OSS Distributions yyreduce:
1474*5c2921b0SApple OSS Distributions /* yyn is the number of a rule to reduce with. */
1475*5c2921b0SApple OSS Distributions yylen = yyr2[yyn];
1476*5c2921b0SApple OSS Distributions
1477*5c2921b0SApple OSS Distributions /* If YYLEN is nonzero, implement the default value of the action:
1478*5c2921b0SApple OSS Distributions * `$$ = $1'.
1479*5c2921b0SApple OSS Distributions *
1480*5c2921b0SApple OSS Distributions * Otherwise, the following line sets YYVAL to garbage.
1481*5c2921b0SApple OSS Distributions * This behavior is undocumented and Bison
1482*5c2921b0SApple OSS Distributions * users should not rely upon it. Assigning to YYVAL
1483*5c2921b0SApple OSS Distributions * unconditionally makes the parser a bit smaller, and it avoids a
1484*5c2921b0SApple OSS Distributions * GCC warning that YYVAL may be used uninitialized. */
1485*5c2921b0SApple OSS Distributions yyval = yyvsp[1 - yylen];
1486*5c2921b0SApple OSS Distributions
1487*5c2921b0SApple OSS Distributions
1488*5c2921b0SApple OSS Distributions YY_REDUCE_PRINT(yyn);
1489*5c2921b0SApple OSS Distributions switch (yyn) {
1490*5c2921b0SApple OSS Distributions case 2:
1491*5c2921b0SApple OSS Distributions #line 168 "OSUnserialize.y"
1492*5c2921b0SApple OSS Distributions { parsedObject = (OSObject *)NULL; YYACCEPT;;}
1493*5c2921b0SApple OSS Distributions break;
1494*5c2921b0SApple OSS Distributions
1495*5c2921b0SApple OSS Distributions case 3:
1496*5c2921b0SApple OSS Distributions #line 169 "OSUnserialize.y"
1497*5c2921b0SApple OSS Distributions { parsedObject = (OSObject *)(yyvsp[(1) - (1)]); YYACCEPT;;}
1498*5c2921b0SApple OSS Distributions break;
1499*5c2921b0SApple OSS Distributions
1500*5c2921b0SApple OSS Distributions case 4:
1501*5c2921b0SApple OSS Distributions #line 170 "OSUnserialize.y"
1502*5c2921b0SApple OSS Distributions { yyerror("syntax error"); YYERROR;;}
1503*5c2921b0SApple OSS Distributions break;
1504*5c2921b0SApple OSS Distributions
1505*5c2921b0SApple OSS Distributions case 5:
1506*5c2921b0SApple OSS Distributions #line 173 "OSUnserialize.y"
1507*5c2921b0SApple OSS Distributions { (yyval) = (object_t *)buildOSDictionary((yyvsp[(1) - (1)]));;}
1508*5c2921b0SApple OSS Distributions break;
1509*5c2921b0SApple OSS Distributions
1510*5c2921b0SApple OSS Distributions case 6:
1511*5c2921b0SApple OSS Distributions #line 174 "OSUnserialize.y"
1512*5c2921b0SApple OSS Distributions { (yyval) = (object_t *)buildOSArray((yyvsp[(1) - (1)]));;}
1513*5c2921b0SApple OSS Distributions break;
1514*5c2921b0SApple OSS Distributions
1515*5c2921b0SApple OSS Distributions case 7:
1516*5c2921b0SApple OSS Distributions #line 175 "OSUnserialize.y"
1517*5c2921b0SApple OSS Distributions { (yyval) = (object_t *)buildOSSet((yyvsp[(1) - (1)]));;}
1518*5c2921b0SApple OSS Distributions break;
1519*5c2921b0SApple OSS Distributions
1520*5c2921b0SApple OSS Distributions case 8:
1521*5c2921b0SApple OSS Distributions #line 176 "OSUnserialize.y"
1522*5c2921b0SApple OSS Distributions { (yyval) = (object_t *)buildOSString((yyvsp[(1) - (1)]));;}
1523*5c2921b0SApple OSS Distributions break;
1524*5c2921b0SApple OSS Distributions
1525*5c2921b0SApple OSS Distributions case 9:
1526*5c2921b0SApple OSS Distributions #line 177 "OSUnserialize.y"
1527*5c2921b0SApple OSS Distributions { (yyval) = (object_t *)buildOSData((yyvsp[(1) - (1)]));;}
1528*5c2921b0SApple OSS Distributions break;
1529*5c2921b0SApple OSS Distributions
1530*5c2921b0SApple OSS Distributions case 10:
1531*5c2921b0SApple OSS Distributions #line 178 "OSUnserialize.y"
1532*5c2921b0SApple OSS Distributions { (yyval) = (object_t *)buildOSOffset((yyvsp[(1) - (1)]));;}
1533*5c2921b0SApple OSS Distributions break;
1534*5c2921b0SApple OSS Distributions
1535*5c2921b0SApple OSS Distributions case 11:
1536*5c2921b0SApple OSS Distributions #line 179 "OSUnserialize.y"
1537*5c2921b0SApple OSS Distributions { (yyval) = (object_t *)buildOSBoolean((yyvsp[(1) - (1)]));;}
1538*5c2921b0SApple OSS Distributions break;
1539*5c2921b0SApple OSS Distributions
1540*5c2921b0SApple OSS Distributions case 12:
1541*5c2921b0SApple OSS Distributions #line 180 "OSUnserialize.y"
1542*5c2921b0SApple OSS Distributions { (yyval) = (object_t *)retrieveObject((yyvsp[(2) - (2)])->u.offset);
1543*5c2921b0SApple OSS Distributions if ((yyval)) {
1544*5c2921b0SApple OSS Distributions ((OSObject *)(yyval))->retain();
1545*5c2921b0SApple OSS Distributions } else {
1546*5c2921b0SApple OSS Distributions yyerror("forward reference detected");
1547*5c2921b0SApple OSS Distributions YYERROR;
1548*5c2921b0SApple OSS Distributions }
1549*5c2921b0SApple OSS Distributions freeObject((yyvsp[(2) - (2)]));
1550*5c2921b0SApple OSS Distributions ;}
1551*5c2921b0SApple OSS Distributions break;
1552*5c2921b0SApple OSS Distributions
1553*5c2921b0SApple OSS Distributions case 13:
1554*5c2921b0SApple OSS Distributions #line 189 "OSUnserialize.y"
1555*5c2921b0SApple OSS Distributions { (yyval) = (yyvsp[(1) - (3)]);
1556*5c2921b0SApple OSS Distributions rememberObject((yyvsp[(3) - (3)])->u.offset, (yyvsp[(1) - (3)]));
1557*5c2921b0SApple OSS Distributions freeObject((yyvsp[(3) - (3)]));
1558*5c2921b0SApple OSS Distributions ;}
1559*5c2921b0SApple OSS Distributions break;
1560*5c2921b0SApple OSS Distributions
1561*5c2921b0SApple OSS Distributions case 14:
1562*5c2921b0SApple OSS Distributions #line 197 "OSUnserialize.y"
1563*5c2921b0SApple OSS Distributions { (yyval) = NULL;;}
1564*5c2921b0SApple OSS Distributions break;
1565*5c2921b0SApple OSS Distributions
1566*5c2921b0SApple OSS Distributions case 15:
1567*5c2921b0SApple OSS Distributions #line 198 "OSUnserialize.y"
1568*5c2921b0SApple OSS Distributions { (yyval) = (yyvsp[(2) - (3)]);;}
1569*5c2921b0SApple OSS Distributions break;
1570*5c2921b0SApple OSS Distributions
1571*5c2921b0SApple OSS Distributions case 17:
1572*5c2921b0SApple OSS Distributions #line 202 "OSUnserialize.y"
1573*5c2921b0SApple OSS Distributions { (yyvsp[(2) - (2)])->next = (yyvsp[(1) - (2)]); (yyvsp[(1) - (2)])->prev = (yyvsp[(2) - (2)]); (yyval) = (yyvsp[(2) - (2)]);;}
1574*5c2921b0SApple OSS Distributions break;
1575*5c2921b0SApple OSS Distributions
1576*5c2921b0SApple OSS Distributions case 18:
1577*5c2921b0SApple OSS Distributions #line 205 "OSUnserialize.y"
1578*5c2921b0SApple OSS Distributions { (yyval) = newObject();
1579*5c2921b0SApple OSS Distributions (yyval)->next = NULL;
1580*5c2921b0SApple OSS Distributions (yyval)->prev = NULL;
1581*5c2921b0SApple OSS Distributions (yyval)->u.key = (yyvsp[(1) - (4)]);
1582*5c2921b0SApple OSS Distributions (yyval)->object = (yyvsp[(3) - (4)]);
1583*5c2921b0SApple OSS Distributions ;}
1584*5c2921b0SApple OSS Distributions break;
1585*5c2921b0SApple OSS Distributions
1586*5c2921b0SApple OSS Distributions case 19:
1587*5c2921b0SApple OSS Distributions #line 215 "OSUnserialize.y"
1588*5c2921b0SApple OSS Distributions { (yyval) = NULL;;}
1589*5c2921b0SApple OSS Distributions break;
1590*5c2921b0SApple OSS Distributions
1591*5c2921b0SApple OSS Distributions case 20:
1592*5c2921b0SApple OSS Distributions #line 216 "OSUnserialize.y"
1593*5c2921b0SApple OSS Distributions { (yyval) = (yyvsp[(2) - (3)]);;}
1594*5c2921b0SApple OSS Distributions break;
1595*5c2921b0SApple OSS Distributions
1596*5c2921b0SApple OSS Distributions case 21:
1597*5c2921b0SApple OSS Distributions #line 219 "OSUnserialize.y"
1598*5c2921b0SApple OSS Distributions { (yyval) = NULL;;}
1599*5c2921b0SApple OSS Distributions break;
1600*5c2921b0SApple OSS Distributions
1601*5c2921b0SApple OSS Distributions case 22:
1602*5c2921b0SApple OSS Distributions #line 220 "OSUnserialize.y"
1603*5c2921b0SApple OSS Distributions { (yyval) = (yyvsp[(2) - (3)]);;}
1604*5c2921b0SApple OSS Distributions break;
1605*5c2921b0SApple OSS Distributions
1606*5c2921b0SApple OSS Distributions case 23:
1607*5c2921b0SApple OSS Distributions #line 223 "OSUnserialize.y"
1608*5c2921b0SApple OSS Distributions { (yyval) = newObject();
1609*5c2921b0SApple OSS Distributions (yyval)->object = (yyvsp[(1) - (1)]);
1610*5c2921b0SApple OSS Distributions (yyval)->next = NULL;
1611*5c2921b0SApple OSS Distributions (yyval)->prev = NULL;
1612*5c2921b0SApple OSS Distributions ;}
1613*5c2921b0SApple OSS Distributions break;
1614*5c2921b0SApple OSS Distributions
1615*5c2921b0SApple OSS Distributions case 24:
1616*5c2921b0SApple OSS Distributions #line 228 "OSUnserialize.y"
1617*5c2921b0SApple OSS Distributions { oo = newObject();
1618*5c2921b0SApple OSS Distributions oo->object = (yyvsp[(3) - (3)]);
1619*5c2921b0SApple OSS Distributions oo->next = (yyvsp[(1) - (3)]);
1620*5c2921b0SApple OSS Distributions oo->prev = NULL;
1621*5c2921b0SApple OSS Distributions (yyvsp[(1) - (3)])->prev = oo;
1622*5c2921b0SApple OSS Distributions (yyval) = oo;
1623*5c2921b0SApple OSS Distributions ;}
1624*5c2921b0SApple OSS Distributions break;
1625*5c2921b0SApple OSS Distributions
1626*5c2921b0SApple OSS Distributions case 25:
1627*5c2921b0SApple OSS Distributions #line 239 "OSUnserialize.y"
1628*5c2921b0SApple OSS Distributions { (yyval) = (yyvsp[(1) - (3)]);
1629*5c2921b0SApple OSS Distributions (yyval)->size = (yyvsp[(3) - (3)])->u.offset;
1630*5c2921b0SApple OSS Distributions freeObject((yyvsp[(3) - (3)]));
1631*5c2921b0SApple OSS Distributions ;}
1632*5c2921b0SApple OSS Distributions break;
1633*5c2921b0SApple OSS Distributions
1634*5c2921b0SApple OSS Distributions
1635*5c2921b0SApple OSS Distributions /* Line 1267 of yacc.c. */
1636*5c2921b0SApple OSS Distributions #line 1602 "OSUnserialize.tab.c"
1637*5c2921b0SApple OSS Distributions default: break;
1638*5c2921b0SApple OSS Distributions }
1639*5c2921b0SApple OSS Distributions YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1640*5c2921b0SApple OSS Distributions
1641*5c2921b0SApple OSS Distributions YYPOPSTACK(yylen);
1642*5c2921b0SApple OSS Distributions yylen = 0;
1643*5c2921b0SApple OSS Distributions YY_STACK_PRINT(yyss, yyssp);
1644*5c2921b0SApple OSS Distributions
1645*5c2921b0SApple OSS Distributions *++yyvsp = yyval;
1646*5c2921b0SApple OSS Distributions
1647*5c2921b0SApple OSS Distributions
1648*5c2921b0SApple OSS Distributions /* Now `shift' the result of the reduction. Determine what state
1649*5c2921b0SApple OSS Distributions * that goes to, based on the state we popped back to and the rule
1650*5c2921b0SApple OSS Distributions * number reduced by. */
1651*5c2921b0SApple OSS Distributions
1652*5c2921b0SApple OSS Distributions yyn = yyr1[yyn];
1653*5c2921b0SApple OSS Distributions
1654*5c2921b0SApple OSS Distributions yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1655*5c2921b0SApple OSS Distributions if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) {
1656*5c2921b0SApple OSS Distributions yystate = yytable[yystate];
1657*5c2921b0SApple OSS Distributions } else {
1658*5c2921b0SApple OSS Distributions yystate = yydefgoto[yyn - YYNTOKENS];
1659*5c2921b0SApple OSS Distributions }
1660*5c2921b0SApple OSS Distributions
1661*5c2921b0SApple OSS Distributions goto yynewstate;
1662*5c2921b0SApple OSS Distributions
1663*5c2921b0SApple OSS Distributions
1664*5c2921b0SApple OSS Distributions /*------------------------------------.
1665*5c2921b0SApple OSS Distributions | yyerrlab -- here on detecting error |
1666*5c2921b0SApple OSS Distributions | `------------------------------------*/
1667*5c2921b0SApple OSS Distributions yyerrlab:
1668*5c2921b0SApple OSS Distributions /* If not already recovering from an error, report this error. */
1669*5c2921b0SApple OSS Distributions if (!yyerrstatus) {
1670*5c2921b0SApple OSS Distributions ++yynerrs;
1671*5c2921b0SApple OSS Distributions #if !YYERROR_VERBOSE
1672*5c2921b0SApple OSS Distributions yyerror(YY_("syntax error"));
1673*5c2921b0SApple OSS Distributions #else
1674*5c2921b0SApple OSS Distributions {
1675*5c2921b0SApple OSS Distributions YYSIZE_T yysize = yysyntax_error(0, yystate, yychar);
1676*5c2921b0SApple OSS Distributions if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) {
1677*5c2921b0SApple OSS Distributions YYSIZE_T yyalloc = 2 * yysize;
1678*5c2921b0SApple OSS Distributions if (!(yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) {
1679*5c2921b0SApple OSS Distributions yyalloc = YYSTACK_ALLOC_MAXIMUM;
1680*5c2921b0SApple OSS Distributions }
1681*5c2921b0SApple OSS Distributions if (yymsg != yymsgbuf) {
1682*5c2921b0SApple OSS Distributions YYSTACK_FREE(yymsg);
1683*5c2921b0SApple OSS Distributions }
1684*5c2921b0SApple OSS Distributions yymsg = (char *) YYSTACK_ALLOC(yyalloc);
1685*5c2921b0SApple OSS Distributions if (yymsg) {
1686*5c2921b0SApple OSS Distributions yymsg_alloc = yyalloc;
1687*5c2921b0SApple OSS Distributions } else {
1688*5c2921b0SApple OSS Distributions yymsg = yymsgbuf;
1689*5c2921b0SApple OSS Distributions yymsg_alloc = sizeof yymsgbuf;
1690*5c2921b0SApple OSS Distributions }
1691*5c2921b0SApple OSS Distributions }
1692*5c2921b0SApple OSS Distributions
1693*5c2921b0SApple OSS Distributions if (0 < yysize && yysize <= yymsg_alloc) {
1694*5c2921b0SApple OSS Distributions (void) yysyntax_error(yymsg, yystate, yychar);
1695*5c2921b0SApple OSS Distributions yyerror(yymsg);
1696*5c2921b0SApple OSS Distributions } else {
1697*5c2921b0SApple OSS Distributions yyerror(YY_("syntax error"));
1698*5c2921b0SApple OSS Distributions if (yysize != 0) {
1699*5c2921b0SApple OSS Distributions goto yyexhaustedlab;
1700*5c2921b0SApple OSS Distributions }
1701*5c2921b0SApple OSS Distributions }
1702*5c2921b0SApple OSS Distributions }
1703*5c2921b0SApple OSS Distributions #endif
1704*5c2921b0SApple OSS Distributions }
1705*5c2921b0SApple OSS Distributions
1706*5c2921b0SApple OSS Distributions
1707*5c2921b0SApple OSS Distributions
1708*5c2921b0SApple OSS Distributions if (yyerrstatus == 3) {
1709*5c2921b0SApple OSS Distributions /* If just tried and failed to reuse look-ahead token after an
1710*5c2921b0SApple OSS Distributions * error, discard it. */
1711*5c2921b0SApple OSS Distributions
1712*5c2921b0SApple OSS Distributions if (yychar <= YYEOF) {
1713*5c2921b0SApple OSS Distributions /* Return failure if at end of input. */
1714*5c2921b0SApple OSS Distributions if (yychar == YYEOF) {
1715*5c2921b0SApple OSS Distributions YYABORT;
1716*5c2921b0SApple OSS Distributions }
1717*5c2921b0SApple OSS Distributions } else {
1718*5c2921b0SApple OSS Distributions yydestruct("Error: discarding",
1719*5c2921b0SApple OSS Distributions yytoken, &yylval);
1720*5c2921b0SApple OSS Distributions yychar = YYEMPTY;
1721*5c2921b0SApple OSS Distributions }
1722*5c2921b0SApple OSS Distributions }
1723*5c2921b0SApple OSS Distributions
1724*5c2921b0SApple OSS Distributions /* Else will try to reuse look-ahead token after shifting the error
1725*5c2921b0SApple OSS Distributions * token. */
1726*5c2921b0SApple OSS Distributions goto yyerrlab1;
1727*5c2921b0SApple OSS Distributions
1728*5c2921b0SApple OSS Distributions
1729*5c2921b0SApple OSS Distributions /*---------------------------------------------------.
1730*5c2921b0SApple OSS Distributions | yyerrorlab -- error raised explicitly by YYERROR. |
1731*5c2921b0SApple OSS Distributions | `---------------------------------------------------*/
1732*5c2921b0SApple OSS Distributions yyerrorlab:
1733*5c2921b0SApple OSS Distributions
1734*5c2921b0SApple OSS Distributions /* Pacify compilers like GCC when the user code never invokes
1735*5c2921b0SApple OSS Distributions * YYERROR and the label yyerrorlab therefore never appears in user
1736*5c2921b0SApple OSS Distributions * code. */
1737*5c2921b0SApple OSS Distributions if (/*CONSTCOND*/ 0) {
1738*5c2921b0SApple OSS Distributions goto yyerrorlab;
1739*5c2921b0SApple OSS Distributions }
1740*5c2921b0SApple OSS Distributions
1741*5c2921b0SApple OSS Distributions /* Do not reclaim the symbols of the rule which action triggered
1742*5c2921b0SApple OSS Distributions * this YYERROR. */
1743*5c2921b0SApple OSS Distributions YYPOPSTACK(yylen);
1744*5c2921b0SApple OSS Distributions yylen = 0;
1745*5c2921b0SApple OSS Distributions YY_STACK_PRINT(yyss, yyssp);
1746*5c2921b0SApple OSS Distributions yystate = *yyssp;
1747*5c2921b0SApple OSS Distributions goto yyerrlab1;
1748*5c2921b0SApple OSS Distributions
1749*5c2921b0SApple OSS Distributions
1750*5c2921b0SApple OSS Distributions /*-------------------------------------------------------------.
1751*5c2921b0SApple OSS Distributions | yyerrlab1 -- common code for both syntax error and YYERROR. |
1752*5c2921b0SApple OSS Distributions | `-------------------------------------------------------------*/
1753*5c2921b0SApple OSS Distributions yyerrlab1:
1754*5c2921b0SApple OSS Distributions yyerrstatus = 3; /* Each real token shifted decrements this. */
1755*5c2921b0SApple OSS Distributions
1756*5c2921b0SApple OSS Distributions for (;;) {
1757*5c2921b0SApple OSS Distributions yyn = yypact[yystate];
1758*5c2921b0SApple OSS Distributions if (yyn != YYPACT_NINF) {
1759*5c2921b0SApple OSS Distributions yyn += YYTERROR;
1760*5c2921b0SApple OSS Distributions if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) {
1761*5c2921b0SApple OSS Distributions yyn = yytable[yyn];
1762*5c2921b0SApple OSS Distributions if (0 < yyn) {
1763*5c2921b0SApple OSS Distributions break;
1764*5c2921b0SApple OSS Distributions }
1765*5c2921b0SApple OSS Distributions }
1766*5c2921b0SApple OSS Distributions }
1767*5c2921b0SApple OSS Distributions
1768*5c2921b0SApple OSS Distributions /* Pop the current state because it cannot handle the error token. */
1769*5c2921b0SApple OSS Distributions if (yyssp == yyss) {
1770*5c2921b0SApple OSS Distributions YYABORT;
1771*5c2921b0SApple OSS Distributions }
1772*5c2921b0SApple OSS Distributions
1773*5c2921b0SApple OSS Distributions
1774*5c2921b0SApple OSS Distributions yydestruct("Error: popping",
1775*5c2921b0SApple OSS Distributions yystos[yystate], yyvsp);
1776*5c2921b0SApple OSS Distributions YYPOPSTACK(1);
1777*5c2921b0SApple OSS Distributions yystate = *yyssp;
1778*5c2921b0SApple OSS Distributions YY_STACK_PRINT(yyss, yyssp);
1779*5c2921b0SApple OSS Distributions }
1780*5c2921b0SApple OSS Distributions
1781*5c2921b0SApple OSS Distributions if (yyn == YYFINAL) {
1782*5c2921b0SApple OSS Distributions YYACCEPT;
1783*5c2921b0SApple OSS Distributions }
1784*5c2921b0SApple OSS Distributions
1785*5c2921b0SApple OSS Distributions *++yyvsp = yylval;
1786*5c2921b0SApple OSS Distributions
1787*5c2921b0SApple OSS Distributions
1788*5c2921b0SApple OSS Distributions /* Shift the error token. */
1789*5c2921b0SApple OSS Distributions YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
1790*5c2921b0SApple OSS Distributions
1791*5c2921b0SApple OSS Distributions yystate = yyn;
1792*5c2921b0SApple OSS Distributions goto yynewstate;
1793*5c2921b0SApple OSS Distributions
1794*5c2921b0SApple OSS Distributions
1795*5c2921b0SApple OSS Distributions /*-------------------------------------.
1796*5c2921b0SApple OSS Distributions | yyacceptlab -- YYACCEPT comes here. |
1797*5c2921b0SApple OSS Distributions | `-------------------------------------*/
1798*5c2921b0SApple OSS Distributions yyacceptlab:
1799*5c2921b0SApple OSS Distributions yyresult = 0;
1800*5c2921b0SApple OSS Distributions goto yyreturn;
1801*5c2921b0SApple OSS Distributions
1802*5c2921b0SApple OSS Distributions /*-----------------------------------.
1803*5c2921b0SApple OSS Distributions | yyabortlab -- YYABORT comes here. |
1804*5c2921b0SApple OSS Distributions | `-----------------------------------*/
1805*5c2921b0SApple OSS Distributions yyabortlab:
1806*5c2921b0SApple OSS Distributions yyresult = 1;
1807*5c2921b0SApple OSS Distributions goto yyreturn;
1808*5c2921b0SApple OSS Distributions
1809*5c2921b0SApple OSS Distributions #ifndef yyoverflow
1810*5c2921b0SApple OSS Distributions /*-------------------------------------------------.
1811*5c2921b0SApple OSS Distributions | yyexhaustedlab -- memory exhaustion comes here. |
1812*5c2921b0SApple OSS Distributions | `-------------------------------------------------*/
1813*5c2921b0SApple OSS Distributions yyexhaustedlab:
1814*5c2921b0SApple OSS Distributions yyerror(YY_("memory exhausted"));
1815*5c2921b0SApple OSS Distributions yyresult = 2;
1816*5c2921b0SApple OSS Distributions /* Fall through. */
1817*5c2921b0SApple OSS Distributions #endif
1818*5c2921b0SApple OSS Distributions
1819*5c2921b0SApple OSS Distributions yyreturn:
1820*5c2921b0SApple OSS Distributions if (yychar != YYEOF && yychar != YYEMPTY) {
1821*5c2921b0SApple OSS Distributions yydestruct("Cleanup: discarding lookahead",
1822*5c2921b0SApple OSS Distributions yytoken, &yylval);
1823*5c2921b0SApple OSS Distributions }
1824*5c2921b0SApple OSS Distributions /* Do not reclaim the symbols of the rule which action triggered
1825*5c2921b0SApple OSS Distributions * this YYABORT or YYACCEPT. */
1826*5c2921b0SApple OSS Distributions YYPOPSTACK(yylen);
1827*5c2921b0SApple OSS Distributions YY_STACK_PRINT(yyss, yyssp);
1828*5c2921b0SApple OSS Distributions while (yyssp != yyss) {
1829*5c2921b0SApple OSS Distributions yydestruct("Cleanup: popping",
1830*5c2921b0SApple OSS Distributions yystos[*yyssp], yyvsp);
1831*5c2921b0SApple OSS Distributions YYPOPSTACK(1);
1832*5c2921b0SApple OSS Distributions }
1833*5c2921b0SApple OSS Distributions #ifndef yyoverflow
1834*5c2921b0SApple OSS Distributions if (yyss != yyssa) {
1835*5c2921b0SApple OSS Distributions YYSTACK_FREE(yyss);
1836*5c2921b0SApple OSS Distributions }
1837*5c2921b0SApple OSS Distributions #endif
1838*5c2921b0SApple OSS Distributions #if YYERROR_VERBOSE
1839*5c2921b0SApple OSS Distributions if (yymsg != yymsgbuf) {
1840*5c2921b0SApple OSS Distributions YYSTACK_FREE(yymsg);
1841*5c2921b0SApple OSS Distributions }
1842*5c2921b0SApple OSS Distributions #endif
1843*5c2921b0SApple OSS Distributions /* Make sure YYID is used. */
1844*5c2921b0SApple OSS Distributions return YYID(yyresult);
1845*5c2921b0SApple OSS Distributions }
1846*5c2921b0SApple OSS Distributions
1847*5c2921b0SApple OSS Distributions
1848*5c2921b0SApple OSS Distributions #line 260 "OSUnserialize.y"
1849*5c2921b0SApple OSS Distributions
1850*5c2921b0SApple OSS Distributions
1851*5c2921b0SApple OSS Distributions static int lineNumber = 0;
1852*5c2921b0SApple OSS Distributions static const char *parseBuffer;
1853*5c2921b0SApple OSS Distributions static int parseBufferIndex;
1854*5c2921b0SApple OSS Distributions
1855*5c2921b0SApple OSS Distributions #define currentChar() (parseBuffer[parseBufferIndex])
1856*5c2921b0SApple OSS Distributions #define nextChar() (parseBuffer[++parseBufferIndex])
1857*5c2921b0SApple OSS Distributions #define prevChar() (parseBuffer[parseBufferIndex - 1])
1858*5c2921b0SApple OSS Distributions
1859*5c2921b0SApple OSS Distributions #define isSpace(c) ((c) == ' ' || (c) == '\t')
1860*5c2921b0SApple OSS Distributions #define isAlpha(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z'))
1861*5c2921b0SApple OSS Distributions #define isDigit(c) ((c) >= '0' && (c) <= '9')
1862*5c2921b0SApple OSS Distributions #define isAlphaDigit(c) ((c) >= 'a' && (c) <= 'f')
1863*5c2921b0SApple OSS Distributions #define isHexDigit(c) (isDigit(c) || isAlphaDigit(c))
1864*5c2921b0SApple OSS Distributions #define isAlphaNumeric(c) (isAlpha(c) || isDigit(c) || ((c) == '-'))
1865*5c2921b0SApple OSS Distributions
1866*5c2921b0SApple OSS Distributions static char yyerror_message[128];
1867*5c2921b0SApple OSS Distributions
1868*5c2921b0SApple OSS Distributions int
yyerror(const char * s)1869*5c2921b0SApple OSS Distributions yyerror(const char *s) /* Called by yyparse on error */
1870*5c2921b0SApple OSS Distributions {
1871*5c2921b0SApple OSS Distributions snprintf(yyerror_message, sizeof(yyerror_message), "OSUnserialize: %s near line %d\n", s, lineNumber);
1872*5c2921b0SApple OSS Distributions return 0;
1873*5c2921b0SApple OSS Distributions }
1874*5c2921b0SApple OSS Distributions
1875*5c2921b0SApple OSS Distributions int
yylex()1876*5c2921b0SApple OSS Distributions yylex()
1877*5c2921b0SApple OSS Distributions {
1878*5c2921b0SApple OSS Distributions int c;
1879*5c2921b0SApple OSS Distributions
1880*5c2921b0SApple OSS Distributions if (parseBufferIndex == 0) {
1881*5c2921b0SApple OSS Distributions lineNumber = 1;
1882*5c2921b0SApple OSS Distributions }
1883*5c2921b0SApple OSS Distributions
1884*5c2921b0SApple OSS Distributions top:
1885*5c2921b0SApple OSS Distributions c = currentChar();
1886*5c2921b0SApple OSS Distributions
1887*5c2921b0SApple OSS Distributions /* skip white space */
1888*5c2921b0SApple OSS Distributions if (isSpace(c)) {
1889*5c2921b0SApple OSS Distributions while ((c = nextChar()) != 0 && isSpace(c)) {
1890*5c2921b0SApple OSS Distributions }
1891*5c2921b0SApple OSS Distributions }
1892*5c2921b0SApple OSS Distributions ;
1893*5c2921b0SApple OSS Distributions
1894*5c2921b0SApple OSS Distributions /* skip over comments */
1895*5c2921b0SApple OSS Distributions if (c == '#') {
1896*5c2921b0SApple OSS Distributions while ((c = nextChar()) != 0 && c != '\n') {
1897*5c2921b0SApple OSS Distributions }
1898*5c2921b0SApple OSS Distributions }
1899*5c2921b0SApple OSS Distributions ;
1900*5c2921b0SApple OSS Distributions
1901*5c2921b0SApple OSS Distributions /* keep track of line number, don't return \n's */
1902*5c2921b0SApple OSS Distributions if (c == '\n') {
1903*5c2921b0SApple OSS Distributions lineNumber++;
1904*5c2921b0SApple OSS Distributions (void)nextChar();
1905*5c2921b0SApple OSS Distributions goto top;
1906*5c2921b0SApple OSS Distributions }
1907*5c2921b0SApple OSS Distributions
1908*5c2921b0SApple OSS Distributions /* parse boolean */
1909*5c2921b0SApple OSS Distributions if (c == '.') {
1910*5c2921b0SApple OSS Distributions bool boolean = false;
1911*5c2921b0SApple OSS Distributions if (nextChar() == 't') {
1912*5c2921b0SApple OSS Distributions if (nextChar() != 'r') {
1913*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1914*5c2921b0SApple OSS Distributions }
1915*5c2921b0SApple OSS Distributions if (nextChar() != 'u') {
1916*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1917*5c2921b0SApple OSS Distributions }
1918*5c2921b0SApple OSS Distributions if (nextChar() != 'e') {
1919*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1920*5c2921b0SApple OSS Distributions }
1921*5c2921b0SApple OSS Distributions boolean = true;
1922*5c2921b0SApple OSS Distributions } else {
1923*5c2921b0SApple OSS Distributions if (currentChar() != 'f') {
1924*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1925*5c2921b0SApple OSS Distributions }
1926*5c2921b0SApple OSS Distributions if (nextChar() != 'a') {
1927*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1928*5c2921b0SApple OSS Distributions }
1929*5c2921b0SApple OSS Distributions if (nextChar() != 'l') {
1930*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1931*5c2921b0SApple OSS Distributions }
1932*5c2921b0SApple OSS Distributions if (nextChar() != 's') {
1933*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1934*5c2921b0SApple OSS Distributions }
1935*5c2921b0SApple OSS Distributions if (nextChar() != 'e') {
1936*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1937*5c2921b0SApple OSS Distributions }
1938*5c2921b0SApple OSS Distributions }
1939*5c2921b0SApple OSS Distributions if (nextChar() != '.') {
1940*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1941*5c2921b0SApple OSS Distributions }
1942*5c2921b0SApple OSS Distributions /* skip over dot */
1943*5c2921b0SApple OSS Distributions (void)nextChar();
1944*5c2921b0SApple OSS Distributions
1945*5c2921b0SApple OSS Distributions yylval = (object_t *)boolean;
1946*5c2921b0SApple OSS Distributions return BOOLEAN;
1947*5c2921b0SApple OSS Distributions }
1948*5c2921b0SApple OSS Distributions
1949*5c2921b0SApple OSS Distributions /* parse unquoted string */
1950*5c2921b0SApple OSS Distributions if (isAlpha(c)) {
1951*5c2921b0SApple OSS Distributions int start, length;
1952*5c2921b0SApple OSS Distributions char * tempString;
1953*5c2921b0SApple OSS Distributions
1954*5c2921b0SApple OSS Distributions start = parseBufferIndex;
1955*5c2921b0SApple OSS Distributions /* find end of string */
1956*5c2921b0SApple OSS Distributions while (isAlphaNumeric(c)) {
1957*5c2921b0SApple OSS Distributions c = nextChar();
1958*5c2921b0SApple OSS Distributions }
1959*5c2921b0SApple OSS Distributions length = parseBufferIndex - start;
1960*5c2921b0SApple OSS Distributions
1961*5c2921b0SApple OSS Distributions /* copy to null terminated buffer */
1962*5c2921b0SApple OSS Distributions tempString = (char *)malloc(length + 1);
1963*5c2921b0SApple OSS Distributions if (tempString == NULL) {
1964*5c2921b0SApple OSS Distributions printf("OSUnserialize: can't alloc temp memory\n");
1965*5c2921b0SApple OSS Distributions return 0;
1966*5c2921b0SApple OSS Distributions }
1967*5c2921b0SApple OSS Distributions bcopy(&parseBuffer[start], tempString, length);
1968*5c2921b0SApple OSS Distributions tempString[length] = 0;
1969*5c2921b0SApple OSS Distributions yylval = (object_t *)tempString;
1970*5c2921b0SApple OSS Distributions return STRING;
1971*5c2921b0SApple OSS Distributions }
1972*5c2921b0SApple OSS Distributions
1973*5c2921b0SApple OSS Distributions /* parse quoted string */
1974*5c2921b0SApple OSS Distributions if (c == '"' || c == '\'') {
1975*5c2921b0SApple OSS Distributions int start, length;
1976*5c2921b0SApple OSS Distributions char * tempString;
1977*5c2921b0SApple OSS Distributions char quoteChar = c;
1978*5c2921b0SApple OSS Distributions
1979*5c2921b0SApple OSS Distributions start = parseBufferIndex + 1; // skip quote
1980*5c2921b0SApple OSS Distributions /* find end of string, line, buffer */
1981*5c2921b0SApple OSS Distributions while ((c = nextChar()) != quoteChar) {
1982*5c2921b0SApple OSS Distributions if (c == '\\') {
1983*5c2921b0SApple OSS Distributions c = nextChar();
1984*5c2921b0SApple OSS Distributions }
1985*5c2921b0SApple OSS Distributions if (c == '\n') {
1986*5c2921b0SApple OSS Distributions lineNumber++;
1987*5c2921b0SApple OSS Distributions }
1988*5c2921b0SApple OSS Distributions if (c == 0) {
1989*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
1990*5c2921b0SApple OSS Distributions }
1991*5c2921b0SApple OSS Distributions }
1992*5c2921b0SApple OSS Distributions length = parseBufferIndex - start;
1993*5c2921b0SApple OSS Distributions /* skip over trailing quote */
1994*5c2921b0SApple OSS Distributions (void)nextChar();
1995*5c2921b0SApple OSS Distributions /* copy to null terminated buffer */
1996*5c2921b0SApple OSS Distributions tempString = (char *)malloc(length + 1);
1997*5c2921b0SApple OSS Distributions if (tempString == NULL) {
1998*5c2921b0SApple OSS Distributions printf("OSUnserialize: can't alloc temp memory\n");
1999*5c2921b0SApple OSS Distributions return 0;
2000*5c2921b0SApple OSS Distributions }
2001*5c2921b0SApple OSS Distributions
2002*5c2921b0SApple OSS Distributions int to = 0;
2003*5c2921b0SApple OSS Distributions for (int from = start; from < parseBufferIndex; from++) {
2004*5c2921b0SApple OSS Distributions // hack - skip over backslashes
2005*5c2921b0SApple OSS Distributions if (parseBuffer[from] == '\\') {
2006*5c2921b0SApple OSS Distributions length--;
2007*5c2921b0SApple OSS Distributions continue;
2008*5c2921b0SApple OSS Distributions }
2009*5c2921b0SApple OSS Distributions tempString[to] = parseBuffer[from];
2010*5c2921b0SApple OSS Distributions to++;
2011*5c2921b0SApple OSS Distributions }
2012*5c2921b0SApple OSS Distributions tempString[length] = 0;
2013*5c2921b0SApple OSS Distributions yylval = (object_t *)tempString;
2014*5c2921b0SApple OSS Distributions return STRING;
2015*5c2921b0SApple OSS Distributions }
2016*5c2921b0SApple OSS Distributions
2017*5c2921b0SApple OSS Distributions /* process numbers */
2018*5c2921b0SApple OSS Distributions if (isDigit(c)) {
2019*5c2921b0SApple OSS Distributions unsigned long long n = 0;
2020*5c2921b0SApple OSS Distributions int base = 10;
2021*5c2921b0SApple OSS Distributions
2022*5c2921b0SApple OSS Distributions if (c == '0') {
2023*5c2921b0SApple OSS Distributions c = nextChar();
2024*5c2921b0SApple OSS Distributions if (c == 'x') {
2025*5c2921b0SApple OSS Distributions base = 16;
2026*5c2921b0SApple OSS Distributions c = nextChar();
2027*5c2921b0SApple OSS Distributions }
2028*5c2921b0SApple OSS Distributions }
2029*5c2921b0SApple OSS Distributions if (base == 10) {
2030*5c2921b0SApple OSS Distributions while (isDigit(c)) {
2031*5c2921b0SApple OSS Distributions n = (n * base + c - '0');
2032*5c2921b0SApple OSS Distributions c = nextChar();
2033*5c2921b0SApple OSS Distributions }
2034*5c2921b0SApple OSS Distributions } else {
2035*5c2921b0SApple OSS Distributions while (isHexDigit(c)) {
2036*5c2921b0SApple OSS Distributions if (isDigit(c)) {
2037*5c2921b0SApple OSS Distributions n = (n * base + c - '0');
2038*5c2921b0SApple OSS Distributions } else {
2039*5c2921b0SApple OSS Distributions n = (n * base + 0xa + c - 'a');
2040*5c2921b0SApple OSS Distributions }
2041*5c2921b0SApple OSS Distributions c = nextChar();
2042*5c2921b0SApple OSS Distributions }
2043*5c2921b0SApple OSS Distributions }
2044*5c2921b0SApple OSS Distributions
2045*5c2921b0SApple OSS Distributions yylval = newObject();
2046*5c2921b0SApple OSS Distributions yylval->u.offset = n;
2047*5c2921b0SApple OSS Distributions
2048*5c2921b0SApple OSS Distributions return NUMBER;
2049*5c2921b0SApple OSS Distributions }
2050*5c2921b0SApple OSS Distributions
2051*5c2921b0SApple OSS Distributions #define OSDATA_ALLOC_SIZE 4096
2052*5c2921b0SApple OSS Distributions
2053*5c2921b0SApple OSS Distributions /* process data */
2054*5c2921b0SApple OSS Distributions if (c == '<') {
2055*5c2921b0SApple OSS Distributions unsigned char *d, *start, *lastStart;
2056*5c2921b0SApple OSS Distributions
2057*5c2921b0SApple OSS Distributions size_t buflen = OSDATA_ALLOC_SIZE;
2058*5c2921b0SApple OSS Distributions start = lastStart = d = (unsigned char *)malloc(buflen);
2059*5c2921b0SApple OSS Distributions c = nextChar(); // skip over '<'
2060*5c2921b0SApple OSS Distributions while (c != 0 && c != '>') {
2061*5c2921b0SApple OSS Distributions if (isSpace(c)) {
2062*5c2921b0SApple OSS Distributions while ((c = nextChar()) != 0 && isSpace(c)) {
2063*5c2921b0SApple OSS Distributions }
2064*5c2921b0SApple OSS Distributions }
2065*5c2921b0SApple OSS Distributions ;
2066*5c2921b0SApple OSS Distributions if (c == '#') {
2067*5c2921b0SApple OSS Distributions while ((c = nextChar()) != 0 && c != '\n') {
2068*5c2921b0SApple OSS Distributions }
2069*5c2921b0SApple OSS Distributions }
2070*5c2921b0SApple OSS Distributions ;
2071*5c2921b0SApple OSS Distributions if (c == '\n') {
2072*5c2921b0SApple OSS Distributions lineNumber++;
2073*5c2921b0SApple OSS Distributions c = nextChar();
2074*5c2921b0SApple OSS Distributions continue;
2075*5c2921b0SApple OSS Distributions }
2076*5c2921b0SApple OSS Distributions
2077*5c2921b0SApple OSS Distributions // get high nibble
2078*5c2921b0SApple OSS Distributions if (!isHexDigit(c)) {
2079*5c2921b0SApple OSS Distributions break;
2080*5c2921b0SApple OSS Distributions }
2081*5c2921b0SApple OSS Distributions if (isDigit(c)) {
2082*5c2921b0SApple OSS Distributions *d = (c - '0') << 4;
2083*5c2921b0SApple OSS Distributions } else {
2084*5c2921b0SApple OSS Distributions *d = (0xa + (c - 'a')) << 4;
2085*5c2921b0SApple OSS Distributions }
2086*5c2921b0SApple OSS Distributions
2087*5c2921b0SApple OSS Distributions // get low nibble
2088*5c2921b0SApple OSS Distributions c = nextChar();
2089*5c2921b0SApple OSS Distributions if (!isHexDigit(c)) {
2090*5c2921b0SApple OSS Distributions break;
2091*5c2921b0SApple OSS Distributions }
2092*5c2921b0SApple OSS Distributions if (isDigit(c)) {
2093*5c2921b0SApple OSS Distributions *d |= c - '0';
2094*5c2921b0SApple OSS Distributions } else {
2095*5c2921b0SApple OSS Distributions *d |= 0xa + (c - 'a');
2096*5c2921b0SApple OSS Distributions }
2097*5c2921b0SApple OSS Distributions
2098*5c2921b0SApple OSS Distributions d++;
2099*5c2921b0SApple OSS Distributions if ((d - lastStart) >= OSDATA_ALLOC_SIZE) {
2100*5c2921b0SApple OSS Distributions int oldsize = d - start;
2101*5c2921b0SApple OSS Distributions assert(buflen == oldsize);
2102*5c2921b0SApple OSS Distributions start = (unsigned char *)realloc(start, oldsize, buflen);
2103*5c2921b0SApple OSS Distributions d = lastStart = start + oldsize;
2104*5c2921b0SApple OSS Distributions }
2105*5c2921b0SApple OSS Distributions c = nextChar();
2106*5c2921b0SApple OSS Distributions }
2107*5c2921b0SApple OSS Distributions if (c != '>') {
2108*5c2921b0SApple OSS Distributions safe_free(start, buflen);
2109*5c2921b0SApple OSS Distributions return SYNTAX_ERROR;
2110*5c2921b0SApple OSS Distributions }
2111*5c2921b0SApple OSS Distributions
2112*5c2921b0SApple OSS Distributions // got it!
2113*5c2921b0SApple OSS Distributions yylval = newObject();
2114*5c2921b0SApple OSS Distributions yylval->object = start;
2115*5c2921b0SApple OSS Distributions yylval->size = d - start;
2116*5c2921b0SApple OSS Distributions
2117*5c2921b0SApple OSS Distributions (void)nextChar(); // skip over '>'
2118*5c2921b0SApple OSS Distributions return DATA;
2119*5c2921b0SApple OSS Distributions }
2120*5c2921b0SApple OSS Distributions
2121*5c2921b0SApple OSS Distributions
2122*5c2921b0SApple OSS Distributions /* return single chars, move pointer to next char */
2123*5c2921b0SApple OSS Distributions (void)nextChar();
2124*5c2921b0SApple OSS Distributions return c;
2125*5c2921b0SApple OSS Distributions }
2126*5c2921b0SApple OSS Distributions
2127*5c2921b0SApple OSS Distributions // !@$&)(^Q$&*^!$(*!@$_(^%_(*Q#$(_*&!$_(*&!$_(*&!#$(*!@&^!@#%!_!#
2128*5c2921b0SApple OSS Distributions // !@$&)(^Q$&*^!$(*!@$_(^%_(*Q#$(_*&!$_(*&!$_(*&!#$(*!@&^!@#%!_!#
2129*5c2921b0SApple OSS Distributions // !@$&)(^Q$&*^!$(*!@$_(^%_(*Q#$(_*&!$_(*&!$_(*&!#$(*!@&^!@#%!_!#
2130*5c2921b0SApple OSS Distributions
2131*5c2921b0SApple OSS Distributions #if DEBUG
2132*5c2921b0SApple OSS Distributions int debugUnserializeAllocCount = 0;
2133*5c2921b0SApple OSS Distributions #endif
2134*5c2921b0SApple OSS Distributions
2135*5c2921b0SApple OSS Distributions object_t *
newObject()2136*5c2921b0SApple OSS Distributions newObject()
2137*5c2921b0SApple OSS Distributions {
2138*5c2921b0SApple OSS Distributions #if DEBUG
2139*5c2921b0SApple OSS Distributions debugUnserializeAllocCount++;
2140*5c2921b0SApple OSS Distributions #endif
2141*5c2921b0SApple OSS Distributions return malloc_type(object_t);
2142*5c2921b0SApple OSS Distributions }
2143*5c2921b0SApple OSS Distributions
2144*5c2921b0SApple OSS Distributions void
freeObject(object_t * o)2145*5c2921b0SApple OSS Distributions freeObject(object_t *o)
2146*5c2921b0SApple OSS Distributions {
2147*5c2921b0SApple OSS Distributions #if DEBUG
2148*5c2921b0SApple OSS Distributions debugUnserializeAllocCount--;
2149*5c2921b0SApple OSS Distributions #endif
2150*5c2921b0SApple OSS Distributions free_type(object_t, o);
2151*5c2921b0SApple OSS Distributions }
2152*5c2921b0SApple OSS Distributions
2153*5c2921b0SApple OSS Distributions static OSDictionary *tags;
2154*5c2921b0SApple OSS Distributions
2155*5c2921b0SApple OSS Distributions static void
rememberObject(int tag,object_t * o)2156*5c2921b0SApple OSS Distributions rememberObject(int tag, object_t *o)
2157*5c2921b0SApple OSS Distributions {
2158*5c2921b0SApple OSS Distributions char key[16];
2159*5c2921b0SApple OSS Distributions snprintf(key, sizeof(key), "%u", tag);
2160*5c2921b0SApple OSS Distributions
2161*5c2921b0SApple OSS Distributions tags->setObject(key, (OSObject *)o);
2162*5c2921b0SApple OSS Distributions }
2163*5c2921b0SApple OSS Distributions
2164*5c2921b0SApple OSS Distributions static OSObject *
retrieveObject(int tag)2165*5c2921b0SApple OSS Distributions retrieveObject(int tag)
2166*5c2921b0SApple OSS Distributions {
2167*5c2921b0SApple OSS Distributions char key[16];
2168*5c2921b0SApple OSS Distributions snprintf(key, sizeof(key), "%u", tag);
2169*5c2921b0SApple OSS Distributions
2170*5c2921b0SApple OSS Distributions return tags->getObject(key);
2171*5c2921b0SApple OSS Distributions }
2172*5c2921b0SApple OSS Distributions
2173*5c2921b0SApple OSS Distributions OSObject *
buildOSDictionary(object_t * o)2174*5c2921b0SApple OSS Distributions buildOSDictionary(object_t *o)
2175*5c2921b0SApple OSS Distributions {
2176*5c2921b0SApple OSS Distributions object_t *temp, *last = o;
2177*5c2921b0SApple OSS Distributions int count = 0;
2178*5c2921b0SApple OSS Distributions
2179*5c2921b0SApple OSS Distributions // get count and last object
2180*5c2921b0SApple OSS Distributions while (o) {
2181*5c2921b0SApple OSS Distributions count++;
2182*5c2921b0SApple OSS Distributions last = o;
2183*5c2921b0SApple OSS Distributions o = o->next;
2184*5c2921b0SApple OSS Distributions }
2185*5c2921b0SApple OSS Distributions o = last;
2186*5c2921b0SApple OSS Distributions
2187*5c2921b0SApple OSS Distributions OSDictionary *d = OSDictionary::withCapacity(count);
2188*5c2921b0SApple OSS Distributions
2189*5c2921b0SApple OSS Distributions while (o) {
2190*5c2921b0SApple OSS Distributions #ifdef metaclass_stuff_worksXXX
2191*5c2921b0SApple OSS Distributions if (((OSObject *)o->u.key)->metaCast("OSSymbol")) {
2192*5c2921b0SApple OSS Distributions // XXX the evil frontdoor
2193*5c2921b0SApple OSS Distributions d->setObject((OSSymbol *)o->u.key, (OSObject *)o->object);
2194*5c2921b0SApple OSS Distributions } else {
2195*5c2921b0SApple OSS Distributions // If it isn't a symbol, I hope it's a string!
2196*5c2921b0SApple OSS Distributions d->setObject((OSString *)o->u.key, (OSObject *)o->object);
2197*5c2921b0SApple OSS Distributions }
2198*5c2921b0SApple OSS Distributions #else
2199*5c2921b0SApple OSS Distributions d->setObject((OSString *)o->u.key, (OSObject *)o->object);
2200*5c2921b0SApple OSS Distributions #endif
2201*5c2921b0SApple OSS Distributions ((OSObject *)o->object)->release();
2202*5c2921b0SApple OSS Distributions ((OSObject *)o->u.key)->release();
2203*5c2921b0SApple OSS Distributions temp = o;
2204*5c2921b0SApple OSS Distributions o = o->prev;
2205*5c2921b0SApple OSS Distributions freeObject(temp);
2206*5c2921b0SApple OSS Distributions }
2207*5c2921b0SApple OSS Distributions return d;
2208*5c2921b0SApple OSS Distributions };
2209*5c2921b0SApple OSS Distributions
2210*5c2921b0SApple OSS Distributions OSObject *
buildOSArray(object_t * o)2211*5c2921b0SApple OSS Distributions buildOSArray(object_t *o)
2212*5c2921b0SApple OSS Distributions {
2213*5c2921b0SApple OSS Distributions object_t *temp, *last = o;
2214*5c2921b0SApple OSS Distributions int count = 0;
2215*5c2921b0SApple OSS Distributions
2216*5c2921b0SApple OSS Distributions // get count and last object
2217*5c2921b0SApple OSS Distributions while (o) {
2218*5c2921b0SApple OSS Distributions count++;
2219*5c2921b0SApple OSS Distributions last = o;
2220*5c2921b0SApple OSS Distributions o = o->next;
2221*5c2921b0SApple OSS Distributions }
2222*5c2921b0SApple OSS Distributions o = last;
2223*5c2921b0SApple OSS Distributions
2224*5c2921b0SApple OSS Distributions OSArray *a = OSArray::withCapacity(count);
2225*5c2921b0SApple OSS Distributions
2226*5c2921b0SApple OSS Distributions while (o) {
2227*5c2921b0SApple OSS Distributions a->setObject((OSObject *)o->object);
2228*5c2921b0SApple OSS Distributions ((OSObject *)o->object)->release();
2229*5c2921b0SApple OSS Distributions temp = o;
2230*5c2921b0SApple OSS Distributions o = o->prev;
2231*5c2921b0SApple OSS Distributions freeObject(temp);
2232*5c2921b0SApple OSS Distributions }
2233*5c2921b0SApple OSS Distributions return a;
2234*5c2921b0SApple OSS Distributions };
2235*5c2921b0SApple OSS Distributions
2236*5c2921b0SApple OSS Distributions OSObject *
buildOSSet(object_t * o)2237*5c2921b0SApple OSS Distributions buildOSSet(object_t *o)
2238*5c2921b0SApple OSS Distributions {
2239*5c2921b0SApple OSS Distributions OSArray *a = (OSArray *)buildOSArray(o);
2240*5c2921b0SApple OSS Distributions OSSet *s = OSSet::withArray(a, a->getCapacity());
2241*5c2921b0SApple OSS Distributions
2242*5c2921b0SApple OSS Distributions a->release();
2243*5c2921b0SApple OSS Distributions return s;
2244*5c2921b0SApple OSS Distributions };
2245*5c2921b0SApple OSS Distributions
2246*5c2921b0SApple OSS Distributions OSObject *
buildOSString(object_t * o)2247*5c2921b0SApple OSS Distributions buildOSString(object_t *o)
2248*5c2921b0SApple OSS Distributions {
2249*5c2921b0SApple OSS Distributions OSString *s = OSString::withCString((char *)o);
2250*5c2921b0SApple OSS Distributions
2251*5c2921b0SApple OSS Distributions safe_free(o, strlen((char *)o) + 1);
2252*5c2921b0SApple OSS Distributions
2253*5c2921b0SApple OSS Distributions return s;
2254*5c2921b0SApple OSS Distributions };
2255*5c2921b0SApple OSS Distributions
2256*5c2921b0SApple OSS Distributions OSObject *
buildOSData(object_t * o)2257*5c2921b0SApple OSS Distributions buildOSData(object_t *o)
2258*5c2921b0SApple OSS Distributions {
2259*5c2921b0SApple OSS Distributions OSData *d;
2260*5c2921b0SApple OSS Distributions
2261*5c2921b0SApple OSS Distributions if (o->size) {
2262*5c2921b0SApple OSS Distributions d = OSData::withBytes(o->object, o->size);
2263*5c2921b0SApple OSS Distributions } else {
2264*5c2921b0SApple OSS Distributions d = OSData::withCapacity(0);
2265*5c2921b0SApple OSS Distributions }
2266*5c2921b0SApple OSS Distributions safe_free(o->object, o->size);
2267*5c2921b0SApple OSS Distributions freeObject(o);
2268*5c2921b0SApple OSS Distributions return d;
2269*5c2921b0SApple OSS Distributions };
2270*5c2921b0SApple OSS Distributions
2271*5c2921b0SApple OSS Distributions OSObject *
buildOSOffset(object_t * o)2272*5c2921b0SApple OSS Distributions buildOSOffset(object_t *o)
2273*5c2921b0SApple OSS Distributions {
2274*5c2921b0SApple OSS Distributions OSNumber *off = OSNumber::withNumber(o->u.offset, o->size);
2275*5c2921b0SApple OSS Distributions freeObject(o);
2276*5c2921b0SApple OSS Distributions return off;
2277*5c2921b0SApple OSS Distributions };
2278*5c2921b0SApple OSS Distributions
2279*5c2921b0SApple OSS Distributions OSObject *
buildOSBoolean(object_t * o)2280*5c2921b0SApple OSS Distributions buildOSBoolean(object_t *o)
2281*5c2921b0SApple OSS Distributions {
2282*5c2921b0SApple OSS Distributions OSBoolean *b = OSBoolean::withBoolean((bool)o);
2283*5c2921b0SApple OSS Distributions return b;
2284*5c2921b0SApple OSS Distributions };
2285*5c2921b0SApple OSS Distributions
2286*5c2921b0SApple OSS Distributions __BEGIN_DECLS
2287*5c2921b0SApple OSS Distributions #include <kern/locks.h>
2288*5c2921b0SApple OSS Distributions __END_DECLS
2289*5c2921b0SApple OSS Distributions
2290*5c2921b0SApple OSS Distributions static lck_mtx_t * lock = 0;
2291*5c2921b0SApple OSS Distributions extern lck_grp_t *IOLockGroup;
2292*5c2921b0SApple OSS Distributions
2293*5c2921b0SApple OSS Distributions OSObject*
OSUnserialize(const char * buffer,OSString ** errorString)2294*5c2921b0SApple OSS Distributions OSUnserialize(const char *buffer, OSString **errorString)
2295*5c2921b0SApple OSS Distributions {
2296*5c2921b0SApple OSS Distributions OSObject *object;
2297*5c2921b0SApple OSS Distributions
2298*5c2921b0SApple OSS Distributions if (!lock) {
2299*5c2921b0SApple OSS Distributions lock = lck_mtx_alloc_init(IOLockGroup, LCK_ATTR_NULL);
2300*5c2921b0SApple OSS Distributions lck_mtx_lock(lock);
2301*5c2921b0SApple OSS Distributions } else {
2302*5c2921b0SApple OSS Distributions lck_mtx_lock(lock);
2303*5c2921b0SApple OSS Distributions }
2304*5c2921b0SApple OSS Distributions
2305*5c2921b0SApple OSS Distributions #if DEBUG
2306*5c2921b0SApple OSS Distributions debugUnserializeAllocCount = 0;
2307*5c2921b0SApple OSS Distributions #endif
2308*5c2921b0SApple OSS Distributions yyerror_message[0] = 0; //just in case
2309*5c2921b0SApple OSS Distributions parseBuffer = buffer;
2310*5c2921b0SApple OSS Distributions parseBufferIndex = 0;
2311*5c2921b0SApple OSS Distributions tags = OSDictionary::withCapacity(128);
2312*5c2921b0SApple OSS Distributions if (yyparse() == 0) {
2313*5c2921b0SApple OSS Distributions object = parsedObject;
2314*5c2921b0SApple OSS Distributions if (errorString) {
2315*5c2921b0SApple OSS Distributions *errorString = NULL;
2316*5c2921b0SApple OSS Distributions }
2317*5c2921b0SApple OSS Distributions } else {
2318*5c2921b0SApple OSS Distributions object = NULL;
2319*5c2921b0SApple OSS Distributions if (errorString) {
2320*5c2921b0SApple OSS Distributions *errorString = OSString::withCString(yyerror_message);
2321*5c2921b0SApple OSS Distributions }
2322*5c2921b0SApple OSS Distributions }
2323*5c2921b0SApple OSS Distributions
2324*5c2921b0SApple OSS Distributions tags->release();
2325*5c2921b0SApple OSS Distributions #if DEBUG
2326*5c2921b0SApple OSS Distributions if (debugUnserializeAllocCount) {
2327*5c2921b0SApple OSS Distributions printf("OSUnserialize: allocation check failed, count = %d.\n",
2328*5c2921b0SApple OSS Distributions debugUnserializeAllocCount);
2329*5c2921b0SApple OSS Distributions }
2330*5c2921b0SApple OSS Distributions #endif
2331*5c2921b0SApple OSS Distributions lck_mtx_unlock(lock);
2332*5c2921b0SApple OSS Distributions
2333*5c2921b0SApple OSS Distributions return object;
2334*5c2921b0SApple OSS Distributions }
2335*5c2921b0SApple OSS Distributions
2336*5c2921b0SApple OSS Distributions #endif // not __clang_analyzer__
2337*5c2921b0SApple OSS Distributions
2338*5c2921b0SApple OSS Distributions
2339*5c2921b0SApple OSS Distributions //
2340*5c2921b0SApple OSS Distributions //
2341*5c2921b0SApple OSS Distributions //
2342*5c2921b0SApple OSS Distributions //
2343*5c2921b0SApple OSS Distributions //
2344*5c2921b0SApple OSS Distributions // DO NOT EDIT OSUnserialize.cpp!
2345*5c2921b0SApple OSS Distributions //
2346*5c2921b0SApple OSS Distributions // this means you!
2347*5c2921b0SApple OSS Distributions //
2348*5c2921b0SApple OSS Distributions //
2349*5c2921b0SApple OSS Distributions //
2350*5c2921b0SApple OSS Distributions //
2351*5c2921b0SApple OSS Distributions //
2352