y_filter.cpp

来自「Pegasus is an open-source implementation」· C++ 代码 · 共 1,323 行 · 第 1/3 页

CPP
1,323
字号
/* A Bison parser, made from filter.y   by GNU bison 1.35.  */#define YYBISON 1  /* Identify Bison output.  */#define yyparse filterparse#define yylex filterlex#define yyerror filtererror#define yylval filterlval#define yychar filterchar#define yydebug filterdebug#define yynerrs filternerrs# define	L_PAREN	257# define	R_PAREN	258# define	OP_AND	259# define	OP_OR	260# define	OP_NOT	261# define	OP_EQU	262# define	OP_GT	263# define	OP_LT	264# define	OP_PRESENT	265# define	OP_APPROX	266# define	VAL_INT	267# define	VAL_BOOL	268# define	OPERAND	269#line 35 "filter.y"#include "slp_client.h"/* prototypes and globals go here */  void filtererror(char *, ...);  int32 filterlex(void);int32 filterparse(void);void filter_close_lexer(uint32 handle);size_t filter_init_lexer(const char *s);/* have a place to put attributes and the filter while the parser is working *//* on them makes it easier to recover from parser errors - all the memory we  *//* need to free is available from the list heads below.  *//* listhead for reduced filters until the parser is finished */ filterHead reducedFilters = { &reducedFilters, &reducedFilters, TRUE } ; int nesting_level;#line 61 "filter.y"#ifndef YYSTYPEtypedef union {  int32 filter_int;  char *filter_string;  lslpLDAPFilter *filter_filter;} yystype;# define YYSTYPE yystype# define YYSTYPE_IS_TRIVIAL 1#endif#ifndef YYDEBUG# define YYDEBUG 0#endif#define	YYFINAL		26#define	YYFLAG		-32768#define	YYNTBASE	16/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */#define YYTRANSLATE(x) ((unsigned)(x) <= 269 ? yytranslate[x] : 23)/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */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,       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,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     1,     3,     4,     5,       6,     7,     8,     9,    10,    11,    12,    13,    14,    15};#if YYDEBUGstatic const short yyprhs[] ={       0,     0,     2,     5,    10,    14,    16,    18,    20,    22,      24,    27,    31,    35,    39,    41,    43,    45};static const short yyrhs[] ={      17,     0,    16,    17,     0,    18,    20,    16,    19,     0,      18,    21,    19,     0,     3,     0,     4,     0,     5,     0,       6,     0,     7,     0,    15,    11,     0,    15,    22,    13,       0,    15,    22,    14,     0,    15,    22,    15,     0,     8,       0,     9,     0,    10,     0,    12,     0};#endif#if YYDEBUG/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const short yyrline[] ={       0,    80,    81,    84,   102,   111,   114,   117,   118,   119,     124,   133,   143,   153,   164,   165,   166,   167};#endif#if (YYDEBUG) || defined YYERROR_VERBOSE/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */static const char *const yytname[] ={  "$", "error", "$undefined.", "L_PAREN", "R_PAREN", "OP_AND", "OP_OR",   "OP_NOT", "OP_EQU", "OP_GT", "OP_LT", "OP_PRESENT", "OP_APPROX",   "VAL_INT", "VAL_BOOL", "OPERAND", "filter_list", "filter",   "filter_open", "filter_close", "filter_op", "expression",   "exp_operator", 0};#endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const short yyr1[] ={       0,    16,    16,    17,    17,    18,    19,    20,    20,    20,      21,    21,    21,    21,    22,    22,    22,    22};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const short yyr2[] ={       0,     1,     2,     4,     3,     1,     1,     1,     1,     1,       2,     3,     3,     3,     1,     1,     1,     1};/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE   doesn't specify something else to do.  Zero means the default is an   error. */static const short yydefact[] ={       0,     5,     0,     1,     0,     2,     7,     8,     9,     0,       0,     0,    14,    15,    16,    10,    17,     0,     0,     6,       4,    11,    12,    13,     3,     0,     0};static const short yydefgoto[] ={       2,     3,     4,    20,    10,    11,    17};static const short yypact[] ={       1,-32768,    10,-32768,    -4,-32768,-32768,-32768,-32768,    -3,       1,     8,-32768,-32768,-32768,-32768,-32768,     4,    11,-32768,  -32768,-32768,-32768,-32768,-32768,    20,-32768};static const short yypgoto[] ={      12,    -2,-32768,     3,-32768,-32768,-32768};#define	YYLAST		22static const short yytable[] ={       5,     6,     7,     8,     1,    12,    13,    14,    15,    16,      25,     9,    19,     1,     1,    19,     5,    21,    22,    23,      26,    24,    18};static const short yycheck[] ={       2,     5,     6,     7,     3,     8,     9,    10,    11,    12,       0,    15,     4,     3,     3,     4,    18,    13,    14,    15,       0,    18,    10};/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */#line 3 "bison.simple"/* Skeleton output parser for bison,   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software   Foundation, 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 2, 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., 59 Temple Place - Suite 330,   Boston, MA 02111-1307, USA.  *//* As a special exception, when this file is copied by Bison into a   Bison output file, you may use that output file without restriction.   This special exception was added by the Free Software Foundation   in version 1.24 of Bison.  *//* 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.  *//* All symbols defined below should begin with yy or YY, to avoid   infringing on user name space.  This should be done even for local   variables, as they might otherwise be expanded by user macros.   There are some unavoidable exceptions within include files to   define necessary library symbols; they are noted "INFRINGES ON   USER NAME SPACE" below.  */#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)/* The parser invokes alloca or malloc; define the necessary symbols.  */# if YYSTACK_USE_ALLOCA#  define YYSTACK_ALLOC alloca# else#  ifndef YYSTACK_USE_ALLOCA#   if defined (alloca) || defined (_ALLOCA_H)#    define YYSTACK_ALLOC alloca#   else#    ifdef __GNUC__#     define YYSTACK_ALLOC __builtin_alloca#    endif#   endif#  endif# endif# ifdef YYSTACK_ALLOC   /* Pacify GCC's `empty if-body' warning. */#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)# else#  if defined (__STDC__) || defined (__cplusplus)#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */#   define YYSIZE_T size_t#  endif#  define YYSTACK_ALLOC malloc#  define YYSTACK_FREE free# endif#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */#if (! defined (yyoverflow) \     && (! defined (__cplusplus) \	 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member.  */union yyalloc{  short yyss;  YYSTYPE yyvs;# if YYLSP_NEEDED  YYLTYPE yyls;# endif};/* The size of the maximum gap between one aligned stack and the next.  */# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)/* The size of an array large to enough to hold all stacks, each with   N elements.  */# if YYLSP_NEEDED#  define YYSTACK_BYTES(N) \     ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\      + 2 * YYSTACK_GAP_MAX)# else#  define YYSTACK_BYTES(N) \     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\      + YYSTACK_GAP_MAX)# endif/* Copy COUNT objects from FROM to TO.  The source and destination do   not overlap.  */# ifndef YYCOPY#  if 1 < __GNUC__#   define YYCOPY(To, From, Count) \      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))#  else#   define YYCOPY(To, From, Count)		\      do					\	{					\	  register YYSIZE_T yyi;		\	  for (yyi = 0; yyi < (Count); yyi++)	\	    (To)[yyi] = (From)[yyi];		\	}					\      while (0)#  endif# endif/* Relocate STACK from its old location to the new one.  The   local variables YYSIZE and YYSTACKSIZE give the old and new number of   elements in the stack, and YYPTR gives the new location of the   stack.  Advance YYPTR to a properly aligned location for the next   stack.  */# define YYSTACK_RELOCATE(Stack)					\    do									\      {									\	YYSIZE_T yynewbytes;						\	YYCOPY (&yyptr->Stack, Stack, yysize);				\	Stack = &yyptr->Stack;						\	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;	\	yyptr += yynewbytes / sizeof (*yyptr);				\      }									\    while (0)#endif#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)# define YYSIZE_T __SIZE_TYPE__#endif#if ! defined (YYSIZE_T) && defined (size_t)# define YYSIZE_T size_t#endif#if ! defined (YYSIZE_T)# if defined (__STDC__) || defined (__cplusplus)#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */#  define YYSIZE_T size_t# endif#endif#if ! defined (YYSIZE_T)# define YYSIZE_T unsigned int#endif#define yyerrok		(yyerrstatus = 0)#define yyclearin	(yychar = YYEMPTY)#define YYEMPTY		-2#define YYEOF		0#define YYACCEPT	goto yyacceptlab#define YYABORT 	goto yyabortlab#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/* YYLLOC_DEFAULT -- Compute the default location (before the actions   are run).   When YYLLOC_DEFAULT is run, CURRENT is set the location of the   first token.  By default, to implement support for ranges, extend   its range to the last symbol.  */#ifndef YYLLOC_DEFAULT# define YYLLOC_DEFAULT(Current, Rhs, N)       	\   Current.last_line   = Rhs[N].last_line;	\   Current.last_column = Rhs[N].last_column;#endif/* YYLEX -- calling `yylex' with the right arguments.  */#if YYPURE# if YYLSP_NEEDED#  ifdef YYLEX_PARAM#   define YYLEX		yylex (&yylval, &yylloc, YYLEX_PARAM)#  else#   define YYLEX		yylex (&yylval, &yylloc)#  endif# else /* !YYLSP_NEEDED */#  ifdef YYLEX_PARAM#   define YYLEX		yylex (&yylval, YYLEX_PARAM)#  else#   define YYLEX		yylex (&yylval)#  endif# endif /* !YYLSP_NEEDED */#else /* !YYPURE */# define YYLEX			yylex ()#endif /* !YYPURE *//* Enable debugging if requested.  */#if YYDEBUG# ifndef YYFPRINTF#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */#  define YYFPRINTF fprintf# endif# define YYDPRINTF(Args)			\do {						\  if (yydebug)					\    YYFPRINTF Args;				\} while (0)/* Nonzero means print parse trace.  It is left uninitialized so that   multiple parsers can coexist.  */int yydebug;#else /* !YYDEBUG */

⌨️ 快捷键说明

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