📄 nepc.tab.c
字号:
/* A Bison parser, made by GNU Bison 2.0. *//* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 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. *//* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. *//* 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. *//* Identify Bison output. */#define YYBISON 1/* Skeleton name. */#define YYSKELETON_NAME "yacc.c"/* Pure parsers. */#define YYPURE 0/* Using locations. */#define YYLSP_NEEDED 0/* Tokens. */#ifndef YYTOKENTYPE# define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TYPE_INT = 258, TYPE_FLOAT = 259, TYPE_DOUBLE = 260, TYPE_LONG = 261, TYPE_STRING = 262, TYPE_STRUCT = 263, INTEGER = 264, FLOAT = 265, VARIABLE = 266, STRING = 267, ACOS = 268, ASIN = 269, ATAN = 270, CEIL = 271, COS = 272, COSH = 273, EXP = 274, FABS = 275, FLOOR = 276, LOG = 277, LOG10 = 278, POW10 = 279, SIN = 280, SINH = 281, SQRT = 282, TAN = 283, TANH = 284, EXIT = 285, ERASE = 286, CLEAR = 287, LIST = 288, HELP = 289, DEC = 290, HEX = 291, OCT = 292, WHILE = 293, IF = 294, PRINT = 295, FOR = 296, IFX = 297, ELSE = 298, OR = 299, AND = 300, NE = 301, EQ = 302, LE = 303, GE = 304, SS = 305, PP = 306, UMINUS = 307 };#endif#define TYPE_INT 258#define TYPE_FLOAT 259#define TYPE_DOUBLE 260#define TYPE_LONG 261#define TYPE_STRING 262#define TYPE_STRUCT 263#define INTEGER 264#define FLOAT 265#define VARIABLE 266#define STRING 267#define ACOS 268#define ASIN 269#define ATAN 270#define CEIL 271#define COS 272#define COSH 273#define EXP 274#define FABS 275#define FLOOR 276#define LOG 277#define LOG10 278#define POW10 279#define SIN 280#define SINH 281#define SQRT 282#define TAN 283#define TANH 284#define EXIT 285#define ERASE 286#define CLEAR 287#define LIST 288#define HELP 289#define DEC 290#define HEX 291#define OCT 292#define WHILE 293#define IF 294#define PRINT 295#define FOR 296#define IFX 297#define ELSE 298#define OR 299#define AND 300#define NE 301#define EQ 302#define LE 303#define GE 304#define SS 305#define PP 306#define UMINUS 307/* Copy the first part of user declarations. */#line 1 "nepc.y"#include <stdlib.h>#include <stdio.h>#include <assert.h>#include "nepc.h"/* Enabling traces. */#ifndef YYDEBUG# define YYDEBUG 0#endif/* Enabling verbose error messages. */#ifdef YYERROR_VERBOSE# undef YYERROR_VERBOSE# define YYERROR_VERBOSE 1#else# define YYERROR_VERBOSE 0#endif#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)#line 10 "nepc.y"typedef union YYSTYPE {int iValue;double fValue;char *pStr;long *nPtr;int type_int;float type_float;double type_double;long type_long;} YYSTYPE;/* Line 190 of yacc.c. */#line 196 "nepc.tab.c"# define yystype YYSTYPE /* obsolescent; will be withdrawn */# define YYSTYPE_IS_DECLARED 1# define YYSTYPE_IS_TRIVIAL 1#endif/* Copy the second part of user declarations. *//* Line 213 of yacc.c. */#line 208 "nepc.tab.c"#if ! defined (yyoverflow) || YYERROR_VERBOSE# ifndef YYFREE# define YYFREE free# endif# ifndef YYMALLOC# define YYMALLOC malloc# endif/* The parser invokes alloca or malloc; define the necessary symbols. */# ifdef YYSTACK_USE_ALLOCA# if YYSTACK_USE_ALLOCA# ifdef __GNUC__# define YYSTACK_ALLOC __builtin_alloca# else# define YYSTACK_ALLOC alloca# 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 YYMALLOC# define YYSTACK_FREE YYFREE# endif#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */#if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member. */union yyalloc{ short int yyss; YYSTYPE yyvs; };/* The size of the maximum gap between one aligned stack and the next. */# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)/* The size of an array large to enough to hold all stacks, each with N elements. */# define YYSTACK_BYTES(N) \ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM)/* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */# ifndef YYCOPY# if defined (__GNUC__) && 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_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0)#endif#if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char;#else typedef short int yysigned_char;#endif/* YYFINAL -- State number of the termination state. */#define YYFINAL 3/* YYLAST -- Last index in YYTABLE. */#define YYLAST 119/* YYNTOKENS -- Number of terminals. */#define YYNTOKENS 64/* YYNNTS -- Number of nonterminals. */#define YYNNTS 8/* YYNRULES -- Number of rules. */#define YYNRULES 34/* YYNRULES -- Number of states. */#define YYNSTATES 61/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */#define YYUNDEFTOK 2#define YYMAXUTOK 307#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */static const unsigned 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, 56, 2, 2, 62, 63, 54, 52, 2, 53, 2, 55, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 61, 47, 60, 46, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 57, 58, 59};#if YYDEBUG/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */static const unsigned char yyprhs[] ={ 0, 0, 3, 7, 8, 11, 12, 14, 18, 23, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104};/* YYRHS -- A `-1'-separated list of the rules' RHS. */static const yysigned_char yyrhs[] ={ 65, 0, -1, 66, 67, 30, -1, -1, 67, 68, -1, -1, 70, -1, 40, 71, 70, -1, 11, 60, 71, 70, -1, 69, 11, 60, 71, 70, -1, 3, -1, 4, -1, 5, -1, 6, -1, 7, -1, 61, -1, 9, -1, 10, -1, 12, -1, 11, -1, 53, 71, -1, 71, 52, 71, -1, 71, 53, 71, -1, 71, 54, 71, -1, 71, 55, 71, -1, 71, 47, 71, -1, 71, 46, 71, -1, 71, 56, 71, -1, 71, 45, 71, -1, 71, 44, 71, -1, 71, 51, 71, -1, 71, 50, 71, -1, 71, 48, 71, -1, 71, 49, 71, -1, 62, 71, 63, -1};/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const unsigned char yyrline[] ={ 0, 50, 50, 52, 55, 61, 65, 67, 68, 76, 96, 97, 98, 99, 100, 104, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126};#endif#if YYDEBUG || YYERROR_VERBOSE/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */static const char *const yytname[] ={ "$end", "error", "$undefined", "TYPE_INT", "TYPE_FLOAT", "TYPE_DOUBLE", "TYPE_LONG", "TYPE_STRING", "TYPE_STRUCT", "INTEGER", "FLOAT", "VARIABLE", "STRING", "ACOS", "ASIN", "ATAN", "CEIL", "COS", "COSH", "EXP", "FABS", "FLOOR", "LOG", "LOG10", "POW10", "SIN", "SINH", "SQRT", "TAN", "TANH", "EXIT", "ERASE", "CLEAR", "LIST", "HELP", "DEC", "HEX", "OCT", "WHILE", "IF", "PRINT", "FOR", "IFX", "ELSE", "OR", "AND", "'>'", "'<'", "NE", "EQ", "LE", "GE", "'+'", "'-'", "'*'", "'/'", "'%'", "SS", "PP", "UMINUS", "'='", "';'", "'('", "')'", "$accept", "program", "init", "parsed", "stmt", "type_define", "separator", "expr", 0};#endif# ifdef YYPRINT/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */static const unsigned short int yytoknum[] ={ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 62, 60, 301, 302, 303, 304, 43, 45, 42, 47, 37, 305, 306, 307, 61, 59, 40, 41};# endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const unsigned char yyr1[] ={ 0, 64, 65, 66, 67, 67, 68, 68, 68, 68, 69, 69, 69, 69, 69, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const unsigned char yyr2[] ={ 0, 2, 3, 0, 2, 0, 1, 3, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3};/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */static const unsigned char yydefact[] ={ 3, 0, 5, 1, 0, 10, 11, 12, 13, 14, 0, 2, 0, 15, 4, 0, 6, 0, 16, 17, 19, 18, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 34, 29, 28, 26, 25, 32, 33, 31, 30, 21, 22, 23, 24, 27, 0, 9};/* YYDEFGOTO[NTERM-NUM]. */static const yysigned_char yydefgoto[] ={ -1, 1, 2, 4, 14, 15, 16, 24};/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */#define YYPACT_NINF -35static const yysigned_char yypact[] ={ -35, 6, -35, -35, -3, -35, -35, -35, -35, -35, -34, -35, 0, -35, -35, 20, -35, 0, -35, -35, -35, -35, 0, 0, 35, -27, 35, -35, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, -35, -35, 52, 63, -11, -11, -11, -11, -11, -11, -26, -26, -35, -35, -35, 35, -35};/* YYPGOTO[NTERM-NUM]. */static const yysigned_char yypgoto[] ={ -35, -35, -35, -35, -35, -35, -19, 34};/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */#define YYTABLE_NINF -1static const unsigned char yytable[] ={ 5, 6, 7, 8, 9, 42, 3, 44, 10, 18, 19, 20, 21, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 17, 11, 39, 40, 41, 25, 45, 43, 0, 0, 0, 12, 0, 0, 60, 37, 38, 39, 40, 41, 0, 0, 0, 0, 0, 26, 0, 22, 0, 0, 27, 28, 13, 0, 0, 0, 23, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, 59, 0, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, 13, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41};static const yysigned_char yycheck[] ={ 3, 4, 5, 6, 7, 24, 0, 26, 11, 9, 10, 11, 12, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 60, 30, 54, 55, 56, 11, 63, 60, -1, -1, -1, 40, -1, -1, 59, 52, 53, 54, 55, 56, -1, -1, -1, -1, -1, 17, -1, 53, -1, -1, 22, 23, 61, -1, -1, -1, 62, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, 43, -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, -1, -1, -1, 61, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -