summaryrefslogtreecommitdiff
path: root/library/backend/vcc_yacc.cpp
authorschurig <schurig>2004-09-15 09:52:10 (UTC)
committer schurig <schurig>2004-09-15 09:52:10 (UTC)
commitbb7cd69b07a5d6e00a29b23dc8bfebc511d34891 (patch) (unidiff)
tree651e8619cfe51c649237618452b3b43fe015fdb4 /library/backend/vcc_yacc.cpp
parentedc1f329044600c15cdccdacce2b2d6a776ca4ce (diff)
downloadopie-bb7cd69b07a5d6e00a29b23dc8bfebc511d34891.zip
opie-bb7cd69b07a5d6e00a29b23dc8bfebc511d34891.tar.gz
opie-bb7cd69b07a5d6e00a29b23dc8bfebc511d34891.tar.bz2
changed CDLF into CR
Diffstat (limited to 'library/backend/vcc_yacc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/vcc_yacc.cpp2202
1 files changed, 1101 insertions, 1101 deletions
diff --git a/library/backend/vcc_yacc.cpp b/library/backend/vcc_yacc.cpp
index 68f11b5..cb8f8c4 100644
--- a/library/backend/vcc_yacc.cpp
+++ b/library/backend/vcc_yacc.cpp
@@ -9,196 +9,196 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
9#define YYRECOVERING (yyerrflag!=0) 9#define YYRECOVERING (yyerrflag!=0)
10#define YYPREFIX "yy" 10#define YYPREFIX "yy"
11#line 1 "vcc.y" 11#line 1 "vcc.y"
12 12
13 13
14/*************************************************************************** 14/***************************************************************************
15(C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International 15(C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International
16Business Machines Corporation and Siemens Rolm Communications Inc. 16Business Machines Corporation and Siemens Rolm Communications Inc.
17 17
18For purposes of this license notice, the term Licensors shall mean, 18For purposes of this license notice, the term Licensors shall mean,
19collectively, Apple Computer, Inc., AT&T Corp., International 19collectively, Apple Computer, Inc., AT&T Corp., International
20Business Machines Corporation and Siemens Rolm Communications Inc. 20Business Machines Corporation and Siemens Rolm Communications Inc.
21The term Licensor shall mean any of the Licensors. 21The term Licensor shall mean any of the Licensors.
22 22
23Subject to acceptance of the following conditions, permission is hereby 23Subject to acceptance of the following conditions, permission is hereby
24granted by Licensors without the need for written agreement and without 24granted by Licensors without the need for written agreement and without
25license or royalty fees, to use, copy, modify and distribute this 25license or royalty fees, to use, copy, modify and distribute this
26software for any purpose. 26software for any purpose.
27 27
28The above copyright notice and the following four paragraphs must be 28The above copyright notice and the following four paragraphs must be
29reproduced in all copies of this software and any software including 29reproduced in all copies of this software and any software including
30this software. 30this software.
31 31
32THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE 32THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE
33ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR 33ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR
34MODIFICATIONS. 34MODIFICATIONS.
35 35
36IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT, 36IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT,
37INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT 37INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
38OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 38OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
39DAMAGE. 39DAMAGE.
40 40
41EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, 41EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED,
42INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE 42INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE
43IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44PURPOSE. 44PURPOSE.
45 45
46The software is provided with RESTRICTED RIGHTS. Use, duplication, or 46The software is provided with RESTRICTED RIGHTS. Use, duplication, or
47disclosure by the government are subject to restrictions set forth in 47disclosure by the government are subject to restrictions set forth in
48DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. 48DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
49 49
50***************************************************************************/ 50***************************************************************************/
51 51
52/* 52/*
53 * src: vcc.c 53 * src: vcc.c
54 * doc: Parser for vCard and vCalendar. Note that this code is 54 * doc: Parser for vCard and vCalendar. Note that this code is
55 * generated by a yacc parser generator. Generally it should not 55 * generated by a yacc parser generator. Generally it should not
56 * be edited by hand. The real source is vcc.y. The #line directives 56 * be edited by hand. The real source is vcc.y. The #line directives
57 * can be commented out here to make it easier to trace through 57 * can be commented out here to make it easier to trace through
58 * in a debugger. However, if a bug is found it should 58 * in a debugger. However, if a bug is found it should
59 * be fixed in vcc.y and this file regenerated. 59 * be fixed in vcc.y and this file regenerated.
60 */ 60 */
61 61
62 62
63/* debugging utilities */ 63/* debugging utilities */
64#define __DEBUG 1 64#define __DEBUG 1
65 65
66#if __DEBUG 66#if __DEBUG
67#define DBG_(x) printf x 67#define DBG_(x) printf x
68#else 68#else
69#define DBG_(x) 69#define DBG_(x)
70#endif 70#endif
71 71
72/**** External Functions ****/ 72/**** External Functions ****/
73 73
74/* assign local name to parser variables and functions so that 74/* assign local name to parser variables and functions so that
75 we can use more than one yacc based parser. 75 we can use more than one yacc based parser.
76*/ 76*/
77 77
78#if 0 78#if 0
79#define yyparse mime_parse 79#define yyparse mime_parse
80#define yylex mime_lex 80#define yylex mime_lex
81#define yyerror mime_error 81#define yyerror mime_error
82#define yychar mime_char 82#define yychar mime_char
83/* #define p_yyval p_mime_val */ 83/* #define p_yyval p_mime_val */
84#undef yyval 84#undef yyval
85#define yyval mime_yyval 85#define yyval mime_yyval
86/* #define p_yylval p_mime_lval */ 86/* #define p_yylval p_mime_lval */
87#undef yylval 87#undef yylval
88#define yylval mime_yylval 88#define yylval mime_yylval
89#define yydebug mime_debug 89#define yydebug mime_debug
90#define yynerrs mime_nerrs 90#define yynerrs mime_nerrs
91#define yyerrflag mime_errflag 91#define yyerrflag mime_errflag
92#define yyss mime_ss 92#define yyss mime_ss
93#define yyssp mime_ssp 93#define yyssp mime_ssp
94#define yyvs mime_vs 94#define yyvs mime_vs
95#define yyvsp mime_vsp 95#define yyvsp mime_vsp
96#define yylhs mime_lhs 96#define yylhs mime_lhs
97#define yylen mime_len 97#define yylen mime_len
98#define yydefred mime_defred 98#define yydefred mime_defred
99#define yydgoto mime_dgoto 99#define yydgoto mime_dgoto
100#define yysindex mime_sindex 100#define yysindex mime_sindex
101#define yyrindex mime_rindex 101#define yyrindex mime_rindex
102#define yygindex mime_gindex 102#define yygindex mime_gindex
103#define yytable mime_table 103#define yytable mime_table
104#define yycheck mime_check 104#define yycheck mime_check
105#define yyname mime_name 105#define yyname mime_name
106#define yyrule mime_rule 106#define yyrule mime_rule
107#ifdef YYPREFIX 107#ifdef YYPREFIX
108#undef YYPREFIX 108#undef YYPREFIX
109#endif 109#endif
110#define YYPREFIX "mime_" 110#define YYPREFIX "mime_"
111#endif 111#endif
112 112
113 113
114#ifndef _NO_LINE_FOLDING 114#ifndef _NO_LINE_FOLDING
115#define _SUPPORT_LINE_FOLDING 1 115#define _SUPPORT_LINE_FOLDING 1
116#endif 116#endif
117 117
118/* undef below if compile with MFC */ 118/* undef below if compile with MFC */
119/* #define INCLUDEMFC 1 */ 119/* #define INCLUDEMFC 1 */
120 120
121#if defined(WIN32) || defined(_WIN32) 121#if defined(WIN32) || defined(_WIN32)
122#ifdef INCLUDEMFC 122#ifdef INCLUDEMFC
123#include <afx.h> 123#include <afx.h>
124#endif 124#endif
125#endif 125#endif
126 126
127#include <string.h> 127#include <string.h>
128#ifndef __MWERKS__ 128#ifndef __MWERKS__
129#include <stdlib.h> 129#include <stdlib.h>
130#endif 130#endif
131#include <stdio.h> 131#include <stdio.h>
132#include <stdlib.h> 132#include <stdlib.h>
133#include <ctype.h> 133#include <ctype.h>
134 134
135/*#ifdef PALMTOPCENTER */ 135/*#ifdef PALMTOPCENTER*/
136/*#include <qpe/vobject_p.h> */ 136/*#include <qpe/vobject_p.h>*/
137/*#else */ 137/*#else*/
138#include "vobject_p.h" 138#include "vobject_p.h"
139/*#endif */ 139/*#endif*/
140 140
141/**** Types, Constants ****/ 141/**** Types, Constants ****/
142 142
143 #define YYDEBUG 0/* 1 to compile in some debugging code */ 143 #define YYDEBUG 0/* 1 to compile in some debugging code */
144 #define MAXTOKEN 256/* maximum token (line) length */ 144 #define MAXTOKEN 256/* maximum token (line) length */
145 #define YYSTACKSIZE 100/* ~unref ? */ 145 #define YYSTACKSIZE 100/* ~unref ?*/
146 #define MAXLEVEL 10/* max # of nested objects parseable */ 146 #define MAXLEVEL 10/* max # of nested objects parseable */
147 /* (includes outermost) */ 147 /* (includes outermost) */
148 148
149 149
150/**** Global Variables ****/ 150/**** Global Variables ****/
151int q_DontDecodeBase64Photo = 0; 151int q_DontDecodeBase64Photo = 0;
152int mime_lineNum, mime_numErrors; /* yyerror() can use these */ 152int mime_lineNum, mime_numErrors; /* yyerror() can use these */
153static VObject* vObjList; 153static VObject* vObjList;
154static VObject *curProp; 154static VObject *curProp;
155static VObject *curObj; 155static VObject *curObj;
156static VObject* ObjStack[MAXLEVEL]; 156static VObject* ObjStack[MAXLEVEL];
157static int ObjStackTop; 157static int ObjStackTop;
158 158
159 159
160/* A helpful utility for the rest of the app. */ 160/* A helpful utility for the rest of the app. */
161#if __CPLUSPLUS__ 161#if __CPLUSPLUS__
162extern "C" { 162extern "C" {
163#endif 163#endif
164 164
165 extern void yyerror(char *s); 165 extern void yyerror(char *s);
166 166
167#if __CPLUSPLUS__ 167#if __CPLUSPLUS__
168 }; 168 };
169#endif 169#endif
170 170
171int yyparse(); 171int yyparse();
172 172
173enum LexMode { 173enum LexMode {
174 L_NORMAL, 174 L_NORMAL,
175 L_PARAMWORD, 175 L_PARAMWORD,
176 L_VCARD, 176 L_VCARD,
177 L_VCAL, 177 L_VCAL,
178 L_VEVENT, 178 L_VEVENT,
179 L_VTODO, 179 L_VTODO,
180 L_VALUES, 180 L_VALUES,
181 L_BASE64, 181 L_BASE64,
182 L_QUOTED_PRINTABLE 182 L_QUOTED_PRINTABLE
183 }; 183 };
184 184
185/**** Private Forward Declarations ****/ 185/**** Private Forward Declarations ****/
186static int pushVObject(const char *prop); 186static int pushVObject(const char *prop);
187static VObject* popVObject(); 187static VObject* popVObject();
188static void lexPopMode(int top); 188static void lexPopMode(int top);
189static int lexWithinMode(enum LexMode mode); 189static int lexWithinMode(enum LexMode mode);
190static void lexPushMode(enum LexMode mode); 190static void lexPushMode(enum LexMode mode);
191static void enterProps(const char *s); 191static void enterProps(const char *s);
192static void enterAttr(const char *s1, const char *s2); 192static void enterAttr(const char *s1, const char *s2);
193static void enterValues(const char *value); 193static void enterValues(const char *value);
194#define mime_error yyerror 194#define mime_error yyerror
195void mime_error(char *s); 195void mime_error(char *s);
196void mime_error_(char *s); 196void mime_error_(char *s);
197 197
198#line 193 "vcc.y" 198#line 193 "vcc.y"
199typedef union { 199typedef union {
200 char *str; 200 char *str;
201 VObject *vobj; 201 VObject *vobj;
202 } YYSTYPE; 202 } YYSTYPE;
203#line 204 "y.tab.c" 203#line 204 "y.tab.c"
204#define EQ 257 204#define EQ 257
@@ -379,865 +379,865 @@ short yyss[YYSTACKSIZE];
379YYSTYPE yyvs[YYSTACKSIZE]; 379YYSTYPE yyvs[YYSTACKSIZE];
380#define yystacksize YYSTACKSIZE 380#define yystacksize YYSTACKSIZE
381#line 390 "vcc.y" 381#line 390 "vcc.y"
382 382
383/*------------------------------------*/ 383/*------------------------------------*/
384static int pushVObject(const char *prop) 384static int pushVObject(const char *prop)
385 { 385 {
386 VObject *newObj; 386 VObject *newObj;
387 if (ObjStackTop == MAXLEVEL) 387 if (ObjStackTop == MAXLEVEL)
388 return FALSE; 388 return FALSE;
389 389
390 ObjStack[++ObjStackTop] = curObj; 390 ObjStack[++ObjStackTop] = curObj;
391 391
392 if (curObj) { 392 if (curObj) {
393 newObj = addProp(curObj,prop); 393 newObj = addProp(curObj,prop);
394 curObj = newObj; 394 curObj = newObj;
395 } 395 }
396 else 396 else
397 curObj = newVObject(prop); 397 curObj = newVObject(prop);
398 398
399 return TRUE; 399 return TRUE;
400 } 400 }
401 401
402 402
403/*---------------------------------------*/ 403/*---------------------------------------*/
404/* This pops the recently built vCard off the stack and returns it. */ 404/* This pops the recently built vCard off the stack and returns it. */
405static VObject* popVObject() 405static VObject* popVObject()
406 { 406 {
407 VObject *oldObj; 407 VObject *oldObj;
408 if (ObjStackTop < 0) { 408 if (ObjStackTop < 0) {
409 yyerror("pop on empty Object Stack\n"); 409 yyerror("pop on empty Object Stack\n");
410 return 0; 410 return 0;
411 } 411 }
412 oldObj = curObj; 412 oldObj = curObj;
413 curObj = ObjStack[ObjStackTop--]; 413 curObj = ObjStack[ObjStackTop--];
414 414
415 return oldObj; 415 return oldObj;
416 } 416 }
417 417
418 418
419static void enterValues(const char *value) 419static void enterValues(const char *value)
420 { 420 {
421 if (fieldedProp && *fieldedProp) { 421 if (fieldedProp && *fieldedProp) {
422 if (value) { 422 if (value) {
423 addPropValue(curProp,*fieldedProp,value); 423 addPropValue(curProp,*fieldedProp,value);
424 } 424 }
425 /* else this field is empty, advance to next field */ 425 /* else this field is empty, advance to next field */
426 fieldedProp++; 426 fieldedProp++;
427 } 427 }
428 else { 428 else {
429 if (value) { 429 if (value) {
430 setVObjectStringZValue_(curProp,strdup( value )); 430 setVObjectStringZValue_(curProp,strdup( value ));
431 } 431 }
432 } 432 }
433 deleteStr(value); 433 deleteStr(value);
434 } 434 }
435 435
436static void enterProps(const char *s) 436static void enterProps(const char *s)
437 { 437 {
438 curProp = addGroup(curObj,s); 438 curProp = addGroup(curObj,s);
439 deleteStr(s); 439 deleteStr(s);
440 } 440 }
441 441
442static void enterAttr(const char *s1, const char *s2) 442static void enterAttr(const char *s1, const char *s2)
443 { 443 {
444 const char *p1, *p2=0; 444 const char *p1, *p2=0;
445 p1 = lookupProp_(s1); 445 p1 = lookupProp_(s1);
446 if (s2) { 446 if (s2) {
447 VObject *a; 447 VObject *a;
448 p2 = lookupProp_(s2); 448 p2 = lookupProp_(s2);
449 a = addProp(curProp,p1); 449 a = addProp(curProp,p1);
450 setVObjectStringZValue(a,p2); 450 setVObjectStringZValue(a,p2);
451 } 451 }
452 else 452 else
453 addProp(curProp,p1); 453 addProp(curProp,p1);
454 /* Lookup strings so we can quickly use pointer comparison */ 454 /* Lookup strings so we can quickly use pointer comparison */
455 static const char* base64 = lookupProp_(VCBase64Prop); 455 static const char* base64 = lookupProp_(VCBase64Prop);
456 static const char* qp = lookupProp_(VCQuotedPrintableProp); 456 static const char* qp = lookupProp_(VCQuotedPrintableProp);
457 static const char* photo = lookupProp_(VCPhotoProp); 457 static const char* photo = lookupProp_(VCPhotoProp);
458 static const char* encoding = lookupProp_(VCEncodingProp); 458 static const char* encoding = lookupProp_(VCEncodingProp);
459 if ((!q_DontDecodeBase64Photo || vObjectName(curProp) != photo) 459 if ((!q_DontDecodeBase64Photo || vObjectName(curProp) != photo)
460 && (p1 == base64 || p1 == encoding && p2 == base64)) 460 && (p1 == base64 || p1 == encoding && p2 == base64))
461 lexPushMode(L_BASE64); 461 lexPushMode(L_BASE64);
462 else if (p1 == qp || p1 == encoding && p2 == qp) 462 else if (p1 == qp || p1 == encoding && p2 == qp)
463 lexPushMode(L_QUOTED_PRINTABLE); 463 lexPushMode(L_QUOTED_PRINTABLE);
464 deleteStr(s1); deleteStr(s2); 464 deleteStr(s1); deleteStr(s2);
465 } 465 }
466 466
467 467
468#define MAX_LEX_LOOKAHEAD_0 32 468#define MAX_LEX_LOOKAHEAD_0 32
469#define MAX_LEX_LOOKAHEAD 64 469#define MAX_LEX_LOOKAHEAD 64
470#define MAX_LEX_MODE_STACK_SIZE 10 470#define MAX_LEX_MODE_STACK_SIZE 10
471#define LEXMODE() (lexBuf.lexModeStack[lexBuf.lexModeStackTop]) 471#define LEXMODE() (lexBuf.lexModeStack[lexBuf.lexModeStackTop])
472 472
473struct LexBuf { 473struct LexBuf {
474 /* input */ 474 /* input */
475#ifdef INCLUDEMFC 475#ifdef INCLUDEMFC
476 CFile *inputFile; 476 CFile *inputFile;
477#else 477#else
478 FILE *inputFile; 478 FILE *inputFile;
479#endif 479#endif
480 char *inputString; 480 char *inputString;
481 unsigned long curPos; 481 unsigned long curPos;
482 unsigned long inputLen; 482 unsigned long inputLen;
483 /* lookahead buffer */ 483 /* lookahead buffer */
484 /* -- lookahead buffer is short instead of char so that EOF 484 /* -- lookahead buffer is short instead of char so that EOF
485 / can be represented correctly. 485 / can be represented correctly.
486 */ 486 */
487 unsigned long len; 487 unsigned long len;
488 short buf[MAX_LEX_LOOKAHEAD]; 488 short buf[MAX_LEX_LOOKAHEAD];
489 unsigned long getPtr; 489 unsigned long getPtr;
490 /* context stack */ 490 /* context stack */
491 unsigned long lexModeStackTop; 491 unsigned long lexModeStackTop;
492 enum LexMode lexModeStack[MAX_LEX_MODE_STACK_SIZE]; 492 enum LexMode lexModeStack[MAX_LEX_MODE_STACK_SIZE];
493 /* token buffer */ 493 /* token buffer */
494 unsigned long maxToken; 494 unsigned long maxToken;
495 char *strs; 495 char *strs;
496 unsigned long strsLen; 496 unsigned long strsLen;
497 } lexBuf; 497 } lexBuf;
498 498
499static void lexPushMode(enum LexMode mode) 499static void lexPushMode(enum LexMode mode)
500 { 500 {
501 if (lexBuf.lexModeStackTop == (MAX_LEX_MODE_STACK_SIZE-1)) 501 if (lexBuf.lexModeStackTop == (MAX_LEX_MODE_STACK_SIZE-1))
502 yyerror("lexical context stack overflow"); 502 yyerror("lexical context stack overflow");
503 else { 503 else {
504 lexBuf.lexModeStack[++lexBuf.lexModeStackTop] = mode; 504 lexBuf.lexModeStack[++lexBuf.lexModeStackTop] = mode;
505 } 505 }
506 } 506 }
507 507
508static void lexPopMode(int top) 508static void lexPopMode(int top)
509 { 509 {
510 /* special case of pop for ease of error recovery -- this 510 /* special case of pop for ease of error recovery -- this
511 version will never underflow */ 511 version will never underflow */
512 if (top) 512 if (top)
513 lexBuf.lexModeStackTop = 0; 513 lexBuf.lexModeStackTop = 0;
514 else 514 else
515 if (lexBuf.lexModeStackTop > 0) lexBuf.lexModeStackTop--; 515 if (lexBuf.lexModeStackTop > 0) lexBuf.lexModeStackTop--;
516 } 516 }
517 517
518static int lexWithinMode(enum LexMode mode) { 518static int lexWithinMode(enum LexMode mode) {
519 unsigned long i; 519 unsigned long i;
520 for (i=0;i<lexBuf.lexModeStackTop;i++) 520 for (i=0;i<lexBuf.lexModeStackTop;i++)
521 if (mode == lexBuf.lexModeStack[i]) return 1; 521 if (mode == lexBuf.lexModeStack[i]) return 1;
522 return 0; 522 return 0;
523 } 523 }
524 524
525static int lexGetc_() 525static int lexGetc_()
526 { 526 {
527 /* get next char from input, no buffering. */ 527 /* get next char from input, no buffering. */
528 if (lexBuf.curPos == lexBuf.inputLen) 528 if (lexBuf.curPos == lexBuf.inputLen)
529 return EOF; 529 return EOF;
530 else if (lexBuf.inputString) 530 else if (lexBuf.inputString)
531 return *(lexBuf.inputString + lexBuf.curPos++); 531 return *(lexBuf.inputString + lexBuf.curPos++);
532 else { 532 else {
533#ifdef INCLUDEMFC 533#ifdef INCLUDEMFC
534 char result; 534 char result;
535 return lexBuf.inputFile->Read(&result, 1) == 1 ? result : EOF; 535 return lexBuf.inputFile->Read(&result, 1) == 1 ? result : EOF;
536#else 536#else
537 return fgetc(lexBuf.inputFile); 537 return fgetc(lexBuf.inputFile);
538#endif 538#endif
539 } 539 }
540 } 540 }
541 541
542static int lexGeta() 542static int lexGeta()
543 { 543 {
544 ++lexBuf.len; 544 ++lexBuf.len;
545 return (lexBuf.buf[lexBuf.getPtr] = lexGetc_()); 545 return (lexBuf.buf[lexBuf.getPtr] = lexGetc_());
546 } 546 }
547 547
548static int lexGeta_(int i) 548static int lexGeta_(int i)
549 { 549 {
550 ++lexBuf.len; 550 ++lexBuf.len;
551 return (lexBuf.buf[(lexBuf.getPtr+i)%MAX_LEX_LOOKAHEAD] = lexGetc_()); 551 return (lexBuf.buf[(lexBuf.getPtr+i)%MAX_LEX_LOOKAHEAD] = lexGetc_());
552 } 552 }
553 553
554static void lexSkipLookahead() { 554static void lexSkipLookahead() {
555 if (lexBuf.len > 0 && lexBuf.buf[lexBuf.getPtr]!=EOF) { 555 if (lexBuf.len > 0 && lexBuf.buf[lexBuf.getPtr]!=EOF) {
556 /* don't skip EOF. */ 556 /* don't skip EOF. */
557 lexBuf.getPtr = (lexBuf.getPtr + 1) % MAX_LEX_LOOKAHEAD; 557 lexBuf.getPtr = (lexBuf.getPtr + 1) % MAX_LEX_LOOKAHEAD;
558 lexBuf.len--; 558 lexBuf.len--;
559 } 559 }
560 } 560 }
561 561
562static int lexLookahead() { 562static int lexLookahead() {
563 int c = (lexBuf.len)? 563 int c = (lexBuf.len)?
564 lexBuf.buf[lexBuf.getPtr]: 564 lexBuf.buf[lexBuf.getPtr]:
565 lexGeta(); 565 lexGeta();
566 /* do the \r\n -> \n or \r -> \n translation here */ 566 /* do the \r\n -> \n or \r -> \n translation here */
567 if (c == '\r') { 567 if (c == '\r') {
568 int a = (lexBuf.len>1)? 568 int a = (lexBuf.len>1)?
569 lexBuf.buf[(lexBuf.getPtr+1)%MAX_LEX_LOOKAHEAD]: 569 lexBuf.buf[(lexBuf.getPtr+1)%MAX_LEX_LOOKAHEAD]:
570 lexGeta_(1); 570 lexGeta_(1);
571 if (a == '\n') { 571 if (a == '\n') {
572 lexSkipLookahead(); 572 lexSkipLookahead();
573 } 573 }
574 lexBuf.buf[lexBuf.getPtr] = c = '\n'; 574 lexBuf.buf[lexBuf.getPtr] = c = '\n';
575 } 575 }
576 else if (c == '\n') { 576 else if (c == '\n') {
577 int a = (lexBuf.len>1)? 577 int a = (lexBuf.len>1)?
578 lexBuf.buf[lexBuf.getPtr+1]: 578 lexBuf.buf[lexBuf.getPtr+1]:
579 lexGeta_(1); 579 lexGeta_(1);
580 if (a == '\r') { 580 if (a == '\r') {
581 lexSkipLookahead(); 581 lexSkipLookahead();
582 } 582 }
583 lexBuf.buf[lexBuf.getPtr] = '\n'; 583 lexBuf.buf[lexBuf.getPtr] = '\n';
584 } 584 }
585 return c; 585 return c;
586 } 586 }
587 587
588static int lexGetc() { 588static int lexGetc() {
589 int c = lexLookahead(); 589 int c = lexLookahead();
590 if (lexBuf.len > 0 && lexBuf.buf[lexBuf.getPtr]!=EOF) { 590 if (lexBuf.len > 0 && lexBuf.buf[lexBuf.getPtr]!=EOF) {
591 /* EOF will remain in lookahead buffer */ 591 /* EOF will remain in lookahead buffer */
592 lexBuf.getPtr = (lexBuf.getPtr + 1) % MAX_LEX_LOOKAHEAD; 592 lexBuf.getPtr = (lexBuf.getPtr + 1) % MAX_LEX_LOOKAHEAD;
593 lexBuf.len--; 593 lexBuf.len--;
594 } 594 }
595 return c; 595 return c;
596 } 596 }
597 597
598static void lexSkipLookaheadWord() { 598static void lexSkipLookaheadWord() {
599 if (lexBuf.strsLen <= lexBuf.len) { 599 if (lexBuf.strsLen <= lexBuf.len) {
600 lexBuf.len -= lexBuf.strsLen; 600 lexBuf.len -= lexBuf.strsLen;
601 lexBuf.getPtr = (lexBuf.getPtr + lexBuf.strsLen) % MAX_LEX_LOOKAHEAD; 601 lexBuf.getPtr = (lexBuf.getPtr + lexBuf.strsLen) % MAX_LEX_LOOKAHEAD;
602 } 602 }
603 } 603 }
604 604
605static void lexClearToken() 605static void lexClearToken()
606 { 606 {
607 lexBuf.strsLen = 0; 607 lexBuf.strsLen = 0;
608 } 608 }
609 609
610static void lexAppendc(int c) 610static void lexAppendc(int c)
611 { 611 {
612 lexBuf.strs[lexBuf.strsLen] = c; 612 lexBuf.strs[lexBuf.strsLen] = c;
613 /* append up to zero termination */ 613 /* append up to zero termination */
614 if (c == 0) return; 614 if (c == 0) return;
615 lexBuf.strsLen++; 615 lexBuf.strsLen++;
616 if (lexBuf.strsLen > lexBuf.maxToken) { 616 if (lexBuf.strsLen > lexBuf.maxToken) {
617 /* double the token string size */ 617 /* double the token string size */
618 lexBuf.maxToken <<= 1; 618 lexBuf.maxToken <<= 1;
619 lexBuf.strs = (char*) realloc(lexBuf.strs,(size_t)lexBuf.maxToken); 619 lexBuf.strs = (char*) realloc(lexBuf.strs,(size_t)lexBuf.maxToken);
620 } 620 }
621 } 621 }
622 622
623static char* lexStr() { 623static char* lexStr() {
624 return dupStr(lexBuf.strs,(size_t)lexBuf.strsLen+1); 624 return dupStr(lexBuf.strs,(size_t)lexBuf.strsLen+1);
625 } 625 }
626 626
627static void lexSkipWhite() { 627static void lexSkipWhite() {
628 int c = lexLookahead(); 628 int c = lexLookahead();
629 while (c == ' ' || c == '\t') { 629 while (c == ' ' || c == '\t') {
630 lexSkipLookahead(); 630 lexSkipLookahead();
631 c = lexLookahead(); 631 c = lexLookahead();
632 } 632 }
633 } 633 }
634 634
635static char* lexGetWord() { 635static char* lexGetWord() {
636 int c; 636 int c;
637 lexSkipWhite(); 637 lexSkipWhite();
638 lexClearToken(); 638 lexClearToken();
639 c = lexLookahead(); 639 c = lexLookahead();
640 while (c != EOF && !strchr("\t\n ;:=",c)) { 640 while (c != EOF && !strchr("\t\n ;:=",c)) {
641 lexAppendc(c); 641 lexAppendc(c);
642 lexSkipLookahead(); 642 lexSkipLookahead();
643 c = lexLookahead(); 643 c = lexLookahead();
644 } 644 }
645 lexAppendc(0); 645 lexAppendc(0);
646 return lexStr(); 646 return lexStr();
647 } 647 }
648 648
649static char* lexGetParamWord() 649static char* lexGetParamWord()
650{ 650{
651 int c; 651 int c;
652 lexClearToken(); 652 lexClearToken();
653 c = lexLookahead(); 653 c = lexLookahead();
654 while (c >= ' ' && c < 127 && !strchr("[]:=,.;",c)) { 654 while (c >= ' ' && c < 127 && !strchr("[]:=,.;",c)) {
655 lexAppendc(c); 655 lexAppendc(c);
656 lexSkipLookahead(); 656 lexSkipLookahead();
657 c = lexLookahead(); 657 c = lexLookahead();
658 } 658 }
659 lexAppendc(0); 659 lexAppendc(0);
660 return lexStr(); 660 return lexStr();
661} 661}
662 662
663static void lexPushLookaheadc(int c) { 663static void lexPushLookaheadc(int c) {
664 int putptr; 664 int putptr;
665 /* can't putback EOF, because it never leaves lookahead buffer */ 665 /* can't putback EOF, because it never leaves lookahead buffer */
666 if (c == EOF) return; 666 if (c == EOF) return;
667 putptr = (int)lexBuf.getPtr - 1; 667 putptr = (int)lexBuf.getPtr - 1;
668 if (putptr < 0) putptr += MAX_LEX_LOOKAHEAD; 668 if (putptr < 0) putptr += MAX_LEX_LOOKAHEAD;
669 lexBuf.getPtr = putptr; 669 lexBuf.getPtr = putptr;
670 lexBuf.buf[putptr] = c; 670 lexBuf.buf[putptr] = c;
671 lexBuf.len += 1; 671 lexBuf.len += 1;
672 } 672 }
673 673
674static char* lexLookaheadWord() { 674static char* lexLookaheadWord() {
675 /* this function can lookahead word with max size of MAX_LEX_LOOKAHEAD_0 675 /* this function can lookahead word with max size of MAX_LEX_LOOKAHEAD_0
676 / and thing bigger than that will stop the lookahead and return 0; 676 / and thing bigger than that will stop the lookahead and return 0;
677 / leading white spaces are not recoverable. 677 / leading white spaces are not recoverable.
678 */ 678 */
679 int c; 679 int c;
680 int len = 0; 680 int len = 0;
681 int curgetptr = 0; 681 int curgetptr = 0;
682 lexSkipWhite(); 682 lexSkipWhite();
683 lexClearToken(); 683 lexClearToken();
684 curgetptr = (int)lexBuf.getPtr;// remember! 684 curgetptr = (int)lexBuf.getPtr;// remember!
685 while (len < (MAX_LEX_LOOKAHEAD_0)) { 685 while (len < (MAX_LEX_LOOKAHEAD_0)) {
686 c = lexGetc(); 686 c = lexGetc();
687 len++; 687 len++;
688 if (c == EOF || strchr("\t\n ;:=", c)) { 688 if (c == EOF || strchr("\t\n ;:=", c)) {
689 lexAppendc(0); 689 lexAppendc(0);
690 /* restore lookahead buf. */ 690 /* restore lookahead buf. */
691 lexBuf.len += len; 691 lexBuf.len += len;
692 lexBuf.getPtr = curgetptr; 692 lexBuf.getPtr = curgetptr;
693 return lexStr(); 693 return lexStr();
694 } 694 }
695 else 695 else
696 lexAppendc(c); 696 lexAppendc(c);
697 } 697 }
698 lexBuf.len += len;/* char that has been moved to lookahead buffer */ 698 lexBuf.len += len;/* char that has been moved to lookahead buffer */
699 lexBuf.getPtr = curgetptr; 699 lexBuf.getPtr = curgetptr;
700 return 0; 700 return 0;
701 } 701 }
702 702
703#ifdef _SUPPORT_LINE_FOLDING 703#ifdef _SUPPORT_LINE_FOLDING
704static void handleMoreRFC822LineBreak(int c) { 704static void handleMoreRFC822LineBreak(int c) {
705 /* suport RFC 822 line break in cases like 705 /* suport RFC 822 line break in cases like
706 *ADR: foo; 706 *ADR: foo;
707 * morefoo; 707 * morefoo;
708 * more foo; 708 * more foo;
709 */ 709 */
710 if (c == ';') { 710 if (c == ';') {
711 int a; 711 int a;
712 lexSkipLookahead(); 712 lexSkipLookahead();
713 /* skip white spaces */ 713 /* skip white spaces */
714 a = lexLookahead(); 714 a = lexLookahead();
715 while (a == ' ' || a == '\t') { 715 while (a == ' ' || a == '\t') {
716 lexSkipLookahead(); 716 lexSkipLookahead();
717 a = lexLookahead(); 717 a = lexLookahead();
718 } 718 }
719 if (a == '\n') { 719 if (a == '\n') {
720 lexSkipLookahead(); 720 lexSkipLookahead();
721 a = lexLookahead(); 721 a = lexLookahead();
722 if (a == ' ' || a == '\t') { 722 if (a == ' ' || a == '\t') {
723 /* continuation, throw away all the \n and spaces read so 723 /* continuation, throw away all the \n and spaces read so
724 * far 724 * far
725 */ 725 */
726 lexSkipWhite(); 726 lexSkipWhite();
727 lexPushLookaheadc(';'); 727 lexPushLookaheadc(';');
728 } 728 }
729 else { 729 else {
730 lexPushLookaheadc('\n'); 730 lexPushLookaheadc('\n');
731 lexPushLookaheadc(';'); 731 lexPushLookaheadc(';');
732 } 732 }
733 } 733 }
734 else { 734 else {
735 lexPushLookaheadc(';'); 735 lexPushLookaheadc(';');
736 } 736 }
737 } 737 }
738 } 738 }
739 739
740static char* lexGet1Value() { 740static char* lexGet1Value() {
741 int c; 741 int c;
742 lexSkipWhite(); 742 lexSkipWhite();
743 c = lexLookahead(); 743 c = lexLookahead();
744 lexClearToken(); 744 lexClearToken();
745 while (c != EOF && (c != ';' || !fieldedProp)) { 745 while (c != EOF && (c != ';' || !fieldedProp)) {
746 if (c == '\\' ) { 746 if (c == '\\' ) {
747 int a; 747 int a;
748 lexSkipLookahead(); 748 lexSkipLookahead();
749 a = lexLookahead(); 749 a = lexLookahead();
750 if ( a == ';' ) { 750 if ( a == ';' ) {
751 lexAppendc( ';' ); 751 lexAppendc( ';' );
752 lexSkipLookahead(); 752 lexSkipLookahead();
753 } else if ( a == '\n' ) { 753 } else if ( a == '\n' ) {
754 lexAppendc( '\n' ); 754 lexAppendc( '\n' );
755 lexSkipLookahead(); 755 lexSkipLookahead();
756 } else if ( a == '\\' ) { 756 } else if ( a == '\\' ) {
757 lexAppendc( '\\' ); 757 lexAppendc( '\\' );
758 lexSkipLookahead(); 758 lexSkipLookahead();
759 } else { 759 } else {
760 lexAppendc('\\'); 760 lexAppendc('\\');
761 } 761 }
762 } else if (c == '\n') { 762 } else if (c == '\n') {
763 int a; 763 int a;
764 lexSkipLookahead(); 764 lexSkipLookahead();
765 a = lexLookahead(); 765 a = lexLookahead();
766 if (a == ' ' || a == '\t') { 766 if (a == ' ' || a == '\t') {
767 lexAppendc(' '); 767 lexAppendc(' ');
768 lexSkipLookahead(); 768 lexSkipLookahead();
769 } 769 }
770 else { 770 else {
771 lexPushLookaheadc('\n'); 771 lexPushLookaheadc('\n');
772 break; 772 break;
773 } 773 }
774 } 774 }
775 else { 775 else {
776 lexAppendc(c); 776 lexAppendc(c);
777 lexSkipLookahead(); 777 lexSkipLookahead();
778 } 778 }
779 c = lexLookahead(); 779 c = lexLookahead();
780 } 780 }
781 lexAppendc(0); 781 lexAppendc(0);
782 handleMoreRFC822LineBreak(c); 782 handleMoreRFC822LineBreak(c);
783 return c==EOF?0:lexStr(); 783 return c==EOF?0:lexStr();
784 } 784 }
785#endif 785#endif
786 786
787static int match_begin_name(int end) { 787static int match_begin_name(int end) {
788 char *n = lexLookaheadWord(); 788 char *n = lexLookaheadWord();
789 int token = ID; 789 int token = ID;
790 if (n) { 790 if (n) {
791 if (!qstricmp(n,"vcard")) token = end?END_VCARD:BEGIN_VCARD; 791 if (!qstricmp(n,"vcard")) token = end?END_VCARD:BEGIN_VCARD;
792 else if (!qstricmp(n,"vcalendar")) token = end?END_VCAL:BEGIN_VCAL; 792 else if (!qstricmp(n,"vcalendar")) token = end?END_VCAL:BEGIN_VCAL;
793 else if (!qstricmp(n,"vevent")) token = end?END_VEVENT:BEGIN_VEVENT; 793 else if (!qstricmp(n,"vevent")) token = end?END_VEVENT:BEGIN_VEVENT;
794 else if (!qstricmp(n,"vtodo")) token = end?END_VTODO:BEGIN_VTODO; 794 else if (!qstricmp(n,"vtodo")) token = end?END_VTODO:BEGIN_VTODO;
795 deleteStr(n); 795 deleteStr(n);
796 return token; 796 return token;
797 } 797 }
798 return 0; 798 return 0;
799 } 799 }
800 800
801 801
802#ifdef INCLUDEMFC 802#ifdef INCLUDEMFC
803void initLex(const char *inputstring, unsigned long inputlen, CFile *inputfile) 803void initLex(const char *inputstring, unsigned long inputlen, CFile *inputfile)
804#else 804#else
805void initLex(const char *inputstring, unsigned long inputlen, FILE *inputfile) 805void initLex(const char *inputstring, unsigned long inputlen, FILE *inputfile)
806#endif 806#endif
807 { 807 {
808 // initialize lex mode stack 808 // initialize lex mode stack
809 lexBuf.lexModeStack[lexBuf.lexModeStackTop=0] = L_NORMAL; 809 lexBuf.lexModeStack[lexBuf.lexModeStackTop=0] = L_NORMAL;
810 810
811 // iniatialize lex buffer. 811 // iniatialize lex buffer.
812 lexBuf.inputString = (char*) inputstring; 812 lexBuf.inputString = (char*) inputstring;
813 lexBuf.inputLen = inputlen; 813 lexBuf.inputLen = inputlen;
814 lexBuf.curPos = 0; 814 lexBuf.curPos = 0;
815 lexBuf.inputFile = inputfile; 815 lexBuf.inputFile = inputfile;
816 816
817 lexBuf.len = 0; 817 lexBuf.len = 0;
818 lexBuf.getPtr = 0; 818 lexBuf.getPtr = 0;
819 819
820 lexBuf.maxToken = MAXTOKEN; 820 lexBuf.maxToken = MAXTOKEN;
821 lexBuf.strs = (char*)malloc(MAXTOKEN); 821 lexBuf.strs = (char*)malloc(MAXTOKEN);
822 lexBuf.strsLen = 0; 822 lexBuf.strsLen = 0;
823 823
824 } 824 }
825 825
826static void finiLex() { 826static void finiLex() {
827 free(lexBuf.strs); 827 free(lexBuf.strs);
828 } 828 }
829 829
830 830
831/*-----------------------------------*/ 831/*-----------------------------------*/
832/* This parses and converts the base64 format for binary encoding into 832/* This parses and converts the base64 format for binary encoding into
833 * a decoded buffer (allocated with new). See RFC 1521. 833 * a decoded buffer (allocated with new). See RFC 1521.
834 */ 834 */
835static int lexGetDataFromBase64() 835static int lexGetDataFromBase64()
836 { 836 {
837 unsigned long bytesLen = 0, bytesMax = 0; 837 unsigned long bytesLen = 0, bytesMax = 0;
838 int quadIx = 0, pad = 0; 838 int quadIx = 0, pad = 0;
839 unsigned long trip = 0; 839 unsigned long trip = 0;
840 unsigned char b; 840 unsigned char b;
841 int c; 841 int c;
842 unsigned char *bytes = NULL; 842 unsigned char *bytes = NULL;
843 unsigned char *oldBytes = NULL; 843 unsigned char *oldBytes = NULL;
844 844
845 DBG_(("db: lexGetDataFromBase64\n")); 845 DBG_(("db: lexGetDataFromBase64\n"));
846 while (1) { 846 while (1) {
847 c = lexGetc(); 847 c = lexGetc();
848 lexSkipWhite(); 848 lexSkipWhite();
849 if (c == '\n') { 849 if (c == '\n') {
850 ++mime_lineNum; 850 ++mime_lineNum;
851 if (lexLookahead() == '\n') { 851 if (lexLookahead() == '\n') {
852 /* a '\n' character by itself means end of data */ 852 /* a '\n' character by itself means end of data */
853 break; 853 break;
854 } 854 }
855 else continue; /* ignore '\n' */ 855 else continue; /* ignore '\n' */
856 } 856 }
857 else { 857 else {
858 if ((c >= 'A') && (c <= 'Z')) 858 if ((c >= 'A') && (c <= 'Z'))
859 b = (unsigned char)(c - 'A'); 859 b = (unsigned char)(c - 'A');
860 else if ((c >= 'a') && (c <= 'z')) 860 else if ((c >= 'a') && (c <= 'z'))
861 b = (unsigned char)(c - 'a') + 26; 861 b = (unsigned char)(c - 'a') + 26;
862 else if ((c >= '0') && (c <= '9')) 862 else if ((c >= '0') && (c <= '9'))
863 b = (unsigned char)(c - '0') + 52; 863 b = (unsigned char)(c - '0') + 52;
864 else if (c == '+') 864 else if (c == '+')
865 b = 62; 865 b = 62;
866 else if (c == '/') 866 else if (c == '/')
867 b = 63; 867 b = 63;
868 else if (c == '=') { 868 else if (c == '=') {
869 b = 0; 869 b = 0;
870 pad++; 870 pad++;
871 } else { /* error condition */ 871 } else { /* error condition */
872 if (bytes) free(bytes); 872 if (bytes) free(bytes);
873 else if (oldBytes) free(oldBytes); 873 else if (oldBytes) free(oldBytes);
874 // error recovery: skip until 2 adjacent newlines. 874 // error recovery: skip until 2 adjacent newlines.
875 DBG_(("db: invalid character 0x%x '%c'\n", c,c)); 875 DBG_(("db: invalid character 0x%x '%c'\n", c,c));
876 if (c != EOF) { 876 if (c != EOF) {
877 c = lexGetc(); 877 c = lexGetc();
878 while (c != EOF) { 878 while (c != EOF) {
879 if (c == '\n') { 879 if (c == '\n') {
880 lexSkipWhite(); 880 lexSkipWhite();
881 if(lexLookahead() == '\n') { 881 if(lexLookahead() == '\n') {
882 ++mime_lineNum; 882 ++mime_lineNum;
883 break; 883 break;
884 } 884 }
885 } 885 }
886 c = lexGetc(); 886 c = lexGetc();
887 } 887 }
888 } 888 }
889 return c != EOF; 889 return c != EOF;
890 } 890 }
891 trip = (trip << 6) | b; 891 trip = (trip << 6) | b;
892 if (++quadIx == 4) { 892 if (++quadIx == 4) {
893 unsigned char outBytes[3]; 893 unsigned char outBytes[3];
894 int numOut; 894 int numOut;
895 int i; 895 int i;
896 for (i = 0; i < 3; i++) { 896 for (i = 0; i < 3; i++) {
897 outBytes[2-i] = (unsigned char)(trip & 0xFF); 897 outBytes[2-i] = (unsigned char)(trip & 0xFF);
898 trip >>= 8; 898 trip >>= 8;
899 } 899 }
900 numOut = 3 - pad; 900 numOut = 3 - pad;
901 if (bytesLen + numOut > bytesMax) { 901 if (bytesLen + numOut > bytesMax) {
902 if (!bytes) { 902 if (!bytes) {
903 bytesMax = 1024; 903 bytesMax = 1024;
904 bytes = (unsigned char*)malloc((size_t)bytesMax); 904 bytes = (unsigned char*)malloc((size_t)bytesMax);
905 } 905 }
906 else { 906 else {
907 bytesMax <<= 2; 907 bytesMax <<= 2;
908 oldBytes = bytes; 908 oldBytes = bytes;
909 bytes = (unsigned char*)realloc(bytes,(size_t)bytesMax); 909 bytes = (unsigned char*)realloc(bytes,(size_t)bytesMax);
910 } 910 }
911 if (bytes == 0) { 911 if (bytes == 0) {
912 mime_error("out of memory while processing BASE64 data\n"); 912 mime_error("out of memory while processing BASE64 data\n");
913 } 913 }
914 } 914 }
915 if (bytes) { 915 if (bytes) {
916 memcpy(bytes + bytesLen, outBytes, numOut); 916 memcpy(bytes + bytesLen, outBytes, numOut);
917 bytesLen += numOut; 917 bytesLen += numOut;
918 } 918 }
919 trip = 0; 919 trip = 0;
920 quadIx = 0; 920 quadIx = 0;
921 } 921 }
922 } 922 }
923 } /* while */ 923 } /* while */
924 DBG_(("db: bytesLen = %d\n", bytesLen)); 924 DBG_(("db: bytesLen = %d\n", bytesLen));
925 /* kludge: all this won't be necessary if we have tree form 925 /* kludge: all this won't be necessary if we have tree form
926 representation */ 926 representation */
927 if (bytes) { 927 if (bytes) {
928 setValueWithSize(curProp,bytes,(unsigned int)bytesLen); 928 setValueWithSize(curProp,bytes,(unsigned int)bytesLen);
929 free(bytes); 929 free(bytes);
930 } 930 }
931 else if (oldBytes) { 931 else if (oldBytes) {
932 setValueWithSize(curProp,oldBytes,(unsigned int)bytesLen); 932 setValueWithSize(curProp,oldBytes,(unsigned int)bytesLen);
933 free(oldBytes); 933 free(oldBytes);
934 } 934 }
935 return bytesLen; 935 return bytesLen;
936 } 936 }
937 937
938static int match_begin_end_name(int end) { 938static int match_begin_end_name(int end) {
939 int token; 939 int token;
940 lexSkipWhite(); 940 lexSkipWhite();
941 if (lexLookahead() != ':') return ID; 941 if (lexLookahead() != ':') return ID;
942 lexSkipLookahead(); 942 lexSkipLookahead();
943 lexSkipWhite(); 943 lexSkipWhite();
944 token = match_begin_name(end); 944 token = match_begin_name(end);
945 if (token == ID) { 945 if (token == ID) {
946 lexPushLookaheadc(':'); 946 lexPushLookaheadc(':');
947 DBG_(("db: ID '%s'\n", yylval.str)); 947 DBG_(("db: ID '%s'\n", yylval.str));
948 return ID; 948 return ID;
949 } 949 }
950 else if (token != 0) { 950 else if (token != 0) {
951 lexSkipLookaheadWord(); 951 lexSkipLookaheadWord();
952 deleteStr(yylval.str); 952 deleteStr(yylval.str);
953 DBG_(("db: begin/end %d\n", token)); 953 DBG_(("db: begin/end %d\n", token));
954 return token; 954 return token;
955 } 955 }
956 return 0; 956 return 0;
957 } 957 }
958 958
959static char* lexGetQuotedPrintable() 959static char* lexGetQuotedPrintable()
960{ 960{
961 int c; 961 int c;
962 lexSkipWhite(); 962 lexSkipWhite();
963 c = lexLookahead(); 963 c = lexLookahead();
964 lexClearToken(); 964 lexClearToken();
965 965
966 while (c != EOF && (c != ';' || !fieldedProp)) { 966 while (c != EOF && (c != ';' || !fieldedProp)) {
967 if (c == '\n') { 967 if (c == '\n') {
968 // break, leave '\n' on remaining chars. 968 // break, leave '\n' on remaining chars.
969 break; 969 break;
970 } else if (c == '=') { 970 } else if (c == '=') {
971 int cur = 0; 971 int cur = 0;
972 int next; 972 int next;
973 973
974 lexSkipLookahead(); // skip '=' 974 lexSkipLookahead(); // skip '='
975 next = lexLookahead(); 975 next = lexLookahead();
976 976
977 if (next == '\n') { 977 if (next == '\n') {
978 // skip and only skip the \n 978 // skip and only skip the \n
979 lexSkipLookahead(); 979 lexSkipLookahead();
980 c = lexLookahead(); 980 c = lexLookahead();
981 ++mime_lineNum; // aid in error reporting 981 ++mime_lineNum; // aid in error reporting
982 continue; 982 continue;
983 } else if (next >= '0' && next <= '9') { 983 } else if (next >= '0' && next <= '9') {
984 cur = next - '0'; 984 cur = next - '0';
985 } else if (next >= 'A' && next <= 'F') { 985 } else if (next >= 'A' && next <= 'F') {
986 cur = next - 'A' + 10; 986 cur = next - 'A' + 10;
987 } else { 987 } else {
988 // we have been sent buggy stuff. doesn't matter 988 // we have been sent buggy stuff. doesn't matter
989 // what we do so long as we keep going. 989 // what we do so long as we keep going.
990 // should probably spit an error here 990 // should probably spit an error here
991 lexSkipLookahead(); 991 lexSkipLookahead();
992 c = lexLookahead(); 992 c = lexLookahead();
993 continue; 993 continue;
994 } 994 }
995 995
996 lexSkipLookahead(); // skip A-Z0-9 996 lexSkipLookahead(); // skip A-Z0-9
997 next = lexLookahead(); 997 next = lexLookahead();
998 998
999 cur = cur * 16; 999 cur = cur * 16;
1000 // this time really just expecting 0-9A-F 1000 // this time really just expecting 0-9A-F
1001 if (next >= '0' && next <= '9') { 1001 if (next >= '0' && next <= '9') {
1002 cur += next - '0'; 1002 cur += next - '0';
1003 } else if (next >= 'A' && next <= 'F') { 1003 } else if (next >= 'A' && next <= 'F') {
1004 cur += next - 'A' + 10; 1004 cur += next - 'A' + 10;
1005 } else { 1005 } else {
1006 // we have been sent buggy stuff. doesn't matter 1006 // we have been sent buggy stuff. doesn't matter
1007 // what we do so long as we keep going. 1007 // what we do so long as we keep going.
1008 // should probably spit an error here 1008 // should probably spit an error here
1009 lexSkipLookahead(); 1009 lexSkipLookahead();
1010 c = lexLookahead(); 1010 c = lexLookahead();
1011 continue; 1011 continue;
1012 } 1012 }
1013 1013
1014 // got a valid escaped =. append it. 1014 // got a valid escaped =. append it.
1015 lexSkipLookahead(); // skip second 0-9A-F 1015 lexSkipLookahead(); // skip second 0-9A-F
1016 lexAppendc(cur); 1016 lexAppendc(cur);
1017 } else { 1017 } else {
1018 lexSkipLookahead(); // skip whatever we just read. 1018 lexSkipLookahead(); // skip whatever we just read.
1019 lexAppendc(c); // and append it. 1019 lexAppendc(c); // and append it.
1020 } 1020 }
1021 c = lexLookahead(); 1021 c = lexLookahead();
1022 } 1022 }
1023 lexAppendc(0); 1023 lexAppendc(0);
1024 return c==EOF?0:lexStr(); 1024 return c==EOF?0:lexStr();
1025} 1025}
1026 1026
1027static int yylex() { 1027static int yylex() {
1028 1028
1029 int lexmode = LEXMODE(); 1029 int lexmode = LEXMODE();
1030 if (lexmode == L_VALUES) { 1030 if (lexmode == L_VALUES) {
1031 int c = lexGetc(); 1031 int c = lexGetc();
1032 int c2; 1032 int c2;
1033 if (c == ';' && fieldedProp) { 1033 if (c == ';' && fieldedProp) {
1034 DBG_(("db: SEMICOLON\n")); 1034 DBG_(("db: SEMICOLON\n"));
1035 lexPushLookaheadc(c); 1035 lexPushLookaheadc(c);
1036 handleMoreRFC822LineBreak(c); 1036 handleMoreRFC822LineBreak(c);
1037 lexSkipLookahead(); 1037 lexSkipLookahead();
1038 return SEMICOLON; 1038 return SEMICOLON;
1039 } 1039 }
1040 else if (strchr("\n",c) && (c2 = lexLookahead()) != ' ' && c2 != '\t') { 1040 else if (strchr("\n",c) && (c2 = lexLookahead()) != ' ' && c2 != '\t') {
1041 ++mime_lineNum; 1041 ++mime_lineNum;
1042 /* consume all line separator(s) adjacent to each other */ 1042 /* consume all line separator(s) adjacent to each other */
1043 while (strchr("\n",c2)) { 1043 while (strchr("\n",c2)) {
1044 lexSkipLookahead(); 1044 lexSkipLookahead();
1045 c2 = lexLookahead(); 1045 c2 = lexLookahead();
1046 ++mime_lineNum; 1046 ++mime_lineNum;
1047 } 1047 }
1048 DBG_(("db: LINESEP\n")); 1048 DBG_(("db: LINESEP\n"));
1049 return LINESEP; 1049 return LINESEP;
1050 } 1050 }
1051 else { 1051 else {
1052 char *p = 0; 1052 char *p = 0;
1053 lexPushLookaheadc(c); 1053 lexPushLookaheadc(c);
1054 if (lexWithinMode(L_BASE64)) { 1054 if (lexWithinMode(L_BASE64)) {
1055 /* get each char and convert to bin on the fly... */ 1055 /* get each char and convert to bin on the fly... */
1056 yylval.str = NULL; 1056 yylval.str = NULL;
1057 return lexGetDataFromBase64() ? STRING : 0; 1057 return lexGetDataFromBase64() ? STRING : 0;
1058 } 1058 }
1059 else if (lexWithinMode(L_QUOTED_PRINTABLE)) { 1059 else if (lexWithinMode(L_QUOTED_PRINTABLE)) {
1060 p = lexGetQuotedPrintable(); 1060 p = lexGetQuotedPrintable();
1061 } 1061 }
1062 else { 1062 else {
1063#ifdef _SUPPORT_LINE_FOLDING 1063#ifdef _SUPPORT_LINE_FOLDING
1064 p = lexGet1Value(); 1064 p = lexGet1Value();
1065#else 1065#else
1066 p = lexGetStrUntil(";\n"); 1066 p = lexGetStrUntil(";\n");
1067#endif 1067#endif
1068 } 1068 }
1069 if (p) { 1069 if (p) {
1070 DBG_(("db: STRING: '%s'\n", p)); 1070 DBG_(("db: STRING: '%s'\n", p));
1071 yylval.str = p; 1071 yylval.str = p;
1072 return STRING; 1072 return STRING;
1073 } 1073 }
1074 else return 0; 1074 else return 0;
1075 } 1075 }
1076 } else if (lexmode == L_PARAMWORD) { 1076 } else if (lexmode == L_PARAMWORD) {
1077 yylval.str = lexGetParamWord(); 1077 yylval.str = lexGetParamWord();
1078 return ID; 1078 return ID;
1079 } else { 1079 } else {
1080 /* normal mode */ 1080 /* normal mode */
1081 while (1) { 1081 while (1) {
1082 int c = lexGetc(); 1082 int c = lexGetc();
1083 switch(c) { 1083 switch(c) {
1084 case ':': { 1084 case ':': {
1085 /* consume all line separator(s) adjacent to each other */ 1085 /* consume all line separator(s) adjacent to each other */
1086 /* ignoring linesep immediately after colon. */ 1086 /* ignoring linesep immediately after colon. */
1087 /* I don't see this in the spec, and it breaks null values -- WA 1087 /* I don't see this in the spec, and it breaks null values -- WA
1088 c = lexLookahead(); 1088 c = lexLookahead();
1089 while (strchr("\n",c)) { 1089 while (strchr("\n",c)) {
1090 lexSkipLookahead(); 1090 lexSkipLookahead();
1091 c = lexLookahead(); 1091 c = lexLookahead();
1092 ++mime_lineNum; 1092 ++mime_lineNum;
1093 } 1093 }
1094 */ 1094 */
1095 DBG_(("db: COLON\n")); 1095 DBG_(("db: COLON\n"));
1096 return COLON; 1096 return COLON;
1097 } 1097 }
1098 case ';': 1098 case ';':
1099 DBG_(("db: SEMICOLON\n")); 1099 DBG_(("db: SEMICOLON\n"));
1100 return SEMICOLON; 1100 return SEMICOLON;
1101 case '=': 1101 case '=':
1102 DBG_(("db: EQ\n")); 1102 DBG_(("db: EQ\n"));
1103 return EQ; 1103 return EQ;
1104 /* ignore whitespace in this mode */ 1104 /* ignore whitespace in this mode */
1105 case '\t': 1105 case '\t':
1106 case ' ': continue; 1106 case ' ': continue;
1107 case '\n': { 1107 case '\n': {
1108 ++mime_lineNum; 1108 ++mime_lineNum;
1109 continue; 1109 continue;
1110 } 1110 }
1111 case EOF: return 0; 1111 case EOF: return 0;
1112 break; 1112 break;
1113 default: { 1113 default: {
1114 lexPushLookaheadc(c); 1114 lexPushLookaheadc(c);
1115 if (isalnum(c)) { 1115 if (isalnum(c)) {
1116 char *t = lexGetWord(); 1116 char *t = lexGetWord();
1117 yylval.str = t; 1117 yylval.str = t;
1118 if (!qstricmp(t, "begin")) { 1118 if (!qstricmp(t, "begin")) {
1119 return match_begin_end_name(0); 1119 return match_begin_end_name(0);
1120 } 1120 }
1121 else if (!qstricmp(t,"end")) { 1121 else if (!qstricmp(t,"end")) {
1122 return match_begin_end_name(1); 1122 return match_begin_end_name(1);
1123 } 1123 }
1124 else { 1124 else {
1125 DBG_(("db: ID '%s'\n", t)); 1125 DBG_(("db: ID '%s'\n", t));
1126 return ID; 1126 return ID;
1127 } 1127 }
1128 } 1128 }
1129 else { 1129 else {
1130 /* unknow token */ 1130 /* unknow token */
1131 return 0; 1131 return 0;
1132 } 1132 }
1133 break; 1133 break;
1134 } 1134 }
1135 } 1135 }
1136 } 1136 }
1137 } 1137 }
1138 return 0; 1138 return 0;
1139 } 1139 }
1140 1140
1141 1141
1142/***************************************************************************/ 1142/***************************************************************************/
1143 /*** Public Functions ****/ 1143 /*** Public Functions ****/
1144/***************************************************************************/ 1144/***************************************************************************/
1145 1145
1146static VObject* Parse_MIMEHelper() 1146static VObject* Parse_MIMEHelper()
1147 { 1147 {
1148 ObjStackTop = -1; 1148 ObjStackTop = -1;
1149 mime_numErrors = 0; 1149 mime_numErrors = 0;
1150 mime_lineNum = 1; 1150 mime_lineNum = 1;
1151 vObjList = 0; 1151 vObjList = 0;
1152 curObj = 0; 1152 curObj = 0;
1153 1153
1154 if (yyparse() != 0) 1154 if (yyparse() != 0)
1155 return 0; 1155 return 0;
1156 1156
1157 finiLex(); 1157 finiLex();
1158 return vObjList; 1158 return vObjList;
1159 } 1159 }
1160 1160
1161/*--------------------------------------------*/ 1161/*--------------------------------------------*/
1162DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len) 1162DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len)
1163 { 1163 {
1164 initLex(input, len, 0); 1164 initLex(input, len, 0);
1165 return Parse_MIMEHelper(); 1165 return Parse_MIMEHelper();
1166 } 1166 }
1167 1167
1168 1168
1169#if INCLUDEMFC 1169#if INCLUDEMFC
1170 1170
1171DLLEXPORT(VObject*) Parse_MIME_FromFile(CFile *file) 1171DLLEXPORT(VObject*) Parse_MIME_FromFile(CFile *file)
1172 { 1172 {
1173 unsigned long startPos; 1173 unsigned long startPos;
1174 VObject *result; 1174 VObject *result;
1175 1175
1176 initLex(0,-1,file); 1176 initLex(0,-1,file);
1177 startPos = file->GetPosition(); 1177 startPos = file->GetPosition();
1178 if (!(result = Parse_MIMEHelper())) 1178 if (!(result = Parse_MIMEHelper()))
1179 file->Seek(startPos, CFile::begin); 1179 file->Seek(startPos, CFile::begin);
1180 return result; 1180 return result;
1181 } 1181 }
1182 1182
1183#else 1183#else
1184 1184
1185VObject* Parse_MIME_FromFile(FILE *file) 1185VObject* Parse_MIME_FromFile(FILE *file)
1186 { 1186 {
1187 VObject *result; 1187 VObject *result;
1188 long startPos; 1188 long startPos;
1189 1189
1190 initLex(0,(unsigned long)-1,file); 1190 initLex(0,(unsigned long)-1,file);
1191 startPos = ftell(file); 1191 startPos = ftell(file);
1192 if (!(result = Parse_MIMEHelper())) { 1192 if (!(result = Parse_MIMEHelper())) {
1193 fseek(file,startPos,SEEK_SET); 1193 fseek(file,startPos,SEEK_SET);
1194 } 1194 }
1195 return result; 1195 return result;
1196 } 1196 }
1197 1197
1198DLLEXPORT(VObject*) Parse_MIME_FromFileName(char *fname) 1198DLLEXPORT(VObject*) Parse_MIME_FromFileName(char *fname)
1199 { 1199 {
1200 FILE *fp = fopen(fname,"r"); 1200 FILE *fp = fopen(fname,"r");
1201 if (fp) { 1201 if (fp) {
1202 VObject* o = Parse_MIME_FromFile(fp); 1202 VObject* o = Parse_MIME_FromFile(fp);
1203 fclose(fp); 1203 fclose(fp);
1204 return o; 1204 return o;
1205 } 1205 }
1206 else { 1206 else {
1207 char msg[80]; 1207 char msg[80];
1208 sprintf(msg, "can't open file '%s' for reading\n", fname); 1208 sprintf(msg, "can't open file '%s' for reading\n", fname);
1209 mime_error_(msg); 1209 mime_error_(msg);
1210 return 0; 1210 return 0;
1211 } 1211 }
1212 } 1212 }
1213 1213
1214#endif 1214#endif
1215 1215
1216/*-------------------------------------*/ 1216/*-------------------------------------*/
1217 1217
1218static MimeErrorHandler mimeErrorHandler; 1218static MimeErrorHandler mimeErrorHandler;
1219 1219
1220DLLEXPORT(void) registerMimeErrorHandler(MimeErrorHandler me) 1220DLLEXPORT(void) registerMimeErrorHandler(MimeErrorHandler me)
1221 { 1221 {
1222 mimeErrorHandler = me; 1222 mimeErrorHandler = me;
1223 } 1223 }
1224 1224
1225void mime_error(char *s) 1225void mime_error(char *s)
1226 { 1226 {
1227 char msg[256]; 1227 char msg[256];
1228 if (mimeErrorHandler) { 1228 if (mimeErrorHandler) {
1229 sprintf(msg,"%s at line %d", s, mime_lineNum); 1229 sprintf(msg,"%s at line %d", s, mime_lineNum);
1230 mimeErrorHandler(msg); 1230 mimeErrorHandler(msg);
1231 } 1231 }
1232 } 1232 }
1233 1233
1234void mime_error_(char *s) 1234void mime_error_(char *s)
1235 { 1235 {
1236 if (mimeErrorHandler) { 1236 if (mimeErrorHandler) {
1237 mimeErrorHandler(s); 1237 mimeErrorHandler(s);
1238 } 1238 }
1239 } 1239 }
1240 1240
1241#line 1242 "y.tab.c" 1241#line 1242 "y.tab.c"
1242#define YYABORT goto yyabort 1242#define YYABORT goto yyabort
1243#define YYREJECT goto yyabort 1243#define YYREJECT goto yyabort
@@ -1389,75 +1389,75 @@ case 3:
1389break; 1389break;
1390case 6: 1390case 6:
1391#line 236 "vcc.y" 1391#line 236 "vcc.y"
1392{ 1392{
1393 lexPushMode(L_VCARD); 1393 lexPushMode(L_VCARD);
1394 if (!pushVObject(VCCardProp)) YYERROR; 1394 if (!pushVObject(VCCardProp)) YYERROR;
1395 } 1395 }
1396break; 1396break;
1397case 7: 1397case 7:
1398#line 241 "vcc.y" 1398#line 241 "vcc.y"
1399{ 1399{
1400 lexPopMode(0); 1400 lexPopMode(0);
1401 yyval.vobj = popVObject(); 1401 yyval.vobj = popVObject();
1402 } 1402 }
1403break; 1403break;
1404case 8: 1404case 8:
1405#line 246 "vcc.y" 1405#line 246 "vcc.y"
1406{ 1406{
1407 lexPushMode(L_VCARD); 1407 lexPushMode(L_VCARD);
1408 if (!pushVObject(VCCardProp)) YYERROR; 1408 if (!pushVObject(VCCardProp)) YYERROR;
1409 } 1409 }
1410break; 1410break;
1411case 9: 1411case 9:
1412#line 251 "vcc.y" 1412#line 251 "vcc.y"
1413{ 1413{
1414 lexPopMode(0); 1414 lexPopMode(0);
1415 yyval.vobj = popVObject(); 1415 yyval.vobj = popVObject();
1416 } 1416 }
1417break; 1417break;
1418case 12: 1418case 12:
1419#line 262 "vcc.y" 1419#line 262 "vcc.y"
1420{ 1420{
1421 lexPushMode(L_VALUES); 1421 lexPushMode(L_VALUES);
1422 } 1422 }
1423break; 1423break;
1424case 13: 1424case 13:
1425#line 266 "vcc.y" 1425#line 266 "vcc.y"
1426{ 1426{
1427 if (lexWithinMode(L_BASE64) || lexWithinMode(L_QUOTED_PRINTABLE)) 1427 if (lexWithinMode(L_BASE64) || lexWithinMode(L_QUOTED_PRINTABLE))
1428 lexPopMode(0); 1428 lexPopMode(0);
1429 lexPopMode(0); 1429 lexPopMode(0);
1430 } 1430 }
1431break; 1431break;
1432case 15: 1432case 15:
1433#line 275 "vcc.y" 1433#line 275 "vcc.y"
1434{ 1434{
1435 enterProps(yyvsp[0].str); 1435 enterProps(yyvsp[0].str);
1436 } 1436 }
1437break; 1437break;
1438case 17: 1438case 17:
1439#line 280 "vcc.y" 1439#line 280 "vcc.y"
1440{ 1440{
1441 enterProps(yyvsp[0].str); 1441 enterProps(yyvsp[0].str);
1442 } 1442 }
1443break; 1443break;
1444case 21: 1444case 21:
1445#line 293 "vcc.y" 1445#line 293 "vcc.y"
1446{ 1446{
1447 enterAttr(yyvsp[0].str,0); 1447 enterAttr(yyvsp[0].str,0);
1448 } 1448 }
1449break; 1449break;
1450case 22: 1450case 22:
1451#line 297 "vcc.y" 1451#line 297 "vcc.y"
1452{ 1452{
1453 lexPushMode(L_PARAMWORD); 1453 lexPushMode(L_PARAMWORD);
1454 } 1454 }
1455break; 1455break;
1456case 23: 1456case 23:
1457#line 301 "vcc.y" 1457#line 301 "vcc.y"
1458{ 1458{
1459 lexPopMode(0); 1459 lexPopMode(0);
1460 enterAttr(yyvsp[-3].str,yyvsp[0].str); 1460 enterAttr(yyvsp[-3].str,yyvsp[0].str);
1461 } 1461 }
1462break; 1462break;
1463case 25: 1463case 25:
@@ -1490,58 +1490,58 @@ case 33:
1490break; 1490break;
1491case 39: 1491case 39:
1492#line 344 "vcc.y" 1492#line 344 "vcc.y"
1493{ 1493{
1494 lexPushMode(L_VEVENT); 1494 lexPushMode(L_VEVENT);
1495 if (!pushVObject(VCEventProp)) YYERROR; 1495 if (!pushVObject(VCEventProp)) YYERROR;
1496 } 1496 }
1497break; 1497break;
1498case 40: 1498case 40:
1499#line 350 "vcc.y" 1499#line 350 "vcc.y"
1500{ 1500{
1501 lexPopMode(0); 1501 lexPopMode(0);
1502 popVObject(); 1502 popVObject();
1503 } 1503 }
1504break; 1504break;
1505case 41: 1505case 41:
1506#line 355 "vcc.y" 1506#line 355 "vcc.y"
1507{ 1507{
1508 lexPushMode(L_VEVENT); 1508 lexPushMode(L_VEVENT);
1509 if (!pushVObject(VCEventProp)) YYERROR; 1509 if (!pushVObject(VCEventProp)) YYERROR;
1510 } 1510 }
1511break; 1511break;
1512case 42: 1512case 42:
1513#line 360 "vcc.y" 1513#line 360 "vcc.y"
1514{ 1514{
1515 lexPopMode(0); 1515 lexPopMode(0);
1516 popVObject(); 1516 popVObject();
1517 } 1517 }
1518break; 1518break;
1519case 43: 1519case 43:
1520#line 368 "vcc.y" 1520#line 368 "vcc.y"
1521{ 1521{
1522 lexPushMode(L_VTODO); 1522 lexPushMode(L_VTODO);
1523 if (!pushVObject(VCTodoProp)) YYERROR; 1523 if (!pushVObject(VCTodoProp)) YYERROR;
1524 } 1524 }
1525break; 1525break;
1526case 44: 1526case 44:
1527#line 374 "vcc.y" 1527#line 374 "vcc.y"
1528{ 1528{
1529 lexPopMode(0); 1529 lexPopMode(0);
1530 popVObject(); 1530 popVObject();
1531 } 1531 }
1532break; 1532break;
1533case 45: 1533case 45:
1534#line 379 "vcc.y" 1534#line 379 "vcc.y"
1535{ 1535{
1536 lexPushMode(L_VTODO); 1536 lexPushMode(L_VTODO);
1537 if (!pushVObject(VCTodoProp)) YYERROR; 1537 if (!pushVObject(VCTodoProp)) YYERROR;
1538 } 1538 }
1539break; 1539break;
1540case 46: 1540case 46:
1541#line 384 "vcc.y" 1541#line 384 "vcc.y"
1542{ 1542{
1543 lexPopMode(0); 1543 lexPopMode(0);
1544 popVObject(); 1544 popVObject();
1545 } 1545 }
1546break; 1546break;
1547#line 1548 "y.tab.c" 1547#line 1548 "y.tab.c"