⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pl_gram.c

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻 C
📖 第 1 页 / 共 5 页
字号:
#if PLPGSQL_YYDEBUG/*--------------------------------.| Print this symbol on PLPGSQL_YYOUTPUT.  |`--------------------------------*/#if defined (__STDC__) || defined (__cplusplus)static voidplpgsql_yysymprint (FILE *plpgsql_yyoutput, int plpgsql_yytype, PLPGSQL_YYSTYPE *plpgsql_yyvaluep)#elsestatic voidplpgsql_yysymprint (plpgsql_yyoutput, plpgsql_yytype, plpgsql_yyvaluep)    FILE *plpgsql_yyoutput;    int plpgsql_yytype;    PLPGSQL_YYSTYPE *plpgsql_yyvaluep;#endif{  /* Pacify ``unused variable'' warnings.  */  (void) plpgsql_yyvaluep;  if (plpgsql_yytype < PLPGSQL_YYNTOKENS)    {      PLPGSQL_YYFPRINTF (plpgsql_yyoutput, "token %s (", plpgsql_yytname[plpgsql_yytype]);# ifdef PLPGSQL_YYPRINT      PLPGSQL_YYPRINT (plpgsql_yyoutput, plpgsql_yytoknum[plpgsql_yytype], *plpgsql_yyvaluep);# endif    }  else    PLPGSQL_YYFPRINTF (plpgsql_yyoutput, "nterm %s (", plpgsql_yytname[plpgsql_yytype]);  switch (plpgsql_yytype)    {      default:        break;    }  PLPGSQL_YYFPRINTF (plpgsql_yyoutput, ")");}#endif /* ! PLPGSQL_YYDEBUG *//*-----------------------------------------------.| Release the memory associated to this symbol.  |`-----------------------------------------------*/#if defined (__STDC__) || defined (__cplusplus)static voidplpgsql_yydestruct (int plpgsql_yytype, PLPGSQL_YYSTYPE *plpgsql_yyvaluep)#elsestatic voidplpgsql_yydestruct (plpgsql_yytype, plpgsql_yyvaluep)    int plpgsql_yytype;    PLPGSQL_YYSTYPE *plpgsql_yyvaluep;#endif{  /* Pacify ``unused variable'' warnings.  */  (void) plpgsql_yyvaluep;  switch (plpgsql_yytype)    {      default:        break;    }}/* Prevent warnings from -Wmissing-prototypes.  */#ifdef PLPGSQL_YYPARSE_PARAM# if defined (__STDC__) || defined (__cplusplus)int plpgsql_yyparse (void *PLPGSQL_YYPARSE_PARAM);# elseint plpgsql_yyparse ();# endif#else /* ! PLPGSQL_YYPARSE_PARAM */#if defined (__STDC__) || defined (__cplusplus)int plpgsql_yyparse (void);#elseint plpgsql_yyparse ();#endif#endif /* ! PLPGSQL_YYPARSE_PARAM *//* The lookahead symbol.  */int plpgsql_yychar;/* The semantic value of the lookahead symbol.  */PLPGSQL_YYSTYPE plpgsql_yylval;/* Number of syntax errors so far.  */int plpgsql_yynerrs;/*----------.| plpgsql_yyparse.  |`----------*/#ifdef PLPGSQL_YYPARSE_PARAM# if defined (__STDC__) || defined (__cplusplus)int plpgsql_yyparse (void *PLPGSQL_YYPARSE_PARAM)# elseint plpgsql_yyparse (PLPGSQL_YYPARSE_PARAM)  void *PLPGSQL_YYPARSE_PARAM;# endif#else /* ! PLPGSQL_YYPARSE_PARAM */#if defined (__STDC__) || defined (__cplusplus)intplpgsql_yyparse (void)#elseintplpgsql_yyparse ()#endif#endif{    register int plpgsql_yystate;  register int plpgsql_yyn;  int plpgsql_yyresult;  /* Number of tokens to shift before error messages enabled.  */  int plpgsql_yyerrstatus;  /* Lookahead token as an internal (translated) token number.  */  int plpgsql_yytoken = 0;  /* Three stacks and their tools:     `plpgsql_yyss': related to states,     `plpgsql_yyvs': related to semantic values,     `plpgsql_yyls': related to locations.     Refer to the stacks thru separate pointers, to allow plpgsql_yyoverflow     to reallocate them elsewhere.  */  /* The state stack.  */  short	plpgsql_yyssa[PLPGSQL_YYINITDEPTH];  short *plpgsql_yyss = plpgsql_yyssa;  register short *plpgsql_yyssp;  /* The semantic value stack.  */  PLPGSQL_YYSTYPE plpgsql_yyvsa[PLPGSQL_YYINITDEPTH];  PLPGSQL_YYSTYPE *plpgsql_yyvs = plpgsql_yyvsa;  register PLPGSQL_YYSTYPE *plpgsql_yyvsp;#define PLPGSQL_YYPOPSTACK   (plpgsql_yyvsp--, plpgsql_yyssp--)  PLPGSQL_YYSIZE_T plpgsql_yystacksize = PLPGSQL_YYINITDEPTH;  /* The variables used to return semantic value and location from the     action routines.  */  PLPGSQL_YYSTYPE plpgsql_yyval;  /* When reducing, the number of symbols on the RHS of the reduced     rule.  */  int plpgsql_yylen;  PLPGSQL_YYDPRINTF ((stderr, "Starting parse\n"));  plpgsql_yystate = 0;  plpgsql_yyerrstatus = 0;  plpgsql_yynerrs = 0;  plpgsql_yychar = PLPGSQL_YYEMPTY;		/* Cause a token to be read.  */  /* Initialize stack pointers.     Waste one element of value and location stack     so that they stay on the same level as the state stack.     The wasted elements are never initialized.  */  plpgsql_yyssp = plpgsql_yyss;  plpgsql_yyvsp = plpgsql_yyvs;  goto plpgsql_yysetstate;/*------------------------------------------------------------.| plpgsql_yynewstate -- Push a new state, which is found in plpgsql_yystate.  |`------------------------------------------------------------*/ plpgsql_yynewstate:  /* In all cases, when you get here, the value and location stacks     have just been pushed. so pushing a state here evens the stacks.     */  plpgsql_yyssp++; plpgsql_yysetstate:  *plpgsql_yyssp = plpgsql_yystate;  if (plpgsql_yyss + plpgsql_yystacksize - 1 <= plpgsql_yyssp)    {      /* Get the current used size of the three stacks, in elements.  */      PLPGSQL_YYSIZE_T plpgsql_yysize = plpgsql_yyssp - plpgsql_yyss + 1;#ifdef plpgsql_yyoverflow      {	/* Give user a chance to reallocate the stack. Use copies of	   these so that the &'s don't force the real ones into	   memory.  */	PLPGSQL_YYSTYPE *plpgsql_yyvs1 = plpgsql_yyvs;	short *plpgsql_yyss1 = plpgsql_yyss;	/* Each stack pointer address is followed by the size of the	   data in use in that stack, in bytes.  This used to be a	   conditional around just the two extra args, but that might	   be undefined if plpgsql_yyoverflow is a macro.  */	plpgsql_yyoverflow ("parser stack overflow",		    &plpgsql_yyss1, plpgsql_yysize * sizeof (*plpgsql_yyssp),		    &plpgsql_yyvs1, plpgsql_yysize * sizeof (*plpgsql_yyvsp),		    &plpgsql_yystacksize);	plpgsql_yyss = plpgsql_yyss1;	plpgsql_yyvs = plpgsql_yyvs1;      }#else /* no plpgsql_yyoverflow */# ifndef PLPGSQL_YYSTACK_RELOCATE      goto plpgsql_yyoverflowlab;# else      /* Extend the stack our own way.  */      if (PLPGSQL_YYMAXDEPTH <= plpgsql_yystacksize)	goto plpgsql_yyoverflowlab;      plpgsql_yystacksize *= 2;      if (PLPGSQL_YYMAXDEPTH < plpgsql_yystacksize)	plpgsql_yystacksize = PLPGSQL_YYMAXDEPTH;      {	short *plpgsql_yyss1 = plpgsql_yyss;	union plpgsql_yyalloc *plpgsql_yyptr =	  (union plpgsql_yyalloc *) PLPGSQL_YYSTACK_ALLOC (PLPGSQL_YYSTACK_BYTES (plpgsql_yystacksize));	if (! plpgsql_yyptr)	  goto plpgsql_yyoverflowlab;	PLPGSQL_YYSTACK_RELOCATE (plpgsql_yyss);	PLPGSQL_YYSTACK_RELOCATE (plpgsql_yyvs);#  undef PLPGSQL_YYSTACK_RELOCATE	if (plpgsql_yyss1 != plpgsql_yyssa)	  PLPGSQL_YYSTACK_FREE (plpgsql_yyss1);      }# endif#endif /* no plpgsql_yyoverflow */      plpgsql_yyssp = plpgsql_yyss + plpgsql_yysize - 1;      plpgsql_yyvsp = plpgsql_yyvs + plpgsql_yysize - 1;      PLPGSQL_YYDPRINTF ((stderr, "Stack size increased to %lu\n",		  (unsigned long int) plpgsql_yystacksize));      if (plpgsql_yyss + plpgsql_yystacksize - 1 <= plpgsql_yyssp)	PLPGSQL_YYABORT;    }  PLPGSQL_YYDPRINTF ((stderr, "Entering state %d\n", plpgsql_yystate));  goto plpgsql_yybackup;/*-----------.| plpgsql_yybackup.  |`-----------*/plpgsql_yybackup:/* Do appropriate processing given the current state.  *//* Read a lookahead token if we need one and don't already have one.  *//* plpgsql_yyresume: */  /* First try to decide what to do without reference to lookahead token.  */  plpgsql_yyn = plpgsql_yypact[plpgsql_yystate];  if (plpgsql_yyn == PLPGSQL_YYPACT_NINF)    goto plpgsql_yydefault;  /* Not known => get a lookahead token if don't already have one.  */  /* PLPGSQL_YYCHAR is either PLPGSQL_YYEMPTY or PLPGSQL_YYEOF or a valid lookahead symbol.  */  if (plpgsql_yychar == PLPGSQL_YYEMPTY)    {      PLPGSQL_YYDPRINTF ((stderr, "Reading a token: "));      plpgsql_yychar = PLPGSQL_YYLEX;    }  if (plpgsql_yychar <= PLPGSQL_YYEOF)    {      plpgsql_yychar = plpgsql_yytoken = PLPGSQL_YYEOF;      PLPGSQL_YYDPRINTF ((stderr, "Now at end of input.\n"));    }  else    {      plpgsql_yytoken = PLPGSQL_YYTRANSLATE (plpgsql_yychar);      PLPGSQL_YYDSYMPRINTF ("Next token is", plpgsql_yytoken, &plpgsql_yylval, &plpgsql_yylloc);    }  /* If the proper action on seeing token PLPGSQL_YYTOKEN is to reduce or to     detect an error, take that action.  */  plpgsql_yyn += plpgsql_yytoken;  if (plpgsql_yyn < 0 || PLPGSQL_YYLAST < plpgsql_yyn || plpgsql_yycheck[plpgsql_yyn] != plpgsql_yytoken)    goto plpgsql_yydefault;  plpgsql_yyn = plpgsql_yytable[plpgsql_yyn];  if (plpgsql_yyn <= 0)    {      if (plpgsql_yyn == 0 || plpgsql_yyn == PLPGSQL_YYTABLE_NINF)	goto plpgsql_yyerrlab;      plpgsql_yyn = -plpgsql_yyn;      goto plpgsql_yyreduce;    }  if (plpgsql_yyn == PLPGSQL_YYFINAL)    PLPGSQL_YYACCEPT;  /* Shift the lookahead token.  */  PLPGSQL_YYDPRINTF ((stderr, "Shifting token %s, ", plpgsql_yytname[plpgsql_yytoken]));  /* Discard the token being shifted unless it is eof.  */  if (plpgsql_yychar != PLPGSQL_YYEOF)    plpgsql_yychar = PLPGSQL_YYEMPTY;  *++plpgsql_yyvsp = plpgsql_yylval;  /* Count tokens shifted since error; after three, turn off error     status.  */  if (plpgsql_yyerrstatus)    plpgsql_yyerrstatus--;  plpgsql_yystate = plpgsql_yyn;  goto plpgsql_yynewstate;/*-----------------------------------------------------------.| plpgsql_yydefault -- do the default action for the current state.  |`-----------------------------------------------------------*/plpgsql_yydefault:  plpgsql_yyn = plpgsql_yydefact[plpgsql_yystate];  if (plpgsql_yyn == 0)    goto plpgsql_yyerrlab;  goto plpgsql_yyreduce;/*-----------------------------.| plpgsql_yyreduce -- Do a reduction.  |`-----------------------------*/plpgsql_yyreduce:  /* plpgsql_yyn is the number of a rule to reduce with.  */  plpgsql_yylen = plpgsql_yyr2[plpgsql_yyn];  /* If PLPGSQL_YYLEN is nonzero, implement the default value of the action:     `$$ = $1'.     Otherwise, the following line sets PLPGSQL_YYVAL to garbage.     This behavior is undocumented and Bison     users should not rely upon it.  Assigning to PLPGSQL_YYVAL     unconditionally makes the parser a bit smaller, and it avoids a     GCC warning that PLPGSQL_YYVAL may be used uninitialized.  */  plpgsql_yyval = plpgsql_yyvsp[1-plpgsql_yylen];  PLPGSQL_YY_REDUCE_PRINT (plpgsql_yyn);  switch (plpgsql_yyn)    {        case 2:#line 231 "gram.y"    {						plpgsql_yylval.program = (PLpgSQL_stmt_block *)plpgsql_yyvsp[-1].stmt;					}    break;  case 3:#line 235 "gram.y"    {						plpgsql_yylval.program = (PLpgSQL_stmt_block *)plpgsql_yyvsp[-1].stmt;					}    break;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -