?? lp_rlpt.c
字號(hào):
/* A Bison parser, made by GNU Bison 2.3. *//* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *//* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. *//* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. *//* All symbols defined below should begin with lpt_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/* Bison version. */#define YYBISON_VERSION "2.3"/* Skeleton name. */#define YYSKELETON_NAME "yacc.c"/* Pure parsers. */#define YYPURE 1/* 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 lpt_yytokentype { VAR = 258, CONS = 259, INTCONS = 260, VARIABLECOLON = 261, INF = 262, FRE = 263, SEC_INT = 264, SEC_SEC = 265, SEC_SOS = 266, SOSTYPE = 267, TOK_SIGN = 268, RE_OPEQ = 269, RE_OPLE = 270, RE_OPGE = 271, MINIMISE = 272, MAXIMISE = 273, SUBJECTTO = 274, BOUNDS = 275, END = 276, UNDEFINED = 277 };#endif/* Tokens. */#define VAR 258#define CONS 259#define INTCONS 260#define VARIABLECOLON 261#define INF 262#define FRE 263#define SEC_INT 264#define SEC_SEC 265#define SEC_SOS 266#define SOSTYPE 267#define TOK_SIGN 268#define RE_OPEQ 269#define RE_OPLE 270#define RE_OPGE 271#define MINIMISE 272#define MAXIMISE 273#define SUBJECTTO 274#define BOUNDS 275#define END 276#define UNDEFINED 277/* Copy the first part of user declarations. */#include <stdlib.h>#include <string.h>#include <ctype.h>#define scanner lpt_yyscanner#define PARM lpt_yyget_extra(lpt_yyscanner)#define YYSTYPE int#define YY_EXTRA_TYPE parse_parm *#define YY_FATAL_ERROR(msg) lex_fatal_error(PARM, lpt_yyscanner, msg)#undef YY_INPUT#define lpt_yyerror read_error#include "lpkit.h"#include "yacc_read.h"typedef struct parse_vars_s{ char HadVar, HadConstraint, Had_lineair_sum, HadSign, OP, Sign, isign, isign0, make_neg, objconst; char Within_gen_decl; /* TRUE when we are within an gen declaration */ char Within_bin_decl; /* TRUE when we are within an bin declaration */ char Within_sec_decl; /* TRUE when we are within a sec declaration */ char Within_sos_decl; /* TRUE when we are within a sos declaration */ short SOStype; /* SOS type */ int SOSNr; int SOSweight; /* SOS weight */ int weight; char *Last_var; REAL f, f0, f1, f2;} parse_vars;#ifdef FORTIFY# include "lp_fortify.h"#endif/* let's please C++ users */#ifdef __cplusplusextern "C" {#endif#if defined MSDOS || defined __MSDOS__ || defined WINDOWS || defined _WINDOWS || defined WIN32 || defined _WIN32#define YY_NO_UNISTD_Hstatic int isatty(int f){ return(FALSE);}#if !defined _STDLIB_H# define _STDLIB_H#endif#endif#ifdef __cplusplus};#endif#include "lp_rlpt.inc"#undef lpt_yylval/* 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/* Enabling the token table. */#ifndef YYTOKEN_TABLE# define YYTOKEN_TABLE 0#endif#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLAREDtypedef int YYSTYPE;# define lpt_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 216 of yacc.c. */#ifdef short# undef short#endif#ifdef YYTYPE_UINT8typedef YYTYPE_UINT8 lpt_yytype_uint8;#elsetypedef unsigned char lpt_yytype_uint8;#endif#ifdef YYTYPE_INT8typedef YYTYPE_INT8 lpt_yytype_int8;#elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER)typedef signed char lpt_yytype_int8;#elsetypedef short int lpt_yytype_int8;#endif#ifdef YYTYPE_UINT16typedef YYTYPE_UINT16 lpt_yytype_uint16;#elsetypedef unsigned short int lpt_yytype_uint16;#endif#ifdef YYTYPE_INT16typedef YYTYPE_INT16 lpt_yytype_int16;#elsetypedef short int lpt_yytype_int16;#endif#ifndef YYSIZE_T# ifdef __SIZE_TYPE__# define YYSIZE_T __SIZE_TYPE__# elif defined size_t# define YYSIZE_T size_t# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER)# include <stddef.h> /* INFRINGES ON USER NAME SPACE */# define YYSIZE_T size_t# else# define YYSIZE_T unsigned int# endif#endif#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)#ifndef YY_# if YYENABLE_NLS# if ENABLE_NLS# include <libintl.h> /* INFRINGES ON USER NAME SPACE */# define YY_(msgid) dgettext ("bison-runtime", msgid)# endif# endif# ifndef YY_# define YY_(msgid) msgid# endif#endif/* Suppress unused-variable warnings by "using" E. */#if ! defined lint || defined __GNUC__# define YYUSE(e) ((void) (e))#else# define YYUSE(e) /* empty */#endif/* Identity function, used to suppress warnings about constant conditions. */#ifndef lint# define YYID(n) (n)#else#if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER)static intYYID (int i)#elsestatic intYYID (i) int i;#endif{ return i;}#endif#if ! defined lpt_yyoverflow || YYERROR_VERBOSE/* 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# elif defined __BUILTIN_VA_ARG_INCR# include <alloca.h> /* INFRINGES ON USER NAME SPACE */# elif defined _AIX# define YYSTACK_ALLOC __alloca# elif defined _MSC_VER# include <malloc.h> /* INFRINGES ON USER NAME SPACE */# define alloca _alloca# else# define YYSTACK_ALLOC alloca# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER)# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */# ifndef _STDLIB_H# define _STDLIB_H 1# endif# endif# endif# endif# endif# ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))# ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */# endif# else# define YYSTACK_ALLOC YYMALLOC# define YYSTACK_FREE YYFREE# ifndef YYSTACK_ALLOC_MAXIMUM# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM# endif# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free)))# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */# ifndef _STDLIB_H# define _STDLIB_H 1# endif# endif# ifndef YYMALLOC# define YYMALLOC malloc# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER)void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */# endif# endif# ifndef YYFREE# define YYFREE free# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER)void free (void *); /* INFRINGES ON USER NAME SPACE */# endif# endif# endif#endif /* ! defined lpt_yyoverflow || YYERROR_VERBOSE */#if (! defined lpt_yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member. */union lpt_yyalloc{ lpt_yytype_int16 lpt_yyss; YYSTYPE lpt_yyvs; };/* The size of the maximum gap between one aligned stack and the next. */# define YYSTACK_GAP_MAXIMUM (sizeof (union lpt_yyalloc) - 1)/* The size of an array large to enough to hold all stacks, each with N elements. */# define YYSTACK_BYTES(N) \ ((N) * (sizeof (lpt_yytype_int16) + 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 \ { \ YYSIZE_T lpt_yyi; \ for (lpt_yyi = 0; lpt_yyi < (Count); lpt_yyi++) \ (To)[lpt_yyi] = (From)[lpt_yyi]; \ } \ while (YYID (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 lpt_yynewbytes; \ YYCOPY (&lpt_yyptr->Stack, Stack, lpt_yysize); \ Stack = &lpt_yyptr->Stack; \ lpt_yynewbytes = lpt_yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ lpt_yyptr += lpt_yynewbytes / sizeof (*lpt_yyptr); \ } \ while (YYID (0))#endif/* YYFINAL -- State number of the termination state. */#define YYFINAL 3/* YYLAST -- Last index in YYTABLE. */#define YYLAST 149/* YYNTOKENS -- Number of terminals. */#define YYNTOKENS 23/* YYNNTS -- Number of nonterminals. */#define YYNNTS 74/* YYNRULES -- Number of rules. */#define YYNRULES 110/* YYNRULES -- Number of states. */#define YYNSTATES 151/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */#define YYUNDEFTOK 2#define YYMAXUTOK 277#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? lpt_yytranslate[YYX] : YYUNDEFTOK)/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */static const lpt_yytype_uint8 lpt_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,
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -