diff options
Diffstat (limited to 'src/libicalss/icalssyacc.c')
-rw-r--r-- | src/libicalss/icalssyacc.c | 109 |
1 files changed, 43 insertions, 66 deletions
diff --git a/src/libicalss/icalssyacc.c b/src/libicalss/icalssyacc.c index 8d720db..5896120 100644 --- a/src/libicalss/icalssyacc.c +++ b/src/libicalss/icalssyacc.c @@ -120,36 +120,35 @@ /* Copy the first part of user declarations. */ -#line 1 "icalssyacc.y" -/* -*- Mode: C -*- - ====================================================================== - FILE: icalssyacc.y - CREATOR: eric 08 Aug 2000 - - DESCRIPTION: - - $Id: icalssyacc.y,v 1.10 2008-01-14 00:35:26 dothebart Exp $ - $Locker: $ - -(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org - - This program is free software; you can redistribute it and/or modify - it under the terms of either: - - The LGPL as published by the Free Software Foundation, version - 2.1, available at: http://www.fsf.org/copyleft/lesser.html - - Or: - - The Mozilla Public License Version 1.0. You may obtain a copy of - the License at http://www.mozilla.org/MPL/ - - The Original Code is eric. The Initial Developer of the Original - Code is Eric Busboom - - ======================================================================*/ -/*#define YYDEBUG 1*/ +/* -*- Mode: C -*- */ +/* ====================================================================== */ +/* FILE: icalssyacc.y */ +/* CREATOR: eric 08 Aug 2000 */ +/* */ +/* DESCRIPTION: */ +/* */ +/* $Id: icalssyacc.y,v 1.10 2008-01-14 00:35:26 dothebart Exp $ */ +/* $Locker: $ */ +/* */ +/* (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of either: */ +/* */ +/* The LGPL as published by the Free Software Foundation, version */ +/* 2.1, available at: http://www.fsf.org/copyleft/lesser.html */ +/* */ +/* Or: */ +/* */ +/* The Mozilla Public License Version 1.0. You may obtain a copy of */ +/* the License at http://www.mozilla.org/MPL/ */ +/* */ +/* The Original Code is eric. The Initial Developer of the Original */ +/* Code is Eric Busboom */ +/* */ +/* ====================================================================== */ +#define YYDEBUG 1 #include <stdlib.h> #include <string.h> /* for strdup() */ #include <limits.h> /* for SHRT_MAX*/ @@ -174,13 +173,12 @@ static void set_logic(struct icalgauge_impl* impl,icalgaugelogic l); /* Don't know why I need this.... */ -/* TODO: older flex version produce whats here configured as OpenBSD */ -/* autoconf should figure out, and which flex version we should be newer than? */ -#ifndef __OpenBSD__ -int sslex(void *YYPARSE_PARAM); -#else -int sslex(); -#endif +/* older flex version (such as included in OpenBSD) takes a different calling syntax */ +#ifdef YYPARSE_PARAM +int sslex(void *YYPARSE_PARAM); +#else +int sslex(void); +#endif /* Enabling traces. */ @@ -203,12 +201,10 @@ int sslex(); #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 63 "icalssyacc.y" { char* v_string; } /* Line 187 of yacc.c. */ -#line 212 "y.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -221,7 +217,6 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 225 "y.tab.c" #ifdef short # undef short @@ -362,14 +357,14 @@ YYID (i) # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) + || defined __cplusplus) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) + || defined __cplusplus) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -513,9 +508,9 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 74, 74, 75, 76, 83, 84, 89, 90, 93, - 95, 96, 97, 98, 99, 100, 101, 102, 106, 107, - 108 + 0, 73, 73, 74, 75, 82, 83, 88, 89, 92, + 94, 95, 96, 97, 98, 99, 100, 101, 105, 106, + 107 }; #endif @@ -1436,7 +1431,6 @@ yyreduce: switch (yyn) { case 4: -#line 76 "icalssyacc.y" { yyclearin; YYABORT; @@ -1444,83 +1438,67 @@ yyreduce: break; case 5: -#line 83 "icalssyacc.y" {ssyacc_add_select(icalss_yy_gauge,(yyvsp[(1) - (1)].v_string));} break; case 6: -#line 84 "icalssyacc.y" {ssyacc_add_select(icalss_yy_gauge,(yyvsp[(3) - (3)].v_string));} break; case 7: -#line 89 "icalssyacc.y" {ssyacc_add_from(icalss_yy_gauge,(yyvsp[(1) - (1)].v_string));} break; case 8: -#line 90 "icalssyacc.y" {ssyacc_add_from(icalss_yy_gauge,(yyvsp[(3) - (3)].v_string));} break; case 10: -#line 95 "icalssyacc.y" {ssyacc_add_where(icalss_yy_gauge,(yyvsp[(1) - (3)].v_string),ICALGAUGECOMPARE_EQUAL,(yyvsp[(3) - (3)].v_string)); } break; case 11: -#line 96 "icalssyacc.y" {ssyacc_add_where(icalss_yy_gauge,(yyvsp[(1) - (3)].v_string),ICALGAUGECOMPARE_ISNULL,""); } break; case 12: -#line 97 "icalssyacc.y" {ssyacc_add_where(icalss_yy_gauge,(yyvsp[(1) - (4)].v_string),ICALGAUGECOMPARE_ISNOTNULL,""); } break; case 13: -#line 98 "icalssyacc.y" {ssyacc_add_where(icalss_yy_gauge,(yyvsp[(1) - (3)].v_string),ICALGAUGECOMPARE_NOTEQUAL,(yyvsp[(3) - (3)].v_string)); } break; case 14: -#line 99 "icalssyacc.y" {ssyacc_add_where(icalss_yy_gauge,(yyvsp[(1) - (3)].v_string),ICALGAUGECOMPARE_LESS,(yyvsp[(3) - (3)].v_string)); } break; case 15: -#line 100 "icalssyacc.y" {ssyacc_add_where(icalss_yy_gauge,(yyvsp[(1) - (3)].v_string),ICALGAUGECOMPARE_GREATER,(yyvsp[(3) - (3)].v_string)); } break; case 16: -#line 101 "icalssyacc.y" {ssyacc_add_where(icalss_yy_gauge,(yyvsp[(1) - (3)].v_string),ICALGAUGECOMPARE_LESSEQUAL,(yyvsp[(3) - (3)].v_string)); } break; case 17: -#line 102 "icalssyacc.y" {ssyacc_add_where(icalss_yy_gauge,(yyvsp[(1) - (3)].v_string),ICALGAUGECOMPARE_GREATEREQUAL,(yyvsp[(3) - (3)].v_string)); } break; case 18: -#line 106 "icalssyacc.y" {set_logic(icalss_yy_gauge,ICALGAUGELOGIC_NONE);} break; case 19: -#line 107 "icalssyacc.y" {set_logic(icalss_yy_gauge,ICALGAUGELOGIC_AND);} break; case 20: -#line 108 "icalssyacc.y" {set_logic(icalss_yy_gauge,ICALGAUGELOGIC_OR);} break; /* Line 1267 of yacc.c. */ -#line 1524 "y.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -1734,7 +1712,6 @@ yyreturn: } -#line 112 "icalssyacc.y" static void ssyacc_add_where(struct icalgauge_impl* impl, char* str1, @@ -1767,8 +1744,8 @@ static void ssyacc_add_where(struct icalgauge_impl* impl, char* str1, where->value = strdup(s); - /* Is there a period in str1 ? If so, the string specified both a - component and a property*/ + /* Is there a period in str1 ? If so, the string specified both a */ + /* component and a property */ if( (c = strrchr(str1,'.')) != 0){ compstr = str1; propstr = c+1; @@ -1827,8 +1804,8 @@ static void ssyacc_add_select(struct icalgauge_impl* impl, char* str1) where->comp = ICAL_NO_COMPONENT; where->prop = ICAL_NO_PROPERTY; - /* Is there a period in str1 ? If so, the string specified both a - component and a property*/ + /* Is there a period in str1 ? If so, the string specified both a */ + /* component and a property */ if( (c = strrchr(str1,'.')) != 0){ compstr = str1; propstr = c+1; |