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

📄 y.tab.c

📁 A* sudo sudo/* B* adduser script adduser C* rmuser script rmuser E* tout tout/*
💻 C
字号:
#ifndef lintstatic char const yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";#endif#include <stdlib.h>#define YYBYACC 1#define YYMAJOR 1#define YYMINOR 9#define YYLEX yylex()#define YYEMPTY -1#define yyclearin (yychar=(YYEMPTY))#define yyerrok (yyerrflag=0)#define YYRECOVERING() (yyerrflag!=0)static int yygrowstack();#define YYPREFIX "yy"#line 2 "visudo.yacc"/* *  sudo version 1.1 allows users to execute commands as root *  Copyright (C) 1991  The Root Group, Inc. * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 1, or (at your option) *  any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *  If you make modifications to the source, we would be happy to have *  them to include in future releases.  Feel free to send them to: *      Jeff Nieusma                       nieusma@rootgroup.com *      3959 Arbol CT                      (303) 447-8093 *      Boulder, CO 80301-1752              *//******************************************************************************** visudo.yacc, sudo project* David R. Hieb* February 17, 1991** Yacc Specification file for the visudo command in the sudo project.*******************************************************************************/#include <stdio.h>#include "sudo.h"extern int status;extern int yyerrok, yylineno, err_line_no;yyerror(s)char *s;{/* we don't want any output here */}yywrap(){return(1);}#line 65 "y.tab.c"#define YYERRCODE 256#define IDENT1 257#define IDENT2 258#define IDENT3 259#define COMMENT 260#define ERROR 261const short yylhs[] = {                                        -1,    0,    0,    1,    1,    1,    2,    2,    3,    4,    4,    5,    5,    5,    5,};const short yylen[] = {                                         2,    1,    2,    1,    2,    3,    1,    3,    3,    1,    3,    1,    2,    1,    2,};const short yydefred[] = {                                      0,    0,    0,    3,    0,    1,    4,    0,    0,    6,    2,    0,    5,    0,   13,   11,    0,    0,    9,    7,   14,   12,    0,   10,};const short yydgoto[] = {                                       4,    5,    8,    9,   17,   18,};const short yysindex[] = {                                   -253, -255, -252,    0, -253,    0,    0,  -51,  -57,    0,    0,  -33,    0, -252,    0,    0, -250,  -32,    0,    0,    0,    0,  -33,    0,};const short yyrindex[] = {                                      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,  -56,    0,    0,    0,    0,    0,    0,};const short yygindex[] = {                                      0,    7,    0,    1,    0,   -9,};#define YYTABLESIZE 226const short yytable[] = {                                      16,   13,    8,    1,    2,    6,    7,    3,   20,   21,   11,   10,   22,   23,   19,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   12,    8,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   14,   15,};const short yycheck[] = {                                      33,   58,   58,  256,  257,  260,  258,  260,  258,  259,   61,    4,   44,   22,   13,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  260,  260,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,  259,};#define YYFINAL 4#ifndef YYDEBUG#define YYDEBUG 0#endif#define YYMAXTOKEN 261#if YYDEBUGconst char * const yyname[] = {"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'!'",0,0,0,0,0,0,0,0,0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'",0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"IDENT1","IDENT2","IDENT3","COMMENT","ERROR",};const char * const yyrule[] = {"$accept : file","file : entry","file : file entry","entry : COMMENT","entry : error COMMENT","entry : IDENT1 access_series COMMENT","access_series : access_group","access_series : access_series ':' access_group","access_group : IDENT2 '=' cmnd_list","cmnd_list : cmnd_type","cmnd_list : cmnd_list ',' cmnd_type","cmnd_type : IDENT3","cmnd_type : '!' IDENT3","cmnd_type : IDENT2","cmnd_type : '!' IDENT2",};#endif#if YYDEBUG#include <stdio.h>#endif#ifdef YYSTACKSIZE#undef YYMAXDEPTH#define YYMAXDEPTH YYSTACKSIZE#else#ifdef YYMAXDEPTH#define YYSTACKSIZE YYMAXDEPTH#else#define YYSTACKSIZE 10000#define YYMAXDEPTH 10000#endif#endif#define YYINITSTACKSIZE 200int yydebug;int yynerrs;int yyerrflag;int yychar;short *yyssp;YYSTYPE *yyvsp;YYSTYPE yyval;YYSTYPE yylval;short *yyss;short *yysslim;YYSTYPE *yyvs;int yystacksize;/* allocate initial stack or double stack size, up to YYMAXDEPTH */static int yygrowstack(){    int newsize, i;    short *newss;    YYSTYPE *newvs;    if ((newsize = yystacksize) == 0)        newsize = YYINITSTACKSIZE;    else if (newsize >= YYMAXDEPTH)        return -1;    else if ((newsize *= 2) > YYMAXDEPTH)        newsize = YYMAXDEPTH;    i = yyssp - yyss;    newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :      (short *)malloc(newsize * sizeof *newss);    if (newss == NULL)        return -1;    yyss = newss;    yyssp = newss + i;    newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :      (YYSTYPE *)malloc(newsize * sizeof *newvs);    if (newvs == NULL)        return -1;    yyvs = newvs;    yyvsp = newvs + i;    yystacksize = newsize;    yysslim = yyss + newsize - 1;    return 0;}#define YYABORT goto yyabort#define YYREJECT goto yyabort#define YYACCEPT goto yyaccept#define YYERROR goto yyerrlab#ifndef YYPARSE_PARAM#if defined(__cplusplus) || __STDC__#define YYPARSE_PARAM_ARG void#define YYPARSE_PARAM_DECL#else	/* ! ANSI-C/C++ */#define YYPARSE_PARAM_ARG#define YYPARSE_PARAM_DECL#endif	/* ANSI-C/C++ */#else	/* YYPARSE_PARAM */#ifndef YYPARSE_PARAM_TYPE#define YYPARSE_PARAM_TYPE void *#endif#if defined(__cplusplus) || __STDC__#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM#define YYPARSE_PARAM_DECL#else	/* ! ANSI-C/C++ */#define YYPARSE_PARAM_ARG YYPARSE_PARAM#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;#endif	/* ANSI-C/C++ */#endif	/* ! YYPARSE_PARAM */intyyparse (YYPARSE_PARAM_ARG)    YYPARSE_PARAM_DECL{    register int yym, yyn, yystate;#if YYDEBUG    register const char *yys;    if ((yys = getenv("YYDEBUG")))    {        yyn = *yys;        if (yyn >= '0' && yyn <= '9')            yydebug = yyn - '0';    }#endif    yynerrs = 0;    yyerrflag = 0;    yychar = (-1);    if (yyss == NULL && yygrowstack()) goto yyoverflow;    yyssp = yyss;    yyvsp = yyvs;    *yyssp = yystate = 0;yyloop:    if ((yyn = yydefred[yystate])) goto yyreduce;    if (yychar < 0)    {        if ((yychar = yylex()) < 0) yychar = 0;#if YYDEBUG        if (yydebug)        {            yys = 0;            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];            if (!yys) yys = "illegal-symbol";            printf("%sdebug: state %d, reading %d (%s)\n",                    YYPREFIX, yystate, yychar, yys);        }#endif    }    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)    {#if YYDEBUG        if (yydebug)            printf("%sdebug: state %d, shifting to state %d\n",                    YYPREFIX, yystate, yytable[yyn]);#endif        if (yyssp >= yysslim && yygrowstack())        {            goto yyoverflow;        }        *++yyssp = yystate = yytable[yyn];        *++yyvsp = yylval;        yychar = (-1);        if (yyerrflag > 0)  --yyerrflag;        goto yyloop;    }    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)    {        yyn = yytable[yyn];        goto yyreduce;    }    if (yyerrflag) goto yyinrecovery;#if defined(lint) || defined(__GNUC__)    goto yynewerror;#endifyynewerror:    yyerror("syntax error");#if defined(lint) || defined(__GNUC__)    goto yyerrlab;#endifyyerrlab:    ++yynerrs;yyinrecovery:    if (yyerrflag < 3)    {        yyerrflag = 3;        for (;;)        {            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)            {#if YYDEBUG                if (yydebug)                    printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);#endif                if (yyssp >= yysslim && yygrowstack())                {                    goto yyoverflow;                }                *++yyssp = yystate = yytable[yyn];                *++yyvsp = yylval;                goto yyloop;            }            else            {#if YYDEBUG                if (yydebug)                    printf("%sdebug: error recovery discarding state %d\n",                            YYPREFIX, *yyssp);#endif                if (yyssp <= yyss) goto yyabort;                --yyssp;                --yyvsp;            }        }    }    else    {        if (yychar == 0) goto yyabort;#if YYDEBUG        if (yydebug)        {            yys = 0;            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];            if (!yys) yys = "illegal-symbol";            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",                    YYPREFIX, yystate, yychar, yys);        }#endif        yychar = (-1);        goto yyloop;    }yyreduce:#if YYDEBUG    if (yydebug)        printf("%sdebug: state %d, reducing by rule %d (%s)\n",                YYPREFIX, yystate, yyn, yyrule[yyn]);#endif    yym = yylen[yyn];    yyval = yyvsp[1-yym];    switch (yyn)    {case 4:#line 65 "visudo.yacc"{ yyerrok; if (status == 0) status = yylineno; }break;#line 411 "y.tab.c"    }    yyssp -= yym;    yystate = *yyssp;    yyvsp -= yym;    yym = yylhs[yyn];    if (yystate == 0 && yym == 0)    {#if YYDEBUG        if (yydebug)            printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL);#endif        yystate = YYFINAL;        *++yyssp = YYFINAL;        *++yyvsp = yyval;        if (yychar < 0)        {            if ((yychar = yylex()) < 0) yychar = 0;#if YYDEBUG            if (yydebug)            {                yys = 0;                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];                if (!yys) yys = "illegal-symbol";                printf("%sdebug: state %d, reading %d (%s)\n",                        YYPREFIX, YYFINAL, yychar, yys);            }#endif        }        if (yychar == 0) goto yyaccept;        goto yyloop;    }    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)        yystate = yytable[yyn];    else        yystate = yydgoto[yym];#if YYDEBUG    if (yydebug)        printf("%sdebug: after reduction, shifting from state %d \to state %d\n", YYPREFIX, *yyssp, yystate);#endif    if (yyssp >= yysslim && yygrowstack())    {        goto yyoverflow;    }    *++yyssp = yystate;    *++yyvsp = yyval;    goto yyloop;yyoverflow:    yyerror("yacc stack overflow");yyabort:    return (1);yyaccept:    return (0);}

⌨️ 快捷键说明

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