summaryrefslogtreecommitdiff
path: root/library/backend/vcc_yacc.cpp
Side-by-side diff
Diffstat (limited to 'library/backend/vcc_yacc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/vcc_yacc.cpp169
1 files changed, 100 insertions, 69 deletions
diff --git a/library/backend/vcc_yacc.cpp b/library/backend/vcc_yacc.cpp
index cb24631..19a108f 100644
--- a/library/backend/vcc_yacc.cpp
+++ b/library/backend/vcc_yacc.cpp
@@ -1,3 +1,4 @@
#ifndef lint
-static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
+/*static char yysccsid[] = "from: @(#)yaccpar 1.9 (Berkeley) 02/21/93";*/
+static char yyrcsid[] = "$Id$";
#endif
@@ -9,4 +10,28 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
#define YYRECOVERING (yyerrflag!=0)
-#define YYPREFIX "yy"
-#line 1 "vcc.y"
+#define yyparse vccparse
+#define yylex vcclex
+#define yyerror vccerror
+#define yychar vccchar
+#define yyval vccval
+#define yylval vcclval
+#define yydebug vccdebug
+#define yynerrs vccnerrs
+#define yyerrflag vccerrflag
+#define yyss vccss
+#define yyssp vccssp
+#define yyvs vccvs
+#define yyvsp vccvsp
+#define yylhs vcclhs
+#define yylen vcclen
+#define yydefred vccdefred
+#define yydgoto vccdgoto
+#define yysindex vccsindex
+#define yyrindex vccrindex
+#define yygindex vccgindex
+#define yytable vcctable
+#define yycheck vcccheck
+#define yyname vccname
+#define yyrule vccrule
+#define YYPREFIX "vcc"
+#line 1 "backend/vcc.y"
@@ -75,2 +100,3 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
+#if 0
#define yyparse mime_parse
@@ -107,2 +133,3 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
#define YYPREFIX "mime_"
+#endif
@@ -130,9 +157,7 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
-#ifdef PALMTOPCENTER
-#include <qpe/vobject_p.h>
-#include <qpe/qfiledirect_p.h>
-#else
+/*#ifdef PALMTOPCENTER */
+/*#include <qpe/vobject_p.h> */
+/*#else */
#include "vobject_p.h"
-#include "qfiledirect_p.h"
-#endif
+/*#endif */
@@ -142,4 +167,3 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
#define MAXTOKEN 256 /* maximum token (line) length */
-#define YYSTACKSIZE 100 /* ~unref ?
-*/
+#define YYSTACKSIZE 100 /* ~unref ? */
#define MAXLEVEL 10 /* max # of nested objects parseable */
@@ -190,5 +214,7 @@ static void enterAttr(const char *s1, const char *s2);
static void enterValues(const char *value);
+#define mime_error yyerror
+void mime_error(char *s);
void mime_error_(char *s);
-#line 185 "vcc.y"
+#line 189 "backend/vcc.y"
typedef union {
@@ -197,3 +223,3 @@ typedef union {
} YYSTYPE;
-#line 196 "y.tab.c"
+#line 225 "y.tab.c"
#define EQ 257
@@ -217,3 +243,3 @@ typedef union {
#define YYERRCODE 256
-short yylhs[] = { -1,
+short vcclhs[] = { -1,
0, 6, 6, 5, 5, 8, 3, 9, 3, 7,
@@ -224,3 +250,3 @@ short yylhs[] = { -1,
};
-short yylen[] = { 2,
+short vcclen[] = { 2,
1, 2, 1, 1, 1, 0, 4, 0, 3, 2,
@@ -231,3 +257,3 @@ short yylen[] = { 2,
};
-short yydefred[] = { 0,
+short vccdefred[] = { 0,
0, 0, 0, 4, 5, 3, 0, 0, 0, 0,
@@ -239,3 +265,3 @@ short yydefred[] = { 0,
};
-short yydgoto[] = { 3,
+short vccdgoto[] = { 3,
15, 50, 4, 5, 6, 7, 22, 8, 9, 17,
@@ -244,3 +270,3 @@ short yydgoto[] = { 3,
};
-short yysindex[] = { -262,
+short vccsindex[] = { -262,
0, 0, 0, 0, 0, 0, -262, -252, -219, -249,
@@ -252,3 +278,3 @@ short yysindex[] = { -262,
};
-short yyrindex[] = { 0,
+short vccrindex[] = { 0,
-222, -238, 0, 0, 0, 0, 65, 0, 0, 0,
@@ -260,3 +286,3 @@ short yyrindex[] = { 0,
};
-short yygindex[] = { 0,
+short vccgindex[] = { 0,
3, 0, 0, 0, 61, 0, -7, 0, 0, -16,
@@ -266,3 +292,3 @@ short yygindex[] = { 0,
#define YYTABLESIZE 71
-short yytable[] = { 30,
+short vcctable[] = { 30,
16, 13, 1, 13, 2, 30, 13, 37, 37, 28,
@@ -276,3 +302,3 @@ short yytable[] = { 30,
};
-short yycheck[] = { 16,
+short vcccheck[] = { 16,
8, 256, 265, 256, 267, 22, 256, 268, 269, 260,
@@ -292,3 +318,3 @@ short yycheck[] = { 16,
#if YYDEBUG
-char *yyname[] = {
+char *vccname[] = {
"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,
@@ -303,3 +329,3 @@ char *yyname[] = {
};
-char *yyrule[] = {
+char *vccrule[] = {
"$accept : mime",
@@ -374,3 +400,3 @@ YYSTYPE yyvs[YYSTACKSIZE];
#define yystacksize YYSTACKSIZE
-#line 378 "vcc.y"
+#line 382 "backend/vcc.y"
@@ -513,3 +539,3 @@ static int lexWithinMode(enum LexMode mode) {
-static char lexGetc_()
+static int lexGetc_()
{
@@ -927,3 +953,3 @@ static char* lexGetQuotedPrintable()
{
- char cur;
+ int cur;
@@ -969,3 +995,3 @@ static char* lexGetQuotedPrintable()
}
- case (char)EOF:
+ case (int)EOF:
break;
@@ -975,3 +1001,3 @@ static char* lexGetQuotedPrintable()
} /* switch */
- } while (cur != (char)EOF);
+ } while (cur != (int)EOF);
@@ -1152,9 +1178,14 @@ DLLEXPORT(VObject*) Parse_MIME_FromFileName(char *fname)
{
- QFileDirect f( fname );
- if ( !f.open( IO_ReadOnly ) ) {
- qWarning("Unable to open mime for reading %s", fname);
- return 0;
+ FILE *fp = fopen(fname,"r");
+ if (fp) {
+ VObject* o = Parse_MIME_FromFile(fp);
+ fclose(fp);
+ return o;
+ }
+ else {
+ char msg[80];
+ sprintf(msg, "can't open file '%s' for reading\n", fname);
+ mime_error_(msg);
+ return 0;
}
-
- return Parse_MIME_FromFile( f.directHandle() );
}
@@ -1188,3 +1219,3 @@ void mime_error_(char *s)
-#line 1192 "y.tab.c"
+#line 1221 "y.tab.c"
#define YYABORT goto yyabort
@@ -1194,3 +1225,7 @@ void mime_error_(char *s)
int
+#if defined(__STDC__)
+yyparse(void)
+#else
yyparse()
+#endif
{
@@ -1218,3 +1253,3 @@ yyparse()
yyloop:
- if (yyn = yydefred[yystate]) goto yyreduce;
+ if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
if (yychar < 0)
@@ -1258,6 +1293,2 @@ yyloop:
if (yyerrflag) goto yyinrecovery;
-#ifdef lint
- goto yynewerror;
-#endif
-yynewerror:
yyerror("syntax error");
@@ -1330,3 +1361,3 @@ yyreduce:
case 2:
-#line 217 "vcc.y"
+#line 221 "backend/vcc.y"
{ addList(&vObjList, yyvsp[0].vobj); curObj = 0; }
@@ -1334,3 +1365,3 @@ break;
case 3:
-#line 219 "vcc.y"
+#line 223 "backend/vcc.y"
{ addList(&vObjList, yyvsp[0].vobj); curObj = 0; }
@@ -1338,3 +1369,3 @@ break;
case 6:
-#line 228 "vcc.y"
+#line 232 "backend/vcc.y"
{
@@ -1345,3 +1376,3 @@ break;
case 7:
-#line 233 "vcc.y"
+#line 237 "backend/vcc.y"
{
@@ -1352,3 +1383,3 @@ break;
case 8:
-#line 238 "vcc.y"
+#line 242 "backend/vcc.y"
{
@@ -1359,3 +1390,3 @@ break;
case 9:
-#line 243 "vcc.y"
+#line 247 "backend/vcc.y"
{
@@ -1366,3 +1397,3 @@ break;
case 12:
-#line 254 "vcc.y"
+#line 258 "backend/vcc.y"
{
@@ -1372,3 +1403,3 @@ break;
case 13:
-#line 258 "vcc.y"
+#line 262 "backend/vcc.y"
{
@@ -1380,3 +1411,3 @@ break;
case 15:
-#line 267 "vcc.y"
+#line 271 "backend/vcc.y"
{
@@ -1386,3 +1417,3 @@ break;
case 17:
-#line 272 "vcc.y"
+#line 276 "backend/vcc.y"
{
@@ -1392,3 +1423,3 @@ break;
case 21:
-#line 285 "vcc.y"
+#line 289 "backend/vcc.y"
{
@@ -1398,3 +1429,3 @@ break;
case 22:
-#line 289 "vcc.y"
+#line 293 "backend/vcc.y"
{
@@ -1405,3 +1436,3 @@ break;
case 24:
-#line 298 "vcc.y"
+#line 302 "backend/vcc.y"
{ enterValues(yyvsp[-1].str); }
@@ -1409,3 +1440,3 @@ break;
case 26:
-#line 300 "vcc.y"
+#line 304 "backend/vcc.y"
{ enterValues(yyvsp[0].str); }
@@ -1413,3 +1444,3 @@ break;
case 28:
-#line 305 "vcc.y"
+#line 309 "backend/vcc.y"
{ yyval.str = 0; }
@@ -1417,3 +1448,3 @@ break;
case 29:
-#line 310 "vcc.y"
+#line 314 "backend/vcc.y"
{ if (!pushVObject(VCCalProp)) YYERROR; }
@@ -1421,3 +1452,3 @@ break;
case 30:
-#line 313 "vcc.y"
+#line 317 "backend/vcc.y"
{ yyval.vobj = popVObject(); }
@@ -1425,3 +1456,3 @@ break;
case 31:
-#line 315 "vcc.y"
+#line 319 "backend/vcc.y"
{ if (!pushVObject(VCCalProp)) YYERROR; }
@@ -1429,3 +1460,3 @@ break;
case 32:
-#line 317 "vcc.y"
+#line 321 "backend/vcc.y"
{ yyval.vobj = popVObject(); }
@@ -1433,3 +1464,3 @@ break;
case 38:
-#line 332 "vcc.y"
+#line 336 "backend/vcc.y"
{
@@ -1440,3 +1471,3 @@ break;
case 39:
-#line 338 "vcc.y"
+#line 342 "backend/vcc.y"
{
@@ -1447,3 +1478,3 @@ break;
case 40:
-#line 343 "vcc.y"
+#line 347 "backend/vcc.y"
{
@@ -1454,3 +1485,3 @@ break;
case 41:
-#line 348 "vcc.y"
+#line 352 "backend/vcc.y"
{
@@ -1461,3 +1492,3 @@ break;
case 42:
-#line 356 "vcc.y"
+#line 360 "backend/vcc.y"
{
@@ -1468,3 +1499,3 @@ break;
case 43:
-#line 362 "vcc.y"
+#line 366 "backend/vcc.y"
{
@@ -1475,3 +1506,3 @@ break;
case 44:
-#line 367 "vcc.y"
+#line 371 "backend/vcc.y"
{
@@ -1482,3 +1513,3 @@ break;
case 45:
-#line 372 "vcc.y"
+#line 376 "backend/vcc.y"
{
@@ -1488,3 +1519,3 @@ case 45:
break;
-#line 1492 "y.tab.c"
+#line 1521 "y.tab.c"
}