config.parse.c
来自「ftam等标准协议服务器和客户端的源代码。」· C语言 代码 · 共 950 行 · 第 1/2 页
C
950 行
/* A Bison parser, made from config.b */#define SEARCHPATH 258#define NUMBER 259#define STRING 260#line 1 "config.b"/* $Header: /xtel/isode/isode/others/quipu/uips/doog/RCS/config.parse.c,v 9.0 1992/06/16 12:45:18 isode Rel $ *//* * $Log: config.parse.c,v $ * Revision 9.0 1992/06/16 12:45:18 isode * Release 8.0 * */#include "types.h"#include "sequence.h"#include "util.h"#include "initialize.h"#include "query.h"#include "quipu/util.h"#ifdef _AIX#pragma alloca#endif#define yyparse parseConfigstatic int yylex();void add_ufn_path_element();extern FILE *config_file;extern QCardinal config_line_num;extern char config_file_name[];static char lexeme[255];void exit();#line 40 "config.b"typedef union{ int number; QCardinal symbol; char strval[255]; entryList dnlist;} YYSTYPE;#ifndef YYLTYPEtypedef struct yyltype { int timestamp; int first_line; int first_column; int last_line; int last_column; char *text; } yyltype;#define YYLTYPE yyltype#endif#include <stdio.h>#ifndef __STDC__#define const#endif#define YYFINAL 29#define YYFLAG -32768#define YYNTBASE 11#define YYTRANSLATE(x) ((unsigned)(x) <= 260 ? yytranslate[x] : 17)static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7, 8, 2, 10, 9, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5};static const short yyprhs[] = { 0, 0, 2, 5, 6, 14, 24, 34, 36, 38, 42};static const short yyrhs[] = { 12, 0, 13, 12, 0, 0, 3, 6, 14, 6, 7, 16, 8, 0, 3, 6, 14, 9, 15, 6, 7, 16, 8, 0, 3, 6, 14, 9, 10, 6, 7, 16, 8, 0, 4, 0, 4, 0, 5, 9, 16, 0, 5, 0};#if YYDEBUG != 0static const short yyrline[] = { 0, 59, 62, 63, 66, 71, 76, 82, 85, 88, 93};static const char * const yytname[] = { "$","error","$illegal.","SEARCHPATH","NUMBER","STRING","':'","'('","')'","','","'+'","configure","option_list","option","lower_bound","upper_bound","entry_list",""};#endifstatic const short yyr1[] = { 0, 11, 12, 12, 13, 13, 13, 14, 15, 16, 16};static const short yyr2[] = { 0, 1, 2, 0, 7, 9, 9, 1, 1, 3, 1};static const short yydefact[] = { 3, 0, 1, 3, 0, 2, 7, 0, 0, 0, 0, 8, 0, 0, 10, 0, 0, 0, 0, 4, 0, 0, 9, 0, 0, 6, 5, 0, 0, 0};static const short yydefgoto[] = { 27, 2, 3, 7, 13, 15};static const short yypact[] = { 4, 3,-32768, 4, -2,-32768,-32768, -1, 5, -4, 6,-32768, 7, 8, 1, 9, 11, 12, 6,-32768, 6, 6,-32768, 13, 14,-32768,-32768, 15, 16,-32768};static const short yypgoto[] = {-32768, 17,-32768,-32768,-32768, -17};#define YYLAST 22static const short yytable[] = { 11, 22, 6, 23, 24, 8, 12, 1, 9, 4, 18, 14, 10, 16, 17, 28, 29, 19, 20, 21, 5, 25, 26};static const short yycheck[] = { 4, 18, 4, 20, 21, 6, 10, 3, 9, 6, 9, 5, 7, 6, 6, 0, 0, 8, 7, 7, 3, 8, 8};#define YYPURE 1/* -*-C-*- Note some compilers choke on comments on `#line' lines. */#line 3 "/usr/local/lib/bison.simple"/* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman 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. */#ifndef alloca#ifdef __GNUC__#define alloca __builtin_alloca#else /* Not GNU C. */#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)#include <alloca.h>#else /* Not sparc */#ifdef MSDOS#include <malloc.h>#endif /* MSDOS */#endif /* Not sparc. */#endif /* Not GNU C. */#endif /* alloca not defined. *//* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. *//* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */#define yyerrok (yyerrstatus = 0)#define yyclearin (yychar = YYEMPTY)#define YYEMPTY -2#define YYEOF 0#define YYACCEPT return(0)#define YYABORT return(1)#define YYERROR goto yyerrlab1/* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */#define YYFAIL goto yyerrlab#define YYRECOVERING() (!!yyerrstatus)#define YYBACKUP(token, value) \do \ if (yychar == YYEMPTY && yylen == 1) \ { yychar = (token), yylval = (value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { yyerror ("syntax error: cannot back up"); YYERROR; } \while (0)#define YYTERROR 1#define YYERRCODE 256#ifndef YYPURE#define YYLEX yylex()#endif#ifdef YYPURE#ifdef YYLSP_NEEDED#define YYLEX yylex(&yylval, &yylloc)#else#define YYLEX yylex(&yylval)#endif#endif/* If nonreentrant, generate the variables here */#ifndef YYPUREint yychar; /* the lookahead symbol */YYSTYPE yylval; /* the semantic value of the */ /* lookahead symbol */#ifdef YYLSP_NEEDEDYYLTYPE yylloc; /* location data for the lookahead */ /* symbol */#endifint yynerrs; /* number of parse errors so far */#endif /* not YYPURE */#if YYDEBUG != 0int yydebug; /* nonzero means print parse trace *//* Since this is uninitialized, it does not stop multiple parsers from coexisting. */#endif/* YYINITDEPTH indicates the initial size of the parser's stacks */#ifndef YYINITDEPTH#define YYINITDEPTH 200#endif/* YYMAXDEPTH is the maximum size the stacks can grow to (effective only if the built-in stack extension method is used). */#if YYMAXDEPTH == 0#undef YYMAXDEPTH#endif#ifndef YYMAXDEPTH#define YYMAXDEPTH 10000#endif#ifndef __cplusplus/* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */static void__yy_bcopy (from, to, count) char *from; char *to; int count;{ register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++;}#else /* __cplusplus *//* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */static void__yy_bcopy (char *from, char *to, int count){ register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++;}#endif#line 160 "/usr/local/lib/bison.simple"intyyparse(){ register int yystate; register int yyn; register short *yyssp; register YYSTYPE *yyvsp; int yyerrstatus; /* number of tokens to shift before error messages enabled */ int yychar1; /* lookahead token as an internal (translated) token number */ short yyssa[YYINITDEPTH]; /* the state stack */ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ short *yyss = yyssa; /* refer to the stacks thru separate pointers */ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */#ifdef YYLSP_NEEDED YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */#define YYPOPSTACK (yyvsp--, yysp--, yylsp--)#else#define YYPOPSTACK (yyvsp--, yysp--)#endif int yystacksize = YYINITDEPTH;#ifdef YYPURE int yychar; YYSTYPE yylval; int yynerrs;#ifdef YYLSP_NEEDED YYLTYPE yylloc;#endif#endif YYSTYPE yyval; /* the variable used to return */ /* semantic values from the action */ /* routines */ int yylen;#if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Starting parse\n");#endif yystate = 0; yyerrstatus = 0; yynerrs = 0; 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. */ yyssp = yyss - 1; yyvsp = yyvs;#ifdef YYLSP_NEEDED yylsp = yyls;#endif/* Push a new state, which is found in yystate . *//* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */yynewstate: *++yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* 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 *yyvs1 = yyvs; short *yyss1 = yyss;#ifdef YYLSP_NEEDED YYLTYPE *yyls1 = yyls;#endif /* Get the current used size of the three stacks, in elements. */ int size = yyssp - yyss + 1;#ifdef yyoverflow /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp),#ifdef YYLSP_NEEDED &yyls1, size * sizeof (*yylsp),#endif &yystacksize); yyss = yyss1; yyvs = yyvs1;#ifdef YYLSP_NEEDED yyls = yyls1;#endif#else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));#ifdef YYLSP_NEEDED yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));#endif#endif /* no yyoverflow */ yyssp = yyss + size - 1; yyvsp = yyvs + size - 1;#ifdef YYLSP_NEEDED yylsp = yyls + size - 1;#endif#if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Stack size increased to %d\n", yystacksize);#endif if (yyssp >= yyss + yystacksize - 1) YYABORT; }#if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Entering state %d\n", yystate);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?