?? cexp.c
字號:
/* A Bison parser, made from ./cexp.y */#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 26 "./cexp.y"#include "config.h"#include <setjmp.h>/* #define YYDEBUG 1 */ int yylex (); void yyerror (); int expression_value; static jmp_buf parse_return_error; /* some external tables of character types */ extern unsigned char is_idstart[], is_idchar[];#ifndef CHAR_TYPE_SIZE#define CHAR_TYPE_SIZE BITS_PER_UNIT#endif#line 45 "./cexp.y"typedef union { struct constant {long value; int unsignedp;} integer; int voidval; char *sval;} 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 61#define YYFLAG -32768#define YYNTBASE 33#define YYTRANSLATE(x) ((unsigned)(x) <= 270 ? yytranslate[x] : 36)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, 2, 2, 27, 14, 2, 31, 32, 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};static const short yyprhs[] = { 0, 0, 2, 4, 8, 11, 14, 17, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 102, 104, 106};static const short yyrhs[] = { 34, 0, 35, 0, 34, 9, 35, 0, 24, 35, 0, 29, 35, 0, 23, 35, 0, 30, 35, 0, 31, 34, 32, 0, 35, 25, 35, 0, 35, 26, 35, 0, 35, 27, 35, 0, 35, 23, 35, 0, 35, 24, 35, 0, 35, 21, 35, 0, 35, 22, 35, 0, 35, 15, 35, 0, 35, 16, 35, 0, 35, 19, 35, 0, 35, 20, 35, 0, 35, 17, 35, 0, 35, 18, 35, 0, 35, 14, 35, 0, 35, 13, 35, 0, 35, 12, 35, 0, 35, 11, 35, 0, 35, 10, 35, 0, 35, 7, 35, 8, 35, 0, 3, 0, 4, 0, 5, 0};#if YYDEBUG != 0static const short yyrline[] = { 0, 74, 79, 80, 85, 88, 91, 93, 96, 101, 107, 118, 129, 132, 135, 141, 147, 150, 153, 159, 165, 171, 177, 180, 183, 186, 189, 192, 195, 197, 199};static const char * const yytname[] = { "$","error","$illegal.","INT","CHAR","NAME","ERROR","'?'","':'","','","OR","AND","'|'","'^'","'&'","EQUAL","NOTEQUAL","'<'","'>'","LEQ","GEQ","LSH","RSH","'+'","'-'","'*'","'/'","'%'","UNARY","'!'","'~'","'('","')'","start","exp1","exp",""};#endifstatic const short yyr1[] = { 0, 33, 34, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35};static const short yyr2[] = { 0, 1, 1, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 1, 1, 1};static const short yydefact[] = { 0, 28, 29, 30, 0, 0, 0, 0, 0, 1, 2, 6, 4, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 3, 0, 26, 25, 24, 23, 22, 16, 17, 20, 21, 18, 19, 14, 15, 12, 13, 9, 10, 11, 0, 27, 0, 0, 0};static const short yydefgoto[] = { 59, 9, 10};static const short yypact[] = { 31,-32768,-32768,-32768, 31, 31, 31, 31, 31, 1, 77,-32768,-32768,-32768,-32768, 0, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,-32768, 77, 56, 94, 25, 109, 123, 136, 147, 147, 154, 154, 154, 154, -19, -19, 32, 32,-32768,-32768,-32768, 31, 77, 11, 33,-32768};static const short yypgoto[] = {-32768, 48, -4};#define YYLAST 181static const short yytable[] = { 11, 12, 13, 14, 31, 32, 33, 34, 35, 16, 16, 60, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 36, 61, 1, 2, 3, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 58, 4, 5, 15, 33, 34, 35, 6, 7, 8, 17, 57, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 17, 0, 0, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 29, 30, 31, 32, 33, 34, 35};static const short yycheck[] = { 4, 5, 6, 7, 23, 24, 25, 26, 27, 9, 9, 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 32, 0, 3, 4, 5, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 57, 23, 24, 8, 25, 26, 27, 29, 30, 31, 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 7, -1, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 11, 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};/* -*-C-*- Note some compilers choke on comments on `#line' lines. */#line 3 "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 "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;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -