/[bison]/bison/src/parse-gram.c
ViewVC logotype

Diff of /bison/src/parse-gram.c

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

revision 1.33 by akim, Tue Nov 12 08:26:38 2002 UTC revision 1.34 by akim, Tue Nov 12 09:44:41 2002 UTC
# Line 1  Line 1 
1  /* A Bison parser, made from parse-gram.y, by GNU bison 1.75b.  */  /* A Bison parser, made by GNU Bison 1.75b.  */
2    
3  /* Skeleton parser for Yacc-like parsing with Bison,  /* Skeleton parser for Yacc-like parsing with Bison,
4     Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.     Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
# Line 238  typedef union { Line 238  typedef union {
238    assoc_t assoc;    assoc_t assoc;
239    struniq_t struniq;    struniq_t struniq;
240  } yystype;  } yystype;
241  /* Line 237 of /usr/local/share/bison/yacc.c.  */  /* Line 195 of /usr/local/share/bison/yacc.c.  */
242  #line 243 "parse-gram.c"  #line 242 "parse-gram.c"
243  # define YYSTYPE yystype  # define YYSTYPE yystype
244  # define YYSTYPE_IS_TRIVIAL 1  # define YYSTYPE_IS_TRIVIAL 1
245  #endif  #endif
# Line 259  typedef struct yyltype Line 259  typedef struct yyltype
259  /* Copy the second part of user declarations.  */  /* Copy the second part of user declarations.  */
260    
261    
262  /* Line 257 of /usr/local/share/bison/yacc.c.  */  /* Line 215 of /usr/local/share/bison/yacc.c.  */
263  #line 264 "parse-gram.c"  #line 263 "parse-gram.c"
264    
265  #if ! defined (yyoverflow) || YYERROR_VERBOSE  #if ! defined (yyoverflow) || YYERROR_VERBOSE
266    
# Line 375  union yyalloc Line 375  union yyalloc
375  #define YYUNDEFTOK  2  #define YYUNDEFTOK  2
376  #define YYMAXUTOK   301  #define YYMAXUTOK   301
377    
378  #define YYTRANSLATE(X) \  #define YYTRANSLATE(YYX)                                                \
379    ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)    ((YYX <= 0) ? YYEOF :                                                 \
380       (unsigned)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
381    
382  /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */  /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
383  static const unsigned char yytranslate[] =  static const unsigned char yytranslate[] =
# Line 661  static const unsigned char yystos[] = Line 662  static const unsigned char yystos[] =
662  #endif  #endif
663    
664  #define yyerrok         (yyerrstatus = 0)  #define yyerrok         (yyerrstatus = 0)
665  #define yyclearin       (yychar = YYEMPTY)  #define yyclearin       (yytoken = YYEMPTY)
666  #define YYEMPTY         -2  #define YYEMPTY         -2
667  #define YYEOF           0  #define YYEOF           0
668    
# Line 679  static const unsigned char yystos[] = Line 680  static const unsigned char yystos[] =
680    
681  #define YYBACKUP(Token, Value)                                  \  #define YYBACKUP(Token, Value)                                  \
682  do                                                              \  do                                                              \
683    if (yychar == YYEMPTY && yylen == 1)                          \    if (yytoken == YYEMPTY && yylen == 1)                         \
684      {                                                           \      {                                                           \
685        yychar = (Token);                                         \        yychar = (Token);                                         \
686        yylval = (Value);                                         \        yylval = (Value);                                         \
687        yychar1 = YYTRANSLATE (yychar);                           \        yytoken = YYTRANSLATE (yychar);                           \
688        YYPOPSTACK;                                               \        YYPOPSTACK;                                               \
689        goto yybackup;                                            \        goto yybackup;                                            \
690      }                                                           \      }                                                           \
# Line 826  yystpcpy (yydest, yysrc) Line 827  yystpcpy (yydest, yysrc)
827    
828  #if defined (__STDC__) || defined (__cplusplus)  #if defined (__STDC__) || defined (__cplusplus)
829  static void  static void
830  yysymprint (FILE *yyout, int yytype, YYSTYPE yyvalue, YYLTYPE yylocation)  yysymprint (FILE *yyout, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
831  #else  #else
832  static void  static void
833  yysymprint (yyout, yytype, yyvalue, yylocation)  yysymprint (yyout, yytype, yyvaluep, yylocationp)
834      FILE *yyout;      FILE *yyout;
835      int yytype;      int yytype;
836      YYSTYPE yyvalue;      YYSTYPE *yyvaluep;
837      YYLTYPE yylocation;      YYLTYPE *yylocationp;
838  #endif  #endif
839  {  {
840    /* Pacify ``unused variable'' warnings.  */    /* Pacify ``unused variable'' warnings.  */
841    (void) yyvalue;    (void) yyvaluep;
842    (void) yylocation;    (void) yylocationp;
843    
844    if (yytype < YYNTOKENS)    if (yytype < YYNTOKENS)
845      {      {
846        YYFPRINTF (yyout, "token %s (", yytname[yytype]);        YYFPRINTF (yyout, "token %s (", yytname[yytype]);
847  # ifdef YYPRINT  # ifdef YYPRINT
848        YYPRINT (yyout, yytoknum[yytype], yyvalue);        YYPRINT (yyout, yytoknum[yytype], *yyvaluep);
849  # endif  # endif
850      }      }
851    else    else
# Line 857  yysymprint (yyout, yytype, yyvalue, yylo Line 858  yysymprint (yyout, yytype, yyvalue, yylo
858      }      }
859    YYFPRINTF (yyout, ")");    YYFPRINTF (yyout, ")");
860  }  }
 #endif /* YYDEBUG. */  
   
861    
862    #endif /* YYDEBUG. */
863  /*-----------------------------------------------.  /*-----------------------------------------------.
864  | Release the memory associated to this symbol.  |  | Release the memory associated to this symbol.  |
865  `-----------------------------------------------*/  `-----------------------------------------------*/
866    
867  #if defined (__STDC__) || defined (__cplusplus)  #if defined (__STDC__) || defined (__cplusplus)
868  static void  static void
869  yydestruct (int yytype, YYSTYPE yyvalue, YYLTYPE yylocation)  yydestruct (int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
870  #else  #else
871  static void  static void
872  yydestruct (yytype, yyvalue, yylocation)  yydestruct (yytype, yyvaluep, yylocationp)
873      int yytype;      int yytype;
874      YYSTYPE yyvalue;      YYSTYPE *yyvaluep;
875      YYLTYPE yylocation;      YYLTYPE *yylocationp;
876  #endif  #endif
877  {  {
878    /* Pacify ``unused variable'' warnings.  */    /* Pacify ``unused variable'' warnings.  */
879    (void) yyvalue;    (void) yyvaluep;
880    (void) yylocation;    (void) yylocationp;
881    
882    switch (yytype)    switch (yytype)
883      {      {
884    
885        default:        default:
886          break;          break;
887      }      }
888  }  }
   
889    
890    
891  /* Prevent warnings from -Wmissing-prototypes.  */  /* Prevent warnings from -Wmissing-prototypes.  */
# Line 948  YYLTYPE yylloc; Line 948  YYLTYPE yylloc;
948    /* Number of tokens to shift before error messages enabled.  */    /* Number of tokens to shift before error messages enabled.  */
949    int yyerrstatus;    int yyerrstatus;
950    /* Lookahead token as an internal (translated) token number.  */    /* Lookahead token as an internal (translated) token number.  */
951    int yychar1 = 0;    int yytoken = 0;
952    
953    /* Three stacks and their tools:    /* Three stacks and their tools:
954       `yyss': related to states,       `yyss': related to states,
# Line 991  YYLTYPE yylloc; Line 991  YYLTYPE yylloc;
991    yystate = 0;    yystate = 0;
992    yyerrstatus = 0;    yyerrstatus = 0;
993    yynerrs = 0;    yynerrs = 0;
994    yychar = YYEMPTY;             /* Cause a token to be read.  */    yychar = yytoken = YYEMPTY;           /* Cause a token to be read.  */
995    
996    /* Initialize stack pointers.    /* Initialize stack pointers.
997       Waste one element of value and location stack       Waste one element of value and location stack
# Line 1101  yybackup: Line 1101  yybackup:
1101    
1102    /* Not known => get a lookahead token if don't already have one.  */    /* Not known => get a lookahead token if don't already have one.  */
1103    
1104    /* yychar is either YYEMPTY or YYEOF    /* YYTOKEN is either YYEMPTY or YYEOF or a valid token.  */
1105       or a valid token in external form.  */    if (yytoken == YYEMPTY)
   
   if (yychar == YYEMPTY)  
1106      {      {
1107        YYDPRINTF ((stderr, "Reading a token: "));        YYDPRINTF ((stderr, "Reading a token: "));
1108        yychar = YYLEX;        yychar = YYLEX;
1109          yytoken = YYTRANSLATE (yychar);
1110      }      }
1111    
1112    /* Convert token to internal form (in yychar1) for indexing tables with.  */    if (yytoken == YYEOF)
   
   if (yychar <= 0)              /* This means end of input.  */  
1113      {      {
       yychar1 = 0;  
       yychar = YYEOF;           /* Don't call YYLEX any more.  */  
   
1114        YYDPRINTF ((stderr, "Now at end of input.\n"));        YYDPRINTF ((stderr, "Now at end of input.\n"));
1115      }      }
1116    else    else
1117      {      {
       yychar1 = YYTRANSLATE (yychar);  
   
1118        /* We have to keep this `#if YYDEBUG', since we use variables        /* We have to keep this `#if YYDEBUG', since we use variables
1119           which are defined only if `YYDEBUG' is set.  */           which are defined only if `YYDEBUG' is set.  */
1120        YYDPRINTF ((stderr, "Next token is "));        YYDPRINTF ((stderr, "Next token is "));
1121        YYDSYMPRINT ((stderr, yychar1, yylval, yyloc));        YYDSYMPRINT ((stderr, yytoken, &yylval, &yyloc));
1122        YYDPRINTF ((stderr, "\n"));        YYDPRINTF ((stderr, "\n"));
1123      }      }
1124    
1125    /* If the proper action on seeing token YYCHAR1 is to reduce or to    /* If the proper action on seeing token YYTOKEN is to reduce or to
1126       detect an error, take that action.  */       detect an error, take that action.  */
1127    yyn += yychar1;    yyn += yytoken;
1128    if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)    if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1129      goto yydefault;      goto yydefault;
1130    yyn = yytable[yyn];    yyn = yytable[yyn];
1131    if (yyn <= 0)    if (yyn <= 0)
# Line 1149  yybackup: Line 1141  yybackup:
1141    
1142    /* Shift the lookahead token.  */    /* Shift the lookahead token.  */
1143    YYDPRINTF ((stderr, "Shifting token %d (%s), ",    YYDPRINTF ((stderr, "Shifting token %d (%s), ",
1144                yychar, yytname[yychar1]));                yytoken, yytname[yytoken]));
1145    
1146    /* Discard the token being shifted unless it is eof.  */    /* Discard the token being shifted unless it is eof.  */
1147    if (yychar != YYEOF)    if (yytoken != YYEOF)
1148      yychar = YYEMPTY;      yytoken = YYEMPTY;
1149    
1150    *++yyvsp = yylval;    *++yyvsp = yylval;
1151    *++yylsp = yylloc;    *++yylsp = yylloc;
# Line 1611  yyreduce: Line 1603  yyreduce:
1603    
1604      }      }
1605    
1606  /* Line 1056 of /usr/local/share/bison/yacc.c.  */  /* Line 950 of /usr/local/share/bison/yacc.c.  */
1607  #line 1616 "parse-gram.c"  #line 1607 "parse-gram.c"
1608    
1609    yyvsp -= yylen;    yyvsp -= yylen;
1610    yyssp -= yylen;    yyssp -= yylen;
# Line 1717  yyerrlab1: Line 1709  yyerrlab1:
1709           error, discard it.  */           error, discard it.  */
1710    
1711        /* Return failure if at end of input.  */        /* Return failure if at end of input.  */
1712        if (yychar == YYEOF)        if (yytoken == YYEOF)
1713          {          {
1714            /* Pop the error token.  */            /* Pop the error token.  */
1715            YYPOPSTACK;            YYPOPSTACK;
# Line 1727  yyerrlab1: Line 1719  yyerrlab1:
1719                YYDPRINTF ((stderr, "Error: popping "));                YYDPRINTF ((stderr, "Error: popping "));
1720                YYDSYMPRINT ((stderr,                YYDSYMPRINT ((stderr,
1721                              yystos[*yyssp],                              yystos[*yyssp],
1722                              *yyvsp, *yylsp));                              yyvsp, yylsp));
1723                YYDPRINTF ((stderr, "\n"));                YYDPRINTF ((stderr, "\n"));
1724                yydestruct (yystos[*yyssp], *yyvsp, *yylsp);                yydestruct (yystos[*yyssp], yyvsp, yylsp);
1725                YYPOPSTACK;                YYPOPSTACK;
1726              }              }
1727            YYABORT;            YYABORT;
1728          }          }
1729    
1730        YYDPRINTF ((stderr, "Discarding token %d (%s).\n",        YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1731                    yychar, yytname[yychar1]));                    yytoken, yytname[yytoken]));
1732        yydestruct (yychar1, yylval, yylloc);        yydestruct (yytoken, &yylval, &yylloc);
1733        yychar = YYEMPTY;        yytoken = YYEMPTY;
1734      }      }
1735    
1736    /* Else will try to reuse lookahead token after shifting the error    /* Else will try to reuse lookahead token after shifting the error
# Line 1766  yyerrlab1: Line 1758  yyerrlab1:
1758    
1759        YYDPRINTF ((stderr, "Error: popping "));        YYDPRINTF ((stderr, "Error: popping "));
1760        YYDSYMPRINT ((stderr,        YYDSYMPRINT ((stderr,
1761                      yystos[*yyssp], *yyvsp, *yylsp));                      yystos[*yyssp], yyvsp, yylsp));
1762        YYDPRINTF ((stderr, "\n"));        YYDPRINTF ((stderr, "\n"));
1763    
1764        yydestruct (yystos[yystate], *yyvsp, *yylsp);        yydestruct (yystos[yystate], yyvsp, yylsp);
1765        yyvsp--;        yyvsp--;
1766        yystate = *--yyssp;        yystate = *--yyssp;
1767        yylsp--;        yylsp--;

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

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