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

📄 cexp.c

📁 gcc库的原代码,对编程有很大帮助.
💻 C
📖 第 1 页 / 共 4 页
字号:
/*  A Bison parser, made from cexp.y with Bison version GNU Bison version 1.22  */#define YYBISON 1  /* Identify Bison output.  */#define	INT	258#define	CHAR	259#define	NAME	260#define	ERROR	261#define	OR	262#define	AND	263#define	EQUAL	264#define	NOTEQUAL	265#define	LEQ	266#define	GEQ	267#define	LSH	268#define	RSH	269#define	UNARY	270#line 27 "cexp.y"#include "config.h"#include <setjmp.h>/* #define YYDEBUG 1 */#ifdef MULTIBYTE_CHARS#include <stdlib.h>#include <locale.h>#endif#include <stdio.h>typedef unsigned char U_CHAR;/* This is used for communicating lists of keywords with cccp.c.  */struct arglist {  struct arglist *next;  U_CHAR *name;  int length;  int argno;};/* Define a generic NULL if one hasn't already been defined.  */#ifndef NULL#define NULL 0#endif#ifndef GENERIC_PTR#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)#define GENERIC_PTR void *#else#define GENERIC_PTR char *#endif#endif/* Find the largest host integer type and set its size and type.  */#ifndef HOST_BITS_PER_WIDE_INT#if HOST_BITS_PER_LONG > HOST_BITS_PER_INT#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG#define HOST_WIDE_INT long#else#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT#define HOST_WIDE_INT int#endif#endif#ifndef NULL_PTR#define NULL_PTR ((GENERIC_PTR)0)#endifint yylex ();void yyerror ();HOST_WIDE_INT expression_value;static jmp_buf parse_return_error;/* Nonzero means count most punctuation as part of a name.  */static int keyword_parsing = 0;/* Nonzero means do not evaluate this expression.   This is a count, since unevaluated expressions can nest.  */static int skip_evaluation;/* some external tables of character types */extern unsigned char is_idstart[], is_idchar[], is_hor_space[];extern char *xmalloc ();/* Flag for -pedantic.  */extern int pedantic;/* Flag for -traditional.  */extern int traditional;#ifndef CHAR_TYPE_SIZE#define CHAR_TYPE_SIZE BITS_PER_UNIT#endif#ifndef INT_TYPE_SIZE#define INT_TYPE_SIZE BITS_PER_WORD#endif#ifndef LONG_TYPE_SIZE#define LONG_TYPE_SIZE BITS_PER_WORD#endif#ifndef WCHAR_TYPE_SIZE#define WCHAR_TYPE_SIZE INT_TYPE_SIZE#endif#ifndef MAX_CHAR_TYPE_SIZE#define MAX_CHAR_TYPE_SIZE CHAR_TYPE_SIZE#endif#ifndef MAX_INT_TYPE_SIZE#define MAX_INT_TYPE_SIZE INT_TYPE_SIZE#endif#ifndef MAX_LONG_TYPE_SIZE#define MAX_LONG_TYPE_SIZE LONG_TYPE_SIZE#endif#ifndef MAX_WCHAR_TYPE_SIZE#define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE#endif/* Yield nonzero if adding two numbers with A's and B's signs can yield a   number with SUM's sign, where A, B, and SUM are all C integers.  */#define possible_sum_sign(a, b, sum) ((((a) ^ (b)) | ~ ((a) ^ (sum))) < 0)static void integer_overflow ();static long left_shift ();static long right_shift ();#line 146 "cexp.y"typedef union {  struct constant {long value; int unsignedp;} integer;  struct name {U_CHAR *address; int length;} name;  struct arglist *keywords;} 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 __cplusplus#ifndef __STDC__#define const#endif#endif#define	YYFINAL		77#define	YYFLAG		-32768#define	YYNTBASE	34#define YYTRANSLATE(x) ((unsigned)(x) <= 270 ? yytranslate[x] : 43)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,    29,     2,    31,     2,    27,    14,     2,    32,    33,    25,    23,     9,    24,     2,    26,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     8,     2,    17,     2,    18,     7,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,    13,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,    12,     2,    30,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,     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,     6,    10,    11,    15,    16,    19,    20,    21,    22,    28};#if YYDEBUG != 0static const short yyprhs[] = {     0,     0,     2,     4,     8,    11,    14,    17,    20,    23,    24,    31,    35,    39,    43,    47,    51,    55,    59,    63,    67,    71,    75,    79,    83,    87,    91,    95,    99,   100,   105,   106,   111,   112,   113,   121,   123,   125,   127,   128,   133};static const short yyrhs[] = {    35,     0,    36,     0,    35,     9,    36,     0,    24,    36,     0,    29,    36,     0,    23,    36,     0,    30,    36,     0,    31,     5,     0,     0,    31,     5,    37,    32,    42,    33,     0,    32,    35,    33,     0,    36,    25,    36,     0,    36,    26,    36,     0,    36,    27,    36,     0,    36,    23,    36,     0,    36,    24,    36,     0,    36,    21,    36,     0,    36,    22,    36,     0,    36,    15,    36,     0,    36,    16,    36,     0,    36,    19,    36,     0,    36,    20,    36,     0,    36,    17,    36,     0,    36,    18,    36,     0,    36,    14,    36,     0,    36,    13,    36,     0,    36,    12,    36,     0,     0,    36,    11,    38,    36,     0,     0,    36,    10,    39,    36,     0,     0,     0,    36,     7,    40,    36,     8,    41,    36,     0,     3,     0,     4,     0,     5,     0,     0,    32,    42,    33,    42,     0,     5,    42,     0};#endif#if YYDEBUG != 0static const short yyrline[] = { 0,   176,   181,   182,   189,   194,   197,   199,   202,   206,   208,   213,   218,   230,   246,   258,   265,   272,   278,   284,   287,   290,   296,   302,   308,   314,   317,   320,   323,   326,   329,   332,   335,   337,   340,   343,   345,   347,   352,   354,   367};static const char * const yytname[] = {   "$","error","$illegal.","INT","CHAR","NAME","ERROR","'?'","':'","','","OR","AND","'|'","'^'","'&'","EQUAL","NOTEQUAL","'<'","'>'","LEQ","GEQ","LSH","RSH","'+'","'-'","'*'","'/'","'%'","UNARY","'!'","'~'","'#'","'('","')'","start","exp1","exp","@1","@2","@3","@4","@5","keywords",""};#endifstatic const short yyr1[] = {     0,    34,    35,    35,    36,    36,    36,    36,    36,    37,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    36,    38,    36,    39,    36,    40,    41,    36,    36,    36,    36,    42,    42,    42};static const short yyr2[] = {     0,     1,     1,     3,     2,     2,     2,     2,     2,     0,     6,     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,     0,     4,     0,     4,     0,     0,     7,     1,     1,     1,     0,     4,     2};static const short yydefact[] = {     0,    35,    36,    37,     0,     0,     0,     0,     0,     0,     1,     2,     6,     4,     5,     7,     8,     0,     0,    32,    30,    28,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,    11,     3,     0,     0,     0,    27,    26,    25,    19,    20,    23,    24,    21,    22,    17,    18,    15,    16,    12,    13,    14,    38,     0,    31,    29,    38,    38,     0,    33,    40,     0,    10,     0,    38,    34,    39,     0,     0,     0};static const short yydefgoto[] = {    75,    10,    11,    38,    43,    42,    41,    71,    66};static const short yypact[] = {    12,-32768,-32768,-32768,    12,    12,    12,    12,     1,    12,     4,    79,-32768,-32768,-32768,-32768,   -21,    31,    12,-32768,-32768,-32768,    12,    12,    12,    12,    12,    12,    12,    12,    12,    12,    12,    12,    12,    12,    12,    12,    30,-32768,    79,    12,    12,    12,   110,   124,   137,   148,   148,   155,   155,   155,   155,   160,   160,   -17,   -17,-32768,-32768,-32768,     2,    58,    34,    95,     2,     2,    54,-32768,-32768,    55,-32768,    12,     2,    79,-32768,    63,   188,-32768};static const short yypgoto[] = {-32768,   180,    -4,-32768,-32768,-32768,-32768,-32768,   -60};#define	YYLAST		189static const short yytable[] = {    12,    13,    14,    15,    68,    69,    16,    64,    35,    36,    37,    -9,    74,    18,    40,     1,     2,     3,    44,    45,    46,    47,    48,    49,    50,    51,    52,    53,    54,    55,    56,    57,    58,    59,    65,     4,     5,    61,    62,    63,    18,     6,     7,     8,     9,    21,    22,    23,    24,    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    60,    76,    39,    19,    67,    73,    20,    21,    22,    23,    24,    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    19,    70,    72,    20,    21,    22,    23,    24,    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    22,    23,    24,    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    23,    24,    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    24,    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    31,    32,    33,    34,    35,    36,    37,    33,    34,    35,    36,    37,    77,    17};static const short yycheck[] = {     4,     5,     6,     7,    64,    65,     5,     5,    25,    26,    27,    32,    72,     9,    18,     3,     4,     5,    22,    23,    24,    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,    32,    23,    24,    41,    42,    43,     9,    29,    30,    31,    32,    11,    12,    13,    14,    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,    27,    32,     0,    33,     7,     8,    71,    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,    27,     7,    33,    33,    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,    27,    12,    13,    14,    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,    27,    13,    14,    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,    27,    14,    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,    27,    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,    27,    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,    27,    21,    22,    23,    24,    25,    26,    27,    23,    24,    25,    26,    27,     0,     9};/* -*-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__) || defined (__sparc) || defined (__sgi)#include <alloca.h>#else /* not sparc */#if defined (MSDOS) && !defined (__TURBOC__)#include <malloc.h>#else /* not MSDOS, or __TURBOC__ */#if defined(_AIX)#include <malloc.h> #pragma alloca#else /* not MSDOS, __TURBOC__, or _AIX */#ifdef __hpux#ifdef __cplusplusextern "C" {void *alloca (unsigned int);};#else /* not __cplusplus */void *alloca ();#endif /* not __cplusplus */#endif /* __hpux */#endif /* not _AIX */#endif /* not MSDOS, or __TURBOC__ */#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/* Prevent warning if -Wstrict-prototypes.  */#ifdef __GNUC__int yyparse (void);#endif#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */#define __yy_bcopy(FROM,TO,COUNT)	__builtin_memcpy(TO,FROM,COUNT)#else				/* not GNU C or C++ */#ifndef __cplusplus

⌨️ 快捷键说明

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