Diffstat (limited to 'libical/src/libicalss/icalssyacc.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libical/src/libicalss/icalssyacc.c | 270 |
1 files changed, 144 insertions, 126 deletions
diff --git a/libical/src/libicalss/icalssyacc.c b/libical/src/libicalss/icalssyacc.c index 943123e..3d8cdc1 100644 --- a/libical/src/libicalss/icalssyacc.c +++ b/libical/src/libicalss/icalssyacc.c | |||
@@ -1,418 +1,404 @@ | |||
1 | /* A Bison parser, made from icalssyacc.y | 1 | /* A Bison parser, made from icalssyacc.y |
2 | by GNU bison 1.35. */ | 2 | by GNU bison 1.34. */ |
3 | 3 | ||
4 | #define YYBISON 1 /* Identify Bison output. */ | 4 | #define YYBISON 1 /* Identify Bison output. */ |
5 | 5 | ||
6 | #define yyparse ssparse | 6 | #define yyparse ssparse |
7 | #define yylex sslex | 7 | #define yylex sslex |
8 | #define yyerror sserror | 8 | #define yyerror sserror |
9 | #define yylval sslval | 9 | #define yylval sslval |
10 | #define yychar sschar | 10 | #define yychar sschar |
11 | #define yydebug ssdebug | 11 | #define yydebug ssdebug |
12 | #define yynerrs ssnerrs | 12 | #define yynerrs ssnerrs |
13 | # define STRING257 | 13 | # define STRING257 |
14 | # define SELECT258 | 14 | # define SELECT258 |
15 | # define FROM259 | 15 | # define FROM259 |
16 | # define WHERE260 | 16 | # define WHERE260 |
17 | # define COMMA261 | 17 | # define COMMA261 |
18 | # define QUOTE262 | 18 | # define QUOTE262 |
19 | # define EQUALS263 | 19 | # define EQUALS263 |
20 | # define NOTEQUALS264 | 20 | # define NOTEQUALS264 |
21 | # define LESS265 | 21 | # define LESS265 |
22 | # define GREATER266 | 22 | # define GREATER266 |
23 | # define LESSEQUALS267 | 23 | # define LESSEQUALS267 |
24 | # define GREATEREQUALS268 | 24 | # define GREATEREQUALS268 |
25 | # define AND269 | 25 | # define AND269 |
26 | # define OR270 | 26 | # define OR270 |
27 | # define EOL271 | 27 | # define EOL271 |
28 | # define END272 | 28 | # define END272 |
29 | # define IS273 | ||
30 | # define NOT274 | ||
31 | # define SQLNULL275 | ||
29 | 32 | ||
30 | #line 1 "icalssyacc.y" | 33 | #line 3 "icalssyacc.y" |
31 | 34 | ||
32 | /* -*- Mode: C -*- | 35 | /* -*- Mode: C -*- |
33 | ====================================================================== | 36 | ====================================================================== |
34 | FILE: icalssyacc.y | 37 | FILE: icalssyacc.y |
35 | CREATOR: eric 08 Aug 2000 | 38 | CREATOR: eric 08 Aug 2000 |
36 | 39 | ||
37 | DESCRIPTION: | 40 | DESCRIPTION: |
38 | 41 | ||
39 | $Id$ | 42 | $Id$ |
40 | $Locker$ | 43 | $Locker$ |
41 | 44 | ||
42 | (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org | 45 | (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org |
43 | 46 | ||
44 | This program is free software; you can redistribute it and/or modify | 47 | This program is free software; you can redistribute it and/or modify |
45 | it under the terms of either: | 48 | it under the terms of either: |
46 | 49 | ||
47 | The LGPL as published by the Free Software Foundation, version | 50 | The LGPL as published by the Free Software Foundation, version |
48 | 2.1, available at: http://www.fsf.org/copyleft/lesser.html | 51 | 2.1, available at: http://www.fsf.org/copyleft/lesser.html |
49 | 52 | ||
50 | Or: | 53 | Or: |
51 | 54 | ||
52 | The Mozilla Public License Version 1.0. You may obtain a copy of | 55 | The Mozilla Public License Version 1.0. You may obtain a copy of |
53 | the License at http://www.mozilla.org/MPL/ | 56 | the License at http://www.mozilla.org/MPL/ |
54 | 57 | ||
55 | The Original Code is eric. The Initial Developer of the Original | 58 | The Original Code is eric. The Initial Developer of the Original |
56 | Code is Eric Busboom | 59 | Code is Eric Busboom |
57 | 60 | ||
58 | ======================================================================*/ | 61 | ======================================================================*/ |
59 | 62 | /*#define YYDEBUG 1*/ | |
60 | #include <stdlib.h> | 63 | #include <stdlib.h> |
61 | #include <string.h> /* for strdup() */ | 64 | #include <string.h> /* for strdup() */ |
62 | #include <limits.h> /* for SHRT_MAX*/ | 65 | #include <limits.h> /* for SHRT_MAX*/ |
63 | #include "ical.h" | 66 | #include "ical.h" |
64 | #include "pvl.h" | ||
65 | #include "icalgauge.h" | 67 | #include "icalgauge.h" |
66 | #include "icalgaugeimpl.h" | 68 | #include "icalgaugeimpl.h" |
67 | 69 | ||
68 | 70 | ||
69 | extern struct icalgauge_impl *icalss_yy_gauge; | 71 | #define YYPARSE_PARAM yy_globals |
70 | 72 | #define YYLEX_PARAM yy_globals | |
71 | void ssyacc_add_where(struct icalgauge_impl* impl, char* prop, | 73 | #define YY_EXTRA_TYPE icalgauge_impl* |
72 | icalgaugecompare compare , char* value); | 74 | /* ick...*/ |
73 | void ssyacc_add_select(struct icalgauge_impl* impl, char* str1); | 75 | #define yyextra ((struct icalgauge_impl*)ssget_extra(yy_globals)) |
74 | void ssyacc_add_from(struct icalgauge_impl* impl, char* str1); | ||
75 | void set_logic(struct icalgauge_impl* impl,icalgaugelogic l); | ||
76 | void sserror(char *s); /* Don't know why I need this.... */ | ||
77 | 76 | ||
78 | 77 | ||
78 | static void ssyacc_add_where(struct icalgauge_impl* impl, char* prop, | ||
79 | icalgaugecompare compare , char* value); | ||
80 | static void ssyacc_add_select(struct icalgauge_impl* impl, char* str1); | ||
81 | static void ssyacc_add_from(struct icalgauge_impl* impl, char* str1); | ||
82 | static void set_logic(struct icalgauge_impl* impl,icalgaugelogic l); | ||
83 | void sserror(char *s); /* Don't know why I need this.... */ | ||
79 | 84 | ||
80 | 85 | ||
81 | #line 52 "icalssyacc.y" | 86 | #line 56 "icalssyacc.y" |
82 | #ifndef YYSTYPE | 87 | #ifndef YYSTYPE |
83 | typedef union { | 88 | typedef union { |
84 | char* v_string; | 89 | char* v_string; |
85 | } yystype; | 90 | } yystype; |
86 | # define YYSTYPE yystype | 91 | # define YYSTYPE yystype |
87 | # define YYSTYPE_IS_TRIVIAL 1 | ||
88 | #endif | 92 | #endif |
89 | #ifndef YYDEBUG | 93 | #ifndef YYDEBUG |
90 | # define YYDEBUG 0 | 94 | # define YYDEBUG 0 |
91 | #endif | 95 | #endif |
92 | 96 | ||
93 | 97 | ||
94 | 98 | ||
95 | #define YYFINAL 34 | 99 | #define YYFINAL 38 |
96 | #define YYFLAG -32768 | 100 | #define YYFLAG -32768 |
97 | #define YYNTBASE19 | 101 | #define YYNTBASE22 |
98 | 102 | ||
99 | /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ | 103 | /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ |
100 | #define YYTRANSLATE(x) ((unsigned)(x) <= 272 ? yytranslate[x] : 24) | 104 | #define YYTRANSLATE(x) ((unsigned)(x) <= 275 ? yytranslate[x] : 27) |
101 | 105 | ||
102 | /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ | 106 | /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ |
103 | static const char yytranslate[] = | 107 | static const char yytranslate[] = |
104 | { | 108 | { |
105 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 109 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
106 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 110 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
107 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 111 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
108 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 112 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
109 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 113 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
110 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 114 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
111 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 115 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
112 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 116 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
113 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 117 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
114 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 118 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
115 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 119 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
116 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 120 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
117 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 121 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
118 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 122 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
119 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 123 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
120 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 124 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
121 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 125 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
122 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 126 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
123 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 127 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
124 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 128 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
125 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 129 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
126 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 130 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
127 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 131 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
128 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 132 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
129 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 133 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
130 | 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, | 134 | 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, |
131 | 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | 135 | 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
132 | 16, 17, 18 | 136 | 16, 17, 18, 19, 20, 21 |
133 | }; | 137 | }; |
134 | 138 | ||
135 | #if YYDEBUG | 139 | #if YYDEBUG |
136 | static const short yyprhs[] = | 140 | static const short yyprhs[] = |
137 | { | 141 | { |
138 | 0, 0, 7, 9, 11, 15, 17, 21, 22, 26, | 142 | 0, 0, 7, 12, 14, 16, 20, 22, 26, 27, |
139 | 30, 34, 38, 42, 46, 48, 52 | 143 | 31, 35, 40, 44, 48, 52, 56, 60, 62, 66 |
140 | }; | 144 | }; |
141 | static const short yyrhs[] = | 145 | static const short yyrhs[] = |
142 | { | 146 | { |
143 | 4, 20, 5, 21, 6, 23, 0, 1, 0, 3, | 147 | 4, 23, 5, 24, 6, 26, 0, 4, 23, 5, |
144 | 0, 20, 7, 3, 0, 3, 0, 21, 7, 3, | 148 | 24, 0, 1, 0, 3, 0, 23, 7, 3, 0, |
145 | 0, 0, 3, 9, 3, 0, 3, 10, 3, 0, | 149 | 3, 0, 24, 7, 3, 0, 0, 3, 9, 3, |
146 | 3, 11, 3, 0, 3, 12, 3, 0, 3, 13, | 150 | 0, 3, 19, 21, 0, 3, 19, 20, 21, 0, |
147 | 3, 0, 3, 14, 3, 0, 22, 0, 23, 15, | 151 | 3, 10, 3, 0, 3, 11, 3, 0, 3, 12, |
148 | 22, 0, 23, 16, 22, 0 | 152 | 3, 0, 3, 13, 3, 0, 3, 14, 3, 0, |
153 | 25, 0, 26, 15, 25, 0, 26, 16, 25, 0 | ||
149 | }; | 154 | }; |
150 | 155 | ||
151 | #endif | 156 | #endif |
152 | 157 | ||
153 | #if YYDEBUG | 158 | #if YYDEBUG |
154 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | 159 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
155 | static const short yyrline[] = | 160 | static const short yyrline[] = |
156 | { | 161 | { |
157 | 0, 63, 64, 70, 72, 76, 78, 81, 83, 85, | 162 | 0, 67, 68, 69, 75, 77, 81, 83, 86, 88, |
158 | 86, 87, 88, 89, 92, 94, 95 | 163 | 89, 90, 91, 92, 93, 94, 95, 98, 100, 101 |
159 | }; | 164 | }; |
160 | #endif | 165 | #endif |
161 | 166 | ||
162 | 167 | ||
163 | #if (YYDEBUG) || defined YYERROR_VERBOSE | 168 | #if (YYDEBUG) || defined YYERROR_VERBOSE |
164 | 169 | ||
165 | /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ | 170 | /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ |
166 | static const char *const yytname[] = | 171 | static const char *const yytname[] = |
167 | { | 172 | { |
168 | "$", "error", "$undefined.", "STRING", "SELECT", "FROM", "WHERE", "COMMA", | 173 | "$", "error", "$undefined.", "STRING", "SELECT", "FROM", "WHERE", "COMMA", |
169 | "QUOTE", "EQUALS", "NOTEQUALS", "LESS", "GREATER", "LESSEQUALS", | 174 | "QUOTE", "EQUALS", "NOTEQUALS", "LESS", "GREATER", "LESSEQUALS", |
170 | "GREATEREQUALS", "AND", "OR", "EOL", "END", "query_min", "select_list", | 175 | "GREATEREQUALS", "AND", "OR", "EOL", "END", "IS", "NOT", "SQLNULL", |
171 | "from_list", "where_clause", "where_list", 0 | 176 | "query_min", "select_list", "from_list", "where_clause", "where_list", 0 |
172 | }; | 177 | }; |
173 | #endif | 178 | #endif |
174 | 179 | ||
175 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | 180 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
176 | static const short yyr1[] = | 181 | static const short yyr1[] = |
177 | { | 182 | { |
178 | 0, 19, 19, 20, 20, 21, 21, 22, 22, 22, | 183 | 0, 22, 22, 22, 23, 23, 24, 24, 25, 25, |
179 | 22, 22, 22, 22, 23, 23, 23 | 184 | 25, 25, 25, 25, 25, 25, 25, 26, 26, 26 |
180 | }; | 185 | }; |
181 | 186 | ||
182 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | 187 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
183 | static const short yyr2[] = | 188 | static const short yyr2[] = |
184 | { | 189 | { |
185 | 0, 6, 1, 1, 3, 1, 3, 0, 3, 3, | 190 | 0, 6, 4, 1, 1, 3, 1, 3, 0, 3, |
186 | 3, 3, 3, 3, 1, 3, 3 | 191 | 3, 4, 3, 3, 3, 3, 3, 1, 3, 3 |
187 | }; | 192 | }; |
188 | 193 | ||
189 | /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE | 194 | /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE |
190 | doesn't specify something else to do. Zero means the default is an | 195 | doesn't specify something else to do. Zero means the default is an |
191 | error. */ | 196 | error. */ |
192 | static const short yydefact[] = | 197 | static const short yydefact[] = |
193 | { | 198 | { |
194 | 0, 2, 0, 3, 0, 0, 0, 5, 0, 4, | 199 | 0, 3, 0, 4, 0, 0, 0, 6, 2, 5, |
195 | 7, 0, 0, 14, 1, 6, 0, 0, 0, 0, | 200 | 8, 0, 0, 17, 1, 7, 0, 0, 0, 0, |
196 | 0, 0, 7, 7, 8, 9, 10, 11, 12, 13, | 201 | 0, 0, 0, 8, 8, 9, 12, 13, 14, 15, |
197 | 15, 16, 0, 0, 0 | 202 | 16, 0, 10, 18, 19, 11, 0, 0, 0 |
198 | }; | 203 | }; |
199 | 204 | ||
200 | static const short yydefgoto[] = | 205 | static const short yydefgoto[] = |
201 | { | 206 | { |
202 | 32, 4, 8, 13, 14 | 207 | 36, 4, 8, 13, 14 |
203 | }; | 208 | }; |
204 | 209 | ||
205 | static const short yypact[] = | 210 | static const short yypact[] = |
206 | { | 211 | { |
207 | 5,-32768, 4,-32768, 3, 8, 15,-32768, 6,-32768, | 212 | 5,-32768, 9,-32768, 6, 17, 18,-32768, 1,-32768, |
208 | 16, 17, -9,-32768, -1,-32768, 18, 19, 20, 21, | 213 | 19, 20, -9,-32768, -1,-32768, 21, 22, 23, 24, |
209 | 22, 23, 16, 16,-32768,-32768,-32768,-32768,-32768,-32768, | 214 | 25, 26, -4, 19, 19,-32768,-32768,-32768,-32768,-32768, |
210 | -32768,-32768, 27, 28,-32768 | 215 | -32768, 10,-32768,-32768,-32768,-32768, 30, 32,-32768 |
211 | }; | 216 | }; |
212 | 217 | ||
213 | static const short yypgoto[] = | 218 | static const short yypgoto[] = |
214 | { | 219 | { |
215 | -32768,-32768,-32768, -6,-32768 | 220 | -32768,-32768,-32768, -5,-32768 |
216 | }; | 221 | }; |
217 | 222 | ||
218 | 223 | ||
219 | #define YYLAST 28 | 224 | #define YYLAST 32 |
220 | 225 | ||
221 | 226 | ||
222 | static const short yytable[] = | 227 | static const short yytable[] = |
223 | { | 228 | { |
224 | 16, 17, 18, 19, 20, 21, 1, 3, 5, 2, | 229 | 16, 17, 18, 19, 20, 21, 1, 10, 11, 2, |
225 | 6, 7, 10, 11, 22, 23, 30, 31, 9, 12, | 230 | 22, 5, 3, 6, 23, 24, 31, 32, 33, 34, |
226 | 15, 24, 25, 26, 27, 28, 29, 33, 34 | 231 | 7, 9, 12, 15, 25, 26, 27, 28, 29, 30, |
232 | 37, 35, 38 | ||
227 | }; | 233 | }; |
228 | 234 | ||
229 | static const short yycheck[] = | 235 | static const short yycheck[] = |
230 | { | 236 | { |
231 | 9, 10, 11, 12, 13, 14, 1, 3, 5, 4, | 237 | 9, 10, 11, 12, 13, 14, 1, 6, 7, 4, |
232 | 7, 3, 6, 7, 15, 16, 22, 23, 3, 3, | 238 | 19, 5, 3, 7, 15, 16, 20, 21, 23, 24, |
233 | 3, 3, 3, 3, 3, 3, 3, 0, 0 | 239 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
240 | 0, 21, 0 | ||
234 | }; | 241 | }; |
242 | #define YYPURE 1 | ||
243 | |||
235 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ | 244 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ |
236 | #line 3 "/usr/share/bison/bison.simple" | 245 | #line 3 "/usr/local/share/bison/bison.simple" |
237 | 246 | ||
238 | /* Skeleton output parser for bison, | 247 | /* Skeleton output parser for bison, |
239 | 248 | ||
240 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software | 249 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software |
241 | Foundation, Inc. | 250 | Foundation, Inc. |
242 | 251 | ||
243 | This program is free software; you can redistribute it and/or modify | 252 | This program is free software; you can redistribute it and/or modify |
244 | it under the terms of the GNU General Public License as published by | 253 | it under the terms of the GNU General Public License as published by |
245 | the Free Software Foundation; either version 2, or (at your option) | 254 | the Free Software Foundation; either version 2, or (at your option) |
246 | any later version. | 255 | any later version. |
247 | 256 | ||
248 | This program is distributed in the hope that it will be useful, | 257 | This program is distributed in the hope that it will be useful, |
249 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 258 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
250 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 259 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
251 | GNU General Public License for more details. | 260 | GNU General Public License for more details. |
252 | 261 | ||
253 | You should have received a copy of the GNU General Public License | 262 | You should have received a copy of the GNU General Public License |
254 | along with this program; if not, write to the Free Software | 263 | along with this program; if not, write to the Free Software |
255 | Foundation, Inc., 59 Temple Place - Suite 330, | 264 | Foundation, Inc., 59 Temple Place - Suite 330, |
256 | Boston, MA 02111-1307, USA. */ | 265 | Boston, MA 02111-1307, USA. */ |
257 | 266 | ||
258 | /* As a special exception, when this file is copied by Bison into a | 267 | /* As a special exception, when this file is copied by Bison into a |
259 | Bison output file, you may use that output file without restriction. | 268 | Bison output file, you may use that output file without restriction. |
260 | This special exception was added by the Free Software Foundation | 269 | This special exception was added by the Free Software Foundation |
261 | in version 1.24 of Bison. */ | 270 | in version 1.24 of Bison. */ |
262 | 271 | ||
263 | /* This is the parser code that is written into each bison parser when | 272 | /* This is the parser code that is written into each bison parser when |
264 | the %semantic_parser declaration is not specified in the grammar. | 273 | the %semantic_parser declaration is not specified in the grammar. |
265 | It was written by Richard Stallman by simplifying the hairy parser | 274 | It was written by Richard Stallman by simplifying the hairy parser |
266 | used when %semantic_parser is specified. */ | 275 | used when %semantic_parser is specified. */ |
267 | 276 | ||
268 | /* All symbols defined below should begin with yy or YY, to avoid | 277 | /* All symbols defined below should begin with yy or YY, to avoid |
269 | infringing on user name space. This should be done even for local | 278 | infringing on user name space. This should be done even for local |
270 | variables, as they might otherwise be expanded by user macros. | 279 | variables, as they might otherwise be expanded by user macros. |
271 | There are some unavoidable exceptions within include files to | 280 | There are some unavoidable exceptions within include files to |
272 | define necessary library symbols; they are noted "INFRINGES ON | 281 | define necessary library symbols; they are noted "INFRINGES ON |
273 | USER NAME SPACE" below. */ | 282 | USER NAME SPACE" below. */ |
274 | 283 | ||
275 | #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) | 284 | #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) |
276 | 285 | ||
277 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | 286 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
278 | 287 | ||
279 | # if YYSTACK_USE_ALLOCA | 288 | # if YYSTACK_USE_ALLOCA |
280 | # define YYSTACK_ALLOC alloca | 289 | # define YYSTACK_ALLOC alloca |
281 | # else | 290 | # else |
282 | # ifndef YYSTACK_USE_ALLOCA | 291 | # ifndef YYSTACK_USE_ALLOCA |
283 | # if defined (alloca) || defined (_ALLOCA_H) | 292 | # if defined (alloca) || defined (_ALLOCA_H) |
284 | # define YYSTACK_ALLOC alloca | 293 | # define YYSTACK_ALLOC alloca |
285 | # else | 294 | # else |
286 | # ifdef __GNUC__ | 295 | # ifdef __GNUC__ |
287 | # define YYSTACK_ALLOC __builtin_alloca | 296 | # define YYSTACK_ALLOC __builtin_alloca |
288 | # endif | 297 | # endif |
289 | # endif | 298 | # endif |
290 | # endif | 299 | # endif |
291 | # endif | 300 | # endif |
292 | 301 | ||
293 | # ifdef YYSTACK_ALLOC | 302 | # ifdef YYSTACK_ALLOC |
294 | /* Pacify GCC's `empty if-body' warning. */ | 303 | /* Pacify GCC's `empty if-body' warning. */ |
295 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) | 304 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
296 | # else | 305 | # else |
297 | # if defined (__STDC__) || defined (__cplusplus) | 306 | # if defined (__STDC__) || defined (__cplusplus) |
298 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | 307 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
299 | # define YYSIZE_T size_t | 308 | # define YYSIZE_T size_t |
300 | # endif | 309 | # endif |
301 | # define YYSTACK_ALLOC malloc | 310 | # define YYSTACK_ALLOC malloc |
302 | # define YYSTACK_FREE free | 311 | # define YYSTACK_FREE free |
303 | # endif | 312 | # endif |
304 | #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ | ||
305 | |||
306 | |||
307 | #if (! defined (yyoverflow) \ | ||
308 | && (! defined (__cplusplus) \ | ||
309 | || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | ||
310 | 313 | ||
311 | /* A type that is properly aligned for any stack member. */ | 314 | /* A type that is properly aligned for any stack member. */ |
312 | union yyalloc | 315 | union yyalloc |
313 | { | 316 | { |
314 | short yyss; | 317 | short yyss; |
315 | YYSTYPE yyvs; | 318 | YYSTYPE yyvs; |
316 | # if YYLSP_NEEDED | 319 | # if YYLSP_NEEDED |
317 | YYLTYPE yyls; | 320 | YYLTYPE yyls; |
318 | # endif | 321 | # endif |
319 | }; | 322 | }; |
320 | 323 | ||
321 | /* The size of the maximum gap between one aligned stack and the next. */ | 324 | /* The size of the maximum gap between one aligned stack and the next. */ |
322 | # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) | 325 | # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) |
323 | 326 | ||
324 | /* The size of an array large to enough to hold all stacks, each with | 327 | /* The size of an array large to enough to hold all stacks, each with |
325 | N elements. */ | 328 | N elements. */ |
326 | # if YYLSP_NEEDED | 329 | # if YYLSP_NEEDED |
327 | # define YYSTACK_BYTES(N) \ | 330 | # define YYSTACK_BYTES(N) \ |
328 | ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))\ | 331 | ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))\ |
329 | + 2 * YYSTACK_GAP_MAX) | 332 | + 2 * YYSTACK_GAP_MAX) |
330 | # else | 333 | # else |
331 | # define YYSTACK_BYTES(N) \ | 334 | # define YYSTACK_BYTES(N) \ |
332 | ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ | 335 | ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ |
333 | + YYSTACK_GAP_MAX) | 336 | + YYSTACK_GAP_MAX) |
334 | # endif | 337 | # endif |
335 | 338 | ||
336 | /* Copy COUNT objects from FROM to TO. The source and destination do | 339 | /* Relocate the TYPE STACK from its old location to the new one. The |
337 | not overlap. */ | ||
338 | # ifndef YYCOPY | ||
339 | # if 1 < __GNUC__ | ||
340 | # define YYCOPY(To, From, Count) \ | ||
341 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | ||
342 | # else | ||
343 | # define YYCOPY(To, From, Count) \ | ||
344 | do \ | ||
345 | { \ | ||
346 | register YYSIZE_T yyi; \ | ||
347 | for (yyi = 0; yyi < (Count); yyi++)\ | ||
348 | (To)[yyi] = (From)[yyi]; \ | ||
349 | } \ | ||
350 | while (0) | ||
351 | # endif | ||
352 | # endif | ||
353 | |||
354 | /* Relocate STACK from its old location to the new one. The | ||
355 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | 340 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
356 | elements in the stack, and YYPTR gives the new location of the | 341 | elements in the stack, and YYPTR gives the new location of the |
357 | stack. Advance YYPTR to a properly aligned location for the next | 342 | stack. Advance YYPTR to a properly aligned location for the next |
358 | stack. */ | 343 | stack. */ |
359 | # define YYSTACK_RELOCATE(Stack) \ | 344 | # define YYSTACK_RELOCATE(Type, Stack) \ |
360 | do \ | 345 | do \ |
361 | { \ | 346 | { \ |
362 | YYSIZE_T yynewbytes; \ | 347 | YYSIZE_T yynewbytes; \ |
363 | YYCOPY (&yyptr->Stack, Stack, yysize); \ | 348 | yymemcpy ((char *) yyptr, (char *) (Stack), \ |
349 | yysize * (YYSIZE_T) sizeof (Type)); \ | ||
364 | Stack = &yyptr->Stack; \ | 350 | Stack = &yyptr->Stack; \ |
365 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;\ | 351 | yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX;\ |
366 | yyptr += yynewbytes / sizeof (*yyptr); \ | 352 | yyptr += yynewbytes / sizeof (*yyptr); \ |
367 | } \ | 353 | } \ |
368 | while (0) | 354 | while (0) |
369 | 355 | ||
370 | #endif | 356 | #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ |
371 | 357 | ||
372 | 358 | ||
373 | #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) | 359 | #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) |
374 | # define YYSIZE_T __SIZE_TYPE__ | 360 | # define YYSIZE_T __SIZE_TYPE__ |
375 | #endif | 361 | #endif |
376 | #if ! defined (YYSIZE_T) && defined (size_t) | 362 | #if ! defined (YYSIZE_T) && defined (size_t) |
377 | # define YYSIZE_T size_t | 363 | # define YYSIZE_T size_t |
378 | #endif | 364 | #endif |
379 | #if ! defined (YYSIZE_T) | 365 | #if ! defined (YYSIZE_T) |
380 | # if defined (__STDC__) || defined (__cplusplus) | 366 | # if defined (__STDC__) || defined (__cplusplus) |
381 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | 367 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
382 | # define YYSIZE_T size_t | 368 | # define YYSIZE_T size_t |
383 | # endif | 369 | # endif |
384 | #endif | 370 | #endif |
385 | #if ! defined (YYSIZE_T) | 371 | #if ! defined (YYSIZE_T) |
386 | # define YYSIZE_T unsigned int | 372 | # define YYSIZE_T unsigned int |
387 | #endif | 373 | #endif |
388 | 374 | ||
389 | #define yyerrok (yyerrstatus = 0) | 375 | #define yyerrok (yyerrstatus = 0) |
390 | #define yyclearin(yychar = YYEMPTY) | 376 | #define yyclearin(yychar = YYEMPTY) |
391 | #define YYEMPTY -2 | 377 | #define YYEMPTY -2 |
392 | #define YYEOF 0 | 378 | #define YYEOF 0 |
393 | #define YYACCEPTgoto yyacceptlab | 379 | #define YYACCEPTgoto yyacceptlab |
394 | #define YYABORT goto yyabortlab | 380 | #define YYABORT goto yyabortlab |
395 | #define YYERROR goto yyerrlab1 | 381 | #define YYERROR goto yyerrlab1 |
396 | /* Like YYERROR except do call yyerror. This remains here temporarily | 382 | /* Like YYERROR except do call yyerror. This remains here temporarily |
397 | to ease the transition to the new meaning of YYERROR, for GCC. | 383 | to ease the transition to the new meaning of YYERROR, for GCC. |
398 | Once GCC version 2 has supplanted version 1, this can go. */ | 384 | Once GCC version 2 has supplanted version 1, this can go. */ |
399 | #define YYFAIL goto yyerrlab | 385 | #define YYFAIL goto yyerrlab |
400 | #define YYRECOVERING() (!!yyerrstatus) | 386 | #define YYRECOVERING() (!!yyerrstatus) |
401 | #define YYBACKUP(Token, Value) \ | 387 | #define YYBACKUP(Token, Value) \ |
402 | do \ | 388 | do \ |
403 | if (yychar == YYEMPTY && yylen == 1) \ | 389 | if (yychar == YYEMPTY && yylen == 1) \ |
404 | { \ | 390 | { \ |
405 | yychar = (Token); \ | 391 | yychar = (Token); \ |
406 | yylval = (Value); \ | 392 | yylval = (Value); \ |
407 | yychar1 = YYTRANSLATE (yychar); \ | 393 | yychar1 = YYTRANSLATE (yychar); \ |
408 | YYPOPSTACK; \ | 394 | YYPOPSTACK; \ |
409 | goto yybackup; \ | 395 | goto yybackup; \ |
410 | } \ | 396 | } \ |
411 | else \ | 397 | else \ |
412 | { \ | 398 | { \ |
413 | yyerror ("syntax error: cannot back up"); \ | 399 | yyerror ("syntax error: cannot back up"); \ |
414 | YYERROR; \ | 400 | YYERROR; \ |
415 | } \ | 401 | } \ |
416 | while (0) | 402 | while (0) |
417 | 403 | ||
418 | #define YYTERROR1 | 404 | #define YYTERROR1 |
@@ -449,149 +435,176 @@ while (0) | |||
449 | # define YYLEX yylex (&yylval) | 435 | # define YYLEX yylex (&yylval) |
450 | # endif | 436 | # endif |
451 | # endif /* !YYLSP_NEEDED */ | 437 | # endif /* !YYLSP_NEEDED */ |
452 | #else /* !YYPURE */ | 438 | #else /* !YYPURE */ |
453 | # define YYLEX yylex () | 439 | # define YYLEX yylex () |
454 | #endif /* !YYPURE */ | 440 | #endif /* !YYPURE */ |
455 | 441 | ||
456 | 442 | ||
457 | /* Enable debugging if requested. */ | 443 | /* Enable debugging if requested. */ |
458 | #if YYDEBUG | 444 | #if YYDEBUG |
459 | 445 | ||
460 | # ifndef YYFPRINTF | 446 | # ifndef YYFPRINTF |
461 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | 447 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
462 | # define YYFPRINTF fprintf | 448 | # define YYFPRINTF fprintf |
463 | # endif | 449 | # endif |
464 | 450 | ||
465 | # define YYDPRINTF(Args) \ | 451 | # define YYDPRINTF(Args) \ |
466 | do { \ | 452 | do { \ |
467 | if (yydebug) \ | 453 | if (yydebug) \ |
468 | YYFPRINTF Args; \ | 454 | YYFPRINTF Args; \ |
469 | } while (0) | 455 | } while (0) |
470 | /* Nonzero means print parse trace. It is left uninitialized so that | 456 | /* Nonzero means print parse trace. It is left uninitialized so that |
471 | multiple parsers can coexist. */ | 457 | multiple parsers can coexist. */ |
472 | int yydebug; | 458 | int yydebug; |
473 | #else /* !YYDEBUG */ | 459 | #else /* !YYDEBUG */ |
474 | # define YYDPRINTF(Args) | 460 | # define YYDPRINTF(Args) |
475 | #endif /* !YYDEBUG */ | 461 | #endif /* !YYDEBUG */ |
476 | 462 | ||
477 | /* YYINITDEPTH -- initial size of the parser's stacks. */ | 463 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
478 | #ifndefYYINITDEPTH | 464 | #ifndefYYINITDEPTH |
479 | # define YYINITDEPTH 200 | 465 | # define YYINITDEPTH 200 |
480 | #endif | 466 | #endif |
481 | 467 | ||
482 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only | 468 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
483 | if the built-in stack extension method is used). | 469 | if the built-in stack extension method is used). |
484 | 470 | ||
485 | Do not make this value too large; the results are undefined if | 471 | Do not make this value too large; the results are undefined if |
486 | SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) | 472 | SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) |
487 | evaluated with infinite-precision integer arithmetic. */ | 473 | evaluated with infinite-precision integer arithmetic. */ |
488 | 474 | ||
489 | #if YYMAXDEPTH == 0 | 475 | #if YYMAXDEPTH == 0 |
490 | # undef YYMAXDEPTH | 476 | # undef YYMAXDEPTH |
491 | #endif | 477 | #endif |
492 | 478 | ||
493 | #ifndef YYMAXDEPTH | 479 | #ifndef YYMAXDEPTH |
494 | # define YYMAXDEPTH 10000 | 480 | # define YYMAXDEPTH 10000 |
495 | #endif | 481 | #endif |
496 | 482 | ||
483 | #if ! defined (yyoverflow) && ! defined (yymemcpy) | ||
484 | # if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ | ||
485 | # define yymemcpy __builtin_memcpy | ||
486 | # else /* not GNU C or C++ */ | ||
487 | |||
488 | /* This is the most reliable way to avoid incompatibilities | ||
489 | in available built-in functions on various systems. */ | ||
490 | static void | ||
491 | # if defined (__STDC__) || defined (__cplusplus) | ||
492 | yymemcpy (char *yyto, const char *yyfrom, YYSIZE_T yycount) | ||
493 | # else | ||
494 | yymemcpy (yyto, yyfrom, yycount) | ||
495 | char *yyto; | ||
496 | const char *yyfrom; | ||
497 | YYSIZE_T yycount; | ||
498 | # endif | ||
499 | { | ||
500 | register const char *yyf = yyfrom; | ||
501 | register char *yyt = yyto; | ||
502 | register YYSIZE_T yyi = yycount; | ||
503 | |||
504 | while (yyi-- != 0) | ||
505 | *yyt++ = *yyf++; | ||
506 | } | ||
507 | # endif | ||
508 | #endif | ||
509 | |||
497 | #ifdef YYERROR_VERBOSE | 510 | #ifdef YYERROR_VERBOSE |
498 | 511 | ||
499 | # ifndef yystrlen | 512 | # ifndef yystrlen |
500 | # if defined (__GLIBC__) && defined (_STRING_H) | 513 | # if defined (__GLIBC__) && defined (_STRING_H) |
501 | # define yystrlen strlen | 514 | # define yystrlen strlen |
502 | # else | 515 | # else |
503 | /* Return the length of YYSTR. */ | 516 | /* Return the length of YYSTR. */ |
504 | static YYSIZE_T | 517 | static YYSIZE_T |
505 | # if defined (__STDC__) || defined (__cplusplus) | 518 | # if defined (__STDC__) || defined (__cplusplus) |
506 | yystrlen (const char *yystr) | 519 | yystrlen (const char *yystr) |
507 | # else | 520 | # else |
508 | yystrlen (yystr) | 521 | yystrlen (yystr) |
509 | const char *yystr; | 522 | const char *yystr; |
510 | # endif | 523 | # endif |
511 | { | 524 | { |
512 | register const char *yys = yystr; | 525 | register const char *yys = yystr; |
513 | 526 | ||
514 | while (*yys++ != '\0') | 527 | while (*yys++ != '\0') |
515 | continue; | 528 | continue; |
516 | 529 | ||
517 | return yys - yystr - 1; | 530 | return yys - yystr - 1; |
518 | } | 531 | } |
519 | # endif | 532 | # endif |
520 | # endif | 533 | # endif |
521 | 534 | ||
522 | # ifndef yystpcpy | 535 | # ifndef yystpcpy |
523 | # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) | 536 | # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) |
524 | # define yystpcpy stpcpy | 537 | # define yystpcpy stpcpy |
525 | # else | 538 | # else |
526 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | 539 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
527 | YYDEST. */ | 540 | YYDEST. */ |
528 | static char * | 541 | static char * |
529 | # if defined (__STDC__) || defined (__cplusplus) | 542 | # if defined (__STDC__) || defined (__cplusplus) |
530 | yystpcpy (char *yydest, const char *yysrc) | 543 | yystpcpy (char *yydest, const char *yysrc) |
531 | # else | 544 | # else |
532 | yystpcpy (yydest, yysrc) | 545 | yystpcpy (yydest, yysrc) |
533 | char *yydest; | 546 | char *yydest; |
534 | const char *yysrc; | 547 | const char *yysrc; |
535 | # endif | 548 | # endif |
536 | { | 549 | { |
537 | register char *yyd = yydest; | 550 | register char *yyd = yydest; |
538 | register const char *yys = yysrc; | 551 | register const char *yys = yysrc; |
539 | 552 | ||
540 | while ((*yyd++ = *yys++) != '\0') | 553 | while ((*yyd++ = *yys++) != '\0') |
541 | continue; | 554 | continue; |
542 | 555 | ||
543 | return yyd - 1; | 556 | return yyd - 1; |
544 | } | 557 | } |
545 | # endif | 558 | # endif |
546 | # endif | 559 | # endif |
547 | #endif | 560 | #endif |
548 | 561 | ||
549 | #line 315 "/usr/share/bison/bison.simple" | 562 | #line 319 "/usr/local/share/bison/bison.simple" |
550 | 563 | ||
551 | 564 | ||
552 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed | 565 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed |
553 | into yyparse. The argument should have type void *. | 566 | into yyparse. The argument should have type void *. |
554 | It should actually point to an object. | 567 | It should actually point to an object. |
555 | Grammar actions can access the variable by casting it | 568 | Grammar actions can access the variable by casting it |
556 | to the proper pointer type. */ | 569 | to the proper pointer type. */ |
557 | 570 | ||
558 | #ifdef YYPARSE_PARAM | 571 | #ifdef YYPARSE_PARAM |
559 | # if defined (__STDC__) || defined (__cplusplus) | 572 | # if defined (__STDC__) || defined (__cplusplus) |
560 | # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM | 573 | # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM |
561 | # define YYPARSE_PARAM_DECL | 574 | # define YYPARSE_PARAM_DECL |
562 | # else | 575 | # else |
563 | # define YYPARSE_PARAM_ARG YYPARSE_PARAM | 576 | # define YYPARSE_PARAM_ARG YYPARSE_PARAM |
564 | # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; | 577 | # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; |
565 | # endif | 578 | # endif |
566 | #else /* !YYPARSE_PARAM */ | 579 | #else /* !YYPARSE_PARAM */ |
567 | # define YYPARSE_PARAM_ARG | 580 | # define YYPARSE_PARAM_ARG |
568 | # define YYPARSE_PARAM_DECL | 581 | # define YYPARSE_PARAM_DECL |
569 | #endif /* !YYPARSE_PARAM */ | 582 | #endif /* !YYPARSE_PARAM */ |
570 | 583 | ||
571 | /* Prevent warning if -Wstrict-prototypes. */ | 584 | /* Prevent warning if -Wstrict-prototypes. */ |
572 | #ifdef __GNUC__ | 585 | #ifdef __GNUC__ |
573 | # ifdef YYPARSE_PARAM | 586 | # ifdef YYPARSE_PARAM |
574 | int yyparse (void *); | 587 | int yyparse (void *); |
575 | # else | 588 | # else |
576 | int yyparse (void); | 589 | int yyparse (void); |
577 | # endif | 590 | # endif |
578 | #endif | 591 | #endif |
579 | 592 | ||
580 | /* YY_DECL_VARIABLES -- depending whether we use a pure parser, | 593 | /* YY_DECL_VARIABLES -- depending whether we use a pure parser, |
581 | variables are global, or local to YYPARSE. */ | 594 | variables are global, or local to YYPARSE. */ |
582 | 595 | ||
583 | #define YY_DECL_NON_LSP_VARIABLES \ | 596 | #define YY_DECL_NON_LSP_VARIABLES \ |
584 | /* The lookahead symbol. */ \ | 597 | /* The lookahead symbol. */ \ |
585 | int yychar; \ | 598 | int yychar; \ |
586 | \ | 599 | \ |
587 | /* The semantic value of the lookahead symbol. */\ | 600 | /* The semantic value of the lookahead symbol. */\ |
588 | YYSTYPE yylval; \ | 601 | YYSTYPE yylval; \ |
589 | \ | 602 | \ |
590 | /* Number of parse errors so far. */ \ | 603 | /* Number of parse errors so far. */ \ |
591 | int yynerrs; | 604 | int yynerrs; |
592 | 605 | ||
593 | #if YYLSP_NEEDED | 606 | #if YYLSP_NEEDED |
594 | # define YY_DECL_VARIABLES \ | 607 | # define YY_DECL_VARIABLES \ |
595 | YY_DECL_NON_LSP_VARIABLES \ | 608 | YY_DECL_NON_LSP_VARIABLES \ |
596 | \ | 609 | \ |
597 | /* Location data for the lookahead symbol. */\ | 610 | /* Location data for the lookahead symbol. */\ |
@@ -691,122 +704,118 @@ yyparse (YYPARSE_PARAM_ARG) | |||
691 | 704 | ||
692 | /*------------------------------------------------------------. | 705 | /*------------------------------------------------------------. |
693 | | yynewstate -- Push a new state, which is found in yystate. | | 706 | | yynewstate -- Push a new state, which is found in yystate. | |
694 | `------------------------------------------------------------*/ | 707 | `------------------------------------------------------------*/ |
695 | yynewstate: | 708 | yynewstate: |
696 | /* In all cases, when you get here, the value and location stacks | 709 | /* In all cases, when you get here, the value and location stacks |
697 | have just been pushed. so pushing a state here evens the stacks. | 710 | have just been pushed. so pushing a state here evens the stacks. |
698 | */ | 711 | */ |
699 | yyssp++; | 712 | yyssp++; |
700 | 713 | ||
701 | yysetstate: | 714 | yysetstate: |
702 | *yyssp = yystate; | 715 | *yyssp = yystate; |
703 | 716 | ||
704 | if (yyssp >= yyss + yystacksize - 1) | 717 | if (yyssp >= yyss + yystacksize - 1) |
705 | { | 718 | { |
706 | /* Get the current used size of the three stacks, in elements. */ | 719 | /* Get the current used size of the three stacks, in elements. */ |
707 | YYSIZE_T yysize = yyssp - yyss + 1; | 720 | YYSIZE_T yysize = yyssp - yyss + 1; |
708 | 721 | ||
709 | #ifdef yyoverflow | 722 | #ifdef yyoverflow |
710 | { | 723 | { |
711 | /* Give user a chance to reallocate the stack. Use copies of | 724 | /* Give user a chance to reallocate the stack. Use copies of |
712 | these so that the &'s don't force the real ones into | 725 | these so that the &'s don't force the real ones into |
713 | memory. */ | 726 | memory. */ |
714 | YYSTYPE *yyvs1 = yyvs; | 727 | YYSTYPE *yyvs1 = yyvs; |
715 | short *yyss1 = yyss; | 728 | short *yyss1 = yyss; |
716 | 729 | ||
717 | /* Each stack pointer address is followed by the size of the | 730 | /* Each stack pointer address is followed by the size of the |
718 | data in use in that stack, in bytes. */ | 731 | data in use in that stack, in bytes. */ |
719 | # if YYLSP_NEEDED | 732 | # if YYLSP_NEEDED |
720 | YYLTYPE *yyls1 = yyls; | 733 | YYLTYPE *yyls1 = yyls; |
721 | /* This used to be a conditional around just the two extra args, | 734 | /* This used to be a conditional around just the two extra args, |
722 | but that might be undefined if yyoverflow is a macro. */ | 735 | but that might be undefined if yyoverflow is a macro. */ |
723 | yyoverflow ("parser stack overflow", | 736 | yyoverflow ("parser stack overflow", |
724 | &yyss1, yysize * sizeof (*yyssp), | 737 | &yyss1, yysize * sizeof (*yyssp), |
725 | &yyvs1, yysize * sizeof (*yyvsp), | 738 | &yyvs1, yysize * sizeof (*yyvsp), |
726 | &yyls1, yysize * sizeof (*yylsp), | 739 | &yyls1, yysize * sizeof (*yylsp), |
727 | &yystacksize); | 740 | &yystacksize); |
728 | yyls = yyls1; | 741 | yyls = yyls1; |
729 | # else | 742 | # else |
730 | yyoverflow ("parser stack overflow", | 743 | yyoverflow ("parser stack overflow", |
731 | &yyss1, yysize * sizeof (*yyssp), | 744 | &yyss1, yysize * sizeof (*yyssp), |
732 | &yyvs1, yysize * sizeof (*yyvsp), | 745 | &yyvs1, yysize * sizeof (*yyvsp), |
733 | &yystacksize); | 746 | &yystacksize); |
734 | # endif | 747 | # endif |
735 | yyss = yyss1; | 748 | yyss = yyss1; |
736 | yyvs = yyvs1; | 749 | yyvs = yyvs1; |
737 | } | 750 | } |
738 | #else /* no yyoverflow */ | 751 | #else /* no yyoverflow */ |
739 | # ifndef YYSTACK_RELOCATE | ||
740 | goto yyoverflowlab; | ||
741 | # else | ||
742 | /* Extend the stack our own way. */ | 752 | /* Extend the stack our own way. */ |
743 | if (yystacksize >= YYMAXDEPTH) | 753 | if (yystacksize >= YYMAXDEPTH) |
744 | goto yyoverflowlab; | 754 | goto yyoverflowlab; |
745 | yystacksize *= 2; | 755 | yystacksize *= 2; |
746 | if (yystacksize > YYMAXDEPTH) | 756 | if (yystacksize > YYMAXDEPTH) |
747 | yystacksize = YYMAXDEPTH; | 757 | yystacksize = YYMAXDEPTH; |
748 | 758 | ||
749 | { | 759 | { |
750 | short *yyss1 = yyss; | 760 | short *yyss1 = yyss; |
751 | union yyalloc *yyptr = | 761 | union yyalloc *yyptr = |
752 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | 762 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
753 | if (! yyptr) | 763 | if (! yyptr) |
754 | goto yyoverflowlab; | 764 | goto yyoverflowlab; |
755 | YYSTACK_RELOCATE (yyss); | 765 | YYSTACK_RELOCATE (short, yyss); |
756 | YYSTACK_RELOCATE (yyvs); | 766 | YYSTACK_RELOCATE (YYSTYPE, yyvs); |
757 | # if YYLSP_NEEDED | 767 | # if YYLSP_NEEDED |
758 | YYSTACK_RELOCATE (yyls); | 768 | YYSTACK_RELOCATE (YYLTYPE, yyls); |
759 | # endif | 769 | # endif |
760 | # undef YYSTACK_RELOCATE | 770 | # undef YYSTACK_RELOCATE |
761 | if (yyss1 != yyssa) | 771 | if (yyss1 != yyssa) |
762 | YYSTACK_FREE (yyss1); | 772 | YYSTACK_FREE (yyss1); |
763 | } | 773 | } |
764 | # endif | ||
765 | #endif /* no yyoverflow */ | 774 | #endif /* no yyoverflow */ |
766 | 775 | ||
767 | yyssp = yyss + yysize - 1; | 776 | yyssp = yyss + yysize - 1; |
768 | yyvsp = yyvs + yysize - 1; | 777 | yyvsp = yyvs + yysize - 1; |
769 | #if YYLSP_NEEDED | 778 | #if YYLSP_NEEDED |
770 | yylsp = yyls + yysize - 1; | 779 | yylsp = yyls + yysize - 1; |
771 | #endif | 780 | #endif |
772 | 781 | ||
773 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", | 782 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
774 | (unsigned long int) yystacksize)); | 783 | (unsigned long int) yystacksize)); |
775 | 784 | ||
776 | if (yyssp >= yyss + yystacksize - 1) | 785 | if (yyssp >= yyss + yystacksize - 1) |
777 | YYABORT; | 786 | YYABORT; |
778 | } | 787 | } |
779 | 788 | ||
780 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | 789 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
781 | 790 | ||
782 | goto yybackup; | 791 | goto yybackup; |
783 | 792 | ||
784 | 793 | ||
785 | /*-----------. | 794 | /*-----------. |
786 | | yybackup. | | 795 | | yybackup. | |
787 | `-----------*/ | 796 | `-----------*/ |
788 | yybackup: | 797 | yybackup: |
789 | 798 | ||
790 | /* Do appropriate processing given the current state. */ | 799 | /* Do appropriate processing given the current state. */ |
791 | /* Read a lookahead token if we need one and don't already have one. */ | 800 | /* Read a lookahead token if we need one and don't already have one. */ |
792 | /* yyresume: */ | 801 | /* yyresume: */ |
793 | 802 | ||
794 | /* First try to decide what to do without reference to lookahead token. */ | 803 | /* First try to decide what to do without reference to lookahead token. */ |
795 | 804 | ||
796 | yyn = yypact[yystate]; | 805 | yyn = yypact[yystate]; |
797 | if (yyn == YYFLAG) | 806 | if (yyn == YYFLAG) |
798 | goto yydefault; | 807 | goto yydefault; |
799 | 808 | ||
800 | /* Not known => get a lookahead token if don't already have one. */ | 809 | /* Not known => get a lookahead token if don't already have one. */ |
801 | 810 | ||
802 | /* yychar is either YYEMPTY or YYEOF | 811 | /* yychar is either YYEMPTY or YYEOF |
803 | or a valid token in external form. */ | 812 | or a valid token in external form. */ |
804 | 813 | ||
805 | if (yychar == YYEMPTY) | 814 | if (yychar == YYEMPTY) |
806 | { | 815 | { |
807 | YYDPRINTF ((stderr, "Reading a token: ")); | 816 | YYDPRINTF ((stderr, "Reading a token: ")); |
808 | yychar = YYLEX; | 817 | yychar = YYLEX; |
809 | } | 818 | } |
810 | 819 | ||
811 | /* Convert token to internal form (in yychar1) for indexing tables with */ | 820 | /* Convert token to internal form (in yychar1) for indexing tables with */ |
812 | 821 | ||
@@ -894,158 +903,166 @@ yydefault: | |||
894 | if (yyn == 0) | 903 | if (yyn == 0) |
895 | goto yyerrlab; | 904 | goto yyerrlab; |
896 | goto yyreduce; | 905 | goto yyreduce; |
897 | 906 | ||
898 | 907 | ||
899 | /*-----------------------------. | 908 | /*-----------------------------. |
900 | | yyreduce -- Do a reduction. | | 909 | | yyreduce -- Do a reduction. | |
901 | `-----------------------------*/ | 910 | `-----------------------------*/ |
902 | yyreduce: | 911 | yyreduce: |
903 | /* yyn is the number of a rule to reduce with. */ | 912 | /* yyn is the number of a rule to reduce with. */ |
904 | yylen = yyr2[yyn]; | 913 | yylen = yyr2[yyn]; |
905 | 914 | ||
906 | /* If YYLEN is nonzero, implement the default value of the action: | 915 | /* If YYLEN is nonzero, implement the default value of the action: |
907 | `$$ = $1'. | 916 | `$$ = $1'. |
908 | 917 | ||
909 | Otherwise, the following line sets YYVAL to the semantic value of | 918 | Otherwise, the following line sets YYVAL to the semantic value of |
910 | the lookahead token. This behavior is undocumented and Bison | 919 | the lookahead token. This behavior is undocumented and Bison |
911 | users should not rely upon it. Assigning to YYVAL | 920 | users should not rely upon it. Assigning to YYVAL |
912 | unconditionally makes the parser a bit smaller, and it avoids a | 921 | unconditionally makes the parser a bit smaller, and it avoids a |
913 | GCC warning that YYVAL may be used uninitialized. */ | 922 | GCC warning that YYVAL may be used uninitialized. */ |
914 | yyval = yyvsp[1-yylen]; | 923 | yyval = yyvsp[1-yylen]; |
915 | 924 | ||
916 | #if YYLSP_NEEDED | 925 | #if YYLSP_NEEDED |
917 | /* Similarly for the default location. Let the user run additional | 926 | /* Similarly for the default location. Let the user run additional |
918 | commands if for instance locations are ranges. */ | 927 | commands if for instance locations are ranges. */ |
919 | yyloc = yylsp[1-yylen]; | 928 | yyloc = yylsp[1-yylen]; |
920 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); | 929 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
921 | #endif | 930 | #endif |
922 | 931 | ||
923 | #if YYDEBUG | 932 | #if YYDEBUG |
924 | /* We have to keep this `#if YYDEBUG', since we use variables which | 933 | /* We have to keep this `#if YYDEBUG', since we use variables which |
925 | are defined only if `YYDEBUG' is set. */ | 934 | are defined only if `YYDEBUG' is set. */ |
926 | if (yydebug) | 935 | if (yydebug) |
927 | { | 936 | { |
928 | int yyi; | 937 | int yyi; |
929 | 938 | ||
930 | YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", | 939 | YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", |
931 | yyn, yyrline[yyn]); | 940 | yyn, yyrline[yyn]); |
932 | 941 | ||
933 | /* Print the symbols being reduced, and their result. */ | 942 | /* Print the symbols being reduced, and their result. */ |
934 | for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) | 943 | for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) |
935 | YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); | 944 | YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); |
936 | YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); | 945 | YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); |
937 | } | 946 | } |
938 | #endif | 947 | #endif |
939 | 948 | ||
940 | switch (yyn) { | 949 | switch (yyn) { |
941 | 950 | ||
942 | case 2: | 951 | case 3: |
943 | #line 64 "icalssyacc.y" | 952 | #line 69 "icalssyacc.y" |
944 | { | 953 | { |
945 | icalparser_clear_flex_input(); | ||
946 | yyclearin; | 954 | yyclearin; |
955 | YYABORT; | ||
947 | } | 956 | } |
948 | break; | 957 | break; |
949 | case 3: | ||
950 | #line 71 "icalssyacc.y" | ||
951 | {ssyacc_add_select(icalss_yy_gauge,yyvsp[0].v_string);} | ||
952 | break; | ||
953 | case 4: | 958 | case 4: |
954 | #line 72 "icalssyacc.y" | 959 | #line 76 "icalssyacc.y" |
955 | {ssyacc_add_select(icalss_yy_gauge,yyvsp[0].v_string);} | 960 | {ssyacc_add_select(yyextra,yyvsp[0].v_string);} |
956 | break; | 961 | break; |
957 | case 5: | 962 | case 5: |
958 | #line 77 "icalssyacc.y" | 963 | #line 77 "icalssyacc.y" |
959 | {ssyacc_add_from(icalss_yy_gauge,yyvsp[0].v_string);} | 964 | {ssyacc_add_select(yyextra,yyvsp[0].v_string);} |
960 | break; | 965 | break; |
961 | case 6: | 966 | case 6: |
962 | #line 78 "icalssyacc.y" | 967 | #line 82 "icalssyacc.y" |
963 | {ssyacc_add_from(icalss_yy_gauge,yyvsp[0].v_string);} | 968 | {ssyacc_add_from(yyextra,yyvsp[0].v_string);} |
964 | break; | 969 | break; |
965 | case 8: | 970 | case 7: |
966 | #line 83 "icalssyacc.y" | 971 | #line 83 "icalssyacc.y" |
967 | {ssyacc_add_where(icalss_yy_gauge,yyvsp[-2].v_string,ICALGAUGECOMPARE_EQUAL,yyvsp[0].v_string); } | 972 | {ssyacc_add_from(yyextra,yyvsp[0].v_string);} |
968 | break; | 973 | break; |
969 | case 9: | 974 | case 9: |
970 | #line 85 "icalssyacc.y" | 975 | #line 88 "icalssyacc.y" |
971 | {ssyacc_add_where(icalss_yy_gauge,yyvsp[-2].v_string,ICALGAUGECOMPARE_NOTEQUAL,yyvsp[0].v_string); } | 976 | {ssyacc_add_where(yyextra,yyvsp[-2].v_string,ICALGAUGECOMPARE_EQUAL,yyvsp[0].v_string); } |
972 | break; | 977 | break; |
973 | case 10: | 978 | case 10: |
974 | #line 86 "icalssyacc.y" | 979 | #line 89 "icalssyacc.y" |
975 | {ssyacc_add_where(icalss_yy_gauge,yyvsp[-2].v_string,ICALGAUGECOMPARE_LESS,yyvsp[0].v_string); } | 980 | {ssyacc_add_where(yyextra,yyvsp[-2].v_string,ICALGAUGECOMPARE_ISNULL,""); } |
976 | break; | 981 | break; |
977 | case 11: | 982 | case 11: |
978 | #line 87 "icalssyacc.y" | 983 | #line 90 "icalssyacc.y" |
979 | {ssyacc_add_where(icalss_yy_gauge,yyvsp[-2].v_string,ICALGAUGECOMPARE_GREATER,yyvsp[0].v_string); } | 984 | {ssyacc_add_where(yyextra,yyvsp[-3].v_string,ICALGAUGECOMPARE_ISNOTNULL,""); } |
980 | break; | 985 | break; |
981 | case 12: | 986 | case 12: |
982 | #line 88 "icalssyacc.y" | 987 | #line 91 "icalssyacc.y" |
983 | {ssyacc_add_where(icalss_yy_gauge,yyvsp[-2].v_string,ICALGAUGECOMPARE_LESSEQUAL,yyvsp[0].v_string); } | 988 | {ssyacc_add_where(yyextra,yyvsp[-2].v_string,ICALGAUGECOMPARE_NOTEQUAL,yyvsp[0].v_string); } |
984 | break; | 989 | break; |
985 | case 13: | 990 | case 13: |
986 | #line 89 "icalssyacc.y" | 991 | #line 92 "icalssyacc.y" |
987 | {ssyacc_add_where(icalss_yy_gauge,yyvsp[-2].v_string,ICALGAUGECOMPARE_GREATEREQUAL,yyvsp[0].v_string); } | 992 | {ssyacc_add_where(yyextra,yyvsp[-2].v_string,ICALGAUGECOMPARE_LESS,yyvsp[0].v_string); } |
988 | break; | 993 | break; |
989 | case 14: | 994 | case 14: |
990 | #line 93 "icalssyacc.y" | 995 | #line 93 "icalssyacc.y" |
991 | {set_logic(icalss_yy_gauge,ICALGAUGELOGIC_NONE);} | 996 | {ssyacc_add_where(yyextra,yyvsp[-2].v_string,ICALGAUGECOMPARE_GREATER,yyvsp[0].v_string); } |
992 | break; | 997 | break; |
993 | case 15: | 998 | case 15: |
994 | #line 94 "icalssyacc.y" | 999 | #line 94 "icalssyacc.y" |
995 | {set_logic(icalss_yy_gauge,ICALGAUGELOGIC_AND);} | 1000 | {ssyacc_add_where(yyextra,yyvsp[-2].v_string,ICALGAUGECOMPARE_LESSEQUAL,yyvsp[0].v_string); } |
996 | break; | 1001 | break; |
997 | case 16: | 1002 | case 16: |
998 | #line 95 "icalssyacc.y" | 1003 | #line 95 "icalssyacc.y" |
999 | {set_logic(icalss_yy_gauge,ICALGAUGELOGIC_OR);} | 1004 | {ssyacc_add_where(yyextra,yyvsp[-2].v_string,ICALGAUGECOMPARE_GREATEREQUAL,yyvsp[0].v_string); } |
1005 | break; | ||
1006 | case 17: | ||
1007 | #line 99 "icalssyacc.y" | ||
1008 | {set_logic(yyextra,ICALGAUGELOGIC_NONE);} | ||
1009 | break; | ||
1010 | case 18: | ||
1011 | #line 100 "icalssyacc.y" | ||
1012 | {set_logic(yyextra,ICALGAUGELOGIC_AND);} | ||
1013 | break; | ||
1014 | case 19: | ||
1015 | #line 101 "icalssyacc.y" | ||
1016 | {set_logic(yyextra,ICALGAUGELOGIC_OR);} | ||
1000 | break; | 1017 | break; |
1001 | } | 1018 | } |
1002 | 1019 | ||
1003 | #line 705 "/usr/share/bison/bison.simple" | 1020 | #line 705 "/usr/local/share/bison/bison.simple" |
1004 | 1021 | ||
1005 | 1022 | ||
1006 | yyvsp -= yylen; | 1023 | yyvsp -= yylen; |
1007 | yyssp -= yylen; | 1024 | yyssp -= yylen; |
1008 | #if YYLSP_NEEDED | 1025 | #if YYLSP_NEEDED |
1009 | yylsp -= yylen; | 1026 | yylsp -= yylen; |
1010 | #endif | 1027 | #endif |
1011 | 1028 | ||
1012 | #if YYDEBUG | 1029 | #if YYDEBUG |
1013 | if (yydebug) | 1030 | if (yydebug) |
1014 | { | 1031 | { |
1015 | short *yyssp1 = yyss - 1; | 1032 | short *yyssp1 = yyss - 1; |
1016 | YYFPRINTF (stderr, "state stack now"); | 1033 | YYFPRINTF (stderr, "state stack now"); |
1017 | while (yyssp1 != yyssp) | 1034 | while (yyssp1 != yyssp) |
1018 | YYFPRINTF (stderr, " %d", *++yyssp1); | 1035 | YYFPRINTF (stderr, " %d", *++yyssp1); |
1019 | YYFPRINTF (stderr, "\n"); | 1036 | YYFPRINTF (stderr, "\n"); |
1020 | } | 1037 | } |
1021 | #endif | 1038 | #endif |
1022 | 1039 | ||
1023 | *++yyvsp = yyval; | 1040 | *++yyvsp = yyval; |
1024 | #if YYLSP_NEEDED | 1041 | #if YYLSP_NEEDED |
1025 | *++yylsp = yyloc; | 1042 | *++yylsp = yyloc; |
1026 | #endif | 1043 | #endif |
1027 | 1044 | ||
1028 | /* Now `shift' the result of the reduction. Determine what state | 1045 | /* Now `shift' the result of the reduction. Determine what state |
1029 | that goes to, based on the state we popped back to and the rule | 1046 | that goes to, based on the state we popped back to and the rule |
1030 | number reduced by. */ | 1047 | number reduced by. */ |
1031 | 1048 | ||
1032 | yyn = yyr1[yyn]; | 1049 | yyn = yyr1[yyn]; |
1033 | 1050 | ||
1034 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; | 1051 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; |
1035 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) | 1052 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
1036 | yystate = yytable[yystate]; | 1053 | yystate = yytable[yystate]; |
1037 | else | 1054 | else |
1038 | yystate = yydefgoto[yyn - YYNTBASE]; | 1055 | yystate = yydefgoto[yyn - YYNTBASE]; |
1039 | 1056 | ||
1040 | goto yynewstate; | 1057 | goto yynewstate; |
1041 | 1058 | ||
1042 | 1059 | ||
1043 | /*------------------------------------. | 1060 | /*------------------------------------. |
1044 | | yyerrlab -- here on detecting error | | 1061 | | yyerrlab -- here on detecting error | |
1045 | `------------------------------------*/ | 1062 | `------------------------------------*/ |
1046 | yyerrlab: | 1063 | yyerrlab: |
1047 | /* If not already recovering from an error, report this error. */ | 1064 | /* If not already recovering from an error, report this error. */ |
1048 | if (!yyerrstatus) | 1065 | if (!yyerrstatus) |
1049 | { | 1066 | { |
1050 | ++yynerrs; | 1067 | ++yynerrs; |
1051 | 1068 | ||
@@ -1186,196 +1203,197 @@ yyerrhandle: | |||
1186 | goto yyreduce; | 1203 | goto yyreduce; |
1187 | } | 1204 | } |
1188 | else if (yyn == 0) | 1205 | else if (yyn == 0) |
1189 | goto yyerrpop; | 1206 | goto yyerrpop; |
1190 | 1207 | ||
1191 | if (yyn == YYFINAL) | 1208 | if (yyn == YYFINAL) |
1192 | YYACCEPT; | 1209 | YYACCEPT; |
1193 | 1210 | ||
1194 | YYDPRINTF ((stderr, "Shifting error token, ")); | 1211 | YYDPRINTF ((stderr, "Shifting error token, ")); |
1195 | 1212 | ||
1196 | *++yyvsp = yylval; | 1213 | *++yyvsp = yylval; |
1197 | #if YYLSP_NEEDED | 1214 | #if YYLSP_NEEDED |
1198 | *++yylsp = yylloc; | 1215 | *++yylsp = yylloc; |
1199 | #endif | 1216 | #endif |
1200 | 1217 | ||
1201 | yystate = yyn; | 1218 | yystate = yyn; |
1202 | goto yynewstate; | 1219 | goto yynewstate; |
1203 | 1220 | ||
1204 | 1221 | ||
1205 | /*-------------------------------------. | 1222 | /*-------------------------------------. |
1206 | | yyacceptlab -- YYACCEPT comes here. | | 1223 | | yyacceptlab -- YYACCEPT comes here. | |
1207 | `-------------------------------------*/ | 1224 | `-------------------------------------*/ |
1208 | yyacceptlab: | 1225 | yyacceptlab: |
1209 | yyresult = 0; | 1226 | yyresult = 0; |
1210 | goto yyreturn; | 1227 | goto yyreturn; |
1211 | 1228 | ||
1212 | /*-----------------------------------. | 1229 | /*-----------------------------------. |
1213 | | yyabortlab -- YYABORT comes here. | | 1230 | | yyabortlab -- YYABORT comes here. | |
1214 | `-----------------------------------*/ | 1231 | `-----------------------------------*/ |
1215 | yyabortlab: | 1232 | yyabortlab: |
1216 | yyresult = 1; | 1233 | yyresult = 1; |
1217 | goto yyreturn; | 1234 | goto yyreturn; |
1218 | 1235 | ||
1219 | /*---------------------------------------------. | 1236 | /*---------------------------------------------. |
1220 | | yyoverflowab -- parser overflow comes here. | | 1237 | | yyoverflowab -- parser overflow comes here. | |
1221 | `---------------------------------------------*/ | 1238 | `---------------------------------------------*/ |
1222 | yyoverflowlab: | 1239 | yyoverflowlab: |
1223 | yyerror ("parser stack overflow"); | 1240 | yyerror ("parser stack overflow"); |
1224 | yyresult = 2; | 1241 | yyresult = 2; |
1225 | /* Fall through. */ | 1242 | /* Fall through. */ |
1226 | 1243 | ||
1227 | yyreturn: | 1244 | yyreturn: |
1228 | #ifndef yyoverflow | 1245 | #ifndef yyoverflow |
1229 | if (yyss != yyssa) | 1246 | if (yyss != yyssa) |
1230 | YYSTACK_FREE (yyss); | 1247 | YYSTACK_FREE (yyss); |
1231 | #endif | 1248 | #endif |
1232 | return yyresult; | 1249 | return yyresult; |
1233 | } | 1250 | } |
1234 | #line 99 "icalssyacc.y" | 1251 | #line 105 "icalssyacc.y" |
1235 | 1252 | ||
1236 | 1253 | ||
1237 | void ssyacc_add_where(struct icalgauge_impl* impl, char* str1, | 1254 | static void ssyacc_add_where(struct icalgauge_impl* impl, char* str1, |
1238 | icalgaugecompare compare , char* value_str) | 1255 | icalgaugecompare compare , char* value_str) |
1239 | { | 1256 | { |
1240 | 1257 | ||
1241 | struct icalgauge_where *where; | 1258 | struct icalgauge_where *where; |
1242 | char *compstr, *propstr, *c, *s,*l; | 1259 | char *compstr, *propstr, *c, *s,*l; |
1243 | 1260 | ||
1244 | if ( (where = malloc(sizeof(struct icalgauge_where))) ==0){ | 1261 | if ( (where = malloc(sizeof(struct icalgauge_where))) ==0){ |
1245 | icalerror_set_errno(ICAL_NEWFAILED_ERROR); | 1262 | icalerror_set_errno(ICAL_NEWFAILED_ERROR); |
1246 | return; | 1263 | return; |
1247 | } | 1264 | } |
1248 | 1265 | ||
1249 | memset(where,0,sizeof(struct icalgauge_where)); | 1266 | memset(where,0,sizeof(struct icalgauge_where)); |
1250 | where->logic = ICALGAUGELOGIC_NONE; | 1267 | where->logic = ICALGAUGELOGIC_NONE; |
1251 | where->compare = ICALGAUGECOMPARE_NONE; | 1268 | where->compare = ICALGAUGECOMPARE_NONE; |
1252 | where->comp = ICAL_NO_COMPONENT; | 1269 | where->comp = ICAL_NO_COMPONENT; |
1253 | where->prop = ICAL_NO_PROPERTY; | 1270 | where->prop = ICAL_NO_PROPERTY; |
1254 | 1271 | ||
1255 | /* remove enclosing quotes */ | 1272 | /* remove enclosing quotes */ |
1256 | s = value_str; | 1273 | s = value_str; |
1257 | if(*s == '\''){ | 1274 | if(*s == '\''){ |
1258 | s++; | 1275 | s++; |
1259 | } | 1276 | } |
1260 | l = s+strlen(s)-1; | 1277 | l = s+strlen(s)-1; |
1261 | if(*l == '\''){ | 1278 | if(*l == '\''){ |
1262 | *l=0; | 1279 | *l=0; |
1263 | } | 1280 | } |
1264 | 1281 | ||
1265 | where->value = strdup(s); | 1282 | where->value = strdup(s); |
1266 | 1283 | ||
1267 | /* Is there a period in str1 ? If so, the string specified both a | 1284 | /* Is there a period in str1 ? If so, the string specified both a |
1268 | component and a property*/ | 1285 | component and a property*/ |
1269 | if( (c = strrchr(str1,'.')) != 0){ | 1286 | if( (c = strrchr(str1,'.')) != 0){ |
1270 | compstr = str1; | 1287 | compstr = str1; |
1271 | propstr = c+1; | 1288 | propstr = c+1; |
1272 | *c = '\0'; | 1289 | *c = '\0'; |
1273 | } else { | 1290 | } else { |
1274 | compstr = 0; | 1291 | compstr = 0; |
1275 | propstr = str1; | 1292 | propstr = str1; |
1276 | } | 1293 | } |
1277 | 1294 | ||
1278 | 1295 | ||
1279 | /* Handle the case where a component was specified */ | 1296 | /* Handle the case where a component was specified */ |
1280 | if(compstr != 0){ | 1297 | if(compstr != 0){ |
1281 | where->comp = icalenum_string_to_component_kind(compstr); | 1298 | where->comp = icalenum_string_to_component_kind(compstr); |
1282 | } else { | 1299 | } else { |
1283 | where->comp = ICAL_NO_COMPONENT; | 1300 | where->comp = ICAL_NO_COMPONENT; |
1284 | } | 1301 | } |
1285 | 1302 | ||
1286 | where->prop = icalenum_string_to_property_kind(propstr); | 1303 | where->prop = icalenum_string_to_property_kind(propstr); |
1287 | 1304 | ||
1288 | where->compare = compare; | 1305 | where->compare = compare; |
1289 | 1306 | ||
1290 | if(where->value == 0){ | 1307 | if(where->value == 0){ |
1291 | icalerror_set_errno(ICAL_NEWFAILED_ERROR); | 1308 | icalerror_set_errno(ICAL_NEWFAILED_ERROR); |
1292 | free(where->value); | 1309 | free(where->value); |
1293 | return; | 1310 | return; |
1294 | } | 1311 | } |
1295 | 1312 | ||
1296 | pvl_push(impl->where,where); | 1313 | pvl_push(impl->where,where); |
1297 | } | 1314 | } |
1298 | 1315 | ||
1299 | void set_logic(struct icalgauge_impl* impl,icalgaugelogic l) | 1316 | static void set_logic(struct icalgauge_impl* impl,icalgaugelogic l) |
1300 | { | 1317 | { |
1301 | pvl_elem e = pvl_tail(impl->where); | 1318 | pvl_elem e = pvl_tail(impl->where); |
1302 | struct icalgauge_where *where = pvl_data(e); | 1319 | struct icalgauge_where *where = pvl_data(e); |
1303 | 1320 | ||
1304 | where->logic = l; | 1321 | where->logic = l; |
1305 | 1322 | ||
1306 | } | 1323 | } |
1307 | 1324 | ||
1308 | 1325 | ||
1309 | 1326 | ||
1310 | void ssyacc_add_select(struct icalgauge_impl* impl, char* str1) | 1327 | static void ssyacc_add_select(struct icalgauge_impl* impl, char* str1) |
1311 | { | 1328 | { |
1312 | char *c, *compstr, *propstr; | 1329 | char *c, *compstr, *propstr; |
1313 | struct icalgauge_where *where; | 1330 | struct icalgauge_where *where; |
1314 | 1331 | ||
1315 | /* Uses only the prop and comp fields of the where structure */ | 1332 | /* Uses only the prop and comp fields of the where structure */ |
1316 | if ( (where = malloc(sizeof(struct icalgauge_where))) ==0){ | 1333 | if ( (where = malloc(sizeof(struct icalgauge_where))) ==0){ |
1317 | icalerror_set_errno(ICAL_NEWFAILED_ERROR); | 1334 | icalerror_set_errno(ICAL_NEWFAILED_ERROR); |
1318 | return; | 1335 | return; |
1319 | } | 1336 | } |
1320 | 1337 | ||
1321 | memset(where,0,sizeof(struct icalgauge_where)); | 1338 | memset(where,0,sizeof(struct icalgauge_where)); |
1322 | where->logic = ICALGAUGELOGIC_NONE; | 1339 | where->logic = ICALGAUGELOGIC_NONE; |
1323 | where->compare = ICALGAUGECOMPARE_NONE; | 1340 | where->compare = ICALGAUGECOMPARE_NONE; |
1324 | where->comp = ICAL_NO_COMPONENT; | 1341 | where->comp = ICAL_NO_COMPONENT; |
1325 | where->prop = ICAL_NO_PROPERTY; | 1342 | where->prop = ICAL_NO_PROPERTY; |
1326 | 1343 | ||
1327 | /* Is there a period in str1 ? If so, the string specified both a | 1344 | /* Is there a period in str1 ? If so, the string specified both a |
1328 | component and a property*/ | 1345 | component and a property*/ |
1329 | if( (c = strrchr(str1,'.')) != 0){ | 1346 | if( (c = strrchr(str1,'.')) != 0){ |
1330 | compstr = str1; | 1347 | compstr = str1; |
1331 | propstr = c+1; | 1348 | propstr = c+1; |
1332 | *c = '\0'; | 1349 | *c = '\0'; |
1333 | } else { | 1350 | } else { |
1334 | compstr = 0; | 1351 | compstr = 0; |
1335 | propstr = str1; | 1352 | propstr = str1; |
1336 | } | 1353 | } |
1337 | 1354 | ||
1338 | 1355 | ||
1339 | /* Handle the case where a component was specified */ | 1356 | /* Handle the case where a component was specified */ |
1340 | if(compstr != 0){ | 1357 | if(compstr != 0){ |
1341 | where->comp = icalenum_string_to_component_kind(compstr); | 1358 | where->comp = icalenum_string_to_component_kind(compstr); |
1342 | } else { | 1359 | } else { |
1343 | where->comp = ICAL_NO_COMPONENT; | 1360 | where->comp = ICAL_NO_COMPONENT; |
1344 | } | 1361 | } |
1345 | 1362 | ||
1346 | 1363 | ||
1347 | /* If the property was '*', then accept all properties */ | 1364 | /* If the property was '*', then accept all properties */ |
1348 | if(strcmp("*",propstr) == 0) { | 1365 | if(strcmp("*",propstr) == 0) { |
1349 | where->prop = ICAL_ANY_PROPERTY; | 1366 | where->prop = ICAL_ANY_PROPERTY; |
1350 | } else { | 1367 | } else { |
1351 | where->prop = icalenum_string_to_property_kind(propstr); | 1368 | where->prop = icalenum_string_to_property_kind(propstr); |
1352 | } | 1369 | } |
1353 | 1370 | ||
1354 | 1371 | ||
1355 | if(where->prop == ICAL_NO_PROPERTY){ | 1372 | if(where->prop == ICAL_NO_PROPERTY){ |
1356 | icalgauge_free(where); | 1373 | free(where); |
1357 | icalerror_set_errno(ICAL_BADARG_ERROR); | 1374 | icalerror_set_errno(ICAL_BADARG_ERROR); |
1358 | return; | 1375 | return; |
1359 | } | 1376 | } |
1360 | 1377 | ||
1361 | pvl_push(impl->select,where); | 1378 | pvl_push(impl->select,where); |
1362 | } | 1379 | } |
1363 | 1380 | ||
1364 | void ssyacc_add_from(struct icalgauge_impl* impl, char* str1) | 1381 | static void ssyacc_add_from(struct icalgauge_impl* impl, char* str1) |
1365 | { | 1382 | { |
1366 | icalcomponent_kind ckind; | 1383 | icalcomponent_kind ckind; |
1367 | 1384 | ||
1368 | ckind = icalenum_string_to_component_kind(str1); | 1385 | ckind = icalenum_string_to_component_kind(str1); |
1369 | 1386 | ||
1370 | if(ckind == ICAL_NO_COMPONENT){ | 1387 | if(ckind == ICAL_NO_COMPONENT){ |
1371 | assert(0); | 1388 | assert(0); |
1372 | } | 1389 | } |
1373 | 1390 | ||
1374 | pvl_push(impl->from,(void*)ckind); | 1391 | pvl_push(impl->from,(void*)ckind); |
1375 | 1392 | ||
1376 | } | 1393 | } |
1377 | 1394 | ||
1378 | 1395 | ||
1379 | void sserror(char *s){ | 1396 | void sserror(char *s){ |
1380 | fprintf(stderr,"Parse error \'%s\'\n", s); | 1397 | fprintf(stderr,"Parse error \'%s\'\n", s); |
1398 | icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); | ||
1381 | } | 1399 | } |