📄 bootparse.c
字号:
if (Int_yytype < YYNTOKENS) { YYFPRINTF (Int_yyoutput, "token %s (", Int_yytname[Int_yytype]);# ifdef YYPRINT YYPRINT (Int_yyoutput, Int_yytoknum[Int_yytype], *Int_yyvaluep);# endif } else YYFPRINTF (Int_yyoutput, "nterm %s (", Int_yytname[Int_yytype]); switch (Int_yytype) { default: break; } YYFPRINTF (Int_yyoutput, ")");}#endif /* ! YYDEBUG *//*-----------------------------------------------.| Release the memory associated to this symbol. |`-----------------------------------------------*/#if defined (__STDC__) || defined (__cplusplus)static voidInt_yydestruct (int Int_yytype, YYSTYPE *Int_yyvaluep)#elsestatic voidInt_yydestruct (Int_yytype, Int_yyvaluep) int Int_yytype; YYSTYPE *Int_yyvaluep;#endif{ /* Pacify ``unused variable'' warnings. */ (void) Int_yyvaluep; switch (Int_yytype) { default: break; }}/* Prevent warnings from -Wmissing-prototypes. */#ifdef YYPARSE_PARAM# if defined (__STDC__) || defined (__cplusplus)int Int_yyparse (void *YYPARSE_PARAM);# elseint Int_yyparse ();# endif#else /* ! YYPARSE_PARAM */#if defined (__STDC__) || defined (__cplusplus)int Int_yyparse (void);#elseint Int_yyparse ();#endif#endif /* ! YYPARSE_PARAM *//* The lookahead symbol. */int Int_yychar;/* The semantic value of the lookahead symbol. */YYSTYPE Int_yylval;/* Number of syntax errors so far. */int Int_yynerrs;/*----------.| Int_yyparse. |`----------*/#ifdef YYPARSE_PARAM# if defined (__STDC__) || defined (__cplusplus)int Int_yyparse (void *YYPARSE_PARAM)# elseint Int_yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM;# endif#else /* ! YYPARSE_PARAM */#if defined (__STDC__) || defined (__cplusplus)intInt_yyparse (void)#elseintInt_yyparse ()#endif#endif{ register int Int_yystate; register int Int_yyn; int Int_yyresult; /* Number of tokens to shift before error messages enabled. */ int Int_yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int Int_yytoken = 0; /* Three stacks and their tools: `Int_yyss': related to states, `Int_yyvs': related to semantic values, `Int_yyls': related to locations. Refer to the stacks thru separate pointers, to allow Int_yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short Int_yyssa[YYINITDEPTH]; short *Int_yyss = Int_yyssa; register short *Int_yyssp; /* The semantic value stack. */ YYSTYPE Int_yyvsa[YYINITDEPTH]; YYSTYPE *Int_yyvs = Int_yyvsa; register YYSTYPE *Int_yyvsp;#define YYPOPSTACK (Int_yyvsp--, Int_yyssp--) YYSIZE_T Int_yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE Int_yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int Int_yylen; YYDPRINTF ((stderr, "Starting parse\n")); Int_yystate = 0; Int_yyerrstatus = 0; Int_yynerrs = 0; Int_yychar = 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. */ Int_yyssp = Int_yyss; Int_yyvsp = Int_yyvs; goto Int_yysetstate;/*------------------------------------------------------------.| Int_yynewstate -- Push a new state, which is found in Int_yystate. |`------------------------------------------------------------*/ Int_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. */ Int_yyssp++; Int_yysetstate: *Int_yyssp = Int_yystate; if (Int_yyss + Int_yystacksize - 1 <= Int_yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T Int_yysize = Int_yyssp - Int_yyss + 1;#ifdef Int_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. */ YYSTYPE *Int_yyvs1 = Int_yyvs; short *Int_yyss1 = Int_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 Int_yyoverflow is a macro. */ Int_yyoverflow ("parser stack overflow", &Int_yyss1, Int_yysize * sizeof (*Int_yyssp), &Int_yyvs1, Int_yysize * sizeof (*Int_yyvsp), &Int_yystacksize); Int_yyss = Int_yyss1; Int_yyvs = Int_yyvs1; }#else /* no Int_yyoverflow */# ifndef YYSTACK_RELOCATE goto Int_yyoverflowlab;# else /* Extend the stack our own way. */ if (YYMAXDEPTH <= Int_yystacksize) goto Int_yyoverflowlab; Int_yystacksize *= 2; if (YYMAXDEPTH < Int_yystacksize) Int_yystacksize = YYMAXDEPTH; { short *Int_yyss1 = Int_yyss; union Int_yyalloc *Int_yyptr = (union Int_yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (Int_yystacksize)); if (! Int_yyptr) goto Int_yyoverflowlab; YYSTACK_RELOCATE (Int_yyss); YYSTACK_RELOCATE (Int_yyvs);# undef YYSTACK_RELOCATE if (Int_yyss1 != Int_yyssa) YYSTACK_FREE (Int_yyss1); }# endif#endif /* no Int_yyoverflow */ Int_yyssp = Int_yyss + Int_yysize - 1; Int_yyvsp = Int_yyvs + Int_yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) Int_yystacksize)); if (Int_yyss + Int_yystacksize - 1 <= Int_yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", Int_yystate)); goto Int_yybackup;/*-----------.| Int_yybackup. |`-----------*/Int_yybackup:/* Do appropriate processing given the current state. *//* Read a lookahead token if we need one and don't already have one. *//* Int_yyresume: */ /* First try to decide what to do without reference to lookahead token. */ Int_yyn = Int_yypact[Int_yystate]; if (Int_yyn == YYPACT_NINF) goto Int_yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (Int_yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); Int_yychar = YYLEX; } if (Int_yychar <= YYEOF) { Int_yychar = Int_yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { Int_yytoken = YYTRANSLATE (Int_yychar); YYDSYMPRINTF ("Next token is", Int_yytoken, &Int_yylval, &Int_yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ Int_yyn += Int_yytoken; if (Int_yyn < 0 || YYLAST < Int_yyn || Int_yycheck[Int_yyn] != Int_yytoken) goto Int_yydefault; Int_yyn = Int_yytable[Int_yyn]; if (Int_yyn <= 0) { if (Int_yyn == 0 || Int_yyn == YYTABLE_NINF) goto Int_yyerrlab; Int_yyn = -Int_yyn; goto Int_yyreduce; } if (Int_yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", Int_yytname[Int_yytoken])); /* Discard the token being shifted unless it is eof. */ if (Int_yychar != YYEOF) Int_yychar = YYEMPTY; *++Int_yyvsp = Int_yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (Int_yyerrstatus) Int_yyerrstatus--; Int_yystate = Int_yyn; goto Int_yynewstate;/*-----------------------------------------------------------.| Int_yydefault -- do the default action for the current state. |`-----------------------------------------------------------*/Int_yydefault: Int_yyn = Int_yydefact[Int_yystate]; if (Int_yyn == 0) goto Int_yyerrlab; goto Int_yyreduce;/*-----------------------------.| Int_yyreduce -- Do a reduction. |`-----------------------------*/Int_yyreduce: /* Int_yyn is the number of a rule to reduce with. */ Int_yylen = Int_yyr2[Int_yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ Int_yyval = Int_yyvsp[1-Int_yylen]; YY_REDUCE_PRINT (Int_yyn); switch (Int_yyn) { case 13:#line 132 "bootparse.y" { do_start(); boot_openrel(LexIDStr(Int_yyvsp[0].ival)); do_end(); } break; case 14:#line 141 "bootparse.y" { do_start(); closerel(LexIDStr(Int_yyvsp[0].ival)); do_end(); } break; case 15:#line 147 "bootparse.y" { do_start(); closerel(NULL); do_end(); } break; case 16:#line 156 "bootparse.y" { do_start(); numattr = 0; elog(DEBUG4, "creating%s%s relation %s %u", Int_yyvsp[-5].ival ? " bootstrap" : "", Int_yyvsp[-4].ival ? " shared" : "", LexIDStr(Int_yyvsp[-2].ival), Int_yyvsp[-1].oidval); } break; case 17:#line 166 "bootparse.y" { do_end(); } break; case 18:#line 170 "bootparse.y" { TupleDesc tupdesc; do_start(); tupdesc = CreateTupleDesc(numattr, !(Int_yyvsp[-7].ival), attrtypes); if (Int_yyvsp[-9].ival) { if (boot_reldesc) { elog(DEBUG4, "create bootstrap: warning, open relation exists, closing first"); closerel(NULL); } boot_reldesc = heap_create(LexIDStr(Int_yyvsp[-6].ival), PG_CATALOG_NAMESPACE, Int_yyvsp[-8].ival ? GLOBALTABLESPACE_OID : 0, Int_yyvsp[-5].oidval, tupdesc, RELKIND_RELATION, Int_yyvsp[-8].ival, true); elog(DEBUG4, "bootstrap relation created"); } else {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -