Mercurial > audlegacy-plugins
annotate src/paranormal/libcalc/parser.c @ 3138:8e26022bb814
aac: handle premature EOF on shoutcast streams more gracefully.
in combination with the neon work, we no longer have a problem. (closes #57)
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Thu, 07 May 2009 11:14:36 -0500 |
parents | f1b6f1b2cdb3 |
children |
rev | line source |
---|---|
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1 /* A Bison parser, made by GNU Bison 1.875d. */ |
282 | 2 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
3 /* Skeleton parser for Yacc-like parsing with Bison, |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
295 | 5 |
6 This program is free software; you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
8 the Free Software Foundation; either version 2, or (at your option) | |
9 any later version. | |
10 | |
11 This program is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
282 | 15 |
295 | 16 You should have received a copy of the GNU General Public License |
17 along with this program; if not, write to the Free Software | |
2835 | 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 Boston, MA 02110-1301, USA. */ | |
295 | 20 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
21 /* As a special exception, when this file is copied by Bison into a |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
22 Bison output file, you may use that output file without restriction. |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
23 This special exception was added by the Free Software Foundation |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
24 in version 1.24 of Bison. */ |
295 | 25 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
26 /* Written by Richard Stallman by simplifying the original so called |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
27 ``semantic'' parser. */ |
282 | 28 |
295 | 29 /* All symbols defined below should begin with yy or YY, to avoid |
30 infringing on user name space. This should be done even for local | |
31 variables, as they might otherwise be expanded by user macros. | |
32 There are some unavoidable exceptions within include files to | |
33 define necessary library symbols; they are noted "INFRINGES ON | |
34 USER NAME SPACE" below. */ | |
35 | |
36 /* Identify Bison output. */ | |
37 #define YYBISON 1 | |
38 | |
39 /* Skeleton name. */ | |
40 #define YYSKELETON_NAME "yacc.c" | |
41 | |
42 /* Pure parsers. */ | |
43 #define YYPURE 1 | |
44 | |
45 /* Using locations. */ | |
46 #define YYLSP_NEEDED 0 | |
47 | |
282 | 48 |
295 | 49 |
50 /* Tokens. */ | |
51 #ifndef YYTOKENTYPE | |
52 # define YYTOKENTYPE | |
53 /* Put the tokens into the symbol table, so that GDB and other debuggers | |
54 know about them. */ | |
55 enum yytokentype { | |
56 NAME = 258, | |
57 NUMBER = 259, | |
58 NEG = 260 | |
59 }; | |
60 #endif | |
61 #define NAME 258 | |
62 #define NUMBER 259 | |
63 #define NEG 260 | |
64 | |
65 | |
66 | |
67 | |
68 /* Copy the first part of user declarations. */ | |
69 #line 26 "parser.y" | |
282 | 70 |
71 #include <ctype.h> | |
72 #include <glib.h> | |
73 #include <locale.h> | |
74 #include <math.h> | |
75 #include <stdio.h> | |
76 #include <string.h> | |
77 | |
78 #include "dict.h" | |
79 #include "execute.h" | |
80 #include "function.h" | |
81 #include "parser.h" | |
82 #include "storage.h" | |
83 | |
84 #define YYPARSE_PARAM yyparam | |
85 #define YYLEX_PARAM yyparam | |
86 | |
87 static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict, | |
88 char *str); | |
89 | |
90 #define GENERATE(str) if (!expr_add_compile (((parser_control *)yyparam)->expr, \ | |
91 ((parser_control *)yyparam)->dict, str)) \ | |
92 YYABORT; | |
93 | |
295 | 94 |
95 /* Enabling traces. */ | |
96 #ifndef YYDEBUG | |
97 # define YYDEBUG 0 | |
98 #endif | |
99 | |
100 /* Enabling verbose error messages. */ | |
101 #ifdef YYERROR_VERBOSE | |
102 # undef YYERROR_VERBOSE | |
103 # define YYERROR_VERBOSE 1 | |
104 #else | |
105 # define YYERROR_VERBOSE 0 | |
106 #endif | |
107 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
108 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) |
295 | 109 #line 54 "parser.y" |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
110 typedef union YYSTYPE { |
282 | 111 char *s_value; |
112 char c_value; | |
113 double d_value; | |
114 int i_value; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
115 } YYSTYPE; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
116 /* Line 191 of yacc.c. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
117 #line 118 "parser.c" |
295 | 118 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
119 # define YYSTYPE_IS_DECLARED 1 | |
120 # define YYSTYPE_IS_TRIVIAL 1 | |
282 | 121 #endif |
122 | |
123 | |
124 | |
295 | 125 /* Copy the second part of user declarations. */ |
126 | |
127 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
128 /* Line 214 of yacc.c. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
129 #line 130 "parser.c" |
295 | 130 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
131 #if ! defined (yyoverflow) || YYERROR_VERBOSE |
282 | 132 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
133 # ifndef YYFREE |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
134 # define YYFREE free |
295 | 135 # endif |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
136 # ifndef YYMALLOC |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
137 # define YYMALLOC malloc |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
138 # endif |
295 | 139 |
140 /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
282 | 141 |
295 | 142 # ifdef YYSTACK_USE_ALLOCA |
143 # if YYSTACK_USE_ALLOCA | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
144 # define YYSTACK_ALLOC alloca |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
145 # endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
146 # else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
147 # if defined (alloca) || defined (_ALLOCA_H) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
148 # define YYSTACK_ALLOC alloca |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
149 # else |
295 | 150 # ifdef __GNUC__ |
151 # define YYSTACK_ALLOC __builtin_alloca | |
152 # endif | |
153 # endif | |
154 # endif | |
282 | 155 |
295 | 156 # ifdef YYSTACK_ALLOC |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
157 /* Pacify GCC's `empty if-body' warning. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
158 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
159 # else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
160 # if defined (__STDC__) || defined (__cplusplus) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
161 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
162 # define YYSIZE_T size_t |
295 | 163 # endif |
164 # define YYSTACK_ALLOC YYMALLOC | |
165 # define YYSTACK_FREE YYFREE | |
166 # endif | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
167 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ |
295 | 168 |
169 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
170 #if (! defined (yyoverflow) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
171 && (! defined (__cplusplus) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
172 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) |
282 | 173 |
295 | 174 /* A type that is properly aligned for any stack member. */ |
175 union yyalloc | |
176 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
177 short int yyss; |
295 | 178 YYSTYPE yyvs; |
179 }; | |
180 | |
181 /* The size of the maximum gap between one aligned stack and the next. */ | |
182 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) | |
183 | |
184 /* The size of an array large to enough to hold all stacks, each with | |
185 N elements. */ | |
186 # define YYSTACK_BYTES(N) \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
187 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ |
295 | 188 + YYSTACK_GAP_MAXIMUM) |
189 | |
190 /* Copy COUNT objects from FROM to TO. The source and destination do | |
191 not overlap. */ | |
192 # ifndef YYCOPY | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
193 # if defined (__GNUC__) && 1 < __GNUC__ |
295 | 194 # define YYCOPY(To, From, Count) \ |
195 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
196 # else | |
197 # define YYCOPY(To, From, Count) \ | |
198 do \ | |
199 { \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
200 register YYSIZE_T yyi; \ |
295 | 201 for (yyi = 0; yyi < (Count); yyi++) \ |
202 (To)[yyi] = (From)[yyi]; \ | |
203 } \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
204 while (0) |
295 | 205 # endif |
206 # endif | |
207 | |
208 /* Relocate STACK from its old location to the new one. The | |
209 local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
210 elements in the stack, and YYPTR gives the new location of the | |
211 stack. Advance YYPTR to a properly aligned location for the next | |
212 stack. */ | |
213 # define YYSTACK_RELOCATE(Stack) \ | |
214 do \ | |
215 { \ | |
216 YYSIZE_T yynewbytes; \ | |
217 YYCOPY (&yyptr->Stack, Stack, yysize); \ | |
218 Stack = &yyptr->Stack; \ | |
219 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
220 yyptr += yynewbytes / sizeof (*yyptr); \ | |
221 } \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
222 while (0) |
282 | 223 |
224 #endif | |
225 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
226 #if defined (__STDC__) || defined (__cplusplus) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
227 typedef signed char yysigned_char; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
228 #else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
229 typedef short int yysigned_char; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
230 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
231 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
232 /* YYFINAL -- State number of the termination state. */ |
295 | 233 #define YYFINAL 2 |
234 /* YYLAST -- Last index in YYTABLE. */ | |
235 #define YYLAST 65 | |
236 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
237 /* YYNTOKENS -- Number of terminals. */ |
295 | 238 #define YYNTOKENS 18 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
239 /* YYNNTS -- Number of nonterminals. */ |
295 | 240 #define YYNNTS 5 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
241 /* YYNRULES -- Number of rules. */ |
295 | 242 #define YYNRULES 22 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
243 /* YYNRULES -- Number of states. */ |
295 | 244 #define YYNSTATES 37 |
245 | |
246 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
247 #define YYUNDEFTOK 2 | |
248 #define YYMAXUTOK 260 | |
249 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
250 #define YYTRANSLATE(YYX) \ |
295 | 251 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
252 | |
253 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
254 static const unsigned char yytranslate[] = |
295 | 255 { |
256 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
257 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
258 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
259 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
260 14, 15, 8, 7, 13, 6, 2, 9, 2, 2, | |
261 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, | |
262 17, 5, 16, 2, 2, 2, 2, 2, 2, 2, | |
263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
265 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, | |
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
269 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
272 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
281 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
282 10 | |
282 | 283 }; |
284 | |
295 | 285 #if YYDEBUG |
286 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
287 YYRHS. */ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
288 static const unsigned char yyprhs[] = |
295 | 289 { |
290 0, 0, 3, 4, 7, 8, 10, 13, 16, 18, | |
291 22, 24, 26, 30, 35, 39, 43, 47, 51, 55, | |
292 59, 62, 66 | |
293 }; | |
282 | 294 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
295 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
296 static const yysigned_char yyrhs[] = |
295 | 297 { |
298 19, 0, -1, -1, 19, 20, -1, -1, 22, -1, | |
299 20, 12, -1, 1, 12, -1, 22, -1, 21, 13, | |
300 22, -1, 4, -1, 3, -1, 3, 5, 22, -1, | |
301 3, 14, 21, 15, -1, 22, 16, 22, -1, 22, | |
302 17, 22, -1, 22, 7, 22, -1, 22, 6, 22, | |
303 -1, 22, 8, 22, -1, 22, 9, 22, -1, 6, | |
304 22, -1, 22, 11, 22, -1, 14, 22, 15, -1 | |
305 }; | |
282 | 306 |
295 | 307 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
308 static const unsigned char yyrline[] = |
295 | 309 { |
310 0, 76, 76, 77, 81, 82, 84, 85, 90, 93, | |
311 98, 104, 110, 116, 123, 125, 128, 130, 132, 134, | |
312 136, 138, 140 | |
282 | 313 }; |
314 #endif | |
315 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
316 #if YYDEBUG || YYERROR_VERBOSE |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
317 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
318 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
295 | 319 static const char *const yytname[] = |
320 { | |
321 "$end", "error", "$undefined", "NAME", "NUMBER", "'='", "'-'", "'+'", | |
322 "'*'", "'/'", "NEG", "'^'", "';'", "','", "'('", "')'", "'>'", "'<'", | |
323 "$accept", "input", "expression_list", "argument_list", "expression", 0 | |
282 | 324 }; |
295 | 325 #endif |
282 | 326 |
295 | 327 # ifdef YYPRINT |
328 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to | |
329 token YYLEX-NUM. */ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
330 static const unsigned short int yytoknum[] = |
295 | 331 { |
332 0, 256, 257, 258, 259, 61, 45, 43, 42, 47, | |
333 260, 94, 59, 44, 40, 41, 62, 60 | |
282 | 334 }; |
295 | 335 # endif |
282 | 336 |
295 | 337 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
338 static const unsigned char yyr1[] = |
295 | 339 { |
340 0, 18, 19, 19, 20, 20, 20, 20, 21, 21, | |
341 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, | |
342 22, 22, 22 | |
282 | 343 }; |
344 | |
295 | 345 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
346 static const unsigned char yyr2[] = |
295 | 347 { |
348 0, 2, 0, 2, 0, 1, 2, 2, 1, 3, | |
349 1, 1, 3, 4, 3, 3, 3, 3, 3, 3, | |
350 2, 3, 3 | |
282 | 351 }; |
352 | |
295 | 353 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
354 STATE-NUM when YYTABLE doesn't specify something else to do. Zero | |
355 means the default is an error. */ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
356 static const unsigned char yydefact[] = |
295 | 357 { |
358 2, 0, 1, 0, 11, 10, 0, 0, 3, 5, | |
359 7, 0, 0, 20, 0, 6, 0, 0, 0, 0, | |
360 0, 0, 0, 12, 0, 8, 22, 17, 16, 18, | |
361 19, 21, 14, 15, 0, 13, 9 | |
362 }; | |
282 | 363 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
364 /* YYDEFGOTO[NTERM-NUM]. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
365 static const yysigned_char yydefgoto[] = |
295 | 366 { |
367 -1, 1, 8, 24, 9 | |
282 | 368 }; |
369 | |
295 | 370 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
371 STATE-NUM. */ | |
372 #define YYPACT_NINF -10 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
373 static const yysigned_char yypact[] = |
295 | 374 { |
375 -10, 17, -10, -8, 22, -10, 47, 47, -3, 38, | |
376 -10, 47, 47, -9, 26, -10, 47, 47, 47, 47, | |
377 47, 47, 47, 38, 9, 38, -10, 48, 48, -9, | |
378 -9, -9, 38, 38, 47, -10, 38 | |
282 | 379 }; |
380 | |
295 | 381 /* YYPGOTO[NTERM-NUM]. */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
382 static const yysigned_char yypgoto[] = |
295 | 383 { |
384 -10, -10, -10, -10, -6 | |
385 }; | |
282 | 386 |
295 | 387 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
388 positive, shift that token. If negative, reduce the rule which | |
389 number is the opposite. If zero, do what YYDEFACT says. | |
390 If YYTABLE_NINF, syntax error. */ | |
391 #define YYTABLE_NINF -5 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
392 static const yysigned_char yytable[] = |
295 | 393 { |
394 13, 14, 20, 0, 10, 23, 25, 21, 22, 15, | |
395 27, 28, 29, 30, 31, 32, 33, 2, 3, 0, | |
396 4, 5, 34, 6, 35, 0, 0, 11, 36, -4, | |
397 0, 7, 16, 17, 18, 19, 12, 20, 0, 0, | |
398 0, 26, 21, 22, 16, 17, 18, 19, 0, 20, | |
399 4, 5, 0, 6, 21, 22, 18, 19, 0, 20, | |
400 0, 7, 0, 0, 21, 22 | |
401 }; | |
282 | 402 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
403 static const yysigned_char yycheck[] = |
295 | 404 { |
405 6, 7, 11, -1, 12, 11, 12, 16, 17, 12, | |
406 16, 17, 18, 19, 20, 21, 22, 0, 1, -1, | |
407 3, 4, 13, 6, 15, -1, -1, 5, 34, 12, | |
408 -1, 14, 6, 7, 8, 9, 14, 11, -1, -1, | |
409 -1, 15, 16, 17, 6, 7, 8, 9, -1, 11, | |
410 3, 4, -1, 6, 16, 17, 8, 9, -1, 11, | |
411 -1, 14, -1, -1, 16, 17 | |
412 }; | |
282 | 413 |
295 | 414 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
415 symbol of state STATE-NUM. */ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
416 static const unsigned char yystos[] = |
295 | 417 { |
418 0, 19, 0, 1, 3, 4, 6, 14, 20, 22, | |
419 12, 5, 14, 22, 22, 12, 6, 7, 8, 9, | |
420 11, 16, 17, 22, 21, 22, 15, 22, 22, 22, | |
421 22, 22, 22, 22, 13, 15, 22 | |
422 }; | |
282 | 423 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
424 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
425 # define YYSIZE_T __SIZE_TYPE__ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
426 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
427 #if ! defined (YYSIZE_T) && defined (size_t) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
428 # define YYSIZE_T size_t |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
429 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
430 #if ! defined (YYSIZE_T) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
431 # if defined (__STDC__) || defined (__cplusplus) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
432 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
433 # define YYSIZE_T size_t |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
434 # endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
435 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
436 #if ! defined (YYSIZE_T) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
437 # define YYSIZE_T unsigned int |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
438 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
439 |
282 | 440 #define yyerrok (yyerrstatus = 0) |
441 #define yyclearin (yychar = YYEMPTY) | |
295 | 442 #define YYEMPTY (-2) |
282 | 443 #define YYEOF 0 |
295 | 444 |
282 | 445 #define YYACCEPT goto yyacceptlab |
295 | 446 #define YYABORT goto yyabortlab |
447 #define YYERROR goto yyerrorlab | |
448 | |
449 | |
450 /* Like YYERROR except do call yyerror. This remains here temporarily | |
451 to ease the transition to the new meaning of YYERROR, for GCC. | |
282 | 452 Once GCC version 2 has supplanted version 1, this can go. */ |
295 | 453 |
282 | 454 #define YYFAIL goto yyerrlab |
295 | 455 |
282 | 456 #define YYRECOVERING() (!!yyerrstatus) |
295 | 457 |
458 #define YYBACKUP(Token, Value) \ | |
282 | 459 do \ |
460 if (yychar == YYEMPTY && yylen == 1) \ | |
295 | 461 { \ |
462 yychar = (Token); \ | |
463 yylval = (Value); \ | |
464 yytoken = YYTRANSLATE (yychar); \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
465 YYPOPSTACK; \ |
282 | 466 goto yybackup; \ |
467 } \ | |
468 else \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
469 { \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
470 yyerror ("syntax error: cannot back up");\ |
295 | 471 YYERROR; \ |
472 } \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
473 while (0) |
282 | 474 |
475 #define YYTERROR 1 | |
476 #define YYERRCODE 256 | |
477 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
478 /* YYLLOC_DEFAULT -- Compute the default location (before the actions |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
479 are run). */ |
295 | 480 |
481 #ifndef YYLLOC_DEFAULT | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
482 # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
483 ((Current).first_line = (Rhs)[1].first_line, \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
484 (Current).first_column = (Rhs)[1].first_column, \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
485 (Current).last_line = (Rhs)[N].last_line, \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
486 (Current).last_column = (Rhs)[N].last_column) |
282 | 487 #endif |
488 | |
295 | 489 /* YYLEX -- calling `yylex' with the right arguments. */ |
490 | |
282 | 491 #ifdef YYLEX_PARAM |
2321
6b427677621f
killed a few warnings
Cristi Magherusan <majeru@atheme.org>
parents:
1978
diff
changeset
|
492 int yylex (YYSTYPE *yylval, void *yyparam); |
295 | 493 # define YYLEX yylex (&yylval, YYLEX_PARAM) |
282 | 494 #else |
2321
6b427677621f
killed a few warnings
Cristi Magherusan <majeru@atheme.org>
parents:
1978
diff
changeset
|
495 int yylex (YYSTYPE *yylval); |
295 | 496 # define YYLEX yylex (&yylval) |
282 | 497 #endif |
498 | |
295 | 499 /* Enable debugging if requested. */ |
500 #if YYDEBUG | |
501 | |
502 # ifndef YYFPRINTF | |
503 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
504 # define YYFPRINTF fprintf | |
505 # endif | |
506 | |
507 # define YYDPRINTF(Args) \ | |
508 do { \ | |
509 if (yydebug) \ | |
510 YYFPRINTF Args; \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
511 } while (0) |
295 | 512 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
513 # define YYDSYMPRINT(Args) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
514 do { \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
515 if (yydebug) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
516 yysymprint Args; \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
517 } while (0) |
282 | 518 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
519 # define YYDSYMPRINTF(Title, Token, Value, Location) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
520 do { \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
521 if (yydebug) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
522 { \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
523 YYFPRINTF (stderr, "%s ", Title); \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
524 yysymprint (stderr, \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
525 Token, Value); \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
526 YYFPRINTF (stderr, "\n"); \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
527 } \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
528 } while (0) |
295 | 529 |
530 /*------------------------------------------------------------------. | |
531 | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
532 | TOP (included). | | |
533 `------------------------------------------------------------------*/ | |
534 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
535 #if defined (__STDC__) || defined (__cplusplus) |
295 | 536 static void |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
537 yy_stack_print (short int *bottom, short int *top) |
295 | 538 #else |
539 static void | |
540 yy_stack_print (bottom, top) | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
541 short int *bottom; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
542 short int *top; |
295 | 543 #endif |
544 { | |
545 YYFPRINTF (stderr, "Stack now"); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
546 for (/* Nothing. */; bottom <= top; ++bottom) |
295 | 547 YYFPRINTF (stderr, " %d", *bottom); |
548 YYFPRINTF (stderr, "\n"); | |
549 } | |
550 | |
551 # define YY_STACK_PRINT(Bottom, Top) \ | |
552 do { \ | |
553 if (yydebug) \ | |
554 yy_stack_print ((Bottom), (Top)); \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
555 } while (0) |
295 | 556 |
557 | |
558 /*------------------------------------------------. | |
559 | Report that the YYRULE is going to be reduced. | | |
560 `------------------------------------------------*/ | |
282 | 561 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
562 #if defined (__STDC__) || defined (__cplusplus) |
295 | 563 static void |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
564 yy_reduce_print (int yyrule) |
295 | 565 #else |
566 static void | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
567 yy_reduce_print (yyrule) |
295 | 568 int yyrule; |
569 #endif | |
570 { | |
571 int yyi; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
572 unsigned int yylno = yyrline[yyrule]; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
573 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
574 yyrule - 1, yylno); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
575 /* Print the symbols being reduced, and their result. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
576 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
577 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
578 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); |
295 | 579 } |
580 | |
581 # define YY_REDUCE_PRINT(Rule) \ | |
582 do { \ | |
583 if (yydebug) \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
584 yy_reduce_print (Rule); \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
585 } while (0) |
295 | 586 |
587 /* Nonzero means print parse trace. It is left uninitialized so that | |
588 multiple parsers can coexist. */ | |
589 int yydebug; | |
590 #else /* !YYDEBUG */ | |
591 # define YYDPRINTF(Args) | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
592 # define YYDSYMPRINT(Args) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
593 # define YYDSYMPRINTF(Title, Token, Value, Location) |
295 | 594 # define YY_STACK_PRINT(Bottom, Top) |
595 # define YY_REDUCE_PRINT(Rule) | |
596 #endif /* !YYDEBUG */ | |
597 | |
598 | |
599 /* YYINITDEPTH -- initial size of the parser's stacks. */ | |
600 #ifndef YYINITDEPTH | |
601 # define YYINITDEPTH 200 | |
282 | 602 #endif |
603 | |
295 | 604 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
605 if the built-in stack extension method is used). | |
282 | 606 |
295 | 607 Do not make this value too large; the results are undefined if |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
608 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) |
295 | 609 evaluated with infinite-precision integer arithmetic. */ |
282 | 610 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
611 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
612 # undef YYMAXDEPTH |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
613 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
614 |
295 | 615 #ifndef YYMAXDEPTH |
616 # define YYMAXDEPTH 10000 | |
282 | 617 #endif |
618 | |
619 | |
295 | 620 |
621 #if YYERROR_VERBOSE | |
622 | |
623 # ifndef yystrlen | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
624 # if defined (__GLIBC__) && defined (_STRING_H) |
295 | 625 # define yystrlen strlen |
626 # else | |
627 /* Return the length of YYSTR. */ | |
628 static YYSIZE_T | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
629 # if defined (__STDC__) || defined (__cplusplus) |
295 | 630 yystrlen (const char *yystr) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
631 # else |
295 | 632 yystrlen (yystr) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
633 const char *yystr; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
634 # endif |
295 | 635 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
636 register const char *yys = yystr; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
637 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
638 while (*yys++ != '\0') |
295 | 639 continue; |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
640 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
641 return yys - yystr - 1; |
295 | 642 } |
643 # endif | |
644 # endif | |
645 | |
646 # ifndef yystpcpy | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
647 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) |
295 | 648 # define yystpcpy stpcpy |
649 # else | |
650 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
651 YYDEST. */ | |
652 static char * | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
653 # if defined (__STDC__) || defined (__cplusplus) |
295 | 654 yystpcpy (char *yydest, const char *yysrc) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
655 # else |
295 | 656 yystpcpy (yydest, yysrc) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
657 char *yydest; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
658 const char *yysrc; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
659 # endif |
295 | 660 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
661 register char *yyd = yydest; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
662 register const char *yys = yysrc; |
295 | 663 |
664 while ((*yyd++ = *yys++) != '\0') | |
665 continue; | |
666 | |
667 return yyd - 1; | |
668 } | |
669 # endif | |
670 # endif | |
671 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
672 #endif /* !YYERROR_VERBOSE */ |
295 | 673 |
674 | |
675 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
676 #if YYDEBUG |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
677 /*--------------------------------. |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
678 | Print this symbol on YYOUTPUT. | |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
679 `--------------------------------*/ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
680 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
681 #if defined (__STDC__) || defined (__cplusplus) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
682 static void |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
683 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
684 #else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
685 static void |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
686 yysymprint (yyoutput, yytype, yyvaluep) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
687 FILE *yyoutput; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
688 int yytype; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
689 YYSTYPE *yyvaluep; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
690 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
691 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
692 /* Pacify ``unused variable'' warnings. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
693 (void) yyvaluep; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
694 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
695 if (yytype < YYNTOKENS) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
696 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
697 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
698 # ifdef YYPRINT |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
699 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
700 # endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
701 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
702 else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
703 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
704 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
705 switch (yytype) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
706 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
707 default: |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
708 break; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
709 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
710 YYFPRINTF (yyoutput, ")"); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
711 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
712 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
713 #endif /* ! YYDEBUG */ |
295 | 714 /*-----------------------------------------------. |
715 | Release the memory associated to this symbol. | | |
716 `-----------------------------------------------*/ | |
717 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
718 #if defined (__STDC__) || defined (__cplusplus) |
282 | 719 static void |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
720 yydestruct (int yytype, YYSTYPE *yyvaluep) |
295 | 721 #else |
722 static void | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
723 yydestruct (yytype, yyvaluep) |
295 | 724 int yytype; |
725 YYSTYPE *yyvaluep; | |
726 #endif | |
282 | 727 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
728 /* Pacify ``unused variable'' warnings. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
729 (void) yyvaluep; |
282 | 730 |
295 | 731 switch (yytype) |
732 { | |
733 | |
734 default: | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
735 break; |
295 | 736 } |
282 | 737 } |
295 | 738 |
739 | |
740 /* Prevent warnings from -Wmissing-prototypes. */ | |
282 | 741 |
295 | 742 #ifdef YYPARSE_PARAM |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
743 # if defined (__STDC__) || defined (__cplusplus) |
295 | 744 int yyparse (void *YYPARSE_PARAM); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
745 # else |
295 | 746 int yyparse (); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
747 # endif |
295 | 748 #else /* ! YYPARSE_PARAM */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
749 #if defined (__STDC__) || defined (__cplusplus) |
295 | 750 int yyparse (void); |
751 #else | |
752 int yyparse (); | |
753 #endif | |
754 #endif /* ! YYPARSE_PARAM */ | |
755 | |
2321
6b427677621f
killed a few warnings
Cristi Magherusan <majeru@atheme.org>
parents:
1978
diff
changeset
|
756 int yyerror (char *s); |
295 | 757 |
758 | |
759 | |
760 | |
282 | 761 |
295 | 762 /*----------. |
763 | yyparse. | | |
764 `----------*/ | |
282 | 765 |
295 | 766 #ifdef YYPARSE_PARAM |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
767 # if defined (__STDC__) || defined (__cplusplus) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
768 int yyparse (void *YYPARSE_PARAM) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
769 # else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
770 int yyparse (YYPARSE_PARAM) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
771 void *YYPARSE_PARAM; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
772 # endif |
295 | 773 #else /* ! YYPARSE_PARAM */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
774 #if defined (__STDC__) || defined (__cplusplus) |
295 | 775 int |
776 yyparse (void) | |
777 #else | |
778 int | |
779 yyparse () | |
282 | 780 |
781 #endif | |
782 #endif | |
295 | 783 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
784 /* The lookahead symbol. */ |
295 | 785 int yychar; |
282 | 786 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
787 /* The semantic value of the lookahead symbol. */ |
295 | 788 YYSTYPE yylval; |
789 | |
790 /* Number of syntax errors so far. */ | |
791 int yynerrs; | |
282 | 792 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
793 register int yystate; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
794 register int yyn; |
295 | 795 int yyresult; |
796 /* Number of tokens to shift before error messages enabled. */ | |
797 int yyerrstatus; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
798 /* Lookahead token as an internal (translated) token number. */ |
295 | 799 int yytoken = 0; |
282 | 800 |
295 | 801 /* Three stacks and their tools: |
802 `yyss': related to states, | |
803 `yyvs': related to semantic values, | |
804 `yyls': related to locations. | |
282 | 805 |
295 | 806 Refer to the stacks thru separate pointers, to allow yyoverflow |
807 to reallocate them elsewhere. */ | |
282 | 808 |
295 | 809 /* The state stack. */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
810 short int yyssa[YYINITDEPTH]; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
811 short int *yyss = yyssa; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
812 register short int *yyssp; |
282 | 813 |
295 | 814 /* The semantic value stack. */ |
815 YYSTYPE yyvsa[YYINITDEPTH]; | |
816 YYSTYPE *yyvs = yyvsa; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
817 register YYSTYPE *yyvsp; |
282 | 818 |
295 | 819 |
820 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
821 #define YYPOPSTACK (yyvsp--, yyssp--) |
295 | 822 |
823 YYSIZE_T yystacksize = YYINITDEPTH; | |
282 | 824 |
295 | 825 /* The variables used to return semantic value and location from the |
826 action routines. */ | |
827 YYSTYPE yyval; | |
828 | |
282 | 829 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
830 /* When reducing, the number of symbols on the RHS of the reduced |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
831 rule. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
832 int yylen; |
282 | 833 |
295 | 834 YYDPRINTF ((stderr, "Starting parse\n")); |
282 | 835 |
836 yystate = 0; | |
837 yyerrstatus = 0; | |
838 yynerrs = 0; | |
839 yychar = YYEMPTY; /* Cause a token to be read. */ | |
840 | |
841 /* Initialize stack pointers. | |
842 Waste one element of value and location stack | |
843 so that they stay on the same level as the state stack. | |
844 The wasted elements are never initialized. */ | |
845 | |
295 | 846 yyssp = yyss; |
282 | 847 yyvsp = yyvs; |
848 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
849 |
295 | 850 goto yysetstate; |
282 | 851 |
295 | 852 /*------------------------------------------------------------. |
853 | yynewstate -- Push a new state, which is found in yystate. | | |
854 `------------------------------------------------------------*/ | |
855 yynewstate: | |
856 /* In all cases, when you get here, the value and location stacks | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
857 have just been pushed. so pushing a state here evens the stacks. |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
858 */ |
295 | 859 yyssp++; |
860 | |
861 yysetstate: | |
862 *yyssp = yystate; | |
863 | |
864 if (yyss + yystacksize - 1 <= yyssp) | |
282 | 865 { |
866 /* Get the current used size of the three stacks, in elements. */ | |
295 | 867 YYSIZE_T yysize = yyssp - yyss + 1; |
282 | 868 |
869 #ifdef yyoverflow | |
295 | 870 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
871 /* Give user a chance to reallocate the stack. Use copies of |
295 | 872 these so that the &'s don't force the real ones into |
873 memory. */ | |
874 YYSTYPE *yyvs1 = yyvs; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
875 short int *yyss1 = yyss; |
295 | 876 |
282 | 877 |
295 | 878 /* Each stack pointer address is followed by the size of the |
879 data in use in that stack, in bytes. This used to be a | |
880 conditional around just the two extra args, but that might | |
881 be undefined if yyoverflow is a macro. */ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
882 yyoverflow ("parser stack overflow", |
295 | 883 &yyss1, yysize * sizeof (*yyssp), |
884 &yyvs1, yysize * sizeof (*yyvsp), | |
885 | |
886 &yystacksize); | |
887 | |
888 yyss = yyss1; | |
889 yyvs = yyvs1; | |
890 } | |
282 | 891 #else /* no yyoverflow */ |
295 | 892 # ifndef YYSTACK_RELOCATE |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
893 goto yyoverflowlab; |
295 | 894 # else |
282 | 895 /* Extend the stack our own way. */ |
295 | 896 if (YYMAXDEPTH <= yystacksize) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
897 goto yyoverflowlab; |
282 | 898 yystacksize *= 2; |
295 | 899 if (YYMAXDEPTH < yystacksize) |
282 | 900 yystacksize = YYMAXDEPTH; |
295 | 901 |
902 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
903 short int *yyss1 = yyss; |
295 | 904 union yyalloc *yyptr = |
905 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
906 if (! yyptr) | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
907 goto yyoverflowlab; |
295 | 908 YYSTACK_RELOCATE (yyss); |
909 YYSTACK_RELOCATE (yyvs); | |
910 | |
911 # undef YYSTACK_RELOCATE | |
912 if (yyss1 != yyssa) | |
913 YYSTACK_FREE (yyss1); | |
914 } | |
915 # endif | |
282 | 916 #endif /* no yyoverflow */ |
917 | |
295 | 918 yyssp = yyss + yysize - 1; |
919 yyvsp = yyvs + yysize - 1; | |
920 | |
282 | 921 |
295 | 922 YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
923 (unsigned long int) yystacksize)); | |
282 | 924 |
295 | 925 if (yyss + yystacksize - 1 <= yyssp) |
282 | 926 YYABORT; |
927 } | |
928 | |
295 | 929 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
282 | 930 |
931 goto yybackup; | |
295 | 932 |
933 /*-----------. | |
934 | yybackup. | | |
935 `-----------*/ | |
936 yybackup: | |
282 | 937 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
938 /* Do appropriate processing given the current state. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
939 /* Read a lookahead token if we need one and don't already have one. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
940 /* yyresume: */ |
282 | 941 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
942 /* First try to decide what to do without reference to lookahead token. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
943 |
282 | 944 yyn = yypact[yystate]; |
295 | 945 if (yyn == YYPACT_NINF) |
282 | 946 goto yydefault; |
947 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
948 /* Not known => get a lookahead token if don't already have one. */ |
282 | 949 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
950 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
282 | 951 if (yychar == YYEMPTY) |
952 { | |
295 | 953 YYDPRINTF ((stderr, "Reading a token: ")); |
282 | 954 yychar = YYLEX; |
955 } | |
956 | |
295 | 957 if (yychar <= YYEOF) |
282 | 958 { |
295 | 959 yychar = yytoken = YYEOF; |
960 YYDPRINTF ((stderr, "Now at end of input.\n")); | |
282 | 961 } |
962 else | |
963 { | |
295 | 964 yytoken = YYTRANSLATE (yychar); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
965 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); |
282 | 966 } |
967 | |
295 | 968 /* If the proper action on seeing token YYTOKEN is to reduce or to |
969 detect an error, take that action. */ | |
970 yyn += yytoken; | |
971 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) | |
282 | 972 goto yydefault; |
973 yyn = yytable[yyn]; | |
295 | 974 if (yyn <= 0) |
282 | 975 { |
295 | 976 if (yyn == 0 || yyn == YYTABLE_NINF) |
282 | 977 goto yyerrlab; |
978 yyn = -yyn; | |
979 goto yyreduce; | |
980 } | |
981 | |
982 if (yyn == YYFINAL) | |
983 YYACCEPT; | |
984 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
985 /* Shift the lookahead token. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
986 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
987 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
988 /* Discard the token being shifted unless it is eof. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
989 if (yychar != YYEOF) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
990 yychar = YYEMPTY; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
991 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
992 *++yyvsp = yylval; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
993 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
994 |
295 | 995 /* Count tokens shifted since error; after three, turn off error |
996 status. */ | |
997 if (yyerrstatus) | |
998 yyerrstatus--; | |
282 | 999 |
295 | 1000 yystate = yyn; |
1001 goto yynewstate; | |
1002 | |
1003 | |
1004 /*-----------------------------------------------------------. | |
1005 | yydefault -- do the default action for the current state. | | |
1006 `-----------------------------------------------------------*/ | |
1007 yydefault: | |
1008 yyn = yydefact[yystate]; | |
1009 if (yyn == 0) | |
1010 goto yyerrlab; | |
1011 goto yyreduce; | |
1012 | |
1013 | |
1014 /*-----------------------------. | |
1015 | yyreduce -- Do a reduction. | | |
1016 `-----------------------------*/ | |
1017 yyreduce: | |
1018 /* yyn is the number of a rule to reduce with. */ | |
1019 yylen = yyr2[yyn]; | |
1020 | |
1021 /* If YYLEN is nonzero, implement the default value of the action: | |
1022 `$$ = $1'. | |
1023 | |
1024 Otherwise, the following line sets YYVAL to garbage. | |
1025 This behavior is undocumented and Bison | |
1026 users should not rely upon it. Assigning to YYVAL | |
1027 unconditionally makes the parser a bit smaller, and it avoids a | |
1028 GCC warning that YYVAL may be used uninitialized. */ | |
1029 yyval = yyvsp[1-yylen]; | |
1030 | |
1031 | |
1032 YY_REDUCE_PRINT (yyn); | |
1033 switch (yyn) | |
1034 { | |
1035 case 5: | |
1036 #line 83 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1037 { ;} |
295 | 1038 break; |
1039 | |
1040 case 7: | |
1041 #line 86 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1042 { yyerrok; ;} |
295 | 1043 break; |
1044 | |
1045 case 8: | |
1046 #line 91 "parser.y" | |
1047 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1048 ;} |
295 | 1049 break; |
1050 | |
1051 case 9: | |
1052 #line 94 "parser.y" | |
1053 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1054 ;} |
295 | 1055 break; |
1056 | |
1057 case 10: | |
1058 #line 99 "parser.y" | |
1059 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1060 char *buf = g_strdup_printf ("c%f:", yyvsp[0].d_value); |
295 | 1061 GENERATE (buf); |
1062 g_free (buf); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1063 ;} |
295 | 1064 break; |
1065 | |
1066 case 11: | |
1067 #line 105 "parser.y" | |
1068 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1069 char *buf = g_strdup_printf ("l%s:", yyvsp[0].s_value); |
295 | 1070 GENERATE (buf); |
1071 g_free (buf); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1072 ;} |
295 | 1073 break; |
1074 | |
1075 case 12: | |
1076 #line 111 "parser.y" | |
1077 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1078 char *buf = g_strdup_printf ("s%s:", yyvsp[-2].s_value); |
295 | 1079 GENERATE (buf); |
1080 g_free (buf); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1081 ;} |
295 | 1082 break; |
1083 | |
1084 case 13: | |
1085 #line 117 "parser.y" | |
1086 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1087 char *buf = g_strdup_printf ("f%s:", yyvsp[-3].s_value); |
295 | 1088 GENERATE (buf); |
1089 g_free (buf); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1090 ;} |
295 | 1091 break; |
1092 | |
1093 case 14: | |
1094 #line 124 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1095 { GENERATE (">"); ;} |
295 | 1096 break; |
1097 | |
1098 case 15: | |
1099 #line 126 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1100 { GENERATE ("<"); ;} |
295 | 1101 break; |
1102 | |
1103 case 16: | |
1104 #line 129 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1105 { GENERATE ("+"); ;} |
295 | 1106 break; |
1107 | |
1108 case 17: | |
1109 #line 131 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1110 { GENERATE ("-"); ;} |
295 | 1111 break; |
1112 | |
1113 case 18: | |
1114 #line 133 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1115 { GENERATE ("*"); ;} |
295 | 1116 break; |
1117 | |
1118 case 19: | |
1119 #line 135 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1120 { GENERATE ("/"); ;} |
295 | 1121 break; |
1122 | |
1123 case 20: | |
1124 #line 137 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1125 { GENERATE ("n"); ;} |
295 | 1126 break; |
1127 | |
1128 case 21: | |
1129 #line 139 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1130 { GENERATE ("^"); ;} |
295 | 1131 break; |
1132 | |
1133 case 22: | |
1134 #line 141 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1135 { ;} |
295 | 1136 break; |
1137 | |
1138 | |
1139 } | |
1140 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1141 /* Line 1010 of yacc.c. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1142 #line 1140 "parser.c" |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1143 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1144 yyvsp -= yylen; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1145 yyssp -= yylen; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1146 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1147 |
295 | 1148 YY_STACK_PRINT (yyss, yyssp); |
1149 | |
1150 *++yyvsp = yyval; | |
1151 | |
1152 | |
1153 /* Now `shift' the result of the reduction. Determine what state | |
1154 that goes to, based on the state we popped back to and the rule | |
1155 number reduced by. */ | |
1156 | |
1157 yyn = yyr1[yyn]; | |
1158 | |
1159 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | |
1160 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
1161 yystate = yytable[yystate]; | |
1162 else | |
1163 yystate = yydefgoto[yyn - YYNTOKENS]; | |
1164 | |
1165 goto yynewstate; | |
1166 | |
1167 | |
1168 /*------------------------------------. | |
1169 | yyerrlab -- here on detecting error | | |
1170 `------------------------------------*/ | |
1171 yyerrlab: | |
1172 /* If not already recovering from an error, report this error. */ | |
1173 if (!yyerrstatus) | |
1174 { | |
1175 ++yynerrs; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1176 #if YYERROR_VERBOSE |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1177 yyn = yypact[yystate]; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1178 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1179 if (YYPACT_NINF < yyn && yyn < YYLAST) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1180 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1181 YYSIZE_T yysize = 0; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1182 int yytype = YYTRANSLATE (yychar); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1183 const char* yyprefix; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1184 char *yymsg; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1185 int yyx; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1186 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1187 /* Start YYX at -YYN if negative to avoid negative indexes in |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1188 YYCHECK. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1189 int yyxbegin = yyn < 0 ? -yyn : 0; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1190 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1191 /* Stay within bounds of both yycheck and yytname. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1192 int yychecklim = YYLAST - yyn; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1193 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1194 int yycount = 0; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1195 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1196 yyprefix = ", expecting "; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1197 for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1198 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
295 | 1199 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1200 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1201 yycount += 1; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1202 if (yycount == 5) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1203 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1204 yysize = 0; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1205 break; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1206 } |
295 | 1207 } |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1208 yysize += (sizeof ("syntax error, unexpected ") |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1209 + yystrlen (yytname[yytype])); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1210 yymsg = (char *) YYSTACK_ALLOC (yysize); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1211 if (yymsg != 0) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1212 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1213 char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1214 yyp = yystpcpy (yyp, yytname[yytype]); |
295 | 1215 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1216 if (yycount < 5) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1217 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1218 yyprefix = ", expecting "; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1219 for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1220 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1221 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1222 yyp = yystpcpy (yyp, yyprefix); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1223 yyp = yystpcpy (yyp, yytname[yyx]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1224 yyprefix = " or "; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1225 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1226 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1227 yyerror (yymsg); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1228 YYSTACK_FREE (yymsg); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1229 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1230 else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1231 yyerror ("syntax error; also virtual memory exhausted"); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1232 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1233 else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1234 #endif /* YYERROR_VERBOSE */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1235 yyerror ("syntax error"); |
295 | 1236 } |
282 | 1237 |
295 | 1238 |
1239 | |
1240 if (yyerrstatus == 3) | |
1241 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1242 /* If just tried and failed to reuse lookahead token after an |
295 | 1243 error, discard it. */ |
1244 | |
1245 if (yychar <= YYEOF) | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1246 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1247 /* If at end of input, pop the error token, |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1248 then the rest of the stack, then return failure. */ |
295 | 1249 if (yychar == YYEOF) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1250 for (;;) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1251 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1252 YYPOPSTACK; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1253 if (yyssp == yyss) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1254 YYABORT; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1255 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1256 yydestruct (yystos[*yyssp], yyvsp); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1257 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1258 } |
295 | 1259 else |
1260 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1261 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1262 yydestruct (yytoken, &yylval); |
295 | 1263 yychar = YYEMPTY; |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1264 |
295 | 1265 } |
1266 } | |
1267 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1268 /* Else will try to reuse lookahead token after shifting the error |
295 | 1269 token. */ |
1270 goto yyerrlab1; | |
1271 | |
1272 | |
1273 /*---------------------------------------------------. | |
1274 | yyerrorlab -- error raised explicitly by YYERROR. | | |
1275 `---------------------------------------------------*/ | |
1276 yyerrorlab: | |
1277 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1278 #ifdef __GNUC__ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1279 /* Pacify GCC when the user code never invokes YYERROR and the label |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1280 yyerrorlab therefore never appears in user code. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1281 if (0) |
295 | 1282 goto yyerrorlab; |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1283 #endif |
295 | 1284 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1285 yyvsp -= yylen; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1286 yyssp -= yylen; |
295 | 1287 yystate = *yyssp; |
1288 goto yyerrlab1; | |
1289 | |
1290 | |
1291 /*-------------------------------------------------------------. | |
1292 | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
1293 `-------------------------------------------------------------*/ | |
1294 yyerrlab1: | |
1295 yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
1296 | |
1297 for (;;) | |
1298 { | |
1299 yyn = yypact[yystate]; | |
1300 if (yyn != YYPACT_NINF) | |
1301 { | |
1302 yyn += YYTERROR; | |
1303 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
1304 { | |
1305 yyn = yytable[yyn]; | |
1306 if (0 < yyn) | |
1307 break; | |
1308 } | |
1309 } | |
1310 | |
1311 /* Pop the current state because it cannot handle the error token. */ | |
1312 if (yyssp == yyss) | |
1313 YYABORT; | |
1314 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1315 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1316 yydestruct (yystos[yystate], yyvsp); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1317 YYPOPSTACK; |
295 | 1318 yystate = *yyssp; |
1319 YY_STACK_PRINT (yyss, yyssp); | |
1320 } | |
1321 | |
1322 if (yyn == YYFINAL) | |
1323 YYACCEPT; | |
1324 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1325 YYDPRINTF ((stderr, "Shifting error token, ")); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1326 |
295 | 1327 *++yyvsp = yylval; |
1328 | |
1329 | |
282 | 1330 yystate = yyn; |
1331 goto yynewstate; | |
1332 | |
1333 | |
295 | 1334 /*-------------------------------------. |
1335 | yyacceptlab -- YYACCEPT comes here. | | |
1336 `-------------------------------------*/ | |
1337 yyacceptlab: | |
1338 yyresult = 0; | |
1339 goto yyreturn; | |
282 | 1340 |
295 | 1341 /*-----------------------------------. |
1342 | yyabortlab -- YYABORT comes here. | | |
1343 `-----------------------------------*/ | |
1344 yyabortlab: | |
1345 yyresult = 1; | |
1346 goto yyreturn; | |
282 | 1347 |
295 | 1348 #ifndef yyoverflow |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1349 /*----------------------------------------------. |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1350 | yyoverflowlab -- parser overflow comes here. | |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1351 `----------------------------------------------*/ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1352 yyoverflowlab: |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1353 yyerror ("parser stack overflow"); |
295 | 1354 yyresult = 2; |
1355 /* Fall through. */ | |
282 | 1356 #endif |
1357 | |
295 | 1358 yyreturn: |
1359 #ifndef yyoverflow | |
1360 if (yyss != yyssa) | |
1361 YYSTACK_FREE (yyss); | |
282 | 1362 #endif |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1363 return yyresult; |
295 | 1364 } |
282 | 1365 |
1366 | |
295 | 1367 #line 144 "parser.y" |
282 | 1368 |
1369 /* End of grammar */ | |
1370 | |
1371 /* Called by yyparse on error. */ | |
1372 int yyerror (char *s) { | |
1373 /* Ignore errors, just print a warning. */ | |
1374 g_warning ("%s\n", s); | |
1375 return 0; | |
1376 } | |
1377 | |
1378 int yylex (YYSTYPE *yylval, void *yyparam) { | |
1379 int c; | |
1380 parser_control *pc = (parser_control *) yyparam; | |
1381 | |
1382 /* Ignore whitespace, get first nonwhite character. */ | |
1978 | 1383 while ((c = aud_vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n'); |
282 | 1384 |
1385 /* End of input ? */ | |
1386 if (c == EOF) | |
1387 return 0; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1388 |
282 | 1389 /* Char starts a number => parse the number. */ |
1390 if (isdigit (c)) { | |
1978 | 1391 aud_vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */ |
282 | 1392 { |
1393 char *old_locale, *saved_locale; | |
1394 | |
1395 old_locale = setlocale (LC_ALL, NULL); | |
1396 saved_locale = g_strdup (old_locale); | |
1397 setlocale (LC_ALL, "C"); | |
2321
6b427677621f
killed a few warnings
Cristi Magherusan <majeru@atheme.org>
parents:
1978
diff
changeset
|
1398 sscanf ((const char*)((VFSBuffer *)(pc->input->handle))->iter, "%lf", &yylval->d_value); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1399 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1400 while (isdigit(c) || c == '.') |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1401 { |
1978 | 1402 c = aud_vfs_getc(pc->input); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1403 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1404 |
1978 | 1405 aud_vfs_fseek(pc->input, -1, SEEK_CUR); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1406 |
282 | 1407 setlocale (LC_ALL, saved_locale); |
1408 g_free (saved_locale); | |
1409 } | |
1410 return NUMBER; | |
1411 } | |
1412 | |
1413 /* Char starts an identifier => read the name. */ | |
1414 if (isalpha (c)) { | |
1415 GString *sym_name; | |
1416 | |
1417 sym_name = g_string_new (NULL); | |
1418 | |
1419 do { | |
1420 sym_name = g_string_append_c (sym_name, c); | |
1421 | |
1422 /* Get another character. */ | |
1978 | 1423 c = aud_vfs_getc (pc->input); |
282 | 1424 } while (c != EOF && isalnum (c)); |
1425 | |
1978 | 1426 aud_vfs_fseek (pc->input, -1, SEEK_CUR); |
282 | 1427 |
1428 yylval->s_value = sym_name->str; | |
1429 | |
1430 g_string_free (sym_name, FALSE); | |
1431 | |
1432 return NAME; | |
1433 } | |
1434 | |
1435 /* Any other character is a token by itself. */ | |
1436 return c; | |
1437 } | |
1438 | |
1439 static int load_name (char *str, char **name) { | |
1440 int count = 0; | |
1441 GString *new = g_string_new (NULL); | |
1442 | |
1443 while (*str != 0 && *str != ':') { | |
1444 g_string_append_c (new, *str++); | |
1445 count++; | |
1446 } | |
1447 | |
1448 *name = new->str; | |
1449 g_string_free (new, FALSE); | |
1450 | |
1451 return count; | |
1452 } | |
1453 | |
1454 static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict, | |
1455 char *str) { | |
1456 char op; | |
1457 double dval; | |
1458 int i; | |
1459 char *name; | |
1460 | |
1461 while ((op = *str++)) { | |
1462 switch (op) { | |
1463 case 'c': /* A constant. */ | |
1464 store_byte (expr, 'c'); | |
1465 sscanf (str, "%lf%n", &dval, &i); | |
1466 str += i; | |
1467 store_double (expr, dval); | |
1468 str++; /* Skip ';' */ | |
1469 break; | |
1470 | |
1471 case 'f': /* A function call. */ | |
1472 store_byte (expr, 'f'); | |
1473 str += load_name (str, &name); | |
1474 i = function_lookup (name); | |
1475 if (i < 0) return FALSE; /* Fail on error. */ | |
1476 store_int (expr, i); | |
1477 g_free (name); | |
1478 str++; /* Skip ';' */ | |
1479 break; | |
1480 | |
1481 case 'l': /* Load a variable. */ | |
1482 case 's': /* Store a variable. */ | |
1483 store_byte (expr, op); | |
1484 str += load_name (str, &name); | |
1485 i = dict_lookup (dict, name); | |
1486 store_int (expr, i); | |
1487 g_free (name); | |
1488 str++; /* Skip ';' */ | |
1489 break; | |
1490 | |
1491 default: /* Copy verbatim. */ | |
1492 store_byte (expr, op); | |
1493 break; | |
1494 } | |
1495 } | |
1496 | |
1497 return TRUE; | |
1498 } | |
1499 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1500 expression_t *expr_compile_string (const char* str, symbol_dict_t *dict) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1501 { |
282 | 1502 parser_control pc; |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1503 VFSFile *stream; |
282 | 1504 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1505 g_return_val_if_fail(str != NULL && dict != NULL, NULL); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1506 |
1978 | 1507 stream = aud_vfs_buffer_new_from_string ( (char *) str ); |
282 | 1508 |
1509 pc.input = stream; | |
1510 pc.expr = expr_new (); | |
1511 pc.dict = dict; | |
1512 | |
1513 if (yyparse (&pc) != 0) { | |
1514 /* Check for error. */ | |
1515 expr_free (pc.expr); | |
1516 pc.expr = NULL; | |
1517 } | |
1518 | |
1978 | 1519 aud_vfs_fclose (stream); |
282 | 1520 |
1521 return pc.expr; | |
1522 } | |
295 | 1523 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1524 |