/[bison]/bison/intl/plural.c
ViewVC logotype

Diff of /bison/intl/plural.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by akim, Thu Sep 27 14:06:38 2001 UTC revision 1.1.2.2 by akim, Wed Mar 20 08:43:12 2002 UTC
# Line 50  Line 50 
50  # include <config.h>  # include <config.h>
51  #endif  #endif
52    
53    #include <stddef.h>
54  #include <stdlib.h>  #include <stdlib.h>
55  #include "gettextP.h"  #include "plural-exp.h"
56    
57  /* Names for the libintl functions are a problem.  They must not clash  /* The main function generated by the parser is called __gettextparse,
58     with existing names and they should follow ANSI C.  But this source     but we want it to be called PLURAL_PARSE.  */
59     code is also used in GNU C Library where the names have a __  #ifndef _LIBC
60     prefix.  So we have to make a difference here.  */  # define __gettextparse PLURAL_PARSE
 #ifdef _LIBC  
 # define FREE_EXPRESSION __gettext_free_exp  
 #else  
 # define FREE_EXPRESSION gettext_free_exp__  
 # define __gettextparse gettextparse__  
61  #endif  #endif
62    
63  #define YYLEX_PARAM     &((struct parse_args *) arg)->cp  #define YYLEX_PARAM     &((struct parse_args *) arg)->cp
64  #define YYPARSE_PARAM   arg  #define YYPARSE_PARAM   arg
65    
66  #line 53 "plural.y"  #line 49 "plural.y"
67  typedef union {  typedef union {
68    unsigned long int num;    unsigned long int num;
69    enum operator op;    enum operator op;
70    struct expression *exp;    struct expression *exp;
71  } YYSTYPE;  } YYSTYPE;
72  #line 59 "plural.y"  #line 55 "plural.y"
73    
74  /* Prototypes for local functions.  */  /* Prototypes for local functions.  */
75  static struct expression *new_exp PARAMS ((int nargs, enum operator op,  static struct expression *new_exp PARAMS ((int nargs, enum operator op,
# Line 235  static const short yyrhs[] = {    17, Line 231  static const short yyrhs[] = {    17,
231    
232  #if YYDEBUG != 0  #if YYDEBUG != 0
233  static const short yyrline[] = { 0,  static const short yyrline[] = { 0,
234     178,   186,   190,   194,   198,   202,   206,   210,   214,   218,     174,   182,   186,   190,   194,   198,   202,   206,   210,   214,
235     222,   227     218,   223
236  };  };
237  #endif  #endif
238    
# Line 303  static const short yycheck[] = {     1, Line 299  static const short yycheck[] = {     1,
299  #define YYPURE 1  #define YYPURE 1
300    
301  /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */  /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
302  #line 3 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"  #line 3 "/usr/local/share/bison.simple"
303  /* This file comes from bison-1.28.  */  /* This file comes from bison-1.28.  */
304    
305  /* Skeleton output parser for bison,  /* Skeleton output parser for bison,
# Line 517  __yy_memcpy (char *to, char *from, unsig Line 513  __yy_memcpy (char *to, char *from, unsig
513  #endif  #endif
514  #endif  #endif
515    
516  #line 217 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"  #line 217 "/usr/local/share/bison.simple"
517    
518  /* The user can define YYPARSE_PARAM as the name of an argument to be passed  /* The user can define YYPARSE_PARAM as the name of an argument to be passed
519     into yyparse.  The argument should have type void *.     into yyparse.  The argument should have type void *.
# Line 846  yyreduce: Line 842  yyreduce:
842    switch (yyn) {    switch (yyn) {
843    
844  case 1:  case 1:
845  #line 179 "plural.y"  #line 175 "plural.y"
846  {  {
847              if (yyvsp[0].exp == NULL)              if (yyvsp[0].exp == NULL)
848                YYABORT;                YYABORT;
# Line 854  case 1: Line 850  case 1:
850            ;            ;
851      break;}      break;}
852  case 2:  case 2:
853  #line 187 "plural.y"  #line 183 "plural.y"
854  {  {
855              yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);              yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
856            ;            ;
857      break;}      break;}
858  case 3:  case 3:
859  #line 191 "plural.y"  #line 187 "plural.y"
860  {  {
861              yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);              yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
862            ;            ;
863      break;}      break;}
864  case 4:  case 4:
865  #line 195 "plural.y"  #line 191 "plural.y"
866  {  {
867              yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);              yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
868            ;            ;
869      break;}      break;}
870  case 5:  case 5:
871  #line 199 "plural.y"  #line 195 "plural.y"
872  {  {
873              yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);              yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
874            ;            ;
875      break;}      break;}
876  case 6:  case 6:
877  #line 203 "plural.y"  #line 199 "plural.y"
878  {  {
879              yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);              yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
880            ;            ;
881      break;}      break;}
882  case 7:  case 7:
883  #line 207 "plural.y"  #line 203 "plural.y"
884  {  {
885              yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);              yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
886            ;            ;
887      break;}      break;}
888  case 8:  case 8:
889  #line 211 "plural.y"  #line 207 "plural.y"
890  {  {
891              yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);              yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
892            ;            ;
893      break;}      break;}
894  case 9:  case 9:
895  #line 215 "plural.y"  #line 211 "plural.y"
896  {  {
897              yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);              yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
898            ;            ;
899      break;}      break;}
900  case 10:  case 10:
901  #line 219 "plural.y"  #line 215 "plural.y"
902  {  {
903              yyval.exp = new_exp_0 (var);              yyval.exp = new_exp_0 (var);
904            ;            ;
905      break;}      break;}
906  case 11:  case 11:
907  #line 223 "plural.y"  #line 219 "plural.y"
908  {  {
909              if ((yyval.exp = new_exp_0 (num)) != NULL)              if ((yyval.exp = new_exp_0 (num)) != NULL)
910                yyval.exp->val.num = yyvsp[0].num;                yyval.exp->val.num = yyvsp[0].num;
911            ;            ;
912      break;}      break;}
913  case 12:  case 12:
914  #line 228 "plural.y"  #line 224 "plural.y"
915  {  {
916              yyval.exp = yyvsp[-1].exp;              yyval.exp = yyvsp[-1].exp;
917            ;            ;
918      break;}      break;}
919  }  }
920     /* the action file gets copied in in place of this dollarsign */     /* the action file gets copied in in place of this dollarsign */
921  #line 543 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple"  #line 543 "/usr/local/share/bison.simple"
922    
923    yyvsp -= yylen;    yyvsp -= yylen;
924    yyssp -= yylen;    yyssp -= yylen;
# Line 1142  yyerrhandle: Line 1138  yyerrhandle:
1138      }      }
1139    return 1;    return 1;
1140  }  }
1141  #line 233 "plural.y"  #line 229 "plural.y"
1142    
1143    
1144  void  void

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26