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

📄 configparser.cpp

📁 最新osg包
💻 CPP
📖 第 1 页 / 共 5 页
字号:
/* A Bison parser, made by GNU Bison 1.875.  *//* Skeleton parser for Yacc-like parsing with 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.  *//* 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/* If NAME_PREFIX is specified substitute the variables and functions   names.  */#define yyparse ConfigParser_parse#define yylex   ConfigParser_lex#define yyerror ConfigParser_error#define yylval  ConfigParser_lval#define yychar  ConfigParser_char#define yydebug ConfigParser_debug#define yynerrs ConfigParser_nerrs/* Tokens.  */#ifndef YYTOKENTYPE# define YYTOKENTYPE   /* Put the tokens into the symbol table, so that GDB and other debuggers      know about them.  */   enum yytokentype {     PRTOKEN_VISUAL = 258,     PRTOKEN_SET_SIMPLE = 259,     PRTOKEN_VISUAL_ID = 260,     PRTOKEN_BUFFER_SIZE = 261,     PRTOKEN_LEVEL = 262,     PRTOKEN_RGBA = 263,     PRTOKEN_DOUBLEBUFFER = 264,     PRTOKEN_STEREO = 265,     PRTOKEN_AUX_BUFFERS = 266,     PRTOKEN_RED_SIZE = 267,     PRTOKEN_GREEN_SIZE = 268,     PRTOKEN_BLUE_SIZE = 269,     PRTOKEN_ALPHA_SIZE = 270,     PRTOKEN_DEPTH_SIZE = 271,     PRTOKEN_STENCIL_SIZE = 272,     PRTOKEN_ACCUM_RED_SIZE = 273,     PRTOKEN_ACCUM_GREEN_SIZE = 274,     PRTOKEN_ACCUM_BLUE_SIZE = 275,     PRTOKEN_ACCUM_ALPHA_SIZE = 276,     PRTOKEN_SAMPLES = 277,     PRTOKEN_SAMPLE_BUFFERS = 278,     PRTOKEN_RENDER_SURFACE = 279,     PRTOKEN_WINDOW_RECT = 280,     PRTOKEN_INPUT_RECT = 281,     PRTOKEN_HOSTNAME = 282,     PRTOKEN_DISPLAY = 283,     PRTOKEN_SCREEN = 284,     PRTOKEN_BORDER = 285,     PRTOKEN_DRAWABLE_TYPE = 286,     PRTOKEN_WINDOW_TYPE = 287,     PRTOKEN_PBUFFER_TYPE = 288,     PRTOKEN_CAMERA_GROUP = 289,     PRTOKEN_CAMERA = 290,     PRTOKEN_PROJECTION_RECT = 291,     PRTOKEN_LENS = 292,     PRTOKEN_FRUSTUM = 293,     PRTOKEN_PERSPECTIVE = 294,     PRTOKEN_ORTHO = 295,     PRTOKEN_OFFSET = 296,     PRTOKEN_ROTATE = 297,     PRTOKEN_TRANSLATE = 298,     PRTOKEN_SCALE = 299,     PRTOKEN_SHEAR = 300,     PRTOKEN_CLEAR_COLOR = 301,     PRTOKEN_INPUT_AREA = 302,     PRTOKEN_ERROR = 303,     PRTOKEN_INTEGER = 304,     PRTOKEN_HEX_INTEGER = 305,     PRTOKEN_FLOAT = 306,     PRTOKEN_TRUE = 307,     PRTOKEN_FALSE = 308,     PRTOKEN_QUOTED_STRING = 309,     PRTOKEN_STEREO_SYSTEM_COMMANDS = 310,     PRTOKEN_CUSTOM_FULL_SCREEN_RECTANGLE = 311,     PRTOKEN_METHOD = 312,     PRTOKEN_PREMULTIPLY = 313,     PRTOKEN_POSTMULTIPLY = 314,     PRTOKEN_OVERRIDE_REDIRECT = 315,     PRTOKEN_SHARELENS = 316,     PRTOKEN_SHAREVIEW = 317,     PRTOKEN_READ_DRAWABLE = 318,     PRTOKEN_SET_RTT_MODE = 319,     PRTOKEN_RTT_MODE_NONE = 320,     PRTOKEN_RTT_MODE_RGB = 321,     PRTOKEN_RTT_MODE_RGBA = 322,     PRTOKEN_THREAD_MODEL = 323,     PRTOKEN_SINGLE_THREADED = 324,     PRTOKEN_THREAD_PER_CAMERA = 325,     PRTOKEN_THREAD_PER_RENDER_SURFACE = 326   };#endif#define PRTOKEN_VISUAL 258#define PRTOKEN_SET_SIMPLE 259#define PRTOKEN_VISUAL_ID 260#define PRTOKEN_BUFFER_SIZE 261#define PRTOKEN_LEVEL 262#define PRTOKEN_RGBA 263#define PRTOKEN_DOUBLEBUFFER 264#define PRTOKEN_STEREO 265#define PRTOKEN_AUX_BUFFERS 266#define PRTOKEN_RED_SIZE 267#define PRTOKEN_GREEN_SIZE 268#define PRTOKEN_BLUE_SIZE 269#define PRTOKEN_ALPHA_SIZE 270#define PRTOKEN_DEPTH_SIZE 271#define PRTOKEN_STENCIL_SIZE 272#define PRTOKEN_ACCUM_RED_SIZE 273#define PRTOKEN_ACCUM_GREEN_SIZE 274#define PRTOKEN_ACCUM_BLUE_SIZE 275#define PRTOKEN_ACCUM_ALPHA_SIZE 276#define PRTOKEN_SAMPLES 277#define PRTOKEN_SAMPLE_BUFFERS 278#define PRTOKEN_RENDER_SURFACE 279#define PRTOKEN_WINDOW_RECT 280#define PRTOKEN_INPUT_RECT 281#define PRTOKEN_HOSTNAME 282#define PRTOKEN_DISPLAY 283#define PRTOKEN_SCREEN 284#define PRTOKEN_BORDER 285#define PRTOKEN_DRAWABLE_TYPE 286#define PRTOKEN_WINDOW_TYPE 287#define PRTOKEN_PBUFFER_TYPE 288#define PRTOKEN_CAMERA_GROUP 289#define PRTOKEN_CAMERA 290#define PRTOKEN_PROJECTION_RECT 291#define PRTOKEN_LENS 292#define PRTOKEN_FRUSTUM 293#define PRTOKEN_PERSPECTIVE 294#define PRTOKEN_ORTHO 295#define PRTOKEN_OFFSET 296#define PRTOKEN_ROTATE 297#define PRTOKEN_TRANSLATE 298#define PRTOKEN_SCALE 299#define PRTOKEN_SHEAR 300#define PRTOKEN_CLEAR_COLOR 301#define PRTOKEN_INPUT_AREA 302#define PRTOKEN_ERROR 303#define PRTOKEN_INTEGER 304#define PRTOKEN_HEX_INTEGER 305#define PRTOKEN_FLOAT 306#define PRTOKEN_TRUE 307#define PRTOKEN_FALSE 308#define PRTOKEN_QUOTED_STRING 309#define PRTOKEN_STEREO_SYSTEM_COMMANDS 310#define PRTOKEN_CUSTOM_FULL_SCREEN_RECTANGLE 311#define PRTOKEN_METHOD 312#define PRTOKEN_PREMULTIPLY 313#define PRTOKEN_POSTMULTIPLY 314#define PRTOKEN_OVERRIDE_REDIRECT 315#define PRTOKEN_SHARELENS 316#define PRTOKEN_SHAREVIEW 317#define PRTOKEN_READ_DRAWABLE 318#define PRTOKEN_SET_RTT_MODE 319#define PRTOKEN_RTT_MODE_NONE 320#define PRTOKEN_RTT_MODE_RGB 321#define PRTOKEN_RTT_MODE_RGBA 322#define PRTOKEN_THREAD_MODEL 323#define PRTOKEN_SINGLE_THREADED 324#define PRTOKEN_THREAD_PER_CAMERA 325#define PRTOKEN_THREAD_PER_RENDER_SURFACE 326/* Copy the first part of user declarations.  */#ifndef WIN32#include <unistd.h>#include <sys/wait.h>#include <stdlib.h>#include <fcntl.h>#endif#ifndef WIN32#define SUPPORT_CPP 1#endif#include <osgDB/fstream>#include <string.h>#include <stdio.h>#include <string>#include "FlexLexer.h"#include "CameraConfig.h"using namespace std;using namespace osgProducer;static void ConfigParser_error( const char * );static CameraConfig *cfg = 0L;static std::string fileName = "(stdin)";static yyFlexLexer *flexer = 0L;static int yylex(){    if( flexer == 0L )        fprintf( stderr, "Internal error!\n" );    return flexer->yylex();}/* 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)typedef union YYSTYPE {    char * string;    int    integer;    float  real;    bool boolean;} YYSTYPE;/* Line 191 of yacc.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 214 of yacc.c.  */#if ! defined (yyoverflow) || 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) || YYERROR_VERBOSE */#if (! defined (yyoverflow) \     && (! defined (__cplusplus) \     || (YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member.  */union yyalloc{  short 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) + sizeof (YYSTYPE))                \      + YYSTACK_GAP_MAXIMUM)/* 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_MAXIMUM; \    yyptr += yynewbytes / sizeof (*yyptr);                \      }                                    \    while (0)#endif#if defined (__STDC__) || defined (__cplusplus)   typedef signed char yysigned_char;#else   typedef short yysigned_char;#endif/* YYFINAL -- State number of the termination state. */#define YYFINAL  32/* YYLAST -- Last index in YYTABLE.  */#define YYLAST   279/* YYNTOKENS -- Number of terminals. */#define YYNTOKENS  76/* YYNNTS -- Number of nonterminals. */#define YYNNTS  45/* YYNRULES -- Number of rules. */#define YYNRULES  122/* YYNRULES -- Number of states. */#define YYNSTATES  266/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */#define YYUNDEFTOK  2#define YYMAXUTOK   326#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,     2,     2,     2,       2,     2,     2,     2,    75,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,    72,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,    73,     2,    74,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,       2,     2,     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,    46,    47,    48,    49,    50,    51,    52,    53,    54,      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,      65,    66,    67,    68,    69,    70,    71};#if YYDEBUG/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in

⌨️ 快捷键说明

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