1c1dac77fSApple OSS Distributions /*
23ca3bd55SApple OSS Distributions * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3c1dac77fSApple OSS Distributions *
4e13b1fa5SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5c1dac77fSApple OSS Distributions *
6e13b1fa5SApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code
7e13b1fa5SApple OSS Distributions * as defined in and that are subject to the Apple Public Source License
8e13b1fa5SApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in
9e13b1fa5SApple OSS Distributions * compliance with the License. The rights granted to you under the License
10e13b1fa5SApple OSS Distributions * may not be used to create, or enable the creation or redistribution of,
11e13b1fa5SApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to
12e13b1fa5SApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any
13e13b1fa5SApple OSS Distributions * terms of an Apple operating system software license agreement.
14c1dac77fSApple OSS Distributions *
15e13b1fa5SApple OSS Distributions * Please obtain a copy of the License at
16e13b1fa5SApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file.
17e13b1fa5SApple OSS Distributions *
18e13b1fa5SApple OSS Distributions * The Original Code and all software distributed under the License are
19e13b1fa5SApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20c1dac77fSApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21c1dac77fSApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22e13b1fa5SApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23e13b1fa5SApple OSS Distributions * Please see the License for the specific language governing rights and
24e13b1fa5SApple OSS Distributions * limitations under the License.
25c1dac77fSApple OSS Distributions *
26e13b1fa5SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27c1dac77fSApple OSS Distributions */
28c1dac77fSApple OSS Distributions
29c1dac77fSApple OSS Distributions /* OSUnserialize.y created by rsulack on Nov 21 1998 */
30c1dac77fSApple OSS Distributions
31c1dac77fSApple OSS Distributions // "classic" parser for unserializing OSContainer objects
32c1dac77fSApple OSS Distributions //
33c1dac77fSApple OSS Distributions // XXX - this code should really be removed!
34c1dac77fSApple OSS Distributions // - the XML format is now prefered
35c1dac77fSApple OSS Distributions // - this code leaks on syntax errors, the XML doesn't
36c1dac77fSApple OSS Distributions // - "classic" looks, reads, ... much better than XML :-(
37c1dac77fSApple OSS Distributions // - well except the XML is more efficent on OSData
38c1dac77fSApple OSS Distributions //
39c1dac77fSApple OSS Distributions //
40c1dac77fSApple OSS Distributions // to build :
41c1dac77fSApple OSS Distributions // bison -p OSUnserialize OSUnserialize.y
42c1dac77fSApple OSS Distributions // head -50 OSUnserialize.y > OSUnserialize.cpp
43c1dac77fSApple OSS Distributions // sed -e "s/stdio.h/stddef.h/" < OSUnserialize.tab.c >> OSUnserialize.cpp
44c1dac77fSApple OSS Distributions //
45c1dac77fSApple OSS Distributions // when changing code check in both OSUnserialize.y and OSUnserialize.cpp
46c1dac77fSApple OSS Distributions //
47c1dac77fSApple OSS Distributions //
48c1dac77fSApple OSS Distributions //
49c1dac77fSApple OSS Distributions //
50c1dac77fSApple OSS Distributions // DO NOT EDIT OSUnserialize.tab.cpp!
513ca3bd55SApple OSS Distributions /* A Bison parser, made by GNU Bison 2.3. */
52c1dac77fSApple OSS Distributions
533ca3bd55SApple OSS Distributions /* Skeleton implementation for Bison's Yacc-like parsers in C
54a5e72196SApple OSS Distributions *
55a5e72196SApple OSS Distributions * Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
56a5e72196SApple OSS Distributions * Free Software Foundation, Inc.
57a5e72196SApple OSS Distributions *
58a5e72196SApple OSS Distributions * This program is free software; you can redistribute it and/or modify
59a5e72196SApple OSS Distributions * it under the terms of the GNU General Public License as published by
60a5e72196SApple OSS Distributions * the Free Software Foundation; either version 2, or (at your option)
61a5e72196SApple OSS Distributions * any later version.
62a5e72196SApple OSS Distributions *
63a5e72196SApple OSS Distributions * This program is distributed in the hope that it will be useful,
64a5e72196SApple OSS Distributions * but WITHOUT ANY WARRANTY; without even the implied warranty of
65a5e72196SApple OSS Distributions * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66a5e72196SApple OSS Distributions * GNU General Public License for more details.
67a5e72196SApple OSS Distributions *
68a5e72196SApple OSS Distributions * You should have received a copy of the GNU General Public License
69a5e72196SApple OSS Distributions * along with this program; if not, write to the Free Software
70a5e72196SApple OSS Distributions * Foundation, Inc., 51 Franklin Street, Fifth Floor,
71a5e72196SApple OSS Distributions * Boston, MA 02110-1301, USA. */
723ca3bd55SApple OSS Distributions
733ca3bd55SApple OSS Distributions /* As a special exception, you may create a larger work that contains
74a5e72196SApple OSS Distributions * part or all of the Bison parser skeleton and distribute that work
75a5e72196SApple OSS Distributions * under terms of your choice, so long as that work isn't itself a
76a5e72196SApple OSS Distributions * parser generator using the skeleton or a modified version thereof
77a5e72196SApple OSS Distributions * as a parser skeleton. Alternatively, if you modify or redistribute
78a5e72196SApple OSS Distributions * the parser skeleton itself, you may (at your option) remove this
79a5e72196SApple OSS Distributions * special exception, which will cause the skeleton and the resulting
80a5e72196SApple OSS Distributions * Bison output files to be licensed under the GNU General Public
81a5e72196SApple OSS Distributions * License without this special exception.
82a5e72196SApple OSS Distributions *
83a5e72196SApple OSS Distributions * This special exception was added by the Free Software Foundation in
84a5e72196SApple OSS Distributions * version 2.2 of Bison. */
853ca3bd55SApple OSS Distributions
863ca3bd55SApple OSS Distributions /* C LALR(1) parser skeleton written by Richard Stallman, by
87a5e72196SApple OSS Distributions * simplifying the original so-called "semantic" parser. */
883ca3bd55SApple OSS Distributions
893ca3bd55SApple OSS Distributions /* All symbols defined below should begin with yy or YY, to avoid
90a5e72196SApple OSS Distributions * infringing on user name space. This should be done even for local
91a5e72196SApple OSS Distributions * variables, as they might otherwise be expanded by user macros.
92a5e72196SApple OSS Distributions * There are some unavoidable exceptions within include files to
93a5e72196SApple OSS Distributions * define necessary library symbols; they are noted "INFRINGES ON
94a5e72196SApple OSS Distributions * USER NAME SPACE" below. */
953ca3bd55SApple OSS Distributions
963ca3bd55SApple OSS Distributions /* Identify Bison output. */
973ca3bd55SApple OSS Distributions #define YYBISON 1
983ca3bd55SApple OSS Distributions
993ca3bd55SApple OSS Distributions /* Bison version. */
1003ca3bd55SApple OSS Distributions #define YYBISON_VERSION "2.3"
1013ca3bd55SApple OSS Distributions
1023ca3bd55SApple OSS Distributions /* Skeleton name. */
1033ca3bd55SApple OSS Distributions #define YYSKELETON_NAME "yacc.c"
1043ca3bd55SApple OSS Distributions
1053ca3bd55SApple OSS Distributions /* Pure parsers. */
1063ca3bd55SApple OSS Distributions #define YYPURE 0
1073ca3bd55SApple OSS Distributions
1083ca3bd55SApple OSS Distributions /* Using locations. */
1093ca3bd55SApple OSS Distributions #define YYLSP_NEEDED 0
1103ca3bd55SApple OSS Distributions
1113ca3bd55SApple OSS Distributions /* Substitute the variable and function names. */
112c1dac77fSApple OSS Distributions #define yyparse OSUnserializeparse
113c1dac77fSApple OSS Distributions #define yylex OSUnserializelex
114c1dac77fSApple OSS Distributions #define yyerror OSUnserializeerror
115c1dac77fSApple OSS Distributions #define yylval OSUnserializelval
116c1dac77fSApple OSS Distributions #define yychar OSUnserializechar
117c1dac77fSApple OSS Distributions #define yydebug OSUnserializedebug
118c1dac77fSApple OSS Distributions #define yynerrs OSUnserializenerrs
119c1dac77fSApple OSS Distributions
1203ca3bd55SApple OSS Distributions
1213ca3bd55SApple OSS Distributions /* Tokens. */
1223ca3bd55SApple OSS Distributions #ifndef YYTOKENTYPE
1233ca3bd55SApple OSS Distributions # define YYTOKENTYPE
1243ca3bd55SApple OSS Distributions /* Put the tokens into the symbol table, so that GDB and other debuggers
125a5e72196SApple OSS Distributions * know about them. */
1263ca3bd55SApple OSS Distributions enum yytokentype {
1273ca3bd55SApple OSS Distributions NUMBER = 258,
1283ca3bd55SApple OSS Distributions STRING = 259,
1293ca3bd55SApple OSS Distributions DATA = 260,
1303ca3bd55SApple OSS Distributions BOOLEAN = 261,
1313ca3bd55SApple OSS Distributions SYNTAX_ERROR = 262
1323ca3bd55SApple OSS Distributions };
1333ca3bd55SApple OSS Distributions #endif
1343ca3bd55SApple OSS Distributions /* Tokens. */
1353ca3bd55SApple OSS Distributions #define NUMBER 258
1363ca3bd55SApple OSS Distributions #define STRING 259
1373ca3bd55SApple OSS Distributions #define DATA 260
1383ca3bd55SApple OSS Distributions #define BOOLEAN 261
1393ca3bd55SApple OSS Distributions #define SYNTAX_ERROR 262
1403ca3bd55SApple OSS Distributions
1413ca3bd55SApple OSS Distributions
1423ca3bd55SApple OSS Distributions
1433ca3bd55SApple OSS Distributions
1443ca3bd55SApple OSS Distributions /* Copy the first part of user declarations. */
1453ca3bd55SApple OSS Distributions #line 60 "OSUnserialize.y"
146c1dac77fSApple OSS Distributions
147c1dac77fSApple OSS Distributions #include <libkern/c++/OSMetaClass.h>
148c1dac77fSApple OSS Distributions #include <libkern/c++/OSContainers.h>
149c1dac77fSApple OSS Distributions #include <libkern/c++/OSLib.h>
150c1dac77fSApple OSS Distributions
151c1dac77fSApple OSS Distributions typedef struct object {
152c1dac77fSApple OSS Distributions struct object *next;
153c1dac77fSApple OSS Distributions struct object *prev;
154c1dac77fSApple OSS Distributions void *object;
155c1dac77fSApple OSS Distributions int size; // for data
156c1dac77fSApple OSS Distributions union {
157c1dac77fSApple OSS Distributions void *key; // for dictionary
158c1dac77fSApple OSS Distributions long long offset; // for offset
159c1dac77fSApple OSS Distributions } u;
160c1dac77fSApple OSS Distributions } object_t;
161c1dac77fSApple OSS Distributions
1623ca3bd55SApple OSS Distributions static int yyerror(const char *s);
163c1dac77fSApple OSS Distributions static int yylex();
164c1dac77fSApple OSS Distributions
165c1dac77fSApple OSS Distributions static object_t * newObject();
166c1dac77fSApple OSS Distributions static void freeObject(object_t *o);
167c1dac77fSApple OSS Distributions
168c1dac77fSApple OSS Distributions static OSObject *buildOSDictionary(object_t *);
169c1dac77fSApple OSS Distributions static OSObject *buildOSArray(object_t *);
170c1dac77fSApple OSS Distributions static OSObject *buildOSSet(object_t *);
171c1dac77fSApple OSS Distributions static OSObject *buildOSString(object_t *);
172c1dac77fSApple OSS Distributions static OSObject *buildOSData(object_t *);
173c1dac77fSApple OSS Distributions static OSObject *buildOSOffset(object_t *);
174c1dac77fSApple OSS Distributions static OSObject *buildOSBoolean(object_t *o);
175c1dac77fSApple OSS Distributions
176c1dac77fSApple OSS Distributions static void rememberObject(int, object_t *);
177c1dac77fSApple OSS Distributions static OSObject *retrieveObject(int);
178c1dac77fSApple OSS Distributions
179c1dac77fSApple OSS Distributions // temp variable to use during parsing
1803ca3bd55SApple OSS Distributions static object_t *oo;
181c1dac77fSApple OSS Distributions
182c1dac77fSApple OSS Distributions // resultant object of parsed text
183c1dac77fSApple OSS Distributions static OSObject *parsedObject;
184c1dac77fSApple OSS Distributions
185c1dac77fSApple OSS Distributions #define YYSTYPE object_t *
186c1dac77fSApple OSS Distributions
187bb611c8fSApple OSS Distributions __BEGIN_DECLS
188bb611c8fSApple OSS Distributions #include <kern/kalloc.h>
189bb611c8fSApple OSS Distributions __END_DECLS
190c1dac77fSApple OSS Distributions
191e6231be0SApple OSS Distributions // Omit from static analysis.
192e6231be0SApple OSS Distributions #ifndef __clang_analyzer__
193e6231be0SApple OSS Distributions
194bb611c8fSApple OSS Distributions #define malloc(size) malloc_impl(size)
195*1031c584SApple OSS Distributions #define malloc_type(type) kalloc_type(type, Z_SET_NOTSHARED)
196bb611c8fSApple OSS Distributions static inline void *
malloc_impl(size_t size)197bb611c8fSApple OSS Distributions malloc_impl(size_t size)
198bb611c8fSApple OSS Distributions {
199bb611c8fSApple OSS Distributions if (size == 0) {
200bb611c8fSApple OSS Distributions return NULL;
201bb611c8fSApple OSS Distributions }
202e7776783SApple OSS Distributions return kalloc_data(size,
203e7776783SApple OSS Distributions Z_VM_TAG_BT(Z_WAITOK_ZERO, VM_KERN_MEMORY_LIBKERN));
204bb611c8fSApple OSS Distributions }
205bb611c8fSApple OSS Distributions
206bb611c8fSApple OSS Distributions #define free(addr) free_impl(addr)
207e6231be0SApple OSS Distributions #define free_type(type, addr) kfree_type(type, addr)
208bb611c8fSApple OSS Distributions static inline void
free_impl(void * addr)209bb611c8fSApple OSS Distributions free_impl(void *addr)
210bb611c8fSApple OSS Distributions {
211e7776783SApple OSS Distributions kfree_data_addr(addr);
212bb611c8fSApple OSS Distributions }
213bb611c8fSApple OSS Distributions static inline void
safe_free(void * addr,size_t size)214bb611c8fSApple OSS Distributions safe_free(void *addr, size_t size)
215bb611c8fSApple OSS Distributions {
216e7776783SApple OSS Distributions kfree_data(addr, size);
217bb611c8fSApple OSS Distributions }
218bb611c8fSApple OSS Distributions
219bb611c8fSApple OSS Distributions #define realloc(addr, osize, nsize) realloc_impl(addr, osize, nsize)
220bb611c8fSApple OSS Distributions static inline void *
realloc_impl(void * addr,size_t osize,size_t nsize)221bb611c8fSApple OSS Distributions realloc_impl(void *addr, size_t osize, size_t nsize)
222bb611c8fSApple OSS Distributions {
223e7776783SApple OSS Distributions return krealloc_data(addr, osize, nsize,
224e7776783SApple OSS Distributions Z_VM_TAG_BT(Z_WAITOK_ZERO, VM_KERN_MEMORY_LIBKERN));
225bb611c8fSApple OSS Distributions }
226c1dac77fSApple OSS Distributions
2273ca3bd55SApple OSS Distributions
2283ca3bd55SApple OSS Distributions
2293ca3bd55SApple OSS Distributions /* Enabling traces. */
2303ca3bd55SApple OSS Distributions #ifndef YYDEBUG
2313ca3bd55SApple OSS Distributions # define YYDEBUG 0
232c1dac77fSApple OSS Distributions #endif
233c1dac77fSApple OSS Distributions
2343ca3bd55SApple OSS Distributions /* Enabling verbose error messages. */
2353ca3bd55SApple OSS Distributions #ifdef YYERROR_VERBOSE
2363ca3bd55SApple OSS Distributions # undef YYERROR_VERBOSE
2373ca3bd55SApple OSS Distributions # define YYERROR_VERBOSE 1
2383ca3bd55SApple OSS Distributions #else
2393ca3bd55SApple OSS Distributions # define YYERROR_VERBOSE 0
240c1dac77fSApple OSS Distributions #endif
2413ca3bd55SApple OSS Distributions
2423ca3bd55SApple OSS Distributions /* Enabling the token table. */
2433ca3bd55SApple OSS Distributions #ifndef YYTOKEN_TABLE
2443ca3bd55SApple OSS Distributions # define YYTOKEN_TABLE 0
2453ca3bd55SApple OSS Distributions #endif
2463ca3bd55SApple OSS Distributions
2473ca3bd55SApple OSS Distributions #if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
2483ca3bd55SApple OSS Distributions typedef int YYSTYPE;
2493ca3bd55SApple OSS Distributions # define yystype YYSTYPE /* obsolescent; will be withdrawn */
2503ca3bd55SApple OSS Distributions # define YYSTYPE_IS_DECLARED 1
2513ca3bd55SApple OSS Distributions # define YYSTYPE_IS_TRIVIAL 1
252c1dac77fSApple OSS Distributions #endif
253c1dac77fSApple OSS Distributions
254c1dac77fSApple OSS Distributions
255c1dac77fSApple OSS Distributions
2563ca3bd55SApple OSS Distributions /* Copy the second part of user declarations. */
257c1dac77fSApple OSS Distributions
258c1dac77fSApple OSS Distributions
2593ca3bd55SApple OSS Distributions /* Line 216 of yacc.c. */
260*1031c584SApple OSS Distributions #line 212 "OSUnserialize.tab.c"
261c1dac77fSApple OSS Distributions
2623ca3bd55SApple OSS Distributions #ifdef short
2633ca3bd55SApple OSS Distributions # undef short
264c1dac77fSApple OSS Distributions #endif
265c1dac77fSApple OSS Distributions
2663ca3bd55SApple OSS Distributions #ifdef YYTYPE_UINT8
2673ca3bd55SApple OSS Distributions typedef YYTYPE_UINT8 yytype_uint8;
2683ca3bd55SApple OSS Distributions #else
2693ca3bd55SApple OSS Distributions typedef unsigned char yytype_uint8;
270c1dac77fSApple OSS Distributions #endif
271c1dac77fSApple OSS Distributions
2723ca3bd55SApple OSS Distributions #ifdef YYTYPE_INT8
2733ca3bd55SApple OSS Distributions typedef YYTYPE_INT8 yytype_int8;
2743ca3bd55SApple OSS Distributions #elif (defined __STDC__ || defined __C99__FUNC__ \
2753ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
2763ca3bd55SApple OSS Distributions typedef signed char yytype_int8;
2773ca3bd55SApple OSS Distributions #else
2783ca3bd55SApple OSS Distributions typedef short int yytype_int8;
279c1dac77fSApple OSS Distributions #endif
280c1dac77fSApple OSS Distributions
2813ca3bd55SApple OSS Distributions #ifdef YYTYPE_UINT16
2823ca3bd55SApple OSS Distributions typedef YYTYPE_UINT16 yytype_uint16;
2833ca3bd55SApple OSS Distributions #else
2843ca3bd55SApple OSS Distributions typedef unsigned short int yytype_uint16;
285c1dac77fSApple OSS Distributions #endif
2863ca3bd55SApple OSS Distributions
2873ca3bd55SApple OSS Distributions #ifdef YYTYPE_INT16
2883ca3bd55SApple OSS Distributions typedef YYTYPE_INT16 yytype_int16;
2893ca3bd55SApple OSS Distributions #else
2903ca3bd55SApple OSS Distributions typedef short int yytype_int16;
291c1dac77fSApple OSS Distributions #endif
2923ca3bd55SApple OSS Distributions
2933ca3bd55SApple OSS Distributions #ifndef YYSIZE_T
2943ca3bd55SApple OSS Distributions # ifdef __SIZE_TYPE__
2953ca3bd55SApple OSS Distributions # define YYSIZE_T __SIZE_TYPE__
2963ca3bd55SApple OSS Distributions # elif defined size_t
2973ca3bd55SApple OSS Distributions # define YYSIZE_T size_t
2983ca3bd55SApple OSS Distributions # elif !defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2993ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
3003ca3bd55SApple OSS Distributions # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
3013ca3bd55SApple OSS Distributions # define YYSIZE_T size_t
3023ca3bd55SApple OSS Distributions # else
3033ca3bd55SApple OSS Distributions # define YYSIZE_T unsigned int
3043ca3bd55SApple OSS Distributions # endif
3053ca3bd55SApple OSS Distributions #endif
3063ca3bd55SApple OSS Distributions
3073ca3bd55SApple OSS Distributions #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
3083ca3bd55SApple OSS Distributions
3093ca3bd55SApple OSS Distributions #ifndef YY_
3103ca3bd55SApple OSS Distributions # if defined YYENABLE_NLS && YYENABLE_NLS
3113ca3bd55SApple OSS Distributions # if ENABLE_NLS
3123ca3bd55SApple OSS Distributions # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
3133ca3bd55SApple OSS Distributions # define YY_(msgid) dgettext ("bison-runtime", msgid)
3143ca3bd55SApple OSS Distributions # endif
3153ca3bd55SApple OSS Distributions # endif
3163ca3bd55SApple OSS Distributions # ifndef YY_
3173ca3bd55SApple OSS Distributions # define YY_(msgid) msgid
3183ca3bd55SApple OSS Distributions # endif
3193ca3bd55SApple OSS Distributions #endif
3203ca3bd55SApple OSS Distributions
3213ca3bd55SApple OSS Distributions /* Suppress unused-variable warnings by "using" E. */
3223ca3bd55SApple OSS Distributions #if !defined lint || defined __GNUC__
3233ca3bd55SApple OSS Distributions # define YYUSE(e) ((void) (e))
3243ca3bd55SApple OSS Distributions #else
3253ca3bd55SApple OSS Distributions # define YYUSE(e) /* empty */
3263ca3bd55SApple OSS Distributions #endif
3273ca3bd55SApple OSS Distributions
3283ca3bd55SApple OSS Distributions /* Identity function, used to suppress warnings about constant conditions. */
3293ca3bd55SApple OSS Distributions #ifndef lint
3303ca3bd55SApple OSS Distributions # define YYID(n) (n)
3313ca3bd55SApple OSS Distributions #else
3323ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
3333ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
3343ca3bd55SApple OSS Distributions static int
YYID(int i)3353ca3bd55SApple OSS Distributions YYID(int i)
3363ca3bd55SApple OSS Distributions #else
3373ca3bd55SApple OSS Distributions static int
3383ca3bd55SApple OSS Distributions YYID(i)
3393ca3bd55SApple OSS Distributions int i;
3403ca3bd55SApple OSS Distributions #endif
3413ca3bd55SApple OSS Distributions {
3423ca3bd55SApple OSS Distributions return i;
3433ca3bd55SApple OSS Distributions }
3443ca3bd55SApple OSS Distributions #endif
3453ca3bd55SApple OSS Distributions
3463ca3bd55SApple OSS Distributions #if !defined yyoverflow || YYERROR_VERBOSE
3473ca3bd55SApple OSS Distributions
3483ca3bd55SApple OSS Distributions /* The parser invokes alloca or malloc; define the necessary symbols. */
349c1dac77fSApple OSS Distributions
350c1dac77fSApple OSS Distributions # ifdef YYSTACK_USE_ALLOCA
3513ca3bd55SApple OSS Distributions # if YYSTACK_USE_ALLOCA
3523ca3bd55SApple OSS Distributions # ifdef __GNUC__
3533ca3bd55SApple OSS Distributions # define YYSTACK_ALLOC __builtin_alloca
3543ca3bd55SApple OSS Distributions # elif defined __BUILTIN_VA_ARG_INCR
3553ca3bd55SApple OSS Distributions # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
3563ca3bd55SApple OSS Distributions # elif defined _AIX
3573ca3bd55SApple OSS Distributions # define YYSTACK_ALLOC __alloca
3583ca3bd55SApple OSS Distributions # elif defined _MSC_VER
3593ca3bd55SApple OSS Distributions # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
3603ca3bd55SApple OSS Distributions # define alloca _alloca
361c1dac77fSApple OSS Distributions # else
3623ca3bd55SApple OSS Distributions # define YYSTACK_ALLOC alloca
3633ca3bd55SApple OSS Distributions # if !defined _ALLOCA_H && !defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
3643ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
3653ca3bd55SApple OSS Distributions # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
3663ca3bd55SApple OSS Distributions # ifndef _STDLIB_H
3673ca3bd55SApple OSS Distributions # define _STDLIB_H 1
3683ca3bd55SApple OSS Distributions # endif
3693ca3bd55SApple OSS Distributions # endif
3703ca3bd55SApple OSS Distributions # endif
3713ca3bd55SApple OSS Distributions # endif
372c1dac77fSApple OSS Distributions # endif
373c1dac77fSApple OSS Distributions
3743ca3bd55SApple OSS Distributions # ifdef YYSTACK_ALLOC
3753ca3bd55SApple OSS Distributions /* Pacify GCC's `empty if-body' warning. */
3763ca3bd55SApple OSS Distributions # define YYSTACK_FREE(Ptr) do { /* empty */ ; } while (YYID (0))
3773ca3bd55SApple OSS Distributions # ifndef YYSTACK_ALLOC_MAXIMUM
3783ca3bd55SApple OSS Distributions /* The OS might guarantee only one guard page at the bottom of the stack,
379a5e72196SApple OSS Distributions * and a page size can be as small as 4096 bytes. So we cannot safely
380a5e72196SApple OSS Distributions * invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
381a5e72196SApple OSS Distributions * to allow for a few compiler-allocated temporary stack slots. */
3823ca3bd55SApple OSS Distributions # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
3833ca3bd55SApple OSS Distributions # endif
3843ca3bd55SApple OSS Distributions # else
3853ca3bd55SApple OSS Distributions # define YYSTACK_ALLOC YYMALLOC
3863ca3bd55SApple OSS Distributions # define YYSTACK_FREE YYFREE
3873ca3bd55SApple OSS Distributions # ifndef YYSTACK_ALLOC_MAXIMUM
3883ca3bd55SApple OSS Distributions # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
3893ca3bd55SApple OSS Distributions # endif
3903ca3bd55SApple OSS Distributions # if (defined __cplusplus && !defined _STDLIB_H \
3913ca3bd55SApple OSS Distributions && !((defined YYMALLOC || defined malloc) \
3923ca3bd55SApple OSS Distributions && (defined YYFREE || defined free)))
3933ca3bd55SApple OSS Distributions # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
3943ca3bd55SApple OSS Distributions # ifndef _STDLIB_H
3953ca3bd55SApple OSS Distributions # define _STDLIB_H 1
3963ca3bd55SApple OSS Distributions # endif
3973ca3bd55SApple OSS Distributions # endif
3983ca3bd55SApple OSS Distributions # ifndef YYMALLOC
3993ca3bd55SApple OSS Distributions # define YYMALLOC malloc
4003ca3bd55SApple OSS Distributions # if !defined malloc && !defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
4013ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
4023ca3bd55SApple OSS Distributions void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
4033ca3bd55SApple OSS Distributions # endif
4043ca3bd55SApple OSS Distributions # endif
4053ca3bd55SApple OSS Distributions # ifndef YYFREE
4063ca3bd55SApple OSS Distributions # define YYFREE free
4073ca3bd55SApple OSS Distributions # if !defined free && !defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
4083ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
4093ca3bd55SApple OSS Distributions void free(void *); /* INFRINGES ON USER NAME SPACE */
4103ca3bd55SApple OSS Distributions # endif
4113ca3bd55SApple OSS Distributions # endif
4123ca3bd55SApple OSS Distributions # endif
4133ca3bd55SApple OSS Distributions #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
4143ca3bd55SApple OSS Distributions
4153ca3bd55SApple OSS Distributions
4163ca3bd55SApple OSS Distributions #if (!defined yyoverflow \
4173ca3bd55SApple OSS Distributions && (!defined __cplusplus \
4183ca3bd55SApple OSS Distributions || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
4193ca3bd55SApple OSS Distributions
4203ca3bd55SApple OSS Distributions /* A type that is properly aligned for any stack member. */
421a5e72196SApple OSS Distributions union yyalloc {
4223ca3bd55SApple OSS Distributions yytype_int16 yyss;
4233ca3bd55SApple OSS Distributions YYSTYPE yyvs;
4243ca3bd55SApple OSS Distributions };
4253ca3bd55SApple OSS Distributions
4263ca3bd55SApple OSS Distributions /* The size of the maximum gap between one aligned stack and the next. */
4273ca3bd55SApple OSS Distributions # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
4283ca3bd55SApple OSS Distributions
4293ca3bd55SApple OSS Distributions /* The size of an array large to enough to hold all stacks, each with
430a5e72196SApple OSS Distributions * N elements. */
4313ca3bd55SApple OSS Distributions # define YYSTACK_BYTES(N) \
4323ca3bd55SApple OSS Distributions ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
4333ca3bd55SApple OSS Distributions + YYSTACK_GAP_MAXIMUM)
4343ca3bd55SApple OSS Distributions
4353ca3bd55SApple OSS Distributions /* Copy COUNT objects from FROM to TO. The source and destination do
436a5e72196SApple OSS Distributions * not overlap. */
4373ca3bd55SApple OSS Distributions # ifndef YYCOPY
4383ca3bd55SApple OSS Distributions # if defined __GNUC__ && 1 < __GNUC__
4393ca3bd55SApple OSS Distributions # define YYCOPY(To, From, Count) \
4403ca3bd55SApple OSS Distributions __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
4413ca3bd55SApple OSS Distributions # else
4423ca3bd55SApple OSS Distributions # define YYCOPY(To, From, Count) \
4433ca3bd55SApple OSS Distributions do \
4443ca3bd55SApple OSS Distributions { \
4453ca3bd55SApple OSS Distributions YYSIZE_T yyi; \
4463ca3bd55SApple OSS Distributions for (yyi = 0; yyi < (Count); yyi++) \
4473ca3bd55SApple OSS Distributions (To)[yyi] = (From)[yyi]; \
4483ca3bd55SApple OSS Distributions } \
4493ca3bd55SApple OSS Distributions while (YYID (0))
4503ca3bd55SApple OSS Distributions # endif
4513ca3bd55SApple OSS Distributions # endif
4523ca3bd55SApple OSS Distributions
4533ca3bd55SApple OSS Distributions /* Relocate STACK from its old location to the new one. The
454a5e72196SApple OSS Distributions * local variables YYSIZE and YYSTACKSIZE give the old and new number of
455a5e72196SApple OSS Distributions * elements in the stack, and YYPTR gives the new location of the
456a5e72196SApple OSS Distributions * stack. Advance YYPTR to a properly aligned location for the next
457a5e72196SApple OSS Distributions * stack. */
4583ca3bd55SApple OSS Distributions # define YYSTACK_RELOCATE(Stack) \
4593ca3bd55SApple OSS Distributions do \
4603ca3bd55SApple OSS Distributions { \
4613ca3bd55SApple OSS Distributions YYSIZE_T yynewbytes; \
4623ca3bd55SApple OSS Distributions YYCOPY (&yyptr->Stack, Stack, yysize); \
4633ca3bd55SApple OSS Distributions Stack = &yyptr->Stack; \
4643ca3bd55SApple OSS Distributions yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
4653ca3bd55SApple OSS Distributions yyptr += yynewbytes / sizeof (*yyptr); \
4663ca3bd55SApple OSS Distributions } \
4673ca3bd55SApple OSS Distributions while (YYID (0))
4683ca3bd55SApple OSS Distributions
4693ca3bd55SApple OSS Distributions #endif
4703ca3bd55SApple OSS Distributions
4713ca3bd55SApple OSS Distributions /* YYFINAL -- State number of the termination state. */
4723ca3bd55SApple OSS Distributions #define YYFINAL 30
4733ca3bd55SApple OSS Distributions /* YYLAST -- Last index in YYTABLE. */
4743ca3bd55SApple OSS Distributions #define YYLAST 80
4753ca3bd55SApple OSS Distributions
4763ca3bd55SApple OSS Distributions /* YYNTOKENS -- Number of terminals. */
4773ca3bd55SApple OSS Distributions #define YYNTOKENS 19
4783ca3bd55SApple OSS Distributions /* YYNNTS -- Number of nonterminals. */
4793ca3bd55SApple OSS Distributions #define YYNNTS 13
4803ca3bd55SApple OSS Distributions /* YYNRULES -- Number of rules. */
4813ca3bd55SApple OSS Distributions #define YYNRULES 28
4823ca3bd55SApple OSS Distributions /* YYNRULES -- Number of states. */
4833ca3bd55SApple OSS Distributions #define YYNSTATES 43
4843ca3bd55SApple OSS Distributions
4853ca3bd55SApple OSS Distributions /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
4863ca3bd55SApple OSS Distributions #define YYUNDEFTOK 2
4873ca3bd55SApple OSS Distributions #define YYMAXUTOK 262
4883ca3bd55SApple OSS Distributions
4893ca3bd55SApple OSS Distributions #define YYTRANSLATE(YYX) \
4903ca3bd55SApple OSS Distributions ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
4913ca3bd55SApple OSS Distributions
4923ca3bd55SApple OSS Distributions /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
4933ca3bd55SApple OSS Distributions static const yytype_uint8 yytranslate[] =
4943ca3bd55SApple OSS Distributions {
4953ca3bd55SApple OSS Distributions 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
4963ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
4973ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
4983ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
4993ca3bd55SApple OSS Distributions 13, 14, 2, 2, 17, 2, 2, 2, 2, 2,
5003ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 18, 12,
5013ca3bd55SApple OSS Distributions 2, 11, 2, 2, 8, 2, 2, 2, 2, 2,
5023ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5033ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5043ca3bd55SApple OSS Distributions 2, 15, 2, 16, 2, 2, 2, 2, 2, 2,
5053ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5063ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5073ca3bd55SApple OSS Distributions 2, 2, 2, 9, 2, 10, 2, 2, 2, 2,
5083ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5093ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5103ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5113ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5123ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5133ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5143ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5153ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5163ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5173ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5183ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5193ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5203ca3bd55SApple OSS Distributions 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5213ca3bd55SApple OSS Distributions 5, 6, 7
5223ca3bd55SApple OSS Distributions };
5233ca3bd55SApple OSS Distributions
5243ca3bd55SApple OSS Distributions #if YYDEBUG
5253ca3bd55SApple OSS Distributions /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
526a5e72196SApple OSS Distributions * YYRHS. */
5273ca3bd55SApple OSS Distributions static const yytype_uint8 yyprhs[] =
5283ca3bd55SApple OSS Distributions {
5293ca3bd55SApple OSS Distributions 0, 0, 3, 4, 6, 8, 10, 12, 14, 16,
5303ca3bd55SApple OSS Distributions 18, 20, 22, 25, 29, 32, 36, 38, 41, 46,
5313ca3bd55SApple OSS Distributions 49, 53, 56, 60, 62, 66, 70, 72, 74
5323ca3bd55SApple OSS Distributions };
5333ca3bd55SApple OSS Distributions
5343ca3bd55SApple OSS Distributions /* YYRHS -- A `-1'-separated list of the rules' RHS. */
5353ca3bd55SApple OSS Distributions static const yytype_int8 yyrhs[] =
5363ca3bd55SApple OSS Distributions {
5373ca3bd55SApple OSS Distributions 20, 0, -1, -1, 21, -1, 7, -1, 22, -1,
5383ca3bd55SApple OSS Distributions 25, -1, 26, -1, 30, -1, 29, -1, 28, -1,
5393ca3bd55SApple OSS Distributions 31, -1, 8, 3, -1, 21, 8, 3, -1, 9,
5403ca3bd55SApple OSS Distributions 10, -1, 9, 23, 10, -1, 24, -1, 23, 24,
5413ca3bd55SApple OSS Distributions -1, 21, 11, 21, 12, -1, 13, 14, -1, 13,
5423ca3bd55SApple OSS Distributions 27, 14, -1, 15, 16, -1, 15, 27, 16, -1,
5433ca3bd55SApple OSS Distributions 21, -1, 27, 17, 21, -1, 3, 18, 3, -1,
5443ca3bd55SApple OSS Distributions 5, -1, 4, -1, 6, -1
5453ca3bd55SApple OSS Distributions };
5463ca3bd55SApple OSS Distributions
5473ca3bd55SApple OSS Distributions /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
548*1031c584SApple OSS Distributions static const yytype_uint8 yyrline[] =
5493ca3bd55SApple OSS Distributions {
550*1031c584SApple OSS Distributions 0, 151, 151, 152, 153, 156, 157, 158, 159, 160,
551*1031c584SApple OSS Distributions 161, 162, 163, 172, 180, 181, 184, 185, 188, 198,
552*1031c584SApple OSS Distributions 199, 202, 203, 206, 211, 222, 230, 235, 240
5533ca3bd55SApple OSS Distributions };
5543ca3bd55SApple OSS Distributions #endif
5553ca3bd55SApple OSS Distributions
5563ca3bd55SApple OSS Distributions #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
5573ca3bd55SApple OSS Distributions /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
558a5e72196SApple OSS Distributions * First, the terminals, then, starting at YYNTOKENS, nonterminals. */
5593ca3bd55SApple OSS Distributions static const char *const yytname[] =
5603ca3bd55SApple OSS Distributions {
5613ca3bd55SApple OSS Distributions "$end", "error", "$undefined", "NUMBER", "STRING", "DATA", "BOOLEAN",
5623ca3bd55SApple OSS Distributions "SYNTAX_ERROR", "'@'", "'{'", "'}'", "'='", "';'", "'('", "')'", "'['",
5633ca3bd55SApple OSS Distributions "']'", "','", "':'", "$accept", "input", "object", "dict", "pairs",
5643ca3bd55SApple OSS Distributions "pair", "array", "set", "elements", "offset", "data", "string",
5653ca3bd55SApple OSS Distributions "boolean", 0
5663ca3bd55SApple OSS Distributions };
5673ca3bd55SApple OSS Distributions #endif
5683ca3bd55SApple OSS Distributions
5693ca3bd55SApple OSS Distributions # ifdef YYPRINT
5703ca3bd55SApple OSS Distributions /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
571a5e72196SApple OSS Distributions * token YYLEX-NUM. */
5723ca3bd55SApple OSS Distributions static const yytype_uint16 yytoknum[] =
5733ca3bd55SApple OSS Distributions {
5743ca3bd55SApple OSS Distributions 0, 256, 257, 258, 259, 260, 261, 262, 64, 123,
5753ca3bd55SApple OSS Distributions 125, 61, 59, 40, 41, 91, 93, 44, 58
5763ca3bd55SApple OSS Distributions };
5773ca3bd55SApple OSS Distributions # endif
5783ca3bd55SApple OSS Distributions
5793ca3bd55SApple OSS Distributions /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
5803ca3bd55SApple OSS Distributions static const yytype_uint8 yyr1[] =
5813ca3bd55SApple OSS Distributions {
5823ca3bd55SApple OSS Distributions 0, 19, 20, 20, 20, 21, 21, 21, 21, 21,
5833ca3bd55SApple OSS Distributions 21, 21, 21, 21, 22, 22, 23, 23, 24, 25,
5843ca3bd55SApple OSS Distributions 25, 26, 26, 27, 27, 28, 29, 30, 31
5853ca3bd55SApple OSS Distributions };
5863ca3bd55SApple OSS Distributions
5873ca3bd55SApple OSS Distributions /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
5883ca3bd55SApple OSS Distributions static const yytype_uint8 yyr2[] =
5893ca3bd55SApple OSS Distributions {
5903ca3bd55SApple OSS Distributions 0, 2, 0, 1, 1, 1, 1, 1, 1, 1,
5913ca3bd55SApple OSS Distributions 1, 1, 2, 3, 2, 3, 1, 2, 4, 2,
5923ca3bd55SApple OSS Distributions 3, 2, 3, 1, 3, 3, 1, 1, 1
5933ca3bd55SApple OSS Distributions };
5943ca3bd55SApple OSS Distributions
5953ca3bd55SApple OSS Distributions /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
596a5e72196SApple OSS Distributions * STATE-NUM when YYTABLE doesn't specify something else to do. Zero
597a5e72196SApple OSS Distributions * means the default is an error. */
5983ca3bd55SApple OSS Distributions static const yytype_uint8 yydefact[] =
5993ca3bd55SApple OSS Distributions {
6003ca3bd55SApple OSS Distributions 2, 0, 27, 26, 28, 4, 0, 0, 0, 0,
6013ca3bd55SApple OSS Distributions 0, 3, 5, 6, 7, 10, 9, 8, 11, 0,
6023ca3bd55SApple OSS Distributions 12, 14, 0, 0, 16, 19, 23, 0, 21, 0,
6033ca3bd55SApple OSS Distributions 1, 0, 25, 0, 15, 17, 20, 0, 22, 13,
6043ca3bd55SApple OSS Distributions 0, 24, 18
6053ca3bd55SApple OSS Distributions };
6063ca3bd55SApple OSS Distributions
6073ca3bd55SApple OSS Distributions /* YYDEFGOTO[NTERM-NUM]. */
6083ca3bd55SApple OSS Distributions static const yytype_int8 yydefgoto[] =
6093ca3bd55SApple OSS Distributions {
6103ca3bd55SApple OSS Distributions -1, 10, 22, 12, 23, 24, 13, 14, 27, 15,
6113ca3bd55SApple OSS Distributions 16, 17, 18
6123ca3bd55SApple OSS Distributions };
6133ca3bd55SApple OSS Distributions
6143ca3bd55SApple OSS Distributions /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
615a5e72196SApple OSS Distributions * STATE-NUM. */
6163ca3bd55SApple OSS Distributions #define YYPACT_NINF -14
6173ca3bd55SApple OSS Distributions static const yytype_int8 yypact[] =
6183ca3bd55SApple OSS Distributions {
6193ca3bd55SApple OSS Distributions 12, -13, -14, -14, -14, -14, 9, 26, 39, -2,
6203ca3bd55SApple OSS Distributions 10, 20, -14, -14, -14, -14, -14, -14, -14, 35,
6213ca3bd55SApple OSS Distributions -14, -14, 38, 52, -14, -14, 20, 49, -14, 7,
6223ca3bd55SApple OSS Distributions -14, 37, -14, 65, -14, -14, -14, 65, -14, -14,
6233ca3bd55SApple OSS Distributions 14, 20, -14
6243ca3bd55SApple OSS Distributions };
6253ca3bd55SApple OSS Distributions
6263ca3bd55SApple OSS Distributions /* YYPGOTO[NTERM-NUM]. */
6273ca3bd55SApple OSS Distributions static const yytype_int8 yypgoto[] =
6283ca3bd55SApple OSS Distributions {
6293ca3bd55SApple OSS Distributions -14, -14, 0, -14, -14, 27, -14, -14, 42, -14,
6303ca3bd55SApple OSS Distributions -14, -14, -14
6313ca3bd55SApple OSS Distributions };
6323ca3bd55SApple OSS Distributions
6333ca3bd55SApple OSS Distributions /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
634a5e72196SApple OSS Distributions * positive, shift that token. If negative, reduce the rule which
635a5e72196SApple OSS Distributions * number is the opposite. If zero, do what YYDEFACT says.
636a5e72196SApple OSS Distributions * If YYTABLE_NINF, syntax error. */
6373ca3bd55SApple OSS Distributions #define YYTABLE_NINF -1
6383ca3bd55SApple OSS Distributions static const yytype_uint8 yytable[] =
6393ca3bd55SApple OSS Distributions {
6403ca3bd55SApple OSS Distributions 11, 1, 2, 3, 4, 19, 6, 7, 26, 26,
6413ca3bd55SApple OSS Distributions 30, 8, 20, 9, 28, 1, 2, 3, 4, 5,
6423ca3bd55SApple OSS Distributions 6, 7, 31, 38, 37, 8, 42, 9, 31, 1,
6433ca3bd55SApple OSS Distributions 2, 3, 4, 40, 6, 7, 21, 41, 32, 8,
6443ca3bd55SApple OSS Distributions 39, 9, 1, 2, 3, 4, 31, 6, 7, 33,
6453ca3bd55SApple OSS Distributions 35, 29, 8, 25, 9, 1, 2, 3, 4, 0,
6463ca3bd55SApple OSS Distributions 6, 7, 34, 36, 0, 8, 37, 9, 1, 2,
6473ca3bd55SApple OSS Distributions 3, 4, 0, 6, 7, 0, 0, 0, 8, 0,
6483ca3bd55SApple OSS Distributions 9
6493ca3bd55SApple OSS Distributions };
6503ca3bd55SApple OSS Distributions
6513ca3bd55SApple OSS Distributions static const yytype_int8 yycheck[] =
6523ca3bd55SApple OSS Distributions {
6533ca3bd55SApple OSS Distributions 0, 3, 4, 5, 6, 18, 8, 9, 8, 9,
6543ca3bd55SApple OSS Distributions 0, 13, 3, 15, 16, 3, 4, 5, 6, 7,
6553ca3bd55SApple OSS Distributions 8, 9, 8, 16, 17, 13, 12, 15, 8, 3,
6563ca3bd55SApple OSS Distributions 4, 5, 6, 33, 8, 9, 10, 37, 3, 13,
6573ca3bd55SApple OSS Distributions 3, 15, 3, 4, 5, 6, 8, 8, 9, 11,
6583ca3bd55SApple OSS Distributions 23, 9, 13, 14, 15, 3, 4, 5, 6, -1,
6593ca3bd55SApple OSS Distributions 8, 9, 10, 14, -1, 13, 17, 15, 3, 4,
6603ca3bd55SApple OSS Distributions 5, 6, -1, 8, 9, -1, -1, -1, 13, -1,
6613ca3bd55SApple OSS Distributions 15
6623ca3bd55SApple OSS Distributions };
6633ca3bd55SApple OSS Distributions
6643ca3bd55SApple OSS Distributions /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
665a5e72196SApple OSS Distributions * symbol of state STATE-NUM. */
6663ca3bd55SApple OSS Distributions static const yytype_uint8 yystos[] =
6673ca3bd55SApple OSS Distributions {
6683ca3bd55SApple OSS Distributions 0, 3, 4, 5, 6, 7, 8, 9, 13, 15,
6693ca3bd55SApple OSS Distributions 20, 21, 22, 25, 26, 28, 29, 30, 31, 18,
6703ca3bd55SApple OSS Distributions 3, 10, 21, 23, 24, 14, 21, 27, 16, 27,
6713ca3bd55SApple OSS Distributions 0, 8, 3, 11, 10, 24, 14, 17, 16, 3,
6723ca3bd55SApple OSS Distributions 21, 21, 12
6733ca3bd55SApple OSS Distributions };
674c1dac77fSApple OSS Distributions
675c1dac77fSApple OSS Distributions #define yyerrok (yyerrstatus = 0)
676c1dac77fSApple OSS Distributions #define yyclearin (yychar = YYEMPTY)
6773ca3bd55SApple OSS Distributions #define YYEMPTY (-2)
678c1dac77fSApple OSS Distributions #define YYEOF 0
6793ca3bd55SApple OSS Distributions
680c1dac77fSApple OSS Distributions #define YYACCEPT goto yyacceptlab
681c1dac77fSApple OSS Distributions #define YYABORT goto yyabortlab
6823ca3bd55SApple OSS Distributions #define YYERROR goto yyerrorlab
6833ca3bd55SApple OSS Distributions
6843ca3bd55SApple OSS Distributions
6853ca3bd55SApple OSS Distributions /* Like YYERROR except do call yyerror. This remains here temporarily
686a5e72196SApple OSS Distributions * to ease the transition to the new meaning of YYERROR, for GCC.
687a5e72196SApple OSS Distributions * Once GCC version 2 has supplanted version 1, this can go. */
6883ca3bd55SApple OSS Distributions
689c1dac77fSApple OSS Distributions #define YYFAIL goto yyerrlab
6903ca3bd55SApple OSS Distributions
691c1dac77fSApple OSS Distributions #define YYRECOVERING() (!!yyerrstatus)
6923ca3bd55SApple OSS Distributions
6933ca3bd55SApple OSS Distributions #define YYBACKUP(Token, Value) \
694c1dac77fSApple OSS Distributions do \
695c1dac77fSApple OSS Distributions if (yychar == YYEMPTY && yylen == 1) \
6963ca3bd55SApple OSS Distributions { \
6973ca3bd55SApple OSS Distributions yychar = (Token); \
6983ca3bd55SApple OSS Distributions yylval = (Value); \
6993ca3bd55SApple OSS Distributions yytoken = YYTRANSLATE (yychar); \
7003ca3bd55SApple OSS Distributions YYPOPSTACK (1); \
701c1dac77fSApple OSS Distributions goto yybackup; \
702c1dac77fSApple OSS Distributions } \
703c1dac77fSApple OSS Distributions else \
7043ca3bd55SApple OSS Distributions { \
7053ca3bd55SApple OSS Distributions yyerror (YY_("syntax error: cannot back up")); \
7063ca3bd55SApple OSS Distributions YYERROR; \
7073ca3bd55SApple OSS Distributions } \
7083ca3bd55SApple OSS Distributions while (YYID (0))
7093ca3bd55SApple OSS Distributions
710c1dac77fSApple OSS Distributions
711c1dac77fSApple OSS Distributions #define YYTERROR 1
712c1dac77fSApple OSS Distributions #define YYERRCODE 256
713c1dac77fSApple OSS Distributions
7143ca3bd55SApple OSS Distributions
7153ca3bd55SApple OSS Distributions /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
716a5e72196SApple OSS Distributions * If N is 0, then set CURRENT to the empty location which ends
717a5e72196SApple OSS Distributions * the previous symbol: RHS[0] (always defined). */
7183ca3bd55SApple OSS Distributions
7193ca3bd55SApple OSS Distributions #define YYRHSLOC(Rhs, K) ((Rhs)[K])
7203ca3bd55SApple OSS Distributions #ifndef YYLLOC_DEFAULT
7213ca3bd55SApple OSS Distributions # define YYLLOC_DEFAULT(Current, Rhs, N) \
7223ca3bd55SApple OSS Distributions do \
7233ca3bd55SApple OSS Distributions if (YYID (N)) \
7243ca3bd55SApple OSS Distributions { \
7253ca3bd55SApple OSS Distributions (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
7263ca3bd55SApple OSS Distributions (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
7273ca3bd55SApple OSS Distributions (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
7283ca3bd55SApple OSS Distributions (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
7293ca3bd55SApple OSS Distributions } \
7303ca3bd55SApple OSS Distributions else \
7313ca3bd55SApple OSS Distributions { \
7323ca3bd55SApple OSS Distributions (Current).first_line = (Current).last_line = \
7333ca3bd55SApple OSS Distributions YYRHSLOC (Rhs, 0).last_line; \
7343ca3bd55SApple OSS Distributions (Current).first_column = (Current).last_column = \
7353ca3bd55SApple OSS Distributions YYRHSLOC (Rhs, 0).last_column; \
7363ca3bd55SApple OSS Distributions } \
7373ca3bd55SApple OSS Distributions while (YYID (0))
7383ca3bd55SApple OSS Distributions #endif
7393ca3bd55SApple OSS Distributions
7403ca3bd55SApple OSS Distributions
7413ca3bd55SApple OSS Distributions /* YY_LOCATION_PRINT -- Print the location on the stream.
742a5e72196SApple OSS Distributions * This macro was not mandated originally: define only if we know
743a5e72196SApple OSS Distributions * we won't break user code: when these are the locations we know. */
7443ca3bd55SApple OSS Distributions
7453ca3bd55SApple OSS Distributions #ifndef YY_LOCATION_PRINT
7463ca3bd55SApple OSS Distributions # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
7473ca3bd55SApple OSS Distributions # define YY_LOCATION_PRINT(File, Loc) \
7483ca3bd55SApple OSS Distributions fprintf (File, "%d.%d-%d.%d", \
7493ca3bd55SApple OSS Distributions (Loc).first_line, (Loc).first_column, \
7503ca3bd55SApple OSS Distributions (Loc).last_line, (Loc).last_column)
7513ca3bd55SApple OSS Distributions # else
7523ca3bd55SApple OSS Distributions # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
7533ca3bd55SApple OSS Distributions # endif
7543ca3bd55SApple OSS Distributions #endif
7553ca3bd55SApple OSS Distributions
7563ca3bd55SApple OSS Distributions
7573ca3bd55SApple OSS Distributions /* YYLEX -- calling `yylex' with the right arguments. */
7583ca3bd55SApple OSS Distributions
7593ca3bd55SApple OSS Distributions #ifdef YYLEX_PARAM
7603ca3bd55SApple OSS Distributions # define YYLEX yylex (YYLEX_PARAM)
7613ca3bd55SApple OSS Distributions #else
762c1dac77fSApple OSS Distributions # define YYLEX yylex ()
763c1dac77fSApple OSS Distributions #endif
764c1dac77fSApple OSS Distributions
7653ca3bd55SApple OSS Distributions /* Enable debugging if requested. */
7663ca3bd55SApple OSS Distributions #if YYDEBUG
7673ca3bd55SApple OSS Distributions
7683ca3bd55SApple OSS Distributions # ifndef YYFPRINTF
769e6231be0SApple OSS Distributions # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
7703ca3bd55SApple OSS Distributions # define YYFPRINTF fprintf
7713ca3bd55SApple OSS Distributions # endif
7723ca3bd55SApple OSS Distributions
7733ca3bd55SApple OSS Distributions # define YYDPRINTF(Args) \
7743ca3bd55SApple OSS Distributions do { \
7753ca3bd55SApple OSS Distributions if (yydebug) \
7763ca3bd55SApple OSS Distributions YYFPRINTF Args; \
7773ca3bd55SApple OSS Distributions } while (YYID (0))
7783ca3bd55SApple OSS Distributions
7793ca3bd55SApple OSS Distributions # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
7803ca3bd55SApple OSS Distributions do { \
7813ca3bd55SApple OSS Distributions if (yydebug) \
7823ca3bd55SApple OSS Distributions { \
7833ca3bd55SApple OSS Distributions YYFPRINTF (stderr, "%s ", Title); \
7843ca3bd55SApple OSS Distributions yy_symbol_print (stderr, \
7853ca3bd55SApple OSS Distributions Type, Value); \
7863ca3bd55SApple OSS Distributions YYFPRINTF (stderr, "\n"); \
7873ca3bd55SApple OSS Distributions } \
7883ca3bd55SApple OSS Distributions } while (YYID (0))
7893ca3bd55SApple OSS Distributions
7903ca3bd55SApple OSS Distributions
7913ca3bd55SApple OSS Distributions /*--------------------------------.
7923ca3bd55SApple OSS Distributions | Print this symbol on YYOUTPUT. |
793a5e72196SApple OSS Distributions | `--------------------------------*/
7943ca3bd55SApple OSS Distributions
7953ca3bd55SApple OSS Distributions /*ARGSUSED*/
7963ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
7973ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
7983ca3bd55SApple OSS Distributions static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)7993ca3bd55SApple OSS Distributions yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
800c1dac77fSApple OSS Distributions #else
8013ca3bd55SApple OSS Distributions static void
8023ca3bd55SApple OSS Distributions yy_symbol_value_print(yyoutput, yytype, yyvaluep)
8033ca3bd55SApple OSS Distributions FILE *yyoutput;
8043ca3bd55SApple OSS Distributions int yytype;
8053ca3bd55SApple OSS Distributions YYSTYPE const * const yyvaluep;
806c1dac77fSApple OSS Distributions #endif
8073ca3bd55SApple OSS Distributions {
808a5e72196SApple OSS Distributions if (!yyvaluep) {
8093ca3bd55SApple OSS Distributions return;
810a5e72196SApple OSS Distributions }
8113ca3bd55SApple OSS Distributions # ifdef YYPRINT
812a5e72196SApple OSS Distributions if (yytype < YYNTOKENS) {
8133ca3bd55SApple OSS Distributions YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep);
814a5e72196SApple OSS Distributions }
815c1dac77fSApple OSS Distributions # else
8163ca3bd55SApple OSS Distributions YYUSE(yyoutput);
817c1dac77fSApple OSS Distributions # endif
818a5e72196SApple OSS Distributions switch (yytype) {
8193ca3bd55SApple OSS Distributions default:
8203ca3bd55SApple OSS Distributions break;
8213ca3bd55SApple OSS Distributions }
8223ca3bd55SApple OSS Distributions }
8233ca3bd55SApple OSS Distributions
8243ca3bd55SApple OSS Distributions
8253ca3bd55SApple OSS Distributions /*--------------------------------.
8263ca3bd55SApple OSS Distributions | Print this symbol on YYOUTPUT. |
827a5e72196SApple OSS Distributions | `--------------------------------*/
8283ca3bd55SApple OSS Distributions
8293ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
8303ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
8313ca3bd55SApple OSS Distributions static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)8323ca3bd55SApple OSS Distributions yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
8333ca3bd55SApple OSS Distributions #else
8343ca3bd55SApple OSS Distributions static void
8353ca3bd55SApple OSS Distributions yy_symbol_print(yyoutput, yytype, yyvaluep)
8363ca3bd55SApple OSS Distributions FILE *yyoutput;
8373ca3bd55SApple OSS Distributions int yytype;
8383ca3bd55SApple OSS Distributions YYSTYPE const * const yyvaluep;
839c1dac77fSApple OSS Distributions #endif
8403ca3bd55SApple OSS Distributions {
841a5e72196SApple OSS Distributions if (yytype < YYNTOKENS) {
8423ca3bd55SApple OSS Distributions YYFPRINTF(yyoutput, "token %s (", yytname[yytype]);
843a5e72196SApple OSS Distributions } else {
8443ca3bd55SApple OSS Distributions YYFPRINTF(yyoutput, "nterm %s (", yytname[yytype]);
845a5e72196SApple OSS Distributions }
846c1dac77fSApple OSS Distributions
8473ca3bd55SApple OSS Distributions yy_symbol_value_print(yyoutput, yytype, yyvaluep);
8483ca3bd55SApple OSS Distributions YYFPRINTF(yyoutput, ")");
8493ca3bd55SApple OSS Distributions }
850c1dac77fSApple OSS Distributions
8513ca3bd55SApple OSS Distributions /*------------------------------------------------------------------.
8523ca3bd55SApple OSS Distributions | yy_stack_print -- Print the state stack from its BOTTOM up to its |
8533ca3bd55SApple OSS Distributions | TOP (included). |
854a5e72196SApple OSS Distributions | `------------------------------------------------------------------*/
855c1dac77fSApple OSS Distributions
8563ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
8573ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
8583ca3bd55SApple OSS Distributions static void
yy_stack_print(yytype_int16 * bottom,yytype_int16 * top)8593ca3bd55SApple OSS Distributions yy_stack_print(yytype_int16 *bottom, yytype_int16 *top)
8603ca3bd55SApple OSS Distributions #else
8613ca3bd55SApple OSS Distributions static void
8623ca3bd55SApple OSS Distributions yy_stack_print(bottom, top)
8633ca3bd55SApple OSS Distributions yytype_int16 *bottom;
8643ca3bd55SApple OSS Distributions yytype_int16 *top;
865c1dac77fSApple OSS Distributions #endif
8663ca3bd55SApple OSS Distributions {
8673ca3bd55SApple OSS Distributions YYFPRINTF(stderr, "Stack now");
868a5e72196SApple OSS Distributions for (; bottom <= top; ++bottom) {
8693ca3bd55SApple OSS Distributions YYFPRINTF(stderr, " %d", *bottom);
870a5e72196SApple OSS Distributions }
8713ca3bd55SApple OSS Distributions YYFPRINTF(stderr, "\n");
8723ca3bd55SApple OSS Distributions }
873c1dac77fSApple OSS Distributions
8743ca3bd55SApple OSS Distributions # define YY_STACK_PRINT(Bottom, Top) \
8753ca3bd55SApple OSS Distributions do { \
8763ca3bd55SApple OSS Distributions if (yydebug) \
8773ca3bd55SApple OSS Distributions yy_stack_print ((Bottom), (Top)); \
8783ca3bd55SApple OSS Distributions } while (YYID (0))
879c1dac77fSApple OSS Distributions
8803ca3bd55SApple OSS Distributions
8813ca3bd55SApple OSS Distributions /*------------------------------------------------.
8823ca3bd55SApple OSS Distributions | Report that the YYRULE is going to be reduced. |
883a5e72196SApple OSS Distributions | `------------------------------------------------*/
8843ca3bd55SApple OSS Distributions
8853ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
8863ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
8873ca3bd55SApple OSS Distributions static void
yy_reduce_print(YYSTYPE * yyvsp,int yyrule)8883ca3bd55SApple OSS Distributions yy_reduce_print(YYSTYPE *yyvsp, int yyrule)
8893ca3bd55SApple OSS Distributions #else
8903ca3bd55SApple OSS Distributions static void
8913ca3bd55SApple OSS Distributions yy_reduce_print(yyvsp, yyrule)
8923ca3bd55SApple OSS Distributions YYSTYPE *yyvsp;
8933ca3bd55SApple OSS Distributions int yyrule;
894c1dac77fSApple OSS Distributions #endif
8953ca3bd55SApple OSS Distributions {
8963ca3bd55SApple OSS Distributions int yynrhs = yyr2[yyrule];
8973ca3bd55SApple OSS Distributions int yyi;
8983ca3bd55SApple OSS Distributions unsigned long int yylno = yyrline[yyrule];
8993ca3bd55SApple OSS Distributions YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n",
9003ca3bd55SApple OSS Distributions yyrule - 1, yylno);
9013ca3bd55SApple OSS Distributions /* The symbols being reduced. */
902a5e72196SApple OSS Distributions for (yyi = 0; yyi < yynrhs; yyi++) {
9033ca3bd55SApple OSS Distributions fprintf(stderr, " $%d = ", yyi + 1);
9043ca3bd55SApple OSS Distributions yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi],
9053ca3bd55SApple OSS Distributions &(yyvsp[(yyi + 1) - (yynrhs)])
9063ca3bd55SApple OSS Distributions );
9073ca3bd55SApple OSS Distributions fprintf(stderr, "\n");
9083ca3bd55SApple OSS Distributions }
9093ca3bd55SApple OSS Distributions }
910c1dac77fSApple OSS Distributions
9113ca3bd55SApple OSS Distributions # define YY_REDUCE_PRINT(Rule) \
9123ca3bd55SApple OSS Distributions do { \
9133ca3bd55SApple OSS Distributions if (yydebug) \
9143ca3bd55SApple OSS Distributions yy_reduce_print (yyvsp, Rule); \
9153ca3bd55SApple OSS Distributions } while (YYID (0))
916c1dac77fSApple OSS Distributions
9173ca3bd55SApple OSS Distributions /* Nonzero means print parse trace. It is left uninitialized so that
918a5e72196SApple OSS Distributions * multiple parsers can coexist. */
9193ca3bd55SApple OSS Distributions int yydebug;
9203ca3bd55SApple OSS Distributions #else /* !YYDEBUG */
9213ca3bd55SApple OSS Distributions # define YYDPRINTF(Args)
9223ca3bd55SApple OSS Distributions # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
9233ca3bd55SApple OSS Distributions # define YY_STACK_PRINT(Bottom, Top)
9243ca3bd55SApple OSS Distributions # define YY_REDUCE_PRINT(Rule)
9253ca3bd55SApple OSS Distributions #endif /* !YYDEBUG */
9263ca3bd55SApple OSS Distributions
9273ca3bd55SApple OSS Distributions
9283ca3bd55SApple OSS Distributions /* YYINITDEPTH -- initial size of the parser's stacks. */
929c1dac77fSApple OSS Distributions #ifndef YYINITDEPTH
930c1dac77fSApple OSS Distributions # define YYINITDEPTH 200
931c1dac77fSApple OSS Distributions #endif
932c1dac77fSApple OSS Distributions
9333ca3bd55SApple OSS Distributions /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
934a5e72196SApple OSS Distributions * if the built-in stack extension method is used).
935a5e72196SApple OSS Distributions *
936a5e72196SApple OSS Distributions * Do not make this value too large; the results are undefined if
937a5e72196SApple OSS Distributions * YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
938a5e72196SApple OSS Distributions * evaluated with infinite-precision integer arithmetic. */
939c1dac77fSApple OSS Distributions
940c1dac77fSApple OSS Distributions #ifndef YYMAXDEPTH
941c1dac77fSApple OSS Distributions # define YYMAXDEPTH 10000
942c1dac77fSApple OSS Distributions #endif
9433ca3bd55SApple OSS Distributions
944a5e72196SApple OSS Distributions
945c1dac77fSApple OSS Distributions
9463ca3bd55SApple OSS Distributions #if YYERROR_VERBOSE
947c1dac77fSApple OSS Distributions
9483ca3bd55SApple OSS Distributions # ifndef yystrlen
9493ca3bd55SApple OSS Distributions # if defined __GLIBC__ && defined _STRING_H
9503ca3bd55SApple OSS Distributions # define yystrlen strlen
951c1dac77fSApple OSS Distributions # else
9523ca3bd55SApple OSS Distributions /* Return the length of YYSTR. */
9533ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
9543ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
9553ca3bd55SApple OSS Distributions static YYSIZE_T
yystrlen(const char * yystr)9563ca3bd55SApple OSS Distributions yystrlen(const char *yystr)
9573ca3bd55SApple OSS Distributions #else
9583ca3bd55SApple OSS Distributions static YYSIZE_T
9593ca3bd55SApple OSS Distributions yystrlen(yystr)
9603ca3bd55SApple OSS Distributions const char *yystr;
9613ca3bd55SApple OSS Distributions #endif
9623ca3bd55SApple OSS Distributions {
9633ca3bd55SApple OSS Distributions YYSIZE_T yylen;
964a5e72196SApple OSS Distributions for (yylen = 0; yystr[yylen]; yylen++) {
9653ca3bd55SApple OSS Distributions continue;
966a5e72196SApple OSS Distributions }
9673ca3bd55SApple OSS Distributions return yylen;
9683ca3bd55SApple OSS Distributions }
9693ca3bd55SApple OSS Distributions # endif
9703ca3bd55SApple OSS Distributions # endif
9713ca3bd55SApple OSS Distributions
9723ca3bd55SApple OSS Distributions # ifndef yystpcpy
9733ca3bd55SApple OSS Distributions # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
9743ca3bd55SApple OSS Distributions # define yystpcpy stpcpy
9753ca3bd55SApple OSS Distributions # else
9763ca3bd55SApple OSS Distributions /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
977a5e72196SApple OSS Distributions * YYDEST. */
9783ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
9793ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
9803ca3bd55SApple OSS Distributions static char *
yystpcpy(char * yydest,const char * yysrc)9813ca3bd55SApple OSS Distributions yystpcpy(char *yydest, const char *yysrc)
9823ca3bd55SApple OSS Distributions #else
9833ca3bd55SApple OSS Distributions static char *
9843ca3bd55SApple OSS Distributions yystpcpy(yydest, yysrc)
9853ca3bd55SApple OSS Distributions char *yydest;
9863ca3bd55SApple OSS Distributions const char *yysrc;
9873ca3bd55SApple OSS Distributions #endif
9883ca3bd55SApple OSS Distributions {
9893ca3bd55SApple OSS Distributions char *yyd = yydest;
9903ca3bd55SApple OSS Distributions const char *yys = yysrc;
9913ca3bd55SApple OSS Distributions
992a5e72196SApple OSS Distributions while ((*yyd++ = *yys++) != '\0') {
9933ca3bd55SApple OSS Distributions continue;
994a5e72196SApple OSS Distributions }
9953ca3bd55SApple OSS Distributions
9963ca3bd55SApple OSS Distributions return yyd - 1;
9973ca3bd55SApple OSS Distributions }
9983ca3bd55SApple OSS Distributions # endif
9993ca3bd55SApple OSS Distributions # endif
10003ca3bd55SApple OSS Distributions
10013ca3bd55SApple OSS Distributions # ifndef yytnamerr
10023ca3bd55SApple OSS Distributions /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1003a5e72196SApple OSS Distributions * quotes and backslashes, so that it's suitable for yyerror. The
1004a5e72196SApple OSS Distributions * heuristic is that double-quoting is unnecessary unless the string
1005a5e72196SApple OSS Distributions * contains an apostrophe, a comma, or backslash (other than
1006a5e72196SApple OSS Distributions * backslash-backslash). YYSTR is taken from yytname. If YYRES is
1007a5e72196SApple OSS Distributions * null, do not copy; instead, return the length of what the result
1008a5e72196SApple OSS Distributions * would have been. */
10093ca3bd55SApple OSS Distributions static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)10103ca3bd55SApple OSS Distributions yytnamerr(char *yyres, const char *yystr)
10113ca3bd55SApple OSS Distributions {
1012a5e72196SApple OSS Distributions if (*yystr == '"') {
10133ca3bd55SApple OSS Distributions YYSIZE_T yyn = 0;
10143ca3bd55SApple OSS Distributions char const *yyp = yystr;
10153ca3bd55SApple OSS Distributions
1016a5e72196SApple OSS Distributions for (;;) {
1017a5e72196SApple OSS Distributions switch (*++yyp) {
10183ca3bd55SApple OSS Distributions case '\'':
10193ca3bd55SApple OSS Distributions case ',':
10203ca3bd55SApple OSS Distributions goto do_not_strip_quotes;
10213ca3bd55SApple OSS Distributions
10223ca3bd55SApple OSS Distributions case '\\':
1023a5e72196SApple OSS Distributions if (*++yyp != '\\') {
10243ca3bd55SApple OSS Distributions goto do_not_strip_quotes;
1025a5e72196SApple OSS Distributions }
10263ca3bd55SApple OSS Distributions /* Fall through. */
10273ca3bd55SApple OSS Distributions default:
1028a5e72196SApple OSS Distributions if (yyres) {
10293ca3bd55SApple OSS Distributions yyres[yyn] = *yyp;
1030a5e72196SApple OSS Distributions }
10313ca3bd55SApple OSS Distributions yyn++;
10323ca3bd55SApple OSS Distributions break;
10333ca3bd55SApple OSS Distributions
10343ca3bd55SApple OSS Distributions case '"':
1035a5e72196SApple OSS Distributions if (yyres) {
10363ca3bd55SApple OSS Distributions yyres[yyn] = '\0';
1037a5e72196SApple OSS Distributions }
10383ca3bd55SApple OSS Distributions return yyn;
10393ca3bd55SApple OSS Distributions }
1040a5e72196SApple OSS Distributions }
10413ca3bd55SApple OSS Distributions do_not_strip_quotes:;
10423ca3bd55SApple OSS Distributions }
10433ca3bd55SApple OSS Distributions
1044a5e72196SApple OSS Distributions if (!yyres) {
10453ca3bd55SApple OSS Distributions return yystrlen(yystr);
1046a5e72196SApple OSS Distributions }
10473ca3bd55SApple OSS Distributions
10483ca3bd55SApple OSS Distributions return yystpcpy(yyres, yystr) - yyres;
10493ca3bd55SApple OSS Distributions }
10503ca3bd55SApple OSS Distributions # endif
10513ca3bd55SApple OSS Distributions
10523ca3bd55SApple OSS Distributions /* Copy into YYRESULT an error message about the unexpected token
1053a5e72196SApple OSS Distributions * YYCHAR while in state YYSTATE. Return the number of bytes copied,
1054a5e72196SApple OSS Distributions * including the terminating null byte. If YYRESULT is null, do not
1055a5e72196SApple OSS Distributions * copy anything; just return the number of bytes that would be
1056a5e72196SApple OSS Distributions * copied. As a special case, return 0 if an ordinary "syntax error"
1057a5e72196SApple OSS Distributions * message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1058a5e72196SApple OSS Distributions * size calculation. */
10593ca3bd55SApple OSS Distributions static YYSIZE_T
yysyntax_error(char * yyresult,int yystate,int yychar)10603ca3bd55SApple OSS Distributions yysyntax_error(char *yyresult, int yystate, int yychar)
10613ca3bd55SApple OSS Distributions {
10623ca3bd55SApple OSS Distributions int yyn = yypact[yystate];
10633ca3bd55SApple OSS Distributions
1064a5e72196SApple OSS Distributions if (!(YYPACT_NINF < yyn && yyn <= YYLAST)) {
10653ca3bd55SApple OSS Distributions return 0;
1066a5e72196SApple OSS Distributions } else {
10673ca3bd55SApple OSS Distributions int yytype = YYTRANSLATE(yychar);
10683ca3bd55SApple OSS Distributions YYSIZE_T yysize0 = yytnamerr(0, yytname[yytype]);
10693ca3bd55SApple OSS Distributions YYSIZE_T yysize = yysize0;
10703ca3bd55SApple OSS Distributions YYSIZE_T yysize1;
10713ca3bd55SApple OSS Distributions int yysize_overflow = 0;
10723ca3bd55SApple OSS Distributions enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
10733ca3bd55SApple OSS Distributions char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
10743ca3bd55SApple OSS Distributions int yyx;
10753ca3bd55SApple OSS Distributions
10763ca3bd55SApple OSS Distributions # if 0
10773ca3bd55SApple OSS Distributions /* This is so xgettext sees the translatable formats that are
1078a5e72196SApple OSS Distributions * constructed on the fly. */
10793ca3bd55SApple OSS Distributions YY_("syntax error, unexpected %s");
10803ca3bd55SApple OSS Distributions YY_("syntax error, unexpected %s, expecting %s");
10813ca3bd55SApple OSS Distributions YY_("syntax error, unexpected %s, expecting %s or %s");
10823ca3bd55SApple OSS Distributions YY_("syntax error, unexpected %s, expecting %s or %s or %s");
10833ca3bd55SApple OSS Distributions YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
10843ca3bd55SApple OSS Distributions # endif
10853ca3bd55SApple OSS Distributions char *yyfmt;
10863ca3bd55SApple OSS Distributions char const *yyf;
10873ca3bd55SApple OSS Distributions static char const yyunexpected[] = "syntax error, unexpected %s";
10883ca3bd55SApple OSS Distributions static char const yyexpecting[] = ", expecting %s";
10893ca3bd55SApple OSS Distributions static char const yyor[] = " or %s";
10903ca3bd55SApple OSS Distributions char yyformat[sizeof yyunexpected
10913ca3bd55SApple OSS Distributions + sizeof yyexpecting - 1
10923ca3bd55SApple OSS Distributions + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
10933ca3bd55SApple OSS Distributions * (sizeof yyor - 1))];
10943ca3bd55SApple OSS Distributions char const *yyprefix = yyexpecting;
10953ca3bd55SApple OSS Distributions
10963ca3bd55SApple OSS Distributions /* Start YYX at -YYN if negative to avoid negative indexes in
1097a5e72196SApple OSS Distributions * YYCHECK. */
10983ca3bd55SApple OSS Distributions int yyxbegin = yyn < 0 ? -yyn : 0;
10993ca3bd55SApple OSS Distributions
11003ca3bd55SApple OSS Distributions /* Stay within bounds of both yycheck and yytname. */
11013ca3bd55SApple OSS Distributions int yychecklim = YYLAST - yyn + 1;
11023ca3bd55SApple OSS Distributions int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
11033ca3bd55SApple OSS Distributions int yycount = 1;
11043ca3bd55SApple OSS Distributions
11053ca3bd55SApple OSS Distributions yyarg[0] = yytname[yytype];
11063ca3bd55SApple OSS Distributions yyfmt = yystpcpy(yyformat, yyunexpected);
11073ca3bd55SApple OSS Distributions
1108a5e72196SApple OSS Distributions for (yyx = yyxbegin; yyx < yyxend; ++yyx) {
1109a5e72196SApple OSS Distributions if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) {
1110a5e72196SApple OSS Distributions if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) {
11113ca3bd55SApple OSS Distributions yycount = 1;
11123ca3bd55SApple OSS Distributions yysize = yysize0;
11133ca3bd55SApple OSS Distributions yyformat[sizeof yyunexpected - 1] = '\0';
11143ca3bd55SApple OSS Distributions break;
11153ca3bd55SApple OSS Distributions }
11163ca3bd55SApple OSS Distributions yyarg[yycount++] = yytname[yyx];
11173ca3bd55SApple OSS Distributions yysize1 = yysize + yytnamerr(0, yytname[yyx]);
11183ca3bd55SApple OSS Distributions yysize_overflow |= (yysize1 < yysize);
11193ca3bd55SApple OSS Distributions yysize = yysize1;
11203ca3bd55SApple OSS Distributions yyfmt = yystpcpy(yyfmt, yyprefix);
11213ca3bd55SApple OSS Distributions yyprefix = yyor;
11223ca3bd55SApple OSS Distributions }
1123a5e72196SApple OSS Distributions }
11243ca3bd55SApple OSS Distributions
11253ca3bd55SApple OSS Distributions yyf = YY_(yyformat);
11263ca3bd55SApple OSS Distributions yysize1 = yysize + yystrlen(yyf);
11273ca3bd55SApple OSS Distributions yysize_overflow |= (yysize1 < yysize);
11283ca3bd55SApple OSS Distributions yysize = yysize1;
11293ca3bd55SApple OSS Distributions
1130a5e72196SApple OSS Distributions if (yysize_overflow) {
11313ca3bd55SApple OSS Distributions return YYSIZE_MAXIMUM;
1132a5e72196SApple OSS Distributions }
11333ca3bd55SApple OSS Distributions
1134a5e72196SApple OSS Distributions if (yyresult) {
11353ca3bd55SApple OSS Distributions /* Avoid sprintf, as that infringes on the user's name space.
1136a5e72196SApple OSS Distributions * Don't have undefined behavior even if the translation
1137a5e72196SApple OSS Distributions * produced a string with the wrong number of "%s"s. */
11383ca3bd55SApple OSS Distributions char *yyp = yyresult;
11393ca3bd55SApple OSS Distributions int yyi = 0;
1140a5e72196SApple OSS Distributions while ((*yyp = *yyf) != '\0') {
1141a5e72196SApple OSS Distributions if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) {
11423ca3bd55SApple OSS Distributions yyp += yytnamerr(yyp, yyarg[yyi++]);
11433ca3bd55SApple OSS Distributions yyf += 2;
1144a5e72196SApple OSS Distributions } else {
11453ca3bd55SApple OSS Distributions yyp++;
11463ca3bd55SApple OSS Distributions yyf++;
11473ca3bd55SApple OSS Distributions }
11483ca3bd55SApple OSS Distributions }
11493ca3bd55SApple OSS Distributions }
11503ca3bd55SApple OSS Distributions return yysize;
11513ca3bd55SApple OSS Distributions }
11523ca3bd55SApple OSS Distributions }
11533ca3bd55SApple OSS Distributions #endif /* YYERROR_VERBOSE */
1154a5e72196SApple OSS Distributions
11553ca3bd55SApple OSS Distributions
11563ca3bd55SApple OSS Distributions /*-----------------------------------------------.
11573ca3bd55SApple OSS Distributions | Release the memory associated to this symbol. |
1158a5e72196SApple OSS Distributions | `-----------------------------------------------*/
11593ca3bd55SApple OSS Distributions
11603ca3bd55SApple OSS Distributions /*ARGSUSED*/
11613ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
11623ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
11633ca3bd55SApple OSS Distributions static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)11643ca3bd55SApple OSS Distributions yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
11653ca3bd55SApple OSS Distributions #else
11663ca3bd55SApple OSS Distributions static void
11673ca3bd55SApple OSS Distributions yydestruct(yymsg, yytype, yyvaluep)
11683ca3bd55SApple OSS Distributions const char *yymsg;
11693ca3bd55SApple OSS Distributions int yytype;
11703ca3bd55SApple OSS Distributions YYSTYPE *yyvaluep;
11713ca3bd55SApple OSS Distributions #endif
11723ca3bd55SApple OSS Distributions {
11733ca3bd55SApple OSS Distributions YYUSE(yyvaluep);
11743ca3bd55SApple OSS Distributions
1175a5e72196SApple OSS Distributions if (!yymsg) {
11763ca3bd55SApple OSS Distributions yymsg = "Deleting";
1177a5e72196SApple OSS Distributions }
11783ca3bd55SApple OSS Distributions YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
11793ca3bd55SApple OSS Distributions
1180a5e72196SApple OSS Distributions switch (yytype) {
11813ca3bd55SApple OSS Distributions default:
11823ca3bd55SApple OSS Distributions break;
11833ca3bd55SApple OSS Distributions }
11843ca3bd55SApple OSS Distributions }
1185a5e72196SApple OSS Distributions
11863ca3bd55SApple OSS Distributions
11873ca3bd55SApple OSS Distributions /* Prevent warnings from -Wmissing-prototypes. */
11883ca3bd55SApple OSS Distributions
11893ca3bd55SApple OSS Distributions #ifdef YYPARSE_PARAM
11903ca3bd55SApple OSS Distributions #if defined __STDC__ || defined __cplusplus
11913ca3bd55SApple OSS Distributions int yyparse(void *YYPARSE_PARAM);
11923ca3bd55SApple OSS Distributions #else
11933ca3bd55SApple OSS Distributions int yyparse();
11943ca3bd55SApple OSS Distributions #endif
11953ca3bd55SApple OSS Distributions #else /* ! YYPARSE_PARAM */
11963ca3bd55SApple OSS Distributions #if defined __STDC__ || defined __cplusplus
1197c1dac77fSApple OSS Distributions int yyparse(void);
1198c1dac77fSApple OSS Distributions #else
11993ca3bd55SApple OSS Distributions int yyparse();
1200c1dac77fSApple OSS Distributions #endif
12013ca3bd55SApple OSS Distributions #endif /* ! YYPARSE_PARAM */
1202c1dac77fSApple OSS Distributions
1203c1dac77fSApple OSS Distributions
12043ca3bd55SApple OSS Distributions
12053ca3bd55SApple OSS Distributions /* The look-ahead symbol. */
1206c1dac77fSApple OSS Distributions int yychar;
12073ca3bd55SApple OSS Distributions
12083ca3bd55SApple OSS Distributions /* The semantic value of the look-ahead symbol. */
1209c1dac77fSApple OSS Distributions YYSTYPE yylval;
12103ca3bd55SApple OSS Distributions
12113ca3bd55SApple OSS Distributions /* Number of syntax errors so far. */
1212c1dac77fSApple OSS Distributions int yynerrs;
12133ca3bd55SApple OSS Distributions
12143ca3bd55SApple OSS Distributions
12153ca3bd55SApple OSS Distributions
12163ca3bd55SApple OSS Distributions /*----------.
12173ca3bd55SApple OSS Distributions | yyparse. |
1218a5e72196SApple OSS Distributions | `----------*/
12193ca3bd55SApple OSS Distributions
12203ca3bd55SApple OSS Distributions #ifdef YYPARSE_PARAM
12213ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
12223ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
12233ca3bd55SApple OSS Distributions int
yyparse(void * YYPARSE_PARAM)12243ca3bd55SApple OSS Distributions yyparse(void *YYPARSE_PARAM)
12253ca3bd55SApple OSS Distributions #else
12263ca3bd55SApple OSS Distributions int
12273ca3bd55SApple OSS Distributions yyparse(YYPARSE_PARAM)
12283ca3bd55SApple OSS Distributions void *YYPARSE_PARAM;
12293ca3bd55SApple OSS Distributions #endif
12303ca3bd55SApple OSS Distributions #else /* ! YYPARSE_PARAM */
12313ca3bd55SApple OSS Distributions #if (defined __STDC__ || defined __C99__FUNC__ \
12323ca3bd55SApple OSS Distributions || defined __cplusplus || defined _MSC_VER)
12333ca3bd55SApple OSS Distributions int
12343ca3bd55SApple OSS Distributions yyparse(void)
12353ca3bd55SApple OSS Distributions #else
12363ca3bd55SApple OSS Distributions int
12373ca3bd55SApple OSS Distributions yyparse()
12383ca3bd55SApple OSS Distributions
1239c1dac77fSApple OSS Distributions #endif
1240c1dac77fSApple OSS Distributions #endif
12413ca3bd55SApple OSS Distributions {
12423ca3bd55SApple OSS Distributions int yystate;
12433ca3bd55SApple OSS Distributions int yyn;
12443ca3bd55SApple OSS Distributions int yyresult;
12453ca3bd55SApple OSS Distributions /* Number of tokens to shift before error messages enabled. */
12463ca3bd55SApple OSS Distributions int yyerrstatus;
12473ca3bd55SApple OSS Distributions /* Look-ahead token as an internal (translated) token number. */
12483ca3bd55SApple OSS Distributions int yytoken = 0;
12493ca3bd55SApple OSS Distributions #if YYERROR_VERBOSE
12503ca3bd55SApple OSS Distributions /* Buffer for error messages, and its allocated size. */
12513ca3bd55SApple OSS Distributions char yymsgbuf[128];
12523ca3bd55SApple OSS Distributions char *yymsg = yymsgbuf;
12533ca3bd55SApple OSS Distributions YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1254c1dac77fSApple OSS Distributions #endif
1255c1dac77fSApple OSS Distributions
12563ca3bd55SApple OSS Distributions /* Three stacks and their tools:
1257a5e72196SApple OSS Distributions * `yyss': related to states,
1258a5e72196SApple OSS Distributions * `yyvs': related to semantic values,
1259a5e72196SApple OSS Distributions * `yyls': related to locations.
1260a5e72196SApple OSS Distributions *
1261a5e72196SApple OSS Distributions * Refer to the stacks thru separate pointers, to allow yyoverflow
1262a5e72196SApple OSS Distributions * to reallocate them elsewhere. */
12633ca3bd55SApple OSS Distributions
12643ca3bd55SApple OSS Distributions /* The state stack. */
12653ca3bd55SApple OSS Distributions yytype_int16 yyssa[YYINITDEPTH];
12663ca3bd55SApple OSS Distributions yytype_int16 *yyss = yyssa;
12673ca3bd55SApple OSS Distributions yytype_int16 *yyssp;
12683ca3bd55SApple OSS Distributions
12693ca3bd55SApple OSS Distributions /* The semantic value stack. */
12703ca3bd55SApple OSS Distributions YYSTYPE yyvsa[YYINITDEPTH];
12713ca3bd55SApple OSS Distributions YYSTYPE *yyvs = yyvsa;
12723ca3bd55SApple OSS Distributions YYSTYPE *yyvsp;
12733ca3bd55SApple OSS Distributions
12743ca3bd55SApple OSS Distributions
12753ca3bd55SApple OSS Distributions
12763ca3bd55SApple OSS Distributions #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
12773ca3bd55SApple OSS Distributions
12783ca3bd55SApple OSS Distributions YYSIZE_T yystacksize = YYINITDEPTH;
12793ca3bd55SApple OSS Distributions
12803ca3bd55SApple OSS Distributions /* The variables used to return semantic value and location from the
1281a5e72196SApple OSS Distributions * action routines. */
12823ca3bd55SApple OSS Distributions YYSTYPE yyval;
12833ca3bd55SApple OSS Distributions
12843ca3bd55SApple OSS Distributions
12853ca3bd55SApple OSS Distributions /* The number of symbols on the RHS of the reduced rule.
1286a5e72196SApple OSS Distributions * Keep to zero when no symbol should be popped. */
12873ca3bd55SApple OSS Distributions int yylen = 0;
12883ca3bd55SApple OSS Distributions
12893ca3bd55SApple OSS Distributions YYDPRINTF((stderr, "Starting parse\n"));
12903ca3bd55SApple OSS Distributions
1291c1dac77fSApple OSS Distributions yystate = 0;
1292c1dac77fSApple OSS Distributions yyerrstatus = 0;
1293c1dac77fSApple OSS Distributions yynerrs = 0;
1294c1dac77fSApple OSS Distributions yychar = YYEMPTY; /* Cause a token to be read. */
1295c1dac77fSApple OSS Distributions
1296c1dac77fSApple OSS Distributions /* Initialize stack pointers.
1297a5e72196SApple OSS Distributions * Waste one element of value and location stack
1298a5e72196SApple OSS Distributions * so that they stay on the same level as the state stack.
1299a5e72196SApple OSS Distributions * The wasted elements are never initialized. */
1300c1dac77fSApple OSS Distributions
13013ca3bd55SApple OSS Distributions yyssp = yyss;
1302c1dac77fSApple OSS Distributions yyvsp = yyvs;
1303c1dac77fSApple OSS Distributions
13043ca3bd55SApple OSS Distributions goto yysetstate;
13053ca3bd55SApple OSS Distributions
13063ca3bd55SApple OSS Distributions /*------------------------------------------------------------.
13073ca3bd55SApple OSS Distributions | yynewstate -- Push a new state, which is found in yystate. |
1308a5e72196SApple OSS Distributions | `------------------------------------------------------------*/
1309c1dac77fSApple OSS Distributions yynewstate:
13103ca3bd55SApple OSS Distributions /* In all cases, when you get here, the value and location stacks
1311a5e72196SApple OSS Distributions * have just been pushed. So pushing a state here evens the stacks. */
13123ca3bd55SApple OSS Distributions yyssp++;
1313c1dac77fSApple OSS Distributions
13143ca3bd55SApple OSS Distributions yysetstate:
13153ca3bd55SApple OSS Distributions *yyssp = yystate;
1316c1dac77fSApple OSS Distributions
1317a5e72196SApple OSS Distributions if (yyss + yystacksize - 1 <= yyssp) {
1318c1dac77fSApple OSS Distributions /* Get the current used size of the three stacks, in elements. */
13193ca3bd55SApple OSS Distributions YYSIZE_T yysize = yyssp - yyss + 1;
1320c1dac77fSApple OSS Distributions
1321c1dac77fSApple OSS Distributions #ifdef yyoverflow
13223ca3bd55SApple OSS Distributions {
13233ca3bd55SApple OSS Distributions /* Give user a chance to reallocate the stack. Use copies of
1324a5e72196SApple OSS Distributions * these so that the &'s don't force the real ones into
1325a5e72196SApple OSS Distributions * memory. */
13263ca3bd55SApple OSS Distributions YYSTYPE *yyvs1 = yyvs;
13273ca3bd55SApple OSS Distributions yytype_int16 *yyss1 = yyss;
1328c1dac77fSApple OSS Distributions
13293ca3bd55SApple OSS Distributions
13303ca3bd55SApple OSS Distributions /* Each stack pointer address is followed by the size of the
1331a5e72196SApple OSS Distributions * data in use in that stack, in bytes. This used to be a
1332a5e72196SApple OSS Distributions * conditional around just the two extra args, but that might
1333a5e72196SApple OSS Distributions * be undefined if yyoverflow is a macro. */
13343ca3bd55SApple OSS Distributions yyoverflow(YY_("memory exhausted"),
13353ca3bd55SApple OSS Distributions &yyss1, yysize * sizeof(*yyssp),
13363ca3bd55SApple OSS Distributions &yyvs1, yysize * sizeof(*yyvsp),
13373ca3bd55SApple OSS Distributions
13383ca3bd55SApple OSS Distributions &yystacksize);
13393ca3bd55SApple OSS Distributions
13403ca3bd55SApple OSS Distributions yyss = yyss1;
13413ca3bd55SApple OSS Distributions yyvs = yyvs1;
13423ca3bd55SApple OSS Distributions }
1343c1dac77fSApple OSS Distributions #else /* no yyoverflow */
13443ca3bd55SApple OSS Distributions # ifndef YYSTACK_RELOCATE
13453ca3bd55SApple OSS Distributions goto yyexhaustedlab;
13463ca3bd55SApple OSS Distributions # else
1347c1dac77fSApple OSS Distributions /* Extend the stack our own way. */
1348a5e72196SApple OSS Distributions if (YYMAXDEPTH <= yystacksize) {
13493ca3bd55SApple OSS Distributions goto yyexhaustedlab;
1350a5e72196SApple OSS Distributions }
1351c1dac77fSApple OSS Distributions yystacksize *= 2;
1352a5e72196SApple OSS Distributions if (YYMAXDEPTH < yystacksize) {
1353c1dac77fSApple OSS Distributions yystacksize = YYMAXDEPTH;
1354a5e72196SApple OSS Distributions }
13553ca3bd55SApple OSS Distributions
13563ca3bd55SApple OSS Distributions {
13573ca3bd55SApple OSS Distributions yytype_int16 *yyss1 = yyss;
13583ca3bd55SApple OSS Distributions union yyalloc *yyptr =
13593ca3bd55SApple OSS Distributions (union yyalloc *) YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
1360a5e72196SApple OSS Distributions if (!yyptr) {
13613ca3bd55SApple OSS Distributions goto yyexhaustedlab;
1362a5e72196SApple OSS Distributions }
13633ca3bd55SApple OSS Distributions YYSTACK_RELOCATE(yyss);
13643ca3bd55SApple OSS Distributions YYSTACK_RELOCATE(yyvs);
13653ca3bd55SApple OSS Distributions
13663ca3bd55SApple OSS Distributions # undef YYSTACK_RELOCATE
1367a5e72196SApple OSS Distributions if (yyss1 != yyssa) {
13683ca3bd55SApple OSS Distributions YYSTACK_FREE(yyss1);
13693ca3bd55SApple OSS Distributions }
1370a5e72196SApple OSS Distributions }
1371c1dac77fSApple OSS Distributions # endif
1372c1dac77fSApple OSS Distributions #endif /* no yyoverflow */
1373c1dac77fSApple OSS Distributions
13743ca3bd55SApple OSS Distributions yyssp = yyss + yysize - 1;
13753ca3bd55SApple OSS Distributions yyvsp = yyvs + yysize - 1;
1376c1dac77fSApple OSS Distributions
1377c1dac77fSApple OSS Distributions
13783ca3bd55SApple OSS Distributions YYDPRINTF((stderr, "Stack size increased to %lu\n",
13793ca3bd55SApple OSS Distributions (unsigned long int) yystacksize));
13803ca3bd55SApple OSS Distributions
1381a5e72196SApple OSS Distributions if (yyss + yystacksize - 1 <= yyssp) {
1382c1dac77fSApple OSS Distributions YYABORT;
1383c1dac77fSApple OSS Distributions }
1384a5e72196SApple OSS Distributions }
1385c1dac77fSApple OSS Distributions
13863ca3bd55SApple OSS Distributions YYDPRINTF((stderr, "Entering state %d\n", yystate));
1387c1dac77fSApple OSS Distributions
1388c1dac77fSApple OSS Distributions goto yybackup;
13893ca3bd55SApple OSS Distributions
13903ca3bd55SApple OSS Distributions /*-----------.
13913ca3bd55SApple OSS Distributions | yybackup. |
1392a5e72196SApple OSS Distributions | `-----------*/
1393c1dac77fSApple OSS Distributions yybackup:
1394c1dac77fSApple OSS Distributions
13953ca3bd55SApple OSS Distributions /* Do appropriate processing given the current state. Read a
1396a5e72196SApple OSS Distributions * look-ahead token if we need one and don't already have one. */
1397c1dac77fSApple OSS Distributions
13983ca3bd55SApple OSS Distributions /* First try to decide what to do without reference to look-ahead token. */
1399c1dac77fSApple OSS Distributions yyn = yypact[yystate];
1400a5e72196SApple OSS Distributions if (yyn == YYPACT_NINF) {
1401c1dac77fSApple OSS Distributions goto yydefault;
1402a5e72196SApple OSS Distributions }
1403c1dac77fSApple OSS Distributions
14043ca3bd55SApple OSS Distributions /* Not known => get a look-ahead token if don't already have one. */
1405c1dac77fSApple OSS Distributions
14063ca3bd55SApple OSS Distributions /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1407a5e72196SApple OSS Distributions if (yychar == YYEMPTY) {
14083ca3bd55SApple OSS Distributions YYDPRINTF((stderr, "Reading a token: "));
1409c1dac77fSApple OSS Distributions yychar = YYLEX;
1410c1dac77fSApple OSS Distributions }
1411c1dac77fSApple OSS Distributions
1412a5e72196SApple OSS Distributions if (yychar <= YYEOF) {
14133ca3bd55SApple OSS Distributions yychar = yytoken = YYEOF;
14143ca3bd55SApple OSS Distributions YYDPRINTF((stderr, "Now at end of input.\n"));
1415a5e72196SApple OSS Distributions } else {
14163ca3bd55SApple OSS Distributions yytoken = YYTRANSLATE(yychar);
14173ca3bd55SApple OSS Distributions YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
1418c1dac77fSApple OSS Distributions }
1419c1dac77fSApple OSS Distributions
14203ca3bd55SApple OSS Distributions /* If the proper action on seeing token YYTOKEN is to reduce or to
1421a5e72196SApple OSS Distributions * detect an error, take that action. */
14223ca3bd55SApple OSS Distributions yyn += yytoken;
1423a5e72196SApple OSS Distributions if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) {
1424c1dac77fSApple OSS Distributions goto yydefault;
1425a5e72196SApple OSS Distributions }
1426c1dac77fSApple OSS Distributions yyn = yytable[yyn];
1427a5e72196SApple OSS Distributions if (yyn <= 0) {
1428a5e72196SApple OSS Distributions if (yyn == 0 || yyn == YYTABLE_NINF) {
1429c1dac77fSApple OSS Distributions goto yyerrlab;
1430a5e72196SApple OSS Distributions }
1431c1dac77fSApple OSS Distributions yyn = -yyn;
1432c1dac77fSApple OSS Distributions goto yyreduce;
1433c1dac77fSApple OSS Distributions }
1434c1dac77fSApple OSS Distributions
1435a5e72196SApple OSS Distributions if (yyn == YYFINAL) {
1436c1dac77fSApple OSS Distributions YYACCEPT;
1437a5e72196SApple OSS Distributions }
1438c1dac77fSApple OSS Distributions
14393ca3bd55SApple OSS Distributions /* Count tokens shifted since error; after three, turn off error
1440a5e72196SApple OSS Distributions * status. */
1441a5e72196SApple OSS Distributions if (yyerrstatus) {
14423ca3bd55SApple OSS Distributions yyerrstatus--;
1443a5e72196SApple OSS Distributions }
1444c1dac77fSApple OSS Distributions
14453ca3bd55SApple OSS Distributions /* Shift the look-ahead token. */
14463ca3bd55SApple OSS Distributions YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
1447c1dac77fSApple OSS Distributions
14483ca3bd55SApple OSS Distributions /* Discard the shifted token unless it is eof. */
1449a5e72196SApple OSS Distributions if (yychar != YYEOF) {
1450c1dac77fSApple OSS Distributions yychar = YYEMPTY;
1451a5e72196SApple OSS Distributions }
1452c1dac77fSApple OSS Distributions
1453c1dac77fSApple OSS Distributions yystate = yyn;
14543ca3bd55SApple OSS Distributions *++yyvsp = yylval;
14553ca3bd55SApple OSS Distributions
1456c1dac77fSApple OSS Distributions goto yynewstate;
1457c1dac77fSApple OSS Distributions
1458c1dac77fSApple OSS Distributions
14593ca3bd55SApple OSS Distributions /*-----------------------------------------------------------.
14603ca3bd55SApple OSS Distributions | yydefault -- do the default action for the current state. |
1461a5e72196SApple OSS Distributions | `-----------------------------------------------------------*/
14623ca3bd55SApple OSS Distributions yydefault:
1463c1dac77fSApple OSS Distributions yyn = yydefact[yystate];
1464a5e72196SApple OSS Distributions if (yyn == 0) {
1465c1dac77fSApple OSS Distributions goto yyerrlab;
1466a5e72196SApple OSS Distributions }
14673ca3bd55SApple OSS Distributions goto yyreduce;
1468c1dac77fSApple OSS Distributions
14693ca3bd55SApple OSS Distributions
14703ca3bd55SApple OSS Distributions /*-----------------------------.
14713ca3bd55SApple OSS Distributions | yyreduce -- Do a reduction. |
1472a5e72196SApple OSS Distributions | `-----------------------------*/
1473c1dac77fSApple OSS Distributions yyreduce:
14743ca3bd55SApple OSS Distributions /* yyn is the number of a rule to reduce with. */
1475c1dac77fSApple OSS Distributions yylen = yyr2[yyn];
1476c1dac77fSApple OSS Distributions
14773ca3bd55SApple OSS Distributions /* If YYLEN is nonzero, implement the default value of the action:
1478a5e72196SApple OSS Distributions * `$$ = $1'.
1479a5e72196SApple OSS Distributions *
1480a5e72196SApple OSS Distributions * Otherwise, the following line sets YYVAL to garbage.
1481a5e72196SApple OSS Distributions * This behavior is undocumented and Bison
1482a5e72196SApple OSS Distributions * users should not rely upon it. Assigning to YYVAL
1483a5e72196SApple OSS Distributions * unconditionally makes the parser a bit smaller, and it avoids a
1484a5e72196SApple OSS Distributions * GCC warning that YYVAL may be used uninitialized. */
14853ca3bd55SApple OSS Distributions yyval = yyvsp[1 - yylen];
14863ca3bd55SApple OSS Distributions
14873ca3bd55SApple OSS Distributions
14883ca3bd55SApple OSS Distributions YY_REDUCE_PRINT(yyn);
1489a5e72196SApple OSS Distributions switch (yyn) {
1490c1dac77fSApple OSS Distributions case 2:
1491*1031c584SApple OSS Distributions #line 151 "OSUnserialize.y"
14923ca3bd55SApple OSS Distributions { parsedObject = (OSObject *)NULL; YYACCEPT;;}
14933ca3bd55SApple OSS Distributions break;
14943ca3bd55SApple OSS Distributions
14953ca3bd55SApple OSS Distributions case 3:
1496*1031c584SApple OSS Distributions #line 152 "OSUnserialize.y"
14973ca3bd55SApple OSS Distributions { parsedObject = (OSObject *)(yyvsp[(1) - (1)]); YYACCEPT;;}
14983ca3bd55SApple OSS Distributions break;
14993ca3bd55SApple OSS Distributions
15003ca3bd55SApple OSS Distributions case 4:
1501*1031c584SApple OSS Distributions #line 153 "OSUnserialize.y"
15023ca3bd55SApple OSS Distributions { yyerror("syntax error"); YYERROR;;}
15033ca3bd55SApple OSS Distributions break;
15043ca3bd55SApple OSS Distributions
15053ca3bd55SApple OSS Distributions case 5:
1506*1031c584SApple OSS Distributions #line 156 "OSUnserialize.y"
15073ca3bd55SApple OSS Distributions { (yyval) = (object_t *)buildOSDictionary((yyvsp[(1) - (1)]));;}
15083ca3bd55SApple OSS Distributions break;
15093ca3bd55SApple OSS Distributions
15103ca3bd55SApple OSS Distributions case 6:
1511*1031c584SApple OSS Distributions #line 157 "OSUnserialize.y"
15123ca3bd55SApple OSS Distributions { (yyval) = (object_t *)buildOSArray((yyvsp[(1) - (1)]));;}
15133ca3bd55SApple OSS Distributions break;
15143ca3bd55SApple OSS Distributions
15153ca3bd55SApple OSS Distributions case 7:
1516*1031c584SApple OSS Distributions #line 158 "OSUnserialize.y"
15173ca3bd55SApple OSS Distributions { (yyval) = (object_t *)buildOSSet((yyvsp[(1) - (1)]));;}
15183ca3bd55SApple OSS Distributions break;
15193ca3bd55SApple OSS Distributions
15203ca3bd55SApple OSS Distributions case 8:
1521*1031c584SApple OSS Distributions #line 159 "OSUnserialize.y"
15223ca3bd55SApple OSS Distributions { (yyval) = (object_t *)buildOSString((yyvsp[(1) - (1)]));;}
15233ca3bd55SApple OSS Distributions break;
15243ca3bd55SApple OSS Distributions
15253ca3bd55SApple OSS Distributions case 9:
1526*1031c584SApple OSS Distributions #line 160 "OSUnserialize.y"
15273ca3bd55SApple OSS Distributions { (yyval) = (object_t *)buildOSData((yyvsp[(1) - (1)]));;}
15283ca3bd55SApple OSS Distributions break;
15293ca3bd55SApple OSS Distributions
15303ca3bd55SApple OSS Distributions case 10:
1531*1031c584SApple OSS Distributions #line 161 "OSUnserialize.y"
15323ca3bd55SApple OSS Distributions { (yyval) = (object_t *)buildOSOffset((yyvsp[(1) - (1)]));;}
15333ca3bd55SApple OSS Distributions break;
15343ca3bd55SApple OSS Distributions
15353ca3bd55SApple OSS Distributions case 11:
1536*1031c584SApple OSS Distributions #line 162 "OSUnserialize.y"
15373ca3bd55SApple OSS Distributions { (yyval) = (object_t *)buildOSBoolean((yyvsp[(1) - (1)]));;}
15383ca3bd55SApple OSS Distributions break;
15393ca3bd55SApple OSS Distributions
15403ca3bd55SApple OSS Distributions case 12:
1541*1031c584SApple OSS Distributions #line 163 "OSUnserialize.y"
15423ca3bd55SApple OSS Distributions { (yyval) = (object_t *)retrieveObject((yyvsp[(2) - (2)])->u.offset);
15433ca3bd55SApple OSS Distributions if ((yyval)) {
15443ca3bd55SApple OSS Distributions ((OSObject *)(yyval))->retain();
1545c1dac77fSApple OSS Distributions } else {
1546c1dac77fSApple OSS Distributions yyerror("forward reference detected");
1547c1dac77fSApple OSS Distributions YYERROR;
1548c1dac77fSApple OSS Distributions }
15493ca3bd55SApple OSS Distributions freeObject((yyvsp[(2) - (2)]));
15503ca3bd55SApple OSS Distributions ;}
15513ca3bd55SApple OSS Distributions break;
15523ca3bd55SApple OSS Distributions
1553c1dac77fSApple OSS Distributions case 13:
1554*1031c584SApple OSS Distributions #line 172 "OSUnserialize.y"
15553ca3bd55SApple OSS Distributions { (yyval) = (yyvsp[(1) - (3)]);
15563ca3bd55SApple OSS Distributions rememberObject((yyvsp[(3) - (3)])->u.offset, (yyvsp[(1) - (3)]));
15573ca3bd55SApple OSS Distributions freeObject((yyvsp[(3) - (3)]));
15583ca3bd55SApple OSS Distributions ;}
15593ca3bd55SApple OSS Distributions break;
15603ca3bd55SApple OSS Distributions
1561c1dac77fSApple OSS Distributions case 14:
1562*1031c584SApple OSS Distributions #line 180 "OSUnserialize.y"
15633ca3bd55SApple OSS Distributions { (yyval) = NULL;;}
15643ca3bd55SApple OSS Distributions break;
15653ca3bd55SApple OSS Distributions
15663ca3bd55SApple OSS Distributions case 15:
1567*1031c584SApple OSS Distributions #line 181 "OSUnserialize.y"
15683ca3bd55SApple OSS Distributions { (yyval) = (yyvsp[(2) - (3)]);;}
15693ca3bd55SApple OSS Distributions break;
15703ca3bd55SApple OSS Distributions
1571c1dac77fSApple OSS Distributions case 17:
1572*1031c584SApple OSS Distributions #line 185 "OSUnserialize.y"
15733ca3bd55SApple OSS Distributions { (yyvsp[(2) - (2)])->next = (yyvsp[(1) - (2)]); (yyvsp[(1) - (2)])->prev = (yyvsp[(2) - (2)]); (yyval) = (yyvsp[(2) - (2)]);;}
15743ca3bd55SApple OSS Distributions break;
15753ca3bd55SApple OSS Distributions
1576c1dac77fSApple OSS Distributions case 18:
1577*1031c584SApple OSS Distributions #line 188 "OSUnserialize.y"
15783ca3bd55SApple OSS Distributions { (yyval) = newObject();
15793ca3bd55SApple OSS Distributions (yyval)->next = NULL;
15803ca3bd55SApple OSS Distributions (yyval)->prev = NULL;
15813ca3bd55SApple OSS Distributions (yyval)->u.key = (yyvsp[(1) - (4)]);
15823ca3bd55SApple OSS Distributions (yyval)->object = (yyvsp[(3) - (4)]);
15833ca3bd55SApple OSS Distributions ;}
15843ca3bd55SApple OSS Distributions break;
15853ca3bd55SApple OSS Distributions
1586c1dac77fSApple OSS Distributions case 19:
1587*1031c584SApple OSS Distributions #line 198 "OSUnserialize.y"
15883ca3bd55SApple OSS Distributions { (yyval) = NULL;;}
15893ca3bd55SApple OSS Distributions break;
15903ca3bd55SApple OSS Distributions
15913ca3bd55SApple OSS Distributions case 20:
1592*1031c584SApple OSS Distributions #line 199 "OSUnserialize.y"
15933ca3bd55SApple OSS Distributions { (yyval) = (yyvsp[(2) - (3)]);;}
15943ca3bd55SApple OSS Distributions break;
15953ca3bd55SApple OSS Distributions
15963ca3bd55SApple OSS Distributions case 21:
1597*1031c584SApple OSS Distributions #line 202 "OSUnserialize.y"
15983ca3bd55SApple OSS Distributions { (yyval) = NULL;;}
15993ca3bd55SApple OSS Distributions break;
16003ca3bd55SApple OSS Distributions
1601c1dac77fSApple OSS Distributions case 22:
1602*1031c584SApple OSS Distributions #line 203 "OSUnserialize.y"
16033ca3bd55SApple OSS Distributions { (yyval) = (yyvsp[(2) - (3)]);;}
16043ca3bd55SApple OSS Distributions break;
16053ca3bd55SApple OSS Distributions
1606c1dac77fSApple OSS Distributions case 23:
1607*1031c584SApple OSS Distributions #line 206 "OSUnserialize.y"
16083ca3bd55SApple OSS Distributions { (yyval) = newObject();
16093ca3bd55SApple OSS Distributions (yyval)->object = (yyvsp[(1) - (1)]);
16103ca3bd55SApple OSS Distributions (yyval)->next = NULL;
16113ca3bd55SApple OSS Distributions (yyval)->prev = NULL;
16123ca3bd55SApple OSS Distributions ;}
16133ca3bd55SApple OSS Distributions break;
1614c1dac77fSApple OSS Distributions
16153ca3bd55SApple OSS Distributions case 24:
1616*1031c584SApple OSS Distributions #line 211 "OSUnserialize.y"
16173ca3bd55SApple OSS Distributions { oo = newObject();
16183ca3bd55SApple OSS Distributions oo->object = (yyvsp[(3) - (3)]);
16193ca3bd55SApple OSS Distributions oo->next = (yyvsp[(1) - (3)]);
16203ca3bd55SApple OSS Distributions oo->prev = NULL;
16213ca3bd55SApple OSS Distributions (yyvsp[(1) - (3)])->prev = oo;
16223ca3bd55SApple OSS Distributions (yyval) = oo;
16233ca3bd55SApple OSS Distributions ;}
16243ca3bd55SApple OSS Distributions break;
16253ca3bd55SApple OSS Distributions
16263ca3bd55SApple OSS Distributions case 25:
1627*1031c584SApple OSS Distributions #line 222 "OSUnserialize.y"
16283ca3bd55SApple OSS Distributions { (yyval) = (yyvsp[(1) - (3)]);
16293ca3bd55SApple OSS Distributions (yyval)->size = (yyvsp[(3) - (3)])->u.offset;
16303ca3bd55SApple OSS Distributions freeObject((yyvsp[(3) - (3)]));
16313ca3bd55SApple OSS Distributions ;}
16323ca3bd55SApple OSS Distributions break;
16333ca3bd55SApple OSS Distributions
16343ca3bd55SApple OSS Distributions
16353ca3bd55SApple OSS Distributions /* Line 1267 of yacc.c. */
1636*1031c584SApple OSS Distributions #line 1585 "OSUnserialize.tab.c"
16373ca3bd55SApple OSS Distributions default: break;
1638c1dac77fSApple OSS Distributions }
16393ca3bd55SApple OSS Distributions YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
16403ca3bd55SApple OSS Distributions
16413ca3bd55SApple OSS Distributions YYPOPSTACK(yylen);
16423ca3bd55SApple OSS Distributions yylen = 0;
16433ca3bd55SApple OSS Distributions YY_STACK_PRINT(yyss, yyssp);
1644c1dac77fSApple OSS Distributions
1645c1dac77fSApple OSS Distributions *++yyvsp = yyval;
1646c1dac77fSApple OSS Distributions
1647c1dac77fSApple OSS Distributions
16483ca3bd55SApple OSS Distributions /* Now `shift' the result of the reduction. Determine what state
1649a5e72196SApple OSS Distributions * that goes to, based on the state we popped back to and the rule
1650a5e72196SApple OSS Distributions * number reduced by. */
1651c1dac77fSApple OSS Distributions
1652c1dac77fSApple OSS Distributions yyn = yyr1[yyn];
1653c1dac77fSApple OSS Distributions
16543ca3bd55SApple OSS Distributions yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1655a5e72196SApple OSS Distributions if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) {
1656c1dac77fSApple OSS Distributions yystate = yytable[yystate];
1657a5e72196SApple OSS Distributions } else {
16583ca3bd55SApple OSS Distributions yystate = yydefgoto[yyn - YYNTOKENS];
1659a5e72196SApple OSS Distributions }
1660c1dac77fSApple OSS Distributions
1661c1dac77fSApple OSS Distributions goto yynewstate;
1662c1dac77fSApple OSS Distributions
1663c1dac77fSApple OSS Distributions
16643ca3bd55SApple OSS Distributions /*------------------------------------.
16653ca3bd55SApple OSS Distributions | yyerrlab -- here on detecting error |
1666a5e72196SApple OSS Distributions | `------------------------------------*/
16673ca3bd55SApple OSS Distributions yyerrlab:
1668c1dac77fSApple OSS Distributions /* If not already recovering from an error, report this error. */
1669a5e72196SApple OSS Distributions if (!yyerrstatus) {
1670c1dac77fSApple OSS Distributions ++yynerrs;
16713ca3bd55SApple OSS Distributions #if !YYERROR_VERBOSE
16723ca3bd55SApple OSS Distributions yyerror(YY_("syntax error"));
16733ca3bd55SApple OSS Distributions #else
1674c1dac77fSApple OSS Distributions {
16753ca3bd55SApple OSS Distributions YYSIZE_T yysize = yysyntax_error(0, yystate, yychar);
1676a5e72196SApple OSS Distributions if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) {
16773ca3bd55SApple OSS Distributions YYSIZE_T yyalloc = 2 * yysize;
1678a5e72196SApple OSS Distributions if (!(yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) {
16793ca3bd55SApple OSS Distributions yyalloc = YYSTACK_ALLOC_MAXIMUM;
1680a5e72196SApple OSS Distributions }
1681a5e72196SApple OSS Distributions if (yymsg != yymsgbuf) {
16823ca3bd55SApple OSS Distributions YYSTACK_FREE(yymsg);
1683a5e72196SApple OSS Distributions }
16843ca3bd55SApple OSS Distributions yymsg = (char *) YYSTACK_ALLOC(yyalloc);
1685a5e72196SApple OSS Distributions if (yymsg) {
16863ca3bd55SApple OSS Distributions yymsg_alloc = yyalloc;
1687a5e72196SApple OSS Distributions } else {
16883ca3bd55SApple OSS Distributions yymsg = yymsgbuf;
16893ca3bd55SApple OSS Distributions yymsg_alloc = sizeof yymsgbuf;
1690c1dac77fSApple OSS Distributions }
1691c1dac77fSApple OSS Distributions }
16923ca3bd55SApple OSS Distributions
1693a5e72196SApple OSS Distributions if (0 < yysize && yysize <= yymsg_alloc) {
16943ca3bd55SApple OSS Distributions (void) yysyntax_error(yymsg, yystate, yychar);
16953ca3bd55SApple OSS Distributions yyerror(yymsg);
1696a5e72196SApple OSS Distributions } else {
16973ca3bd55SApple OSS Distributions yyerror(YY_("syntax error"));
1698a5e72196SApple OSS Distributions if (yysize != 0) {
16993ca3bd55SApple OSS Distributions goto yyexhaustedlab;
1700c1dac77fSApple OSS Distributions }
17013ca3bd55SApple OSS Distributions }
1702a5e72196SApple OSS Distributions }
17033ca3bd55SApple OSS Distributions #endif
1704c1dac77fSApple OSS Distributions }
1705c1dac77fSApple OSS Distributions
17063ca3bd55SApple OSS Distributions
1707c1dac77fSApple OSS Distributions
1708a5e72196SApple OSS Distributions if (yyerrstatus == 3) {
17093ca3bd55SApple OSS Distributions /* If just tried and failed to reuse look-ahead token after an
1710a5e72196SApple OSS Distributions * error, discard it. */
1711c1dac77fSApple OSS Distributions
1712a5e72196SApple OSS Distributions if (yychar <= YYEOF) {
17133ca3bd55SApple OSS Distributions /* Return failure if at end of input. */
1714a5e72196SApple OSS Distributions if (yychar == YYEOF) {
1715c1dac77fSApple OSS Distributions YYABORT;
17163ca3bd55SApple OSS Distributions }
1717a5e72196SApple OSS Distributions } else {
17183ca3bd55SApple OSS Distributions yydestruct("Error: discarding",
17193ca3bd55SApple OSS Distributions yytoken, &yylval);
1720c1dac77fSApple OSS Distributions yychar = YYEMPTY;
1721c1dac77fSApple OSS Distributions }
1722c1dac77fSApple OSS Distributions }
1723c1dac77fSApple OSS Distributions
17243ca3bd55SApple OSS Distributions /* Else will try to reuse look-ahead token after shifting the error
1725a5e72196SApple OSS Distributions * token. */
17263ca3bd55SApple OSS Distributions goto yyerrlab1;
1727c1dac77fSApple OSS Distributions
17283ca3bd55SApple OSS Distributions
17293ca3bd55SApple OSS Distributions /*---------------------------------------------------.
17303ca3bd55SApple OSS Distributions | yyerrorlab -- error raised explicitly by YYERROR. |
1731a5e72196SApple OSS Distributions | `---------------------------------------------------*/
17323ca3bd55SApple OSS Distributions yyerrorlab:
17333ca3bd55SApple OSS Distributions
17343ca3bd55SApple OSS Distributions /* Pacify compilers like GCC when the user code never invokes
1735a5e72196SApple OSS Distributions * YYERROR and the label yyerrorlab therefore never appears in user
1736a5e72196SApple OSS Distributions * code. */
1737a5e72196SApple OSS Distributions if (/*CONSTCOND*/ 0) {
17383ca3bd55SApple OSS Distributions goto yyerrorlab;
1739a5e72196SApple OSS Distributions }
17403ca3bd55SApple OSS Distributions
17413ca3bd55SApple OSS Distributions /* Do not reclaim the symbols of the rule which action triggered
1742a5e72196SApple OSS Distributions * this YYERROR. */
17433ca3bd55SApple OSS Distributions YYPOPSTACK(yylen);
17443ca3bd55SApple OSS Distributions yylen = 0;
17453ca3bd55SApple OSS Distributions YY_STACK_PRINT(yyss, yyssp);
17463ca3bd55SApple OSS Distributions yystate = *yyssp;
17473ca3bd55SApple OSS Distributions goto yyerrlab1;
17483ca3bd55SApple OSS Distributions
17493ca3bd55SApple OSS Distributions
17503ca3bd55SApple OSS Distributions /*-------------------------------------------------------------.
17513ca3bd55SApple OSS Distributions | yyerrlab1 -- common code for both syntax error and YYERROR. |
1752a5e72196SApple OSS Distributions | `-------------------------------------------------------------*/
17533ca3bd55SApple OSS Distributions yyerrlab1:
17543ca3bd55SApple OSS Distributions yyerrstatus = 3; /* Each real token shifted decrements this. */
17553ca3bd55SApple OSS Distributions
1756a5e72196SApple OSS Distributions for (;;) {
1757c1dac77fSApple OSS Distributions yyn = yypact[yystate];
1758a5e72196SApple OSS Distributions if (yyn != YYPACT_NINF) {
17593ca3bd55SApple OSS Distributions yyn += YYTERROR;
1760a5e72196SApple OSS Distributions if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) {
17613ca3bd55SApple OSS Distributions yyn = yytable[yyn];
1762a5e72196SApple OSS Distributions if (0 < yyn) {
17633ca3bd55SApple OSS Distributions break;
1764c1dac77fSApple OSS Distributions }
17653ca3bd55SApple OSS Distributions }
1766a5e72196SApple OSS Distributions }
17673ca3bd55SApple OSS Distributions
17683ca3bd55SApple OSS Distributions /* Pop the current state because it cannot handle the error token. */
1769a5e72196SApple OSS Distributions if (yyssp == yyss) {
17703ca3bd55SApple OSS Distributions YYABORT;
1771a5e72196SApple OSS Distributions }
17723ca3bd55SApple OSS Distributions
17733ca3bd55SApple OSS Distributions
17743ca3bd55SApple OSS Distributions yydestruct("Error: popping",
17753ca3bd55SApple OSS Distributions yystos[yystate], yyvsp);
17763ca3bd55SApple OSS Distributions YYPOPSTACK(1);
17773ca3bd55SApple OSS Distributions yystate = *yyssp;
17783ca3bd55SApple OSS Distributions YY_STACK_PRINT(yyss, yyssp);
17793ca3bd55SApple OSS Distributions }
1780c1dac77fSApple OSS Distributions
1781a5e72196SApple OSS Distributions if (yyn == YYFINAL) {
1782c1dac77fSApple OSS Distributions YYACCEPT;
1783a5e72196SApple OSS Distributions }
1784c1dac77fSApple OSS Distributions
1785c1dac77fSApple OSS Distributions *++yyvsp = yylval;
17863ca3bd55SApple OSS Distributions
17873ca3bd55SApple OSS Distributions
17883ca3bd55SApple OSS Distributions /* Shift the error token. */
17893ca3bd55SApple OSS Distributions YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
1790c1dac77fSApple OSS Distributions
1791c1dac77fSApple OSS Distributions yystate = yyn;
1792c1dac77fSApple OSS Distributions goto yynewstate;
1793c1dac77fSApple OSS Distributions
1794c1dac77fSApple OSS Distributions
17953ca3bd55SApple OSS Distributions /*-------------------------------------.
17963ca3bd55SApple OSS Distributions | yyacceptlab -- YYACCEPT comes here. |
1797a5e72196SApple OSS Distributions | `-------------------------------------*/
17983ca3bd55SApple OSS Distributions yyacceptlab:
17993ca3bd55SApple OSS Distributions yyresult = 0;
18003ca3bd55SApple OSS Distributions goto yyreturn;
18013ca3bd55SApple OSS Distributions
18023ca3bd55SApple OSS Distributions /*-----------------------------------.
18033ca3bd55SApple OSS Distributions | yyabortlab -- YYABORT comes here. |
1804a5e72196SApple OSS Distributions | `-----------------------------------*/
1805c1dac77fSApple OSS Distributions yyabortlab:
18063ca3bd55SApple OSS Distributions yyresult = 1;
18073ca3bd55SApple OSS Distributions goto yyreturn;
18083ca3bd55SApple OSS Distributions
18093ca3bd55SApple OSS Distributions #ifndef yyoverflow
18103ca3bd55SApple OSS Distributions /*-------------------------------------------------.
18113ca3bd55SApple OSS Distributions | yyexhaustedlab -- memory exhaustion comes here. |
1812a5e72196SApple OSS Distributions | `-------------------------------------------------*/
18133ca3bd55SApple OSS Distributions yyexhaustedlab:
18143ca3bd55SApple OSS Distributions yyerror(YY_("memory exhausted"));
18153ca3bd55SApple OSS Distributions yyresult = 2;
18163ca3bd55SApple OSS Distributions /* Fall through. */
1817c1dac77fSApple OSS Distributions #endif
18183ca3bd55SApple OSS Distributions
18193ca3bd55SApple OSS Distributions yyreturn:
1820a5e72196SApple OSS Distributions if (yychar != YYEOF && yychar != YYEMPTY) {
18213ca3bd55SApple OSS Distributions yydestruct("Cleanup: discarding lookahead",
18223ca3bd55SApple OSS Distributions yytoken, &yylval);
1823a5e72196SApple OSS Distributions }
18243ca3bd55SApple OSS Distributions /* Do not reclaim the symbols of the rule which action triggered
1825a5e72196SApple OSS Distributions * this YYABORT or YYACCEPT. */
18263ca3bd55SApple OSS Distributions YYPOPSTACK(yylen);
18273ca3bd55SApple OSS Distributions YY_STACK_PRINT(yyss, yyssp);
1828a5e72196SApple OSS Distributions while (yyssp != yyss) {
18293ca3bd55SApple OSS Distributions yydestruct("Cleanup: popping",
18303ca3bd55SApple OSS Distributions yystos[*yyssp], yyvsp);
18313ca3bd55SApple OSS Distributions YYPOPSTACK(1);
1832c1dac77fSApple OSS Distributions }
18333ca3bd55SApple OSS Distributions #ifndef yyoverflow
1834a5e72196SApple OSS Distributions if (yyss != yyssa) {
18353ca3bd55SApple OSS Distributions YYSTACK_FREE(yyss);
1836a5e72196SApple OSS Distributions }
18373ca3bd55SApple OSS Distributions #endif
18383ca3bd55SApple OSS Distributions #if YYERROR_VERBOSE
1839a5e72196SApple OSS Distributions if (yymsg != yymsgbuf) {
18403ca3bd55SApple OSS Distributions YYSTACK_FREE(yymsg);
1841a5e72196SApple OSS Distributions }
18423ca3bd55SApple OSS Distributions #endif
18433ca3bd55SApple OSS Distributions /* Make sure YYID is used. */
18443ca3bd55SApple OSS Distributions return YYID(yyresult);
1845c1dac77fSApple OSS Distributions }
18463ca3bd55SApple OSS Distributions
18473ca3bd55SApple OSS Distributions
1848*1031c584SApple OSS Distributions #line 243 "OSUnserialize.y"
1849c1dac77fSApple OSS Distributions
1850c1dac77fSApple OSS Distributions
1851c1dac77fSApple OSS Distributions static int lineNumber = 0;
1852c1dac77fSApple OSS Distributions static const char *parseBuffer;
1853c1dac77fSApple OSS Distributions static int parseBufferIndex;
1854c1dac77fSApple OSS Distributions
1855c1dac77fSApple OSS Distributions #define currentChar() (parseBuffer[parseBufferIndex])
1856c1dac77fSApple OSS Distributions #define nextChar() (parseBuffer[++parseBufferIndex])
1857c1dac77fSApple OSS Distributions #define prevChar() (parseBuffer[parseBufferIndex - 1])
1858c1dac77fSApple OSS Distributions
1859c1dac77fSApple OSS Distributions #define isSpace(c) ((c) == ' ' || (c) == '\t')
1860c1dac77fSApple OSS Distributions #define isAlpha(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z'))
1861c1dac77fSApple OSS Distributions #define isDigit(c) ((c) >= '0' && (c) <= '9')
1862c1dac77fSApple OSS Distributions #define isAlphaDigit(c) ((c) >= 'a' && (c) <= 'f')
1863c1dac77fSApple OSS Distributions #define isHexDigit(c) (isDigit(c) || isAlphaDigit(c))
1864c1dac77fSApple OSS Distributions #define isAlphaNumeric(c) (isAlpha(c) || isDigit(c) || ((c) == '-'))
1865c1dac77fSApple OSS Distributions
1866c1dac77fSApple OSS Distributions static char yyerror_message[128];
1867c1dac77fSApple OSS Distributions
1868c1dac77fSApple OSS Distributions int
yyerror(const char * s)18693ca3bd55SApple OSS Distributions yyerror(const char *s) /* Called by yyparse on error */
1870c1dac77fSApple OSS Distributions {
18713ca3bd55SApple OSS Distributions snprintf(yyerror_message, sizeof(yyerror_message), "OSUnserialize: %s near line %d\n", s, lineNumber);
1872c1dac77fSApple OSS Distributions return 0;
1873c1dac77fSApple OSS Distributions }
1874c1dac77fSApple OSS Distributions
1875c1dac77fSApple OSS Distributions int
yylex()1876c1dac77fSApple OSS Distributions yylex()
1877c1dac77fSApple OSS Distributions {
1878c1dac77fSApple OSS Distributions int c;
1879c1dac77fSApple OSS Distributions
1880a5e72196SApple OSS Distributions if (parseBufferIndex == 0) {
1881a5e72196SApple OSS Distributions lineNumber = 1;
1882a5e72196SApple OSS Distributions }
1883c1dac77fSApple OSS Distributions
1884c1dac77fSApple OSS Distributions top:
1885c1dac77fSApple OSS Distributions c = currentChar();
1886c1dac77fSApple OSS Distributions
1887c1dac77fSApple OSS Distributions /* skip white space */
1888a5e72196SApple OSS Distributions if (isSpace(c)) {
1889a5e72196SApple OSS Distributions while ((c = nextChar()) != 0 && isSpace(c)) {
1890a5e72196SApple OSS Distributions }
1891a5e72196SApple OSS Distributions }
1892a5e72196SApple OSS Distributions ;
1893c1dac77fSApple OSS Distributions
1894c1dac77fSApple OSS Distributions /* skip over comments */
1895a5e72196SApple OSS Distributions if (c == '#') {
1896a5e72196SApple OSS Distributions while ((c = nextChar()) != 0 && c != '\n') {
1897a5e72196SApple OSS Distributions }
1898a5e72196SApple OSS Distributions }
1899a5e72196SApple OSS Distributions ;
1900c1dac77fSApple OSS Distributions
1901c1dac77fSApple OSS Distributions /* keep track of line number, don't return \n's */
1902c1dac77fSApple OSS Distributions if (c == '\n') {
1903c1dac77fSApple OSS Distributions lineNumber++;
1904c1dac77fSApple OSS Distributions (void)nextChar();
1905c1dac77fSApple OSS Distributions goto top;
1906c1dac77fSApple OSS Distributions }
1907c1dac77fSApple OSS Distributions
1908c1dac77fSApple OSS Distributions /* parse boolean */
1909c1dac77fSApple OSS Distributions if (c == '.') {
1910c1dac77fSApple OSS Distributions bool boolean = false;
1911c1dac77fSApple OSS Distributions if (nextChar() == 't') {
1912a5e72196SApple OSS Distributions if (nextChar() != 'r') {
1913a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1914a5e72196SApple OSS Distributions }
1915a5e72196SApple OSS Distributions if (nextChar() != 'u') {
1916a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1917a5e72196SApple OSS Distributions }
1918a5e72196SApple OSS Distributions if (nextChar() != 'e') {
1919a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1920a5e72196SApple OSS Distributions }
1921c1dac77fSApple OSS Distributions boolean = true;
1922c1dac77fSApple OSS Distributions } else {
1923a5e72196SApple OSS Distributions if (currentChar() != 'f') {
1924a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1925c1dac77fSApple OSS Distributions }
1926a5e72196SApple OSS Distributions if (nextChar() != 'a') {
1927a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1928a5e72196SApple OSS Distributions }
1929a5e72196SApple OSS Distributions if (nextChar() != 'l') {
1930a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1931a5e72196SApple OSS Distributions }
1932a5e72196SApple OSS Distributions if (nextChar() != 's') {
1933a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1934a5e72196SApple OSS Distributions }
1935a5e72196SApple OSS Distributions if (nextChar() != 'e') {
1936a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1937a5e72196SApple OSS Distributions }
1938a5e72196SApple OSS Distributions }
1939a5e72196SApple OSS Distributions if (nextChar() != '.') {
1940a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1941a5e72196SApple OSS Distributions }
1942c1dac77fSApple OSS Distributions /* skip over dot */
1943c1dac77fSApple OSS Distributions (void)nextChar();
1944c1dac77fSApple OSS Distributions
1945c1dac77fSApple OSS Distributions yylval = (object_t *)boolean;
1946c1dac77fSApple OSS Distributions return BOOLEAN;
1947c1dac77fSApple OSS Distributions }
1948c1dac77fSApple OSS Distributions
1949c1dac77fSApple OSS Distributions /* parse unquoted string */
1950c1dac77fSApple OSS Distributions if (isAlpha(c)) {
1951c1dac77fSApple OSS Distributions int start, length;
1952c1dac77fSApple OSS Distributions char * tempString;
1953c1dac77fSApple OSS Distributions
1954c1dac77fSApple OSS Distributions start = parseBufferIndex;
1955c1dac77fSApple OSS Distributions /* find end of string */
1956c1dac77fSApple OSS Distributions while (isAlphaNumeric(c)) {
1957c1dac77fSApple OSS Distributions c = nextChar();
1958c1dac77fSApple OSS Distributions }
1959c1dac77fSApple OSS Distributions length = parseBufferIndex - start;
1960c1dac77fSApple OSS Distributions
1961c1dac77fSApple OSS Distributions /* copy to null terminated buffer */
1962c1dac77fSApple OSS Distributions tempString = (char *)malloc(length + 1);
1963bb611c8fSApple OSS Distributions if (tempString == NULL) {
1964c1dac77fSApple OSS Distributions printf("OSUnserialize: can't alloc temp memory\n");
1965c1dac77fSApple OSS Distributions return 0;
1966c1dac77fSApple OSS Distributions }
1967c1dac77fSApple OSS Distributions bcopy(&parseBuffer[start], tempString, length);
1968c1dac77fSApple OSS Distributions tempString[length] = 0;
1969c1dac77fSApple OSS Distributions yylval = (object_t *)tempString;
1970c1dac77fSApple OSS Distributions return STRING;
1971c1dac77fSApple OSS Distributions }
1972c1dac77fSApple OSS Distributions
1973c1dac77fSApple OSS Distributions /* parse quoted string */
1974c1dac77fSApple OSS Distributions if (c == '"' || c == '\'') {
1975c1dac77fSApple OSS Distributions int start, length;
1976c1dac77fSApple OSS Distributions char * tempString;
1977c1dac77fSApple OSS Distributions char quoteChar = c;
1978c1dac77fSApple OSS Distributions
1979c1dac77fSApple OSS Distributions start = parseBufferIndex + 1; // skip quote
1980c1dac77fSApple OSS Distributions /* find end of string, line, buffer */
1981c1dac77fSApple OSS Distributions while ((c = nextChar()) != quoteChar) {
1982a5e72196SApple OSS Distributions if (c == '\\') {
1983a5e72196SApple OSS Distributions c = nextChar();
1984a5e72196SApple OSS Distributions }
1985a5e72196SApple OSS Distributions if (c == '\n') {
1986a5e72196SApple OSS Distributions lineNumber++;
1987a5e72196SApple OSS Distributions }
1988a5e72196SApple OSS Distributions if (c == 0) {
1989a5e72196SApple OSS Distributions return SYNTAX_ERROR;
1990a5e72196SApple OSS Distributions }
1991c1dac77fSApple OSS Distributions }
1992c1dac77fSApple OSS Distributions length = parseBufferIndex - start;
1993c1dac77fSApple OSS Distributions /* skip over trailing quote */
1994c1dac77fSApple OSS Distributions (void)nextChar();
1995c1dac77fSApple OSS Distributions /* copy to null terminated buffer */
1996c1dac77fSApple OSS Distributions tempString = (char *)malloc(length + 1);
1997bb611c8fSApple OSS Distributions if (tempString == NULL) {
1998c1dac77fSApple OSS Distributions printf("OSUnserialize: can't alloc temp memory\n");
1999c1dac77fSApple OSS Distributions return 0;
2000c1dac77fSApple OSS Distributions }
2001c1dac77fSApple OSS Distributions
2002c1dac77fSApple OSS Distributions int to = 0;
2003c1dac77fSApple OSS Distributions for (int from = start; from < parseBufferIndex; from++) {
2004c1dac77fSApple OSS Distributions // hack - skip over backslashes
2005c1dac77fSApple OSS Distributions if (parseBuffer[from] == '\\') {
2006c1dac77fSApple OSS Distributions length--;
2007c1dac77fSApple OSS Distributions continue;
2008c1dac77fSApple OSS Distributions }
2009c1dac77fSApple OSS Distributions tempString[to] = parseBuffer[from];
2010c1dac77fSApple OSS Distributions to++;
2011c1dac77fSApple OSS Distributions }
2012c1dac77fSApple OSS Distributions tempString[length] = 0;
2013c1dac77fSApple OSS Distributions yylval = (object_t *)tempString;
2014c1dac77fSApple OSS Distributions return STRING;
2015c1dac77fSApple OSS Distributions }
2016c1dac77fSApple OSS Distributions
2017c1dac77fSApple OSS Distributions /* process numbers */
2018a5e72196SApple OSS Distributions if (isDigit(c)) {
2019c1dac77fSApple OSS Distributions unsigned long long n = 0;
2020c1dac77fSApple OSS Distributions int base = 10;
2021c1dac77fSApple OSS Distributions
2022c1dac77fSApple OSS Distributions if (c == '0') {
2023c1dac77fSApple OSS Distributions c = nextChar();
2024c1dac77fSApple OSS Distributions if (c == 'x') {
2025c1dac77fSApple OSS Distributions base = 16;
2026c1dac77fSApple OSS Distributions c = nextChar();
2027c1dac77fSApple OSS Distributions }
2028c1dac77fSApple OSS Distributions }
2029c1dac77fSApple OSS Distributions if (base == 10) {
2030c1dac77fSApple OSS Distributions while (isDigit(c)) {
2031c1dac77fSApple OSS Distributions n = (n * base + c - '0');
2032c1dac77fSApple OSS Distributions c = nextChar();
2033c1dac77fSApple OSS Distributions }
2034c1dac77fSApple OSS Distributions } else {
2035c1dac77fSApple OSS Distributions while (isHexDigit(c)) {
2036c1dac77fSApple OSS Distributions if (isDigit(c)) {
2037c1dac77fSApple OSS Distributions n = (n * base + c - '0');
2038c1dac77fSApple OSS Distributions } else {
2039c1dac77fSApple OSS Distributions n = (n * base + 0xa + c - 'a');
2040c1dac77fSApple OSS Distributions }
2041c1dac77fSApple OSS Distributions c = nextChar();
2042c1dac77fSApple OSS Distributions }
2043c1dac77fSApple OSS Distributions }
2044c1dac77fSApple OSS Distributions
2045c1dac77fSApple OSS Distributions yylval = newObject();
2046c1dac77fSApple OSS Distributions yylval->u.offset = n;
2047c1dac77fSApple OSS Distributions
2048c1dac77fSApple OSS Distributions return NUMBER;
2049c1dac77fSApple OSS Distributions }
2050c1dac77fSApple OSS Distributions
2051c1dac77fSApple OSS Distributions #define OSDATA_ALLOC_SIZE 4096
2052c1dac77fSApple OSS Distributions
2053c1dac77fSApple OSS Distributions /* process data */
2054c1dac77fSApple OSS Distributions if (c == '<') {
2055c1dac77fSApple OSS Distributions unsigned char *d, *start, *lastStart;
2056c1dac77fSApple OSS Distributions
2057bb611c8fSApple OSS Distributions size_t buflen = OSDATA_ALLOC_SIZE;
2058bb611c8fSApple OSS Distributions start = lastStart = d = (unsigned char *)malloc(buflen);
2059c1dac77fSApple OSS Distributions c = nextChar(); // skip over '<'
2060c1dac77fSApple OSS Distributions while (c != 0 && c != '>') {
2061a5e72196SApple OSS Distributions if (isSpace(c)) {
2062a5e72196SApple OSS Distributions while ((c = nextChar()) != 0 && isSpace(c)) {
2063a5e72196SApple OSS Distributions }
2064a5e72196SApple OSS Distributions }
2065a5e72196SApple OSS Distributions ;
2066a5e72196SApple OSS Distributions if (c == '#') {
2067a5e72196SApple OSS Distributions while ((c = nextChar()) != 0 && c != '\n') {
2068a5e72196SApple OSS Distributions }
2069a5e72196SApple OSS Distributions }
2070a5e72196SApple OSS Distributions ;
2071c1dac77fSApple OSS Distributions if (c == '\n') {
2072c1dac77fSApple OSS Distributions lineNumber++;
2073c1dac77fSApple OSS Distributions c = nextChar();
2074c1dac77fSApple OSS Distributions continue;
2075c1dac77fSApple OSS Distributions }
2076c1dac77fSApple OSS Distributions
2077c1dac77fSApple OSS Distributions // get high nibble
2078a5e72196SApple OSS Distributions if (!isHexDigit(c)) {
2079a5e72196SApple OSS Distributions break;
2080a5e72196SApple OSS Distributions }
2081c1dac77fSApple OSS Distributions if (isDigit(c)) {
2082c1dac77fSApple OSS Distributions *d = (c - '0') << 4;
2083c1dac77fSApple OSS Distributions } else {
2084c1dac77fSApple OSS Distributions *d = (0xa + (c - 'a')) << 4;
2085c1dac77fSApple OSS Distributions }
2086c1dac77fSApple OSS Distributions
2087c1dac77fSApple OSS Distributions // get low nibble
2088c1dac77fSApple OSS Distributions c = nextChar();
2089a5e72196SApple OSS Distributions if (!isHexDigit(c)) {
2090a5e72196SApple OSS Distributions break;
2091a5e72196SApple OSS Distributions }
2092c1dac77fSApple OSS Distributions if (isDigit(c)) {
2093c1dac77fSApple OSS Distributions *d |= c - '0';
2094c1dac77fSApple OSS Distributions } else {
2095c1dac77fSApple OSS Distributions *d |= 0xa + (c - 'a');
2096c1dac77fSApple OSS Distributions }
2097c1dac77fSApple OSS Distributions
2098c1dac77fSApple OSS Distributions d++;
2099c1dac77fSApple OSS Distributions if ((d - lastStart) >= OSDATA_ALLOC_SIZE) {
2100c1dac77fSApple OSS Distributions int oldsize = d - start;
2101bb611c8fSApple OSS Distributions assert(buflen == oldsize);
2102bb611c8fSApple OSS Distributions start = (unsigned char *)realloc(start, oldsize, buflen);
2103c1dac77fSApple OSS Distributions d = lastStart = start + oldsize;
2104c1dac77fSApple OSS Distributions }
2105c1dac77fSApple OSS Distributions c = nextChar();
2106c1dac77fSApple OSS Distributions }
2107c1dac77fSApple OSS Distributions if (c != '>') {
2108bb611c8fSApple OSS Distributions safe_free(start, buflen);
2109c1dac77fSApple OSS Distributions return SYNTAX_ERROR;
2110c1dac77fSApple OSS Distributions }
2111c1dac77fSApple OSS Distributions
2112c1dac77fSApple OSS Distributions // got it!
2113c1dac77fSApple OSS Distributions yylval = newObject();
2114c1dac77fSApple OSS Distributions yylval->object = start;
2115c1dac77fSApple OSS Distributions yylval->size = d - start;
2116c1dac77fSApple OSS Distributions
2117c1dac77fSApple OSS Distributions (void)nextChar(); // skip over '>'
2118c1dac77fSApple OSS Distributions return DATA;
2119c1dac77fSApple OSS Distributions }
2120c1dac77fSApple OSS Distributions
2121c1dac77fSApple OSS Distributions
2122c1dac77fSApple OSS Distributions /* return single chars, move pointer to next char */
2123c1dac77fSApple OSS Distributions (void)nextChar();
2124c1dac77fSApple OSS Distributions return c;
2125c1dac77fSApple OSS Distributions }
2126c1dac77fSApple OSS Distributions
2127c1dac77fSApple OSS Distributions // !@$&)(^Q$&*^!$(*!@$_(^%_(*Q#$(_*&!$_(*&!$_(*&!#$(*!@&^!@#%!_!#
2128c1dac77fSApple OSS Distributions // !@$&)(^Q$&*^!$(*!@$_(^%_(*Q#$(_*&!$_(*&!$_(*&!#$(*!@&^!@#%!_!#
2129c1dac77fSApple OSS Distributions // !@$&)(^Q$&*^!$(*!@$_(^%_(*Q#$(_*&!$_(*&!$_(*&!#$(*!@&^!@#%!_!#
2130c1dac77fSApple OSS Distributions
21313ca3bd55SApple OSS Distributions #if DEBUG
2132c1dac77fSApple OSS Distributions int debugUnserializeAllocCount = 0;
2133c1dac77fSApple OSS Distributions #endif
2134c1dac77fSApple OSS Distributions
2135c1dac77fSApple OSS Distributions object_t *
newObject()2136c1dac77fSApple OSS Distributions newObject()
2137c1dac77fSApple OSS Distributions {
21383ca3bd55SApple OSS Distributions #if DEBUG
2139c1dac77fSApple OSS Distributions debugUnserializeAllocCount++;
2140c1dac77fSApple OSS Distributions #endif
2141e6231be0SApple OSS Distributions return malloc_type(object_t);
2142c1dac77fSApple OSS Distributions }
2143c1dac77fSApple OSS Distributions
2144c1dac77fSApple OSS Distributions void
freeObject(object_t * o)2145c1dac77fSApple OSS Distributions freeObject(object_t *o)
2146c1dac77fSApple OSS Distributions {
21473ca3bd55SApple OSS Distributions #if DEBUG
2148c1dac77fSApple OSS Distributions debugUnserializeAllocCount--;
2149c1dac77fSApple OSS Distributions #endif
2150e6231be0SApple OSS Distributions free_type(object_t, o);
2151c1dac77fSApple OSS Distributions }
2152c1dac77fSApple OSS Distributions
2153c1dac77fSApple OSS Distributions static OSDictionary *tags;
2154c1dac77fSApple OSS Distributions
2155c1dac77fSApple OSS Distributions static void
rememberObject(int tag,object_t * o)2156c1dac77fSApple OSS Distributions rememberObject(int tag, object_t *o)
2157c1dac77fSApple OSS Distributions {
2158c1dac77fSApple OSS Distributions char key[16];
21593ca3bd55SApple OSS Distributions snprintf(key, sizeof(key), "%u", tag);
2160c1dac77fSApple OSS Distributions
2161c1dac77fSApple OSS Distributions tags->setObject(key, (OSObject *)o);
2162c1dac77fSApple OSS Distributions }
2163c1dac77fSApple OSS Distributions
2164c1dac77fSApple OSS Distributions static OSObject *
retrieveObject(int tag)2165c1dac77fSApple OSS Distributions retrieveObject(int tag)
2166c1dac77fSApple OSS Distributions {
2167c1dac77fSApple OSS Distributions char key[16];
21683ca3bd55SApple OSS Distributions snprintf(key, sizeof(key), "%u", tag);
2169c1dac77fSApple OSS Distributions
2170c1dac77fSApple OSS Distributions return tags->getObject(key);
2171c1dac77fSApple OSS Distributions }
2172c1dac77fSApple OSS Distributions
2173c1dac77fSApple OSS Distributions OSObject *
buildOSDictionary(object_t * o)2174c1dac77fSApple OSS Distributions buildOSDictionary(object_t *o)
2175c1dac77fSApple OSS Distributions {
2176c1dac77fSApple OSS Distributions object_t *temp, *last = o;
2177c1dac77fSApple OSS Distributions int count = 0;
2178c1dac77fSApple OSS Distributions
2179c1dac77fSApple OSS Distributions // get count and last object
2180c1dac77fSApple OSS Distributions while (o) {
2181c1dac77fSApple OSS Distributions count++;
2182c1dac77fSApple OSS Distributions last = o;
2183c1dac77fSApple OSS Distributions o = o->next;
2184c1dac77fSApple OSS Distributions }
2185c1dac77fSApple OSS Distributions o = last;
2186c1dac77fSApple OSS Distributions
2187c1dac77fSApple OSS Distributions OSDictionary *d = OSDictionary::withCapacity(count);
2188c1dac77fSApple OSS Distributions
2189c1dac77fSApple OSS Distributions while (o) {
2190c1dac77fSApple OSS Distributions #ifdef metaclass_stuff_worksXXX
2191c1dac77fSApple OSS Distributions if (((OSObject *)o->u.key)->metaCast("OSSymbol")) {
2192c1dac77fSApple OSS Distributions // XXX the evil frontdoor
2193c1dac77fSApple OSS Distributions d->setObject((OSSymbol *)o->u.key, (OSObject *)o->object);
2194c1dac77fSApple OSS Distributions } else {
2195c1dac77fSApple OSS Distributions // If it isn't a symbol, I hope it's a string!
2196c1dac77fSApple OSS Distributions d->setObject((OSString *)o->u.key, (OSObject *)o->object);
2197c1dac77fSApple OSS Distributions }
2198c1dac77fSApple OSS Distributions #else
2199c1dac77fSApple OSS Distributions d->setObject((OSString *)o->u.key, (OSObject *)o->object);
2200c1dac77fSApple OSS Distributions #endif
2201c1dac77fSApple OSS Distributions ((OSObject *)o->object)->release();
2202c1dac77fSApple OSS Distributions ((OSObject *)o->u.key)->release();
2203c1dac77fSApple OSS Distributions temp = o;
2204c1dac77fSApple OSS Distributions o = o->prev;
2205c1dac77fSApple OSS Distributions freeObject(temp);
2206c1dac77fSApple OSS Distributions }
2207c1dac77fSApple OSS Distributions return d;
2208c1dac77fSApple OSS Distributions };
2209c1dac77fSApple OSS Distributions
2210c1dac77fSApple OSS Distributions OSObject *
buildOSArray(object_t * o)2211c1dac77fSApple OSS Distributions buildOSArray(object_t *o)
2212c1dac77fSApple OSS Distributions {
2213c1dac77fSApple OSS Distributions object_t *temp, *last = o;
2214c1dac77fSApple OSS Distributions int count = 0;
2215c1dac77fSApple OSS Distributions
2216c1dac77fSApple OSS Distributions // get count and last object
2217c1dac77fSApple OSS Distributions while (o) {
2218c1dac77fSApple OSS Distributions count++;
2219c1dac77fSApple OSS Distributions last = o;
2220c1dac77fSApple OSS Distributions o = o->next;
2221c1dac77fSApple OSS Distributions }
2222c1dac77fSApple OSS Distributions o = last;
2223c1dac77fSApple OSS Distributions
2224c1dac77fSApple OSS Distributions OSArray *a = OSArray::withCapacity(count);
2225c1dac77fSApple OSS Distributions
2226c1dac77fSApple OSS Distributions while (o) {
2227c1dac77fSApple OSS Distributions a->setObject((OSObject *)o->object);
2228c1dac77fSApple OSS Distributions ((OSObject *)o->object)->release();
2229c1dac77fSApple OSS Distributions temp = o;
2230c1dac77fSApple OSS Distributions o = o->prev;
2231c1dac77fSApple OSS Distributions freeObject(temp);
2232c1dac77fSApple OSS Distributions }
2233c1dac77fSApple OSS Distributions return a;
2234c1dac77fSApple OSS Distributions };
2235c1dac77fSApple OSS Distributions
2236c1dac77fSApple OSS Distributions OSObject *
buildOSSet(object_t * o)2237c1dac77fSApple OSS Distributions buildOSSet(object_t *o)
2238c1dac77fSApple OSS Distributions {
2239c1dac77fSApple OSS Distributions OSArray *a = (OSArray *)buildOSArray(o);
2240c1dac77fSApple OSS Distributions OSSet *s = OSSet::withArray(a, a->getCapacity());
2241c1dac77fSApple OSS Distributions
2242c1dac77fSApple OSS Distributions a->release();
2243c1dac77fSApple OSS Distributions return s;
2244c1dac77fSApple OSS Distributions };
2245c1dac77fSApple OSS Distributions
2246c1dac77fSApple OSS Distributions OSObject *
buildOSString(object_t * o)2247c1dac77fSApple OSS Distributions buildOSString(object_t *o)
2248c1dac77fSApple OSS Distributions {
2249c1dac77fSApple OSS Distributions OSString *s = OSString::withCString((char *)o);
2250c1dac77fSApple OSS Distributions
2251bb611c8fSApple OSS Distributions safe_free(o, strlen((char *)o) + 1);
2252c1dac77fSApple OSS Distributions
2253c1dac77fSApple OSS Distributions return s;
2254c1dac77fSApple OSS Distributions };
2255c1dac77fSApple OSS Distributions
2256c1dac77fSApple OSS Distributions OSObject *
buildOSData(object_t * o)2257c1dac77fSApple OSS Distributions buildOSData(object_t *o)
2258c1dac77fSApple OSS Distributions {
2259c1dac77fSApple OSS Distributions OSData *d;
2260c1dac77fSApple OSS Distributions
2261c1dac77fSApple OSS Distributions if (o->size) {
2262c1dac77fSApple OSS Distributions d = OSData::withBytes(o->object, o->size);
2263c1dac77fSApple OSS Distributions } else {
2264c1dac77fSApple OSS Distributions d = OSData::withCapacity(0);
2265c1dac77fSApple OSS Distributions }
2266bb611c8fSApple OSS Distributions safe_free(o->object, o->size);
2267c1dac77fSApple OSS Distributions freeObject(o);
2268c1dac77fSApple OSS Distributions return d;
2269c1dac77fSApple OSS Distributions };
2270c1dac77fSApple OSS Distributions
2271c1dac77fSApple OSS Distributions OSObject *
buildOSOffset(object_t * o)2272c1dac77fSApple OSS Distributions buildOSOffset(object_t *o)
2273c1dac77fSApple OSS Distributions {
2274c1dac77fSApple OSS Distributions OSNumber *off = OSNumber::withNumber(o->u.offset, o->size);
2275c1dac77fSApple OSS Distributions freeObject(o);
2276c1dac77fSApple OSS Distributions return off;
2277c1dac77fSApple OSS Distributions };
2278c1dac77fSApple OSS Distributions
2279c1dac77fSApple OSS Distributions OSObject *
buildOSBoolean(object_t * o)2280c1dac77fSApple OSS Distributions buildOSBoolean(object_t *o)
2281c1dac77fSApple OSS Distributions {
2282c1dac77fSApple OSS Distributions OSBoolean *b = OSBoolean::withBoolean((bool)o);
2283c1dac77fSApple OSS Distributions return b;
2284c1dac77fSApple OSS Distributions };
2285c1dac77fSApple OSS Distributions
2286c1dac77fSApple OSS Distributions __BEGIN_DECLS
22873ca3bd55SApple OSS Distributions #include <kern/locks.h>
2288c1dac77fSApple OSS Distributions __END_DECLS
2289c1dac77fSApple OSS Distributions
22903ca3bd55SApple OSS Distributions static lck_mtx_t * lock = 0;
22913ca3bd55SApple OSS Distributions extern lck_grp_t *IOLockGroup;
2292c1dac77fSApple OSS Distributions
2293c1dac77fSApple OSS Distributions OSObject*
OSUnserialize(const char * buffer,OSString ** errorString)2294c1dac77fSApple OSS Distributions OSUnserialize(const char *buffer, OSString **errorString)
2295c1dac77fSApple OSS Distributions {
2296c1dac77fSApple OSS Distributions OSObject *object;
2297c1dac77fSApple OSS Distributions
2298c1dac77fSApple OSS Distributions if (!lock) {
22993ca3bd55SApple OSS Distributions lock = lck_mtx_alloc_init(IOLockGroup, LCK_ATTR_NULL);
23003ca3bd55SApple OSS Distributions lck_mtx_lock(lock);
2301c1dac77fSApple OSS Distributions } else {
23023ca3bd55SApple OSS Distributions lck_mtx_lock(lock);
2303c1dac77fSApple OSS Distributions }
2304c1dac77fSApple OSS Distributions
23053ca3bd55SApple OSS Distributions #if DEBUG
2306c1dac77fSApple OSS Distributions debugUnserializeAllocCount = 0;
2307c1dac77fSApple OSS Distributions #endif
2308c1dac77fSApple OSS Distributions yyerror_message[0] = 0; //just in case
2309c1dac77fSApple OSS Distributions parseBuffer = buffer;
2310c1dac77fSApple OSS Distributions parseBufferIndex = 0;
2311c1dac77fSApple OSS Distributions tags = OSDictionary::withCapacity(128);
2312c1dac77fSApple OSS Distributions if (yyparse() == 0) {
2313c1dac77fSApple OSS Distributions object = parsedObject;
2314a5e72196SApple OSS Distributions if (errorString) {
2315bb611c8fSApple OSS Distributions *errorString = NULL;
2316a5e72196SApple OSS Distributions }
2317c1dac77fSApple OSS Distributions } else {
2318bb611c8fSApple OSS Distributions object = NULL;
2319a5e72196SApple OSS Distributions if (errorString) {
2320c1dac77fSApple OSS Distributions *errorString = OSString::withCString(yyerror_message);
2321c1dac77fSApple OSS Distributions }
2322a5e72196SApple OSS Distributions }
2323c1dac77fSApple OSS Distributions
2324c1dac77fSApple OSS Distributions tags->release();
23253ca3bd55SApple OSS Distributions #if DEBUG
2326c1dac77fSApple OSS Distributions if (debugUnserializeAllocCount) {
2327c1dac77fSApple OSS Distributions printf("OSUnserialize: allocation check failed, count = %d.\n",
2328c1dac77fSApple OSS Distributions debugUnserializeAllocCount);
2329c1dac77fSApple OSS Distributions }
2330c1dac77fSApple OSS Distributions #endif
23313ca3bd55SApple OSS Distributions lck_mtx_unlock(lock);
2332c1dac77fSApple OSS Distributions
2333c1dac77fSApple OSS Distributions return object;
2334c1dac77fSApple OSS Distributions }
2335c1dac77fSApple OSS Distributions
2336e6231be0SApple OSS Distributions #endif // not __clang_analyzer__
2337e6231be0SApple OSS Distributions
2338c1dac77fSApple OSS Distributions
2339c1dac77fSApple OSS Distributions //
2340c1dac77fSApple OSS Distributions //
2341c1dac77fSApple OSS Distributions //
2342c1dac77fSApple OSS Distributions //
2343c1dac77fSApple OSS Distributions //
2344c1dac77fSApple OSS Distributions // DO NOT EDIT OSUnserialize.cpp!
2345c1dac77fSApple OSS Distributions //
2346c1dac77fSApple OSS Distributions // this means you!
2347c1dac77fSApple OSS Distributions //
2348c1dac77fSApple OSS Distributions //
2349c1dac77fSApple OSS Distributions //
2350c1dac77fSApple OSS Distributions //
2351c1dac77fSApple OSS Distributions //
2352