author | zecke <zecke> | 2004-09-14 22:50:22 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-14 22:50:22 (UTC) |
commit | d46a01de16c8ad65b00c76beda547970f7972b62 (patch) (unidiff) | |
tree | 3ce4b630f5cd45c230c0a4f4ff92993a9c4f4f6c /library/backend/vcc_yacc.cpp | |
parent | 271a3753d1b71a85e5463b357abbfe46fce51732 (diff) | |
download | opie-d46a01de16c8ad65b00c76beda547970f7972b62.zip opie-d46a01de16c8ad65b00c76beda547970f7972b62.tar.gz opie-d46a01de16c8ad65b00c76beda547970f7972b62.tar.bz2 |
Be able to properly import vCard from Cell Phones
-rw-r--r-- | library/backend/vcc_yacc.cpp | 328 |
1 files changed, 165 insertions, 163 deletions
diff --git a/library/backend/vcc_yacc.cpp b/library/backend/vcc_yacc.cpp index bc05f87..68f11b5 100644 --- a/library/backend/vcc_yacc.cpp +++ b/library/backend/vcc_yacc.cpp | |||
@@ -1,5 +1,4 @@ | |||
1 | #ifndef lint | 1 | #ifndef lint |
2 | /*static char yysccsid[] = "from: @(#)yaccpar1.9 (Berkeley) 02/21/93";*/ | 2 | static char yysccsid[] = "@(#)yaccpar1.9 (Berkeley) 02/21/93"; |
3 | static char yyrcsid[] = "$Id$"; | ||
4 | #endif | 3 | #endif |
5 | #define YYBYACC 1 | 4 | #define YYBYACC 1 |
@@ -9,30 +8,6 @@ static char yyrcsid[] = "$Id$"; | |||
9 | #define yyerrok (yyerrflag=0) | 8 | #define yyerrok (yyerrflag=0) |
10 | #define YYRECOVERING (yyerrflag!=0) | 9 | #define YYRECOVERING (yyerrflag!=0) |
11 | #define yyparse vccparse | 10 | #define YYPREFIX "yy" |
12 | #define yylex vcclex | 11 | #line 1 "vcc.y" |
13 | #define yyerror vccerror | ||
14 | #define yychar vccchar | ||
15 | #define yyval vccval | ||
16 | #define yylval vcclval | ||
17 | #define yydebug vccdebug | ||
18 | #define yynerrs vccnerrs | ||
19 | #define yyerrflag vccerrflag | ||
20 | #define yyss vccss | ||
21 | #define yyssp vccssp | ||
22 | #define yyvs vccvs | ||
23 | #define yyvsp vccvsp | ||
24 | #define yylhs vcclhs | ||
25 | #define yylen vcclen | ||
26 | #define yydefred vccdefred | ||
27 | #define yydgoto vccdgoto | ||
28 | #define yysindex vccsindex | ||
29 | #define yyrindex vccrindex | ||
30 | #define yygindex vccgindex | ||
31 | #define yytable vcctable | ||
32 | #define yycheck vcccheck | ||
33 | #define yyname vccname | ||
34 | #define yyrule vccrule | ||
35 | #define YYPREFIX "vcc" | ||
36 | #line 1 "backend/vcc.y" | ||
37 | 12 | ||
38 | 13 | ||
@@ -87,4 +62,6 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | |||
87 | 62 | ||
88 | /* debugging utilities */ | 63 | /* debugging utilities */ |
64 | #define __DEBUG 1 | ||
65 | |||
89 | #if __DEBUG | 66 | #if __DEBUG |
90 | #define DBG_(x) printf x | 67 | #define DBG_(x) printf x |
@@ -156,13 +133,9 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | |||
156 | #include <ctype.h> | 133 | #include <ctype.h> |
157 | 134 | ||
158 | /*#ifdef PALMTOPCENTER | 135 | /*#ifdef PALMTOPCENTER */ |
159 | */ | 136 | /*#include <qpe/vobject_p.h> */ |
160 | /*#include <qpe/vobject_p.h> | 137 | /*#else */ |
161 | */ | ||
162 | /*#else | ||
163 | */ | ||
164 | #include "vobject_p.h" | 138 | #include "vobject_p.h" |
165 | /*#endif | 139 | /*#endif */ |
166 | */ | ||
167 | 140 | ||
168 | /**** Types, Constants ****/ | 141 | /**** Types, Constants ****/ |
@@ -170,6 +143,5 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | |||
170 | #define YYDEBUG 0/* 1 to compile in some debugging code */ | 143 | #define YYDEBUG 0/* 1 to compile in some debugging code */ |
171 | #define MAXTOKEN 256/* maximum token (line) length */ | 144 | #define MAXTOKEN 256/* maximum token (line) length */ |
172 | #define YYSTACKSIZE 100/* ~unref ? | 145 | #define YYSTACKSIZE 100/* ~unref ? */ |
173 | */ | ||
174 | #define MAXLEVEL 10/* max # of nested objects parseable */ | 146 | #define MAXLEVEL 10/* max # of nested objects parseable */ |
175 | /* (includes outermost) */ | 147 | /* (includes outermost) */ |
@@ -177,4 +149,5 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | |||
177 | 149 | ||
178 | /**** Global Variables ****/ | 150 | /**** Global Variables ****/ |
151 | int q_DontDecodeBase64Photo = 0; | ||
179 | int mime_lineNum, mime_numErrors; /* yyerror() can use these */ | 152 | int mime_lineNum, mime_numErrors; /* yyerror() can use these */ |
180 | static VObject* vObjList; | 153 | static VObject* vObjList; |
@@ -200,4 +173,5 @@ int yyparse(); | |||
200 | enum LexMode { | 173 | enum LexMode { |
201 | L_NORMAL, | 174 | L_NORMAL, |
175 | L_PARAMWORD, | ||
202 | L_VCARD, | 176 | L_VCARD, |
203 | L_VCAL, | 177 | L_VCAL, |
@@ -222,10 +196,10 @@ void mime_error(char *s); | |||
222 | void mime_error_(char *s); | 196 | void mime_error_(char *s); |
223 | 197 | ||
224 | #line 189 "backend/vcc.y" | 198 | #line 193 "vcc.y" |
225 | typedef union { | 199 | typedef union { |
226 | char *str; | 200 | char *str; |
227 | VObject *vobj; | 201 | VObject *vobj; |
228 | } YYSTYPE; | 202 | } YYSTYPE; |
229 | #line 225 "y.tab.c" | 203 | #line 204 "y.tab.c" |
230 | #define EQ 257 | 204 | #define EQ 257 |
231 | #define COLON 258 | 205 | #define COLON 258 |
@@ -247,71 +221,71 @@ typedef union { | |||
247 | #define STRING 274 | 221 | #define STRING 274 |
248 | #define YYERRCODE 256 | 222 | #define YYERRCODE 256 |
249 | short vcclhs[] = { -1, | 223 | short yylhs[] = { -1, |
250 | 0, 6, 6, 5, 5, 8, 3, 9, 3, 7, | 224 | 0, 6, 6, 5, 5, 8, 3, 9, 3, 7, |
251 | 7, 13, 10, 10, 15, 11, 11, 14, 14, 16, | 225 | 7, 13, 10, 10, 15, 11, 11, 14, 14, 16, |
252 | 17, 17, 1, 18, 12, 12, 2, 2, 20, 4, | 226 | 17, 18, 17, 1, 19, 12, 12, 2, 2, 21, |
253 | 21, 4, 19, 19, 22, 22, 22, 25, 23, 26, | 227 | 4, 22, 4, 20, 20, 23, 23, 23, 26, 24, |
254 | 23, 27, 24, 28, 24, | 228 | 27, 24, 28, 25, 29, 25, |
255 | }; | 229 | }; |
256 | short vcclen[] = { 2, | 230 | short yylen[] = { 2, |
257 | 1, 2, 1, 1, 1, 0, 4, 0, 3, 2, | 231 | 1, 2, 1, 1, 1, 0, 4, 0, 3, 2, |
258 | 1, 0, 5, 1, 0, 3, 1, 2, 1, 2, | 232 | 1, 0, 5, 1, 0, 3, 1, 2, 1, 2, |
259 | 1, 3, 1, 0, 4, 1, 1, 0, 0, 4, | 233 | 1, 0, 4, 1, 0, 4, 1, 1, 0, 0, |
260 | 0, 3, 2, 1, 1, 1, 1, 0, 4, 0, | 234 | 4, 0, 3, 2, 1, 1, 1, 1, 0, 4, |
261 | 3, 0, 4, 0, 3, | 235 | 0, 3, 0, 4, 0, 3, |
262 | }; | 236 | }; |
263 | short vccdefred[] = { 0, | 237 | short yydefred[] = { 0, |
264 | 0, 0, 0, 4, 5, 3, 0, 0, 0, 0, | 238 | 0, 0, 0, 4, 5, 3, 0, 0, 0, 0, |
265 | 0, 2, 14, 23, 0, 0, 11, 0, 9, 0, | 239 | 0, 2, 14, 24, 0, 0, 11, 0, 9, 0, |
266 | 0, 0, 0, 34, 35, 36, 32, 0, 7, 10, | 240 | 0, 0, 0, 35, 36, 37, 33, 0, 7, 10, |
267 | 12, 0, 0, 0, 0, 30, 33, 0, 0, 19, | 241 | 12, 0, 0, 0, 0, 31, 34, 0, 0, 19, |
268 | 0, 0, 41, 0, 45, 0, 20, 18, 27, 0, | 242 | 0, 0, 42, 0, 46, 0, 20, 18, 28, 0, |
269 | 0, 39, 43, 0, 24, 13, 22, 0, 25, | 243 | 0, 40, 44, 22, 25, 13, 0, 0, 23, 26, |
270 | }; | 244 | }; |
271 | short vccdgoto[] = { 3, | 245 | short yydgoto[] = { 3, |
272 | 15, 50, 4, 5, 6, 7, 22, 8, 9, 17, | 246 | 15, 50, 4, 5, 6, 7, 22, 8, 9, 17, |
273 | 18, 51, 41, 39, 28, 40, 47, 58, 23, 10, | 247 | 18, 51, 41, 39, 28, 40, 47, 57, 58, 23, |
274 | 11, 24, 25, 26, 32, 33, 34, 35, | 248 | 10, 11, 24, 25, 26, 32, 33, 34, 35, |
275 | }; | 249 | }; |
276 | short vccsindex[] = { -262, | 250 | short yysindex[] = { -255, |
277 | 0, 0, 0, 0, 0, 0, -262, -252, -219, -249, | 251 | 0, 0, 0, 0, 0, 0, -255, -215, -257, -234, |
278 | -256, 0, 0, 0, 0, -227, 0, -242, 0, 0, | 252 | -245, 0, 0, 0, 0, -242, 0, -210, 0, 0, |
279 | 0, -252, -254, 0, 0, 0, 0, -208, 0, 0, | 253 | 0, -215, -253, 0, 0, 0, 0, -247, 0, 0, |
280 | 0, -252, -228, -252, -213, 0, 0, -212, -208, 0, | 254 | 0, -215, -227, -215, -226, 0, 0, -221, -247, 0, |
281 | -214, -233, 0, -224, 0, -195, 0, 0, 0, -197, | 255 | -211, -237, 0, -218, 0, -204, 0, 0, 0, -198, |
282 | -199, 0, 0, -212, 0, 0, 0, -214, 0, | 256 | -199, 0, 0, 0, 0, 0, -221, -211, 0, 0, |
283 | }; | 257 | }; |
284 | short vccrindex[] = { 0, | 258 | short yyrindex[] = { 0, |
285 | -222, -238, 0, 0, 0, 0, 65, 0, 0, 0, | 259 | -216, -239, 0, 0, 0, 0, 65, 0, 0, 0, |
286 | 0, 0, 0, 0, -215, 0, 0, 0, 0, -220, | 260 | 0, 0, 0, 0, -213, 0, 0, 0, 0, -214, |
287 | -218, -260, 0, 0, 0, 0, 0, 0, 0, 0, | 261 | -212, -264, 0, 0, 0, 0, 0, 0, 0, 0, |
288 | 0, 0, 0, 0, 0, 0, 0, 0, -192, 0, | 262 | 0, 0, 0, 0, 0, 0, 0, 0, -192, 0, |
289 | -250, 0, 0, 0, 0, -202, 0, 0, 0, -196, | 263 | -252, 0, 0, 0, 0, -209, 0, 0, 0, -196, |
290 | 0, 0, 0, 0, 0, 0, 0, -250, 0, | 264 | 0, 0, 0, 0, 0, 0, 0, -252, 0, 0, |
291 | }; | 265 | }; |
292 | short vccgindex[] = { 0, | 266 | short yygindex[] = { 0, |
293 | 3, 0, 0, 0, 61, 0, -7, 0, 0, -16, | 267 | -36, 0, 0, 0, 61, 0, -7, 0, 0, -16, |
294 | 0, 11, 0, 0, 0, 31, 0, 0, 0, 0, | 268 | 0, 11, 0, 0, 0, 31, 0, 0, 0, 0, |
295 | 0, 48, 0, 0, 0, 0, 0, 0, | 269 | 0, 0, 48, 0, 0, 0, 0, 0, 0, |
296 | }; | 270 | }; |
297 | #define YYTABLESIZE 71 | 271 | #define YYTABLESIZE 71 |
298 | short vcctable[] = { 30, | 272 | short yytable[] = { 30, |
299 | 16, 13, 1, 13, 2, 30, 13, 37, 37, 28, | 273 | 16, 46, 13, 38, 38, 30, 38, 29, 19, 1, |
300 | 37, 27, 28, 36, 20, 31, 21, 29, 14, 20, | 274 | 29, 2, 38, 13, 36, 20, 30, 21, 13, 14, |
301 | 14, 21, 13, 14, 42, 30, 44, 30, 13, 31, | 275 | 59, 13, 27, 29, 42, 30, 44, 30, 32, 30, |
302 | 29, 13, 29, 6, 29, 38, 52, 42, 29, 14, | 276 | 14, 30, 52, 30, 20, 14, 21, 13, 14, 6, |
303 | 46, 43, 17, 8, 15, 14, 19, 53, 14, 40, | 277 | 13, 39, 43, 43, 17, 45, 15, 31, 21, 8, |
304 | 6, 38, 38, 44, 42, 21, 57, 21, 45, 49, | 278 | 21, 14, 54, 53, 14, 41, 6, 14, 39, 45, |
305 | 14, 54, 55, 56, 1, 16, 26, 12, 59, 48, | 279 | 43, 55, 49, 56, 1, 16, 27, 12, 60, 48, |
306 | 37, | 280 | 37, |
307 | }; | 281 | }; |
308 | short vcccheck[] = { 16, | 282 | short yycheck[] = { 16, |
309 | 8, 256, 265, 256, 267, 22, 256, 268, 269, 260, | 283 | 8, 38, 256, 268, 269, 22, 271, 260, 266, 265, |
310 | 271, 268, 263, 268, 269, 258, 271, 256, 273, 269, | 284 | 263, 267, 260, 256, 268, 269, 256, 271, 256, 273, |
311 | 273, 271, 256, 273, 32, 42, 34, 44, 256, 268, | 285 | 57, 256, 268, 266, 32, 42, 34, 44, 268, 269, |
312 | 269, 256, 271, 256, 273, 256, 270, 256, 266, 273, | 286 | 273, 271, 270, 273, 269, 273, 271, 256, 273, 256, |
313 | 38, 270, 258, 266, 260, 273, 266, 272, 273, 270, | 287 | 256, 256, 270, 256, 258, 272, 260, 258, 258, 266, |
314 | 273, 260, 273, 272, 273, 258, 54, 260, 272, 274, | 288 | 260, 273, 257, 272, 273, 270, 273, 273, 273, 272, |
315 | 273, 257, 260, 263, 0, 258, 263, 7, 58, 39, | 289 | 273, 260, 274, 263, 0, 258, 263, 7, 58, 39, |
316 | 23, | 290 | 23, |
317 | }; | 291 | }; |
@@ -322,5 +296,5 @@ short vcccheck[] = { 16, | |||
322 | #define YYMAXTOKEN 274 | 296 | #define YYMAXTOKEN 274 |
323 | #if YYDEBUG | 297 | #if YYDEBUG |
324 | char *vccname[] = { | 298 | char *yyname[] = { |
325 | "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | 299 | "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
326 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | 300 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
@@ -333,5 +307,5 @@ char *vccname[] = { | |||
333 | "END_VCAL","BEGIN_VEVENT","END_VEVENT","BEGIN_VTODO","END_VTODO","ID","STRING", | 307 | "END_VCAL","BEGIN_VEVENT","END_VEVENT","BEGIN_VTODO","END_VTODO","ID","STRING", |
334 | }; | 308 | }; |
335 | char *vccrule[] = { | 309 | char *yyrule[] = { |
336 | "$accept : mime", | 310 | "$accept : mime", |
337 | "mime : vobjects", | 311 | "mime : vobjects", |
@@ -356,15 +330,16 @@ char *vccrule[] = { | |||
356 | "attr_param : SEMICOLON attr", | 330 | "attr_param : SEMICOLON attr", |
357 | "attr : name", | 331 | "attr : name", |
358 | "attr : name EQ name", | ||
359 | "name : ID", | ||
360 | "$$5 :", | 332 | "$$5 :", |
361 | "values : value SEMICOLON $$5 values", | 333 | "attr : name EQ $$5 name", |
334 | "name : ID", | ||
335 | "$$6 :", | ||
336 | "values : value SEMICOLON $$6 values", | ||
362 | "values : value", | 337 | "values : value", |
363 | "value : STRING", | 338 | "value : STRING", |
364 | "value :", | 339 | "value :", |
365 | "$$6 :", | ||
366 | "vcal : BEGIN_VCAL $$6 calitems END_VCAL", | ||
367 | "$$7 :", | 340 | "$$7 :", |
368 | "vcal : BEGIN_VCAL $$7 END_VCAL", | 341 | "vcal : BEGIN_VCAL $$7 calitems END_VCAL", |
342 | "$$8 :", | ||
343 | "vcal : BEGIN_VCAL $$8 END_VCAL", | ||
369 | "calitems : calitems calitem", | 344 | "calitems : calitems calitem", |
370 | "calitems : calitem", | 345 | "calitems : calitem", |
@@ -372,12 +347,12 @@ char *vccrule[] = { | |||
372 | "calitem : todoitem", | 347 | "calitem : todoitem", |
373 | "calitem : items", | 348 | "calitem : items", |
374 | "$$8 :", | ||
375 | "eventitem : BEGIN_VEVENT $$8 items END_VEVENT", | ||
376 | "$$9 :", | 349 | "$$9 :", |
377 | "eventitem : BEGIN_VEVENT $$9 END_VEVENT", | 350 | "eventitem : BEGIN_VEVENT $$9 items END_VEVENT", |
378 | "$$10 :", | 351 | "$$10 :", |
379 | "todoitem : BEGIN_VTODO $$10 items END_VTODO", | 352 | "eventitem : BEGIN_VEVENT $$10 END_VEVENT", |
380 | "$$11 :", | 353 | "$$11 :", |
381 | "todoitem : BEGIN_VTODO $$11 END_VTODO", | 354 | "todoitem : BEGIN_VTODO $$11 items END_VTODO", |
355 | "$$12 :", | ||
356 | "todoitem : BEGIN_VTODO $$12 END_VTODO", | ||
382 | }; | 357 | }; |
383 | #endif | 358 | #endif |
@@ -404,5 +379,5 @@ short yyss[YYSTACKSIZE]; | |||
404 | YYSTYPE yyvs[YYSTACKSIZE]; | 379 | YYSTYPE yyvs[YYSTACKSIZE]; |
405 | #define yystacksize YYSTACKSIZE | 380 | #define yystacksize YYSTACKSIZE |
406 | #line 382 "backend/vcc.y" | 381 | #line 390 "vcc.y" |
407 | 382 | ||
408 | /*------------------------------------*/ | 383 | /*------------------------------------*/ |
@@ -477,8 +452,13 @@ static void enterAttr(const char *s1, const char *s2) | |||
477 | else | 452 | else |
478 | addProp(curProp,p1); | 453 | addProp(curProp,p1); |
479 | if (qstricmp(p1,VCBase64Prop) == 0 || (s2 && qstricmp(p2,VCBase64Prop)==0)) | 454 | /* Lookup strings so we can quickly use pointer comparison */ |
455 | static const char* base64 = lookupProp_(VCBase64Prop); | ||
456 | static const char* qp = lookupProp_(VCQuotedPrintableProp); | ||
457 | static const char* photo = lookupProp_(VCPhotoProp); | ||
458 | static const char* encoding = lookupProp_(VCEncodingProp); | ||
459 | if ((!q_DontDecodeBase64Photo || vObjectName(curProp) != photo) | ||
460 | && (p1 == base64 || p1 == encoding && p2 == base64)) | ||
480 | lexPushMode(L_BASE64); | 461 | lexPushMode(L_BASE64); |
481 | else if (qstricmp(p1,VCQuotedPrintableProp) == 0 | 462 | else if (p1 == qp || p1 == encoding && p2 == qp) |
482 | || (s2 && qstricmp(p2,VCQuotedPrintableProp)==0)) | ||
483 | lexPushMode(L_QUOTED_PRINTABLE); | 463 | lexPushMode(L_QUOTED_PRINTABLE); |
484 | deleteStr(s1); deleteStr(s2); | 464 | deleteStr(s1); deleteStr(s2); |
@@ -667,4 +647,18 @@ static char* lexGetWord() { | |||
667 | } | 647 | } |
668 | 648 | ||
649 | static char* lexGetParamWord() | ||
650 | { | ||
651 | int c; | ||
652 | lexClearToken(); | ||
653 | c = lexLookahead(); | ||
654 | while (c >= ' ' && c < 127 && !strchr("[]:=,.;",c)) { | ||
655 | lexAppendc(c); | ||
656 | lexSkipLookahead(); | ||
657 | c = lexLookahead(); | ||
658 | } | ||
659 | lexAppendc(0); | ||
660 | return lexStr(); | ||
661 | } | ||
662 | |||
669 | static void lexPushLookaheadc(int c) { | 663 | static void lexPushLookaheadc(int c) { |
670 | int putptr; | 664 | int putptr; |
@@ -1036,4 +1030,5 @@ static int yylex() { | |||
1036 | if (lexmode == L_VALUES) { | 1030 | if (lexmode == L_VALUES) { |
1037 | int c = lexGetc(); | 1031 | int c = lexGetc(); |
1032 | int c2; | ||
1038 | if (c == ';' && fieldedProp) { | 1033 | if (c == ';' && fieldedProp) { |
1039 | DBG_(("db: SEMICOLON\n")); | 1034 | DBG_(("db: SEMICOLON\n")); |
@@ -1043,11 +1038,10 @@ static int yylex() { | |||
1043 | return SEMICOLON; | 1038 | return SEMICOLON; |
1044 | } | 1039 | } |
1045 | else if (strchr("\n",c)) { | 1040 | else if (strchr("\n",c) && (c2 = lexLookahead()) != ' ' && c2 != '\t') { |
1046 | ++mime_lineNum; | 1041 | ++mime_lineNum; |
1047 | /* consume all line separator(s) adjacent to each other */ | 1042 | /* consume all line separator(s) adjacent to each other */ |
1048 | c = lexLookahead(); | 1043 | while (strchr("\n",c2)) { |
1049 | while (strchr("\n",c)) { | ||
1050 | lexSkipLookahead(); | 1044 | lexSkipLookahead(); |
1051 | c = lexLookahead(); | 1045 | c2 = lexLookahead(); |
1052 | ++mime_lineNum; | 1046 | ++mime_lineNum; |
1053 | } | 1047 | } |
@@ -1080,6 +1074,8 @@ static int yylex() { | |||
1080 | else return 0; | 1074 | else return 0; |
1081 | } | 1075 | } |
1082 | } | 1076 | } else if (lexmode == L_PARAMWORD) { |
1083 | else { | 1077 | yylval.str = lexGetParamWord(); |
1078 | return ID; | ||
1079 | } else { | ||
1084 | /* normal mode */ | 1080 | /* normal mode */ |
1085 | while (1) { | 1081 | while (1) { |
@@ -1243,5 +1239,5 @@ void mime_error_(char *s) | |||
1243 | } | 1239 | } |
1244 | 1240 | ||
1245 | #line 1241 "y.tab.c" | 1241 | #line 1242 "y.tab.c" |
1246 | #define YYABORT goto yyabort | 1242 | #define YYABORT goto yyabort |
1247 | #define YYREJECT goto yyabort | 1243 | #define YYREJECT goto yyabort |
@@ -1249,9 +1245,5 @@ void mime_error_(char *s) | |||
1249 | #define YYERROR goto yyerrlab | 1245 | #define YYERROR goto yyerrlab |
1250 | int | 1246 | int |
1251 | #if defined(__STDC__) | ||
1252 | yyparse(void) | ||
1253 | #else | ||
1254 | yyparse() | 1247 | yyparse() |
1255 | #endif | ||
1256 | { | 1248 | { |
1257 | register int yym, yyn, yystate; | 1249 | register int yym, yyn, yystate; |
@@ -1277,5 +1269,5 @@ yyparse() | |||
1277 | 1269 | ||
1278 | yyloop: | 1270 | yyloop: |
1279 | if ((yyn = yydefred[yystate]) != 0) goto yyreduce; | 1271 | if (yyn = yydefred[yystate]) goto yyreduce; |
1280 | if (yychar < 0) | 1272 | if (yychar < 0) |
1281 | { | 1273 | { |
@@ -1317,4 +1309,8 @@ yyloop: | |||
1317 | } | 1309 | } |
1318 | if (yyerrflag) goto yyinrecovery; | 1310 | if (yyerrflag) goto yyinrecovery; |
1311 | #ifdef lint | ||
1312 | goto yynewerror; | ||
1313 | #endif | ||
1314 | yynewerror: | ||
1319 | yyerror("syntax error"); | 1315 | yyerror("syntax error"); |
1320 | #ifdef lint | 1316 | #ifdef lint |
@@ -1385,13 +1381,13 @@ yyreduce: | |||
1385 | { | 1381 | { |
1386 | case 2: | 1382 | case 2: |
1387 | #line 221 "backend/vcc.y" | 1383 | #line 225 "vcc.y" |
1388 | { addList(&vObjList, yyvsp[0].vobj); curObj = 0; } | 1384 | { addList(&vObjList, yyvsp[0].vobj); curObj = 0; } |
1389 | break; | 1385 | break; |
1390 | case 3: | 1386 | case 3: |
1391 | #line 223 "backend/vcc.y" | 1387 | #line 227 "vcc.y" |
1392 | { addList(&vObjList, yyvsp[0].vobj); curObj = 0; } | 1388 | { addList(&vObjList, yyvsp[0].vobj); curObj = 0; } |
1393 | break; | 1389 | break; |
1394 | case 6: | 1390 | case 6: |
1395 | #line 232 "backend/vcc.y" | 1391 | #line 236 "vcc.y" |
1396 | { | 1392 | { |
1397 | lexPushMode(L_VCARD); | 1393 | lexPushMode(L_VCARD); |
@@ -1400,5 +1396,5 @@ case 6: | |||
1400 | break; | 1396 | break; |
1401 | case 7: | 1397 | case 7: |
1402 | #line 237 "backend/vcc.y" | 1398 | #line 241 "vcc.y" |
1403 | { | 1399 | { |
1404 | lexPopMode(0); | 1400 | lexPopMode(0); |
@@ -1407,5 +1403,5 @@ case 7: | |||
1407 | break; | 1403 | break; |
1408 | case 8: | 1404 | case 8: |
1409 | #line 242 "backend/vcc.y" | 1405 | #line 246 "vcc.y" |
1410 | { | 1406 | { |
1411 | lexPushMode(L_VCARD); | 1407 | lexPushMode(L_VCARD); |
@@ -1414,5 +1410,5 @@ case 8: | |||
1414 | break; | 1410 | break; |
1415 | case 9: | 1411 | case 9: |
1416 | #line 247 "backend/vcc.y" | 1412 | #line 251 "vcc.y" |
1417 | { | 1413 | { |
1418 | lexPopMode(0); | 1414 | lexPopMode(0); |
@@ -1421,5 +1417,5 @@ case 9: | |||
1421 | break; | 1417 | break; |
1422 | case 12: | 1418 | case 12: |
1423 | #line 258 "backend/vcc.y" | 1419 | #line 262 "vcc.y" |
1424 | { | 1420 | { |
1425 | lexPushMode(L_VALUES); | 1421 | lexPushMode(L_VALUES); |
@@ -1427,5 +1423,5 @@ case 12: | |||
1427 | break; | 1423 | break; |
1428 | case 13: | 1424 | case 13: |
1429 | #line 262 "backend/vcc.y" | 1425 | #line 266 "vcc.y" |
1430 | { | 1426 | { |
1431 | if (lexWithinMode(L_BASE64) || lexWithinMode(L_QUOTED_PRINTABLE)) | 1427 | if (lexWithinMode(L_BASE64) || lexWithinMode(L_QUOTED_PRINTABLE)) |
@@ -1435,5 +1431,5 @@ case 13: | |||
1435 | break; | 1431 | break; |
1436 | case 15: | 1432 | case 15: |
1437 | #line 271 "backend/vcc.y" | 1433 | #line 275 "vcc.y" |
1438 | { | 1434 | { |
1439 | enterProps(yyvsp[0].str); | 1435 | enterProps(yyvsp[0].str); |
@@ -1441,5 +1437,5 @@ case 15: | |||
1441 | break; | 1437 | break; |
1442 | case 17: | 1438 | case 17: |
1443 | #line 276 "backend/vcc.y" | 1439 | #line 280 "vcc.y" |
1444 | { | 1440 | { |
1445 | enterProps(yyvsp[0].str); | 1441 | enterProps(yyvsp[0].str); |
@@ -1447,5 +1443,5 @@ case 17: | |||
1447 | break; | 1443 | break; |
1448 | case 21: | 1444 | case 21: |
1449 | #line 289 "backend/vcc.y" | 1445 | #line 293 "vcc.y" |
1450 | { | 1446 | { |
1451 | enterAttr(yyvsp[0].str,0); | 1447 | enterAttr(yyvsp[0].str,0); |
@@ -1453,40 +1449,46 @@ case 21: | |||
1453 | break; | 1449 | break; |
1454 | case 22: | 1450 | case 22: |
1455 | #line 293 "backend/vcc.y" | 1451 | #line 297 "vcc.y" |
1456 | { | 1452 | { |
1457 | enterAttr(yyvsp[-2].str,yyvsp[0].str); | 1453 | lexPushMode(L_PARAMWORD); |
1458 | 1454 | } | |
1455 | break; | ||
1456 | case 23: | ||
1457 | #line 301 "vcc.y" | ||
1458 | { | ||
1459 | lexPopMode(0); | ||
1460 | enterAttr(yyvsp[-3].str,yyvsp[0].str); | ||
1459 | } | 1461 | } |
1460 | break; | 1462 | break; |
1461 | case 24: | 1463 | case 25: |
1462 | #line 302 "backend/vcc.y" | 1464 | #line 310 "vcc.y" |
1463 | { enterValues(yyvsp[-1].str); } | 1465 | { enterValues(yyvsp[-1].str); } |
1464 | break; | 1466 | break; |
1465 | case 26: | 1467 | case 27: |
1466 | #line 304 "backend/vcc.y" | 1468 | #line 312 "vcc.y" |
1467 | { enterValues(yyvsp[0].str); } | 1469 | { enterValues(yyvsp[0].str); } |
1468 | break; | 1470 | break; |
1469 | case 28: | 1471 | case 29: |
1470 | #line 309 "backend/vcc.y" | 1472 | #line 317 "vcc.y" |
1471 | { yyval.str = 0; } | 1473 | { yyval.str = 0; } |
1472 | break; | 1474 | break; |
1473 | case 29: | 1475 | case 30: |
1474 | #line 314 "backend/vcc.y" | 1476 | #line 322 "vcc.y" |
1475 | { if (!pushVObject(VCCalProp)) YYERROR; } | 1477 | { if (!pushVObject(VCCalProp)) YYERROR; } |
1476 | break; | 1478 | break; |
1477 | case 30: | 1479 | case 31: |
1478 | #line 317 "backend/vcc.y" | 1480 | #line 325 "vcc.y" |
1479 | { yyval.vobj = popVObject(); } | 1481 | { yyval.vobj = popVObject(); } |
1480 | break; | 1482 | break; |
1481 | case 31: | 1483 | case 32: |
1482 | #line 319 "backend/vcc.y" | 1484 | #line 327 "vcc.y" |
1483 | { if (!pushVObject(VCCalProp)) YYERROR; } | 1485 | { if (!pushVObject(VCCalProp)) YYERROR; } |
1484 | break; | 1486 | break; |
1485 | case 32: | 1487 | case 33: |
1486 | #line 321 "backend/vcc.y" | 1488 | #line 329 "vcc.y" |
1487 | { yyval.vobj = popVObject(); } | 1489 | { yyval.vobj = popVObject(); } |
1488 | break; | 1490 | break; |
1489 | case 38: | 1491 | case 39: |
1490 | #line 336 "backend/vcc.y" | 1492 | #line 344 "vcc.y" |
1491 | { | 1493 | { |
1492 | lexPushMode(L_VEVENT); | 1494 | lexPushMode(L_VEVENT); |
@@ -1494,6 +1496,6 @@ case 38: | |||
1494 | } | 1496 | } |
1495 | break; | 1497 | break; |
1496 | case 39: | 1498 | case 40: |
1497 | #line 342 "backend/vcc.y" | 1499 | #line 350 "vcc.y" |
1498 | { | 1500 | { |
1499 | lexPopMode(0); | 1501 | lexPopMode(0); |
@@ -1501,6 +1503,6 @@ case 39: | |||
1501 | } | 1503 | } |
1502 | break; | 1504 | break; |
1503 | case 40: | 1505 | case 41: |
1504 | #line 347 "backend/vcc.y" | 1506 | #line 355 "vcc.y" |
1505 | { | 1507 | { |
1506 | lexPushMode(L_VEVENT); | 1508 | lexPushMode(L_VEVENT); |
@@ -1508,6 +1510,6 @@ case 40: | |||
1508 | } | 1510 | } |
1509 | break; | 1511 | break; |
1510 | case 41: | 1512 | case 42: |
1511 | #line 352 "backend/vcc.y" | 1513 | #line 360 "vcc.y" |
1512 | { | 1514 | { |
1513 | lexPopMode(0); | 1515 | lexPopMode(0); |
@@ -1515,6 +1517,6 @@ case 41: | |||
1515 | } | 1517 | } |
1516 | break; | 1518 | break; |
1517 | case 42: | 1519 | case 43: |
1518 | #line 360 "backend/vcc.y" | 1520 | #line 368 "vcc.y" |
1519 | { | 1521 | { |
1520 | lexPushMode(L_VTODO); | 1522 | lexPushMode(L_VTODO); |
@@ -1522,6 +1524,6 @@ case 42: | |||
1522 | } | 1524 | } |
1523 | break; | 1525 | break; |
1524 | case 43: | 1526 | case 44: |
1525 | #line 366 "backend/vcc.y" | 1527 | #line 374 "vcc.y" |
1526 | { | 1528 | { |
1527 | lexPopMode(0); | 1529 | lexPopMode(0); |
@@ -1529,6 +1531,6 @@ case 43: | |||
1529 | } | 1531 | } |
1530 | break; | 1532 | break; |
1531 | case 44: | 1533 | case 45: |
1532 | #line 371 "backend/vcc.y" | 1534 | #line 379 "vcc.y" |
1533 | { | 1535 | { |
1534 | lexPushMode(L_VTODO); | 1536 | lexPushMode(L_VTODO); |
@@ -1536,6 +1538,6 @@ case 44: | |||
1536 | } | 1538 | } |
1537 | break; | 1539 | break; |
1538 | case 45: | 1540 | case 46: |
1539 | #line 376 "backend/vcc.y" | 1541 | #line 384 "vcc.y" |
1540 | { | 1542 | { |
1541 | lexPopMode(0); | 1543 | lexPopMode(0); |
@@ -1543,5 +1545,5 @@ case 45: | |||
1543 | } | 1545 | } |
1544 | break; | 1546 | break; |
1545 | #line 1541 "y.tab.c" | 1547 | #line 1548 "y.tab.c" |
1546 | } | 1548 | } |
1547 | yyssp -= yym; | 1549 | yyssp -= yym; |