Mercurial > audlegacy-plugins
annotate src/paranormal/libcalc/parser.c @ 1978:fa9f85cebade
s/vfs_/aud_vfs_/g
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Sun, 07 Oct 2007 00:25:33 -0500 |
parents | 17311560f45f |
children | 6b427677621f |
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 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
18 Foundation, Inc., 59 Temple Place - Suite 330, |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
19 Boston, MA 02111-1307, 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 |
295 | 492 # define YYLEX yylex (&yylval, YYLEX_PARAM) |
282 | 493 #else |
295 | 494 # define YYLEX yylex (&yylval) |
282 | 495 #endif |
496 | |
295 | 497 /* Enable debugging if requested. */ |
498 #if YYDEBUG | |
499 | |
500 # ifndef YYFPRINTF | |
501 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
502 # define YYFPRINTF fprintf | |
503 # endif | |
504 | |
505 # define YYDPRINTF(Args) \ | |
506 do { \ | |
507 if (yydebug) \ | |
508 YYFPRINTF Args; \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
509 } while (0) |
295 | 510 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
511 # define YYDSYMPRINT(Args) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
512 do { \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
513 if (yydebug) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
514 yysymprint Args; \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
515 } while (0) |
282 | 516 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
517 # define YYDSYMPRINTF(Title, Token, Value, Location) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
518 do { \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
519 if (yydebug) \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
520 { \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
521 YYFPRINTF (stderr, "%s ", Title); \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
522 yysymprint (stderr, \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
523 Token, Value); \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
524 YYFPRINTF (stderr, "\n"); \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
525 } \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
526 } while (0) |
295 | 527 |
528 /*------------------------------------------------------------------. | |
529 | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
530 | TOP (included). | | |
531 `------------------------------------------------------------------*/ | |
532 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
533 #if defined (__STDC__) || defined (__cplusplus) |
295 | 534 static void |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
535 yy_stack_print (short int *bottom, short int *top) |
295 | 536 #else |
537 static void | |
538 yy_stack_print (bottom, top) | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
539 short int *bottom; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
540 short int *top; |
295 | 541 #endif |
542 { | |
543 YYFPRINTF (stderr, "Stack now"); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
544 for (/* Nothing. */; bottom <= top; ++bottom) |
295 | 545 YYFPRINTF (stderr, " %d", *bottom); |
546 YYFPRINTF (stderr, "\n"); | |
547 } | |
548 | |
549 # define YY_STACK_PRINT(Bottom, Top) \ | |
550 do { \ | |
551 if (yydebug) \ | |
552 yy_stack_print ((Bottom), (Top)); \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
553 } while (0) |
295 | 554 |
555 | |
556 /*------------------------------------------------. | |
557 | Report that the YYRULE is going to be reduced. | | |
558 `------------------------------------------------*/ | |
282 | 559 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
560 #if defined (__STDC__) || defined (__cplusplus) |
295 | 561 static void |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
562 yy_reduce_print (int yyrule) |
295 | 563 #else |
564 static void | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
565 yy_reduce_print (yyrule) |
295 | 566 int yyrule; |
567 #endif | |
568 { | |
569 int yyi; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
570 unsigned int yylno = yyrline[yyrule]; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
571 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
|
572 yyrule - 1, yylno); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
573 /* Print the symbols being reduced, and their result. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
574 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
575 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
576 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); |
295 | 577 } |
578 | |
579 # define YY_REDUCE_PRINT(Rule) \ | |
580 do { \ | |
581 if (yydebug) \ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
582 yy_reduce_print (Rule); \ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
583 } while (0) |
295 | 584 |
585 /* Nonzero means print parse trace. It is left uninitialized so that | |
586 multiple parsers can coexist. */ | |
587 int yydebug; | |
588 #else /* !YYDEBUG */ | |
589 # define YYDPRINTF(Args) | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
590 # define YYDSYMPRINT(Args) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
591 # define YYDSYMPRINTF(Title, Token, Value, Location) |
295 | 592 # define YY_STACK_PRINT(Bottom, Top) |
593 # define YY_REDUCE_PRINT(Rule) | |
594 #endif /* !YYDEBUG */ | |
595 | |
596 | |
597 /* YYINITDEPTH -- initial size of the parser's stacks. */ | |
598 #ifndef YYINITDEPTH | |
599 # define YYINITDEPTH 200 | |
282 | 600 #endif |
601 | |
295 | 602 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
603 if the built-in stack extension method is used). | |
282 | 604 |
295 | 605 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
|
606 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) |
295 | 607 evaluated with infinite-precision integer arithmetic. */ |
282 | 608 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
609 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
610 # undef YYMAXDEPTH |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
611 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
612 |
295 | 613 #ifndef YYMAXDEPTH |
614 # define YYMAXDEPTH 10000 | |
282 | 615 #endif |
616 | |
617 | |
295 | 618 |
619 #if YYERROR_VERBOSE | |
620 | |
621 # ifndef yystrlen | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
622 # if defined (__GLIBC__) && defined (_STRING_H) |
295 | 623 # define yystrlen strlen |
624 # else | |
625 /* Return the length of YYSTR. */ | |
626 static YYSIZE_T | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
627 # if defined (__STDC__) || defined (__cplusplus) |
295 | 628 yystrlen (const char *yystr) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
629 # else |
295 | 630 yystrlen (yystr) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
631 const char *yystr; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
632 # endif |
295 | 633 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
634 register const char *yys = yystr; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
635 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
636 while (*yys++ != '\0') |
295 | 637 continue; |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
638 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
639 return yys - yystr - 1; |
295 | 640 } |
641 # endif | |
642 # endif | |
643 | |
644 # ifndef yystpcpy | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
645 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) |
295 | 646 # define yystpcpy stpcpy |
647 # else | |
648 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
649 YYDEST. */ | |
650 static char * | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
651 # if defined (__STDC__) || defined (__cplusplus) |
295 | 652 yystpcpy (char *yydest, const char *yysrc) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
653 # else |
295 | 654 yystpcpy (yydest, yysrc) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
655 char *yydest; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
656 const char *yysrc; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
657 # endif |
295 | 658 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
659 register char *yyd = yydest; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
660 register const char *yys = yysrc; |
295 | 661 |
662 while ((*yyd++ = *yys++) != '\0') | |
663 continue; | |
664 | |
665 return yyd - 1; | |
666 } | |
667 # endif | |
668 # endif | |
669 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
670 #endif /* !YYERROR_VERBOSE */ |
295 | 671 |
672 | |
673 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
674 #if YYDEBUG |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
675 /*--------------------------------. |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
676 | Print this symbol on YYOUTPUT. | |
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 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
679 #if defined (__STDC__) || defined (__cplusplus) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
680 static void |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
681 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
682 #else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
683 static void |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
684 yysymprint (yyoutput, yytype, yyvaluep) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
685 FILE *yyoutput; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
686 int yytype; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
687 YYSTYPE *yyvaluep; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
688 #endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
689 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
690 /* Pacify ``unused variable'' warnings. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
691 (void) yyvaluep; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
692 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
693 if (yytype < YYNTOKENS) |
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 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
696 # ifdef YYPRINT |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
697 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
698 # endif |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
699 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
700 else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
701 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
702 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
703 switch (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 default: |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
706 break; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
707 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
708 YYFPRINTF (yyoutput, ")"); |
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 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
711 #endif /* ! YYDEBUG */ |
295 | 712 /*-----------------------------------------------. |
713 | Release the memory associated to this symbol. | | |
714 `-----------------------------------------------*/ | |
715 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
716 #if defined (__STDC__) || defined (__cplusplus) |
282 | 717 static void |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
718 yydestruct (int yytype, YYSTYPE *yyvaluep) |
295 | 719 #else |
720 static void | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
721 yydestruct (yytype, yyvaluep) |
295 | 722 int yytype; |
723 YYSTYPE *yyvaluep; | |
724 #endif | |
282 | 725 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
726 /* Pacify ``unused variable'' warnings. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
727 (void) yyvaluep; |
282 | 728 |
295 | 729 switch (yytype) |
730 { | |
731 | |
732 default: | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
733 break; |
295 | 734 } |
282 | 735 } |
295 | 736 |
737 | |
738 /* Prevent warnings from -Wmissing-prototypes. */ | |
282 | 739 |
295 | 740 #ifdef YYPARSE_PARAM |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
741 # if defined (__STDC__) || defined (__cplusplus) |
295 | 742 int yyparse (void *YYPARSE_PARAM); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
743 # else |
295 | 744 int yyparse (); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
745 # endif |
295 | 746 #else /* ! YYPARSE_PARAM */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
747 #if defined (__STDC__) || defined (__cplusplus) |
295 | 748 int yyparse (void); |
749 #else | |
750 int yyparse (); | |
751 #endif | |
752 #endif /* ! YYPARSE_PARAM */ | |
753 | |
754 | |
755 | |
756 | |
757 | |
282 | 758 |
295 | 759 /*----------. |
760 | yyparse. | | |
761 `----------*/ | |
282 | 762 |
295 | 763 #ifdef YYPARSE_PARAM |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
764 # if defined (__STDC__) || defined (__cplusplus) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
765 int yyparse (void *YYPARSE_PARAM) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
766 # else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
767 int yyparse (YYPARSE_PARAM) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
768 void *YYPARSE_PARAM; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
769 # endif |
295 | 770 #else /* ! YYPARSE_PARAM */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
771 #if defined (__STDC__) || defined (__cplusplus) |
295 | 772 int |
773 yyparse (void) | |
774 #else | |
775 int | |
776 yyparse () | |
282 | 777 |
778 #endif | |
779 #endif | |
295 | 780 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
781 /* The lookahead symbol. */ |
295 | 782 int yychar; |
282 | 783 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
784 /* The semantic value of the lookahead symbol. */ |
295 | 785 YYSTYPE yylval; |
786 | |
787 /* Number of syntax errors so far. */ | |
788 int yynerrs; | |
282 | 789 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
790 register int yystate; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
791 register int yyn; |
295 | 792 int yyresult; |
793 /* Number of tokens to shift before error messages enabled. */ | |
794 int yyerrstatus; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
795 /* Lookahead token as an internal (translated) token number. */ |
295 | 796 int yytoken = 0; |
282 | 797 |
295 | 798 /* Three stacks and their tools: |
799 `yyss': related to states, | |
800 `yyvs': related to semantic values, | |
801 `yyls': related to locations. | |
282 | 802 |
295 | 803 Refer to the stacks thru separate pointers, to allow yyoverflow |
804 to reallocate them elsewhere. */ | |
282 | 805 |
295 | 806 /* The state stack. */ |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
807 short int yyssa[YYINITDEPTH]; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
808 short int *yyss = yyssa; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
809 register short int *yyssp; |
282 | 810 |
295 | 811 /* The semantic value stack. */ |
812 YYSTYPE yyvsa[YYINITDEPTH]; | |
813 YYSTYPE *yyvs = yyvsa; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
814 register YYSTYPE *yyvsp; |
282 | 815 |
295 | 816 |
817 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
818 #define YYPOPSTACK (yyvsp--, yyssp--) |
295 | 819 |
820 YYSIZE_T yystacksize = YYINITDEPTH; | |
282 | 821 |
295 | 822 /* The variables used to return semantic value and location from the |
823 action routines. */ | |
824 YYSTYPE yyval; | |
825 | |
282 | 826 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
827 /* 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
|
828 rule. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
829 int yylen; |
282 | 830 |
295 | 831 YYDPRINTF ((stderr, "Starting parse\n")); |
282 | 832 |
833 yystate = 0; | |
834 yyerrstatus = 0; | |
835 yynerrs = 0; | |
836 yychar = YYEMPTY; /* Cause a token to be read. */ | |
837 | |
838 /* Initialize stack pointers. | |
839 Waste one element of value and location stack | |
840 so that they stay on the same level as the state stack. | |
841 The wasted elements are never initialized. */ | |
842 | |
295 | 843 yyssp = yyss; |
282 | 844 yyvsp = yyvs; |
845 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
846 |
295 | 847 goto yysetstate; |
282 | 848 |
295 | 849 /*------------------------------------------------------------. |
850 | yynewstate -- Push a new state, which is found in yystate. | | |
851 `------------------------------------------------------------*/ | |
852 yynewstate: | |
853 /* 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
|
854 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
|
855 */ |
295 | 856 yyssp++; |
857 | |
858 yysetstate: | |
859 *yyssp = yystate; | |
860 | |
861 if (yyss + yystacksize - 1 <= yyssp) | |
282 | 862 { |
863 /* Get the current used size of the three stacks, in elements. */ | |
295 | 864 YYSIZE_T yysize = yyssp - yyss + 1; |
282 | 865 |
866 #ifdef yyoverflow | |
295 | 867 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
868 /* Give user a chance to reallocate the stack. Use copies of |
295 | 869 these so that the &'s don't force the real ones into |
870 memory. */ | |
871 YYSTYPE *yyvs1 = yyvs; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
872 short int *yyss1 = yyss; |
295 | 873 |
282 | 874 |
295 | 875 /* Each stack pointer address is followed by the size of the |
876 data in use in that stack, in bytes. This used to be a | |
877 conditional around just the two extra args, but that might | |
878 be undefined if yyoverflow is a macro. */ | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
879 yyoverflow ("parser stack overflow", |
295 | 880 &yyss1, yysize * sizeof (*yyssp), |
881 &yyvs1, yysize * sizeof (*yyvsp), | |
882 | |
883 &yystacksize); | |
884 | |
885 yyss = yyss1; | |
886 yyvs = yyvs1; | |
887 } | |
282 | 888 #else /* no yyoverflow */ |
295 | 889 # ifndef YYSTACK_RELOCATE |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
890 goto yyoverflowlab; |
295 | 891 # else |
282 | 892 /* Extend the stack our own way. */ |
295 | 893 if (YYMAXDEPTH <= yystacksize) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
894 goto yyoverflowlab; |
282 | 895 yystacksize *= 2; |
295 | 896 if (YYMAXDEPTH < yystacksize) |
282 | 897 yystacksize = YYMAXDEPTH; |
295 | 898 |
899 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
900 short int *yyss1 = yyss; |
295 | 901 union yyalloc *yyptr = |
902 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
903 if (! yyptr) | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
904 goto yyoverflowlab; |
295 | 905 YYSTACK_RELOCATE (yyss); |
906 YYSTACK_RELOCATE (yyvs); | |
907 | |
908 # undef YYSTACK_RELOCATE | |
909 if (yyss1 != yyssa) | |
910 YYSTACK_FREE (yyss1); | |
911 } | |
912 # endif | |
282 | 913 #endif /* no yyoverflow */ |
914 | |
295 | 915 yyssp = yyss + yysize - 1; |
916 yyvsp = yyvs + yysize - 1; | |
917 | |
282 | 918 |
295 | 919 YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
920 (unsigned long int) yystacksize)); | |
282 | 921 |
295 | 922 if (yyss + yystacksize - 1 <= yyssp) |
282 | 923 YYABORT; |
924 } | |
925 | |
295 | 926 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
282 | 927 |
928 goto yybackup; | |
295 | 929 |
930 /*-----------. | |
931 | yybackup. | | |
932 `-----------*/ | |
933 yybackup: | |
282 | 934 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
935 /* Do appropriate processing given the current state. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
936 /* 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
|
937 /* yyresume: */ |
282 | 938 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
939 /* 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
|
940 |
282 | 941 yyn = yypact[yystate]; |
295 | 942 if (yyn == YYPACT_NINF) |
282 | 943 goto yydefault; |
944 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
945 /* Not known => get a lookahead token if don't already have one. */ |
282 | 946 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
947 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
282 | 948 if (yychar == YYEMPTY) |
949 { | |
295 | 950 YYDPRINTF ((stderr, "Reading a token: ")); |
282 | 951 yychar = YYLEX; |
952 } | |
953 | |
295 | 954 if (yychar <= YYEOF) |
282 | 955 { |
295 | 956 yychar = yytoken = YYEOF; |
957 YYDPRINTF ((stderr, "Now at end of input.\n")); | |
282 | 958 } |
959 else | |
960 { | |
295 | 961 yytoken = YYTRANSLATE (yychar); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
962 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); |
282 | 963 } |
964 | |
295 | 965 /* If the proper action on seeing token YYTOKEN is to reduce or to |
966 detect an error, take that action. */ | |
967 yyn += yytoken; | |
968 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) | |
282 | 969 goto yydefault; |
970 yyn = yytable[yyn]; | |
295 | 971 if (yyn <= 0) |
282 | 972 { |
295 | 973 if (yyn == 0 || yyn == YYTABLE_NINF) |
282 | 974 goto yyerrlab; |
975 yyn = -yyn; | |
976 goto yyreduce; | |
977 } | |
978 | |
979 if (yyn == YYFINAL) | |
980 YYACCEPT; | |
981 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
982 /* Shift the lookahead token. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
983 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
984 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
985 /* 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
|
986 if (yychar != YYEOF) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
987 yychar = YYEMPTY; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
988 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
989 *++yyvsp = yylval; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
990 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
991 |
295 | 992 /* Count tokens shifted since error; after three, turn off error |
993 status. */ | |
994 if (yyerrstatus) | |
995 yyerrstatus--; | |
282 | 996 |
295 | 997 yystate = yyn; |
998 goto yynewstate; | |
999 | |
1000 | |
1001 /*-----------------------------------------------------------. | |
1002 | yydefault -- do the default action for the current state. | | |
1003 `-----------------------------------------------------------*/ | |
1004 yydefault: | |
1005 yyn = yydefact[yystate]; | |
1006 if (yyn == 0) | |
1007 goto yyerrlab; | |
1008 goto yyreduce; | |
1009 | |
1010 | |
1011 /*-----------------------------. | |
1012 | yyreduce -- Do a reduction. | | |
1013 `-----------------------------*/ | |
1014 yyreduce: | |
1015 /* yyn is the number of a rule to reduce with. */ | |
1016 yylen = yyr2[yyn]; | |
1017 | |
1018 /* If YYLEN is nonzero, implement the default value of the action: | |
1019 `$$ = $1'. | |
1020 | |
1021 Otherwise, the following line sets YYVAL to garbage. | |
1022 This behavior is undocumented and Bison | |
1023 users should not rely upon it. Assigning to YYVAL | |
1024 unconditionally makes the parser a bit smaller, and it avoids a | |
1025 GCC warning that YYVAL may be used uninitialized. */ | |
1026 yyval = yyvsp[1-yylen]; | |
1027 | |
1028 | |
1029 YY_REDUCE_PRINT (yyn); | |
1030 switch (yyn) | |
1031 { | |
1032 case 5: | |
1033 #line 83 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1034 { ;} |
295 | 1035 break; |
1036 | |
1037 case 7: | |
1038 #line 86 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1039 { yyerrok; ;} |
295 | 1040 break; |
1041 | |
1042 case 8: | |
1043 #line 91 "parser.y" | |
1044 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1045 ;} |
295 | 1046 break; |
1047 | |
1048 case 9: | |
1049 #line 94 "parser.y" | |
1050 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1051 ;} |
295 | 1052 break; |
1053 | |
1054 case 10: | |
1055 #line 99 "parser.y" | |
1056 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1057 char *buf = g_strdup_printf ("c%f:", yyvsp[0].d_value); |
295 | 1058 GENERATE (buf); |
1059 g_free (buf); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1060 ;} |
295 | 1061 break; |
1062 | |
1063 case 11: | |
1064 #line 105 "parser.y" | |
1065 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1066 char *buf = g_strdup_printf ("l%s:", yyvsp[0].s_value); |
295 | 1067 GENERATE (buf); |
1068 g_free (buf); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1069 ;} |
295 | 1070 break; |
1071 | |
1072 case 12: | |
1073 #line 111 "parser.y" | |
1074 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1075 char *buf = g_strdup_printf ("s%s:", yyvsp[-2].s_value); |
295 | 1076 GENERATE (buf); |
1077 g_free (buf); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1078 ;} |
295 | 1079 break; |
1080 | |
1081 case 13: | |
1082 #line 117 "parser.y" | |
1083 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1084 char *buf = g_strdup_printf ("f%s:", yyvsp[-3].s_value); |
295 | 1085 GENERATE (buf); |
1086 g_free (buf); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1087 ;} |
295 | 1088 break; |
1089 | |
1090 case 14: | |
1091 #line 124 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1092 { GENERATE (">"); ;} |
295 | 1093 break; |
1094 | |
1095 case 15: | |
1096 #line 126 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1097 { GENERATE ("<"); ;} |
295 | 1098 break; |
1099 | |
1100 case 16: | |
1101 #line 129 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1102 { GENERATE ("+"); ;} |
295 | 1103 break; |
1104 | |
1105 case 17: | |
1106 #line 131 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1107 { GENERATE ("-"); ;} |
295 | 1108 break; |
1109 | |
1110 case 18: | |
1111 #line 133 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1112 { GENERATE ("*"); ;} |
295 | 1113 break; |
1114 | |
1115 case 19: | |
1116 #line 135 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1117 { GENERATE ("/"); ;} |
295 | 1118 break; |
1119 | |
1120 case 20: | |
1121 #line 137 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1122 { GENERATE ("n"); ;} |
295 | 1123 break; |
1124 | |
1125 case 21: | |
1126 #line 139 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1127 { GENERATE ("^"); ;} |
295 | 1128 break; |
1129 | |
1130 case 22: | |
1131 #line 141 "parser.y" | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1132 { ;} |
295 | 1133 break; |
1134 | |
1135 | |
1136 } | |
1137 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1138 /* Line 1010 of yacc.c. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1139 #line 1140 "parser.c" |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1140 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1141 yyvsp -= yylen; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1142 yyssp -= yylen; |
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 |
295 | 1145 YY_STACK_PRINT (yyss, yyssp); |
1146 | |
1147 *++yyvsp = yyval; | |
1148 | |
1149 | |
1150 /* Now `shift' the result of the reduction. Determine what state | |
1151 that goes to, based on the state we popped back to and the rule | |
1152 number reduced by. */ | |
1153 | |
1154 yyn = yyr1[yyn]; | |
1155 | |
1156 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | |
1157 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
1158 yystate = yytable[yystate]; | |
1159 else | |
1160 yystate = yydefgoto[yyn - YYNTOKENS]; | |
1161 | |
1162 goto yynewstate; | |
1163 | |
1164 | |
1165 /*------------------------------------. | |
1166 | yyerrlab -- here on detecting error | | |
1167 `------------------------------------*/ | |
1168 yyerrlab: | |
1169 /* If not already recovering from an error, report this error. */ | |
1170 if (!yyerrstatus) | |
1171 { | |
1172 ++yynerrs; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1173 #if YYERROR_VERBOSE |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1174 yyn = yypact[yystate]; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1175 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1176 if (YYPACT_NINF < yyn && yyn < YYLAST) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1177 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1178 YYSIZE_T yysize = 0; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1179 int yytype = YYTRANSLATE (yychar); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1180 const char* yyprefix; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1181 char *yymsg; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1182 int yyx; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1183 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1184 /* 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
|
1185 YYCHECK. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1186 int yyxbegin = yyn < 0 ? -yyn : 0; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1187 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1188 /* Stay within bounds of both yycheck and yytname. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1189 int yychecklim = YYLAST - yyn; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1190 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1191 int yycount = 0; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1192 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1193 yyprefix = ", expecting "; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1194 for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1195 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
295 | 1196 { |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1197 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1198 yycount += 1; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1199 if (yycount == 5) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1200 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1201 yysize = 0; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1202 break; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1203 } |
295 | 1204 } |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1205 yysize += (sizeof ("syntax error, unexpected ") |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1206 + yystrlen (yytname[yytype])); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1207 yymsg = (char *) YYSTACK_ALLOC (yysize); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1208 if (yymsg != 0) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1209 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1210 char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1211 yyp = yystpcpy (yyp, yytname[yytype]); |
295 | 1212 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1213 if (yycount < 5) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1214 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1215 yyprefix = ", expecting "; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1216 for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1217 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1218 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1219 yyp = yystpcpy (yyp, yyprefix); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1220 yyp = yystpcpy (yyp, yytname[yyx]); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1221 yyprefix = " or "; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1222 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1223 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1224 yyerror (yymsg); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1225 YYSTACK_FREE (yymsg); |
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 else |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1228 yyerror ("syntax error; also virtual memory exhausted"); |
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 #endif /* YYERROR_VERBOSE */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1232 yyerror ("syntax error"); |
295 | 1233 } |
282 | 1234 |
295 | 1235 |
1236 | |
1237 if (yyerrstatus == 3) | |
1238 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1239 /* If just tried and failed to reuse lookahead token after an |
295 | 1240 error, discard it. */ |
1241 | |
1242 if (yychar <= YYEOF) | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1243 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1244 /* 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
|
1245 then the rest of the stack, then return failure. */ |
295 | 1246 if (yychar == YYEOF) |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1247 for (;;) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1248 { |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1249 YYPOPSTACK; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1250 if (yyssp == yyss) |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1251 YYABORT; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1252 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1253 yydestruct (yystos[*yyssp], yyvsp); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1254 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1255 } |
295 | 1256 else |
1257 { | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1258 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1259 yydestruct (yytoken, &yylval); |
295 | 1260 yychar = YYEMPTY; |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1261 |
295 | 1262 } |
1263 } | |
1264 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1265 /* Else will try to reuse lookahead token after shifting the error |
295 | 1266 token. */ |
1267 goto yyerrlab1; | |
1268 | |
1269 | |
1270 /*---------------------------------------------------. | |
1271 | yyerrorlab -- error raised explicitly by YYERROR. | | |
1272 `---------------------------------------------------*/ | |
1273 yyerrorlab: | |
1274 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1275 #ifdef __GNUC__ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1276 /* 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
|
1277 yyerrorlab therefore never appears in user code. */ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1278 if (0) |
295 | 1279 goto yyerrorlab; |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1280 #endif |
295 | 1281 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1282 yyvsp -= yylen; |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1283 yyssp -= yylen; |
295 | 1284 yystate = *yyssp; |
1285 goto yyerrlab1; | |
1286 | |
1287 | |
1288 /*-------------------------------------------------------------. | |
1289 | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
1290 `-------------------------------------------------------------*/ | |
1291 yyerrlab1: | |
1292 yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
1293 | |
1294 for (;;) | |
1295 { | |
1296 yyn = yypact[yystate]; | |
1297 if (yyn != YYPACT_NINF) | |
1298 { | |
1299 yyn += YYTERROR; | |
1300 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
1301 { | |
1302 yyn = yytable[yyn]; | |
1303 if (0 < yyn) | |
1304 break; | |
1305 } | |
1306 } | |
1307 | |
1308 /* Pop the current state because it cannot handle the error token. */ | |
1309 if (yyssp == yyss) | |
1310 YYABORT; | |
1311 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1312 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1313 yydestruct (yystos[yystate], yyvsp); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1314 YYPOPSTACK; |
295 | 1315 yystate = *yyssp; |
1316 YY_STACK_PRINT (yyss, yyssp); | |
1317 } | |
1318 | |
1319 if (yyn == YYFINAL) | |
1320 YYACCEPT; | |
1321 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1322 YYDPRINTF ((stderr, "Shifting error token, ")); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1323 |
295 | 1324 *++yyvsp = yylval; |
1325 | |
1326 | |
282 | 1327 yystate = yyn; |
1328 goto yynewstate; | |
1329 | |
1330 | |
295 | 1331 /*-------------------------------------. |
1332 | yyacceptlab -- YYACCEPT comes here. | | |
1333 `-------------------------------------*/ | |
1334 yyacceptlab: | |
1335 yyresult = 0; | |
1336 goto yyreturn; | |
282 | 1337 |
295 | 1338 /*-----------------------------------. |
1339 | yyabortlab -- YYABORT comes here. | | |
1340 `-----------------------------------*/ | |
1341 yyabortlab: | |
1342 yyresult = 1; | |
1343 goto yyreturn; | |
282 | 1344 |
295 | 1345 #ifndef yyoverflow |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1346 /*----------------------------------------------. |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1347 | yyoverflowlab -- parser overflow comes here. | |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1348 `----------------------------------------------*/ |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1349 yyoverflowlab: |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1350 yyerror ("parser stack overflow"); |
295 | 1351 yyresult = 2; |
1352 /* Fall through. */ | |
282 | 1353 #endif |
1354 | |
295 | 1355 yyreturn: |
1356 #ifndef yyoverflow | |
1357 if (yyss != yyssa) | |
1358 YYSTACK_FREE (yyss); | |
282 | 1359 #endif |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1360 return yyresult; |
295 | 1361 } |
282 | 1362 |
1363 | |
295 | 1364 #line 144 "parser.y" |
282 | 1365 |
1366 /* End of grammar */ | |
1367 | |
1368 /* Called by yyparse on error. */ | |
1369 int yyerror (char *s) { | |
1370 /* Ignore errors, just print a warning. */ | |
1371 g_warning ("%s\n", s); | |
1372 return 0; | |
1373 } | |
1374 | |
1375 int yylex (YYSTYPE *yylval, void *yyparam) { | |
1376 int c; | |
1377 parser_control *pc = (parser_control *) yyparam; | |
1378 | |
1379 /* Ignore whitespace, get first nonwhite character. */ | |
1978 | 1380 while ((c = aud_vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n'); |
282 | 1381 |
1382 /* End of input ? */ | |
1383 if (c == EOF) | |
1384 return 0; | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1385 |
282 | 1386 /* Char starts a number => parse the number. */ |
1387 if (isdigit (c)) { | |
1978 | 1388 aud_vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */ |
282 | 1389 { |
1390 char *old_locale, *saved_locale; | |
1391 | |
1392 old_locale = setlocale (LC_ALL, NULL); | |
1393 saved_locale = g_strdup (old_locale); | |
1394 setlocale (LC_ALL, "C"); | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1395 sscanf (((VFSBuffer *)(pc->input->handle))->iter, "%lf", &yylval->d_value); |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1396 |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1397 while (isdigit(c) || c == '.') |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1398 { |
1978 | 1399 c = aud_vfs_getc(pc->input); |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1400 } |
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1401 |
1978 | 1402 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
|
1403 |
282 | 1404 setlocale (LC_ALL, saved_locale); |
1405 g_free (saved_locale); | |
1406 } | |
1407 return NUMBER; | |
1408 } | |
1409 | |
1410 /* Char starts an identifier => read the name. */ | |
1411 if (isalpha (c)) { | |
1412 GString *sym_name; | |
1413 | |
1414 sym_name = g_string_new (NULL); | |
1415 | |
1416 do { | |
1417 sym_name = g_string_append_c (sym_name, c); | |
1418 | |
1419 /* Get another character. */ | |
1978 | 1420 c = aud_vfs_getc (pc->input); |
282 | 1421 } while (c != EOF && isalnum (c)); |
1422 | |
1978 | 1423 aud_vfs_fseek (pc->input, -1, SEEK_CUR); |
282 | 1424 |
1425 yylval->s_value = sym_name->str; | |
1426 | |
1427 g_string_free (sym_name, FALSE); | |
1428 | |
1429 return NAME; | |
1430 } | |
1431 | |
1432 /* Any other character is a token by itself. */ | |
1433 return c; | |
1434 } | |
1435 | |
1436 static int load_name (char *str, char **name) { | |
1437 int count = 0; | |
1438 GString *new = g_string_new (NULL); | |
1439 | |
1440 while (*str != 0 && *str != ':') { | |
1441 g_string_append_c (new, *str++); | |
1442 count++; | |
1443 } | |
1444 | |
1445 *name = new->str; | |
1446 g_string_free (new, FALSE); | |
1447 | |
1448 return count; | |
1449 } | |
1450 | |
1451 static gboolean expr_add_compile (expression_t *expr, symbol_dict_t *dict, | |
1452 char *str) { | |
1453 char op; | |
1454 double dval; | |
1455 int i; | |
1456 char *name; | |
1457 | |
1458 while ((op = *str++)) { | |
1459 switch (op) { | |
1460 case 'c': /* A constant. */ | |
1461 store_byte (expr, 'c'); | |
1462 sscanf (str, "%lf%n", &dval, &i); | |
1463 str += i; | |
1464 store_double (expr, dval); | |
1465 str++; /* Skip ';' */ | |
1466 break; | |
1467 | |
1468 case 'f': /* A function call. */ | |
1469 store_byte (expr, 'f'); | |
1470 str += load_name (str, &name); | |
1471 i = function_lookup (name); | |
1472 if (i < 0) return FALSE; /* Fail on error. */ | |
1473 store_int (expr, i); | |
1474 g_free (name); | |
1475 str++; /* Skip ';' */ | |
1476 break; | |
1477 | |
1478 case 'l': /* Load a variable. */ | |
1479 case 's': /* Store a variable. */ | |
1480 store_byte (expr, op); | |
1481 str += load_name (str, &name); | |
1482 i = dict_lookup (dict, name); | |
1483 store_int (expr, i); | |
1484 g_free (name); | |
1485 str++; /* Skip ';' */ | |
1486 break; | |
1487 | |
1488 default: /* Copy verbatim. */ | |
1489 store_byte (expr, op); | |
1490 break; | |
1491 } | |
1492 } | |
1493 | |
1494 return TRUE; | |
1495 } | |
1496 | |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1497 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
|
1498 { |
282 | 1499 parser_control pc; |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1500 VFSFile *stream; |
282 | 1501 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1502 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
|
1503 |
1978 | 1504 stream = aud_vfs_buffer_new_from_string ( (char *) str ); |
282 | 1505 |
1506 pc.input = stream; | |
1507 pc.expr = expr_new (); | |
1508 pc.dict = dict; | |
1509 | |
1510 if (yyparse (&pc) != 0) { | |
1511 /* Check for error. */ | |
1512 expr_free (pc.expr); | |
1513 pc.expr = NULL; | |
1514 } | |
1515 | |
1978 | 1516 aud_vfs_fclose (stream); |
282 | 1517 |
1518 return pc.expr; | |
1519 } | |
295 | 1520 |
342
17311560f45f
[svn] - port from fmemopen() to vfs_buffer_new_from_string().
nenolod
parents:
295
diff
changeset
|
1521 |