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

📄 cimmof_tab.cpp

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 CPP
📖 第 1 页 / 共 5 页
字号:
//%2006//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation, The Open Group.// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; Symantec Corporation; The Open Group.//// Permission is hereby granted, free of charge, to any person obtaining a copy// of this software and associated documentation files (the "Software"), to// deal in the Software without restriction, including without limitation the// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or// sell copies of the Software, and to permit persons to whom the Software is// furnished to do so, subject to the following conditions:// // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.////==============================================================================/* 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 cimmof_parse#define yylex   cimmof_lex#define yyerror cimmof_error#define yylval  cimmof_lval#define yychar  cimmof_char#define yydebug cimmof_debug#define yynerrs cimmof_nerrs/* Tokens.  */#ifndef YYTOKENTYPE# define YYTOKENTYPE   /* Put the tokens into the symbol table, so that GDB and other debuggers      know about them.  */   enum yytokentype {     TOK_ALIAS_IDENTIFIER = 258,     TOK_ANY = 259,     TOK_AS = 260,     TOK_ASSOCIATION = 261,     TOK_BINARY_VALUE = 262,     TOK_CHAR_VALUE = 263,     TOK_CLASS = 264,     TOK_COLON = 265,     TOK_COMMA = 266,     TOK_DISABLEOVERRIDE = 267,     TOK_DQUOTE = 268,     TOK_DT_BOOL = 269,     TOK_DT_CHAR16 = 270,     TOK_DT_CHAR8 = 271,     TOK_DT_DATETIME = 272,     TOK_DT_REAL32 = 273,     TOK_DT_REAL64 = 274,     TOK_DT_SINT16 = 275,     TOK_DT_SINT32 = 276,     TOK_DT_SINT64 = 277,     TOK_DT_SINT8 = 278,     TOK_DT_STR = 279,     TOK_DT_UINT16 = 280,     TOK_DT_UINT32 = 281,     TOK_DT_UINT64 = 282,     TOK_DT_UINT8 = 283,     TOK_ENABLEOVERRIDE = 284,     TOK_END_OF_FILE = 285,     TOK_EQUAL = 286,     TOK_FALSE = 287,     TOK_FLAVOR = 288,     TOK_HEX_VALUE = 289,     TOK_INCLUDE = 290,     TOK_INDICATION = 291,     TOK_INSTANCE = 292,     TOK_LEFTCURLYBRACE = 293,     TOK_LEFTPAREN = 294,     TOK_LEFTSQUAREBRACKET = 295,     TOK_METHOD = 296,     TOK_NULL_VALUE = 297,     TOK_OCTAL_VALUE = 298,     TOK_OF = 299,     TOK_PARAMETER = 300,     TOK_PERIOD = 301,     TOK_POSITIVE_DECIMAL_VALUE = 302,     TOK_PRAGMA = 303,     TOK_PROPERTY = 304,     TOK_QUALIFIER = 305,     TOK_REAL_VALUE = 306,     TOK_REF = 307,     TOK_REFERENCE = 308,     TOK_RESTRICTED = 309,     TOK_RIGHTCURLYBRACE = 310,     TOK_RIGHTPAREN = 311,     TOK_RIGHTSQUAREBRACKET = 312,     TOK_SCHEMA = 313,     TOK_SCOPE = 314,     TOK_SEMICOLON = 315,     TOK_SIGNED_DECIMAL_VALUE = 316,     TOK_SIMPLE_IDENTIFIER = 317,     TOK_STRING_VALUE = 318,     TOK_TOSUBCLASS = 319,     TOK_TRANSLATABLE = 320,     TOK_TRUE = 321,     TOK_UNEXPECTED_CHAR = 322   };#endif#define TOK_ALIAS_IDENTIFIER 258#define TOK_ANY 259#define TOK_AS 260#define TOK_ASSOCIATION 261#define TOK_BINARY_VALUE 262#define TOK_CHAR_VALUE 263#define TOK_CLASS 264#define TOK_COLON 265#define TOK_COMMA 266#define TOK_DISABLEOVERRIDE 267#define TOK_DQUOTE 268#define TOK_DT_BOOL 269#define TOK_DT_CHAR16 270#define TOK_DT_CHAR8 271#define TOK_DT_DATETIME 272#define TOK_DT_REAL32 273#define TOK_DT_REAL64 274#define TOK_DT_SINT16 275#define TOK_DT_SINT32 276#define TOK_DT_SINT64 277#define TOK_DT_SINT8 278#define TOK_DT_STR 279#define TOK_DT_UINT16 280#define TOK_DT_UINT32 281#define TOK_DT_UINT64 282#define TOK_DT_UINT8 283#define TOK_ENABLEOVERRIDE 284#define TOK_END_OF_FILE 285#define TOK_EQUAL 286#define TOK_FALSE 287#define TOK_FLAVOR 288#define TOK_HEX_VALUE 289#define TOK_INCLUDE 290#define TOK_INDICATION 291#define TOK_INSTANCE 292#define TOK_LEFTCURLYBRACE 293#define TOK_LEFTPAREN 294#define TOK_LEFTSQUAREBRACKET 295#define TOK_METHOD 296#define TOK_NULL_VALUE 297#define TOK_OCTAL_VALUE 298#define TOK_OF 299#define TOK_PARAMETER 300#define TOK_PERIOD 301#define TOK_POSITIVE_DECIMAL_VALUE 302#define TOK_PRAGMA 303#define TOK_PROPERTY 304#define TOK_QUALIFIER 305#define TOK_REAL_VALUE 306#define TOK_REF 307#define TOK_REFERENCE 308#define TOK_RESTRICTED 309#define TOK_RIGHTCURLYBRACE 310#define TOK_RIGHTPAREN 311#define TOK_RIGHTSQUAREBRACKET 312#define TOK_SCHEMA 313#define TOK_SCOPE 314#define TOK_SEMICOLON 315#define TOK_SIGNED_DECIMAL_VALUE 316#define TOK_SIMPLE_IDENTIFIER 317#define TOK_STRING_VALUE 318#define TOK_TOSUBCLASS 319#define TOK_TRANSLATABLE 320#define TOK_TRUE 321#define TOK_UNEXPECTED_CHAR 322/* Copy the first part of user declarations.  */#line 29 "cimmof.y"  /* Flex grammar created from CIM Specification Version 2.2 Appendix A */  /*     Note the following implementation details:       1. The MOF specification has a production of type assocDeclaration,       but an association is just a type of classDeclaration with a few       special rules.  At least for the first pass, I'm treating an       associationDeclaration as a classDeclaration and applying its       syntactical rules outside of the grammar definition.       2. Same with the indicationDeclaration.  It appears to be a normal       classDeclaration with the INDICATION qualifier and no special       syntactical rules.       3. The Parser uses String objects throughout to represent       character data.  However, the tokenizer underneath is probably       working with 8-bit chars.  If we later use an extended character       compatible tokenizer, I anticipate NO CHANGE to this parser.       4. Besides the tokenizer, this parser uses 2 sets of outside       services:          1)Class valueFactory.  This has a couple of static methods	  that assist in creating CIMValue objects from Strings.	  2)Class cimmofParser.  This has a wide variety of methods	  that fall into these catagories:            a) Interfaces to the Repository.  You call cimmofParser::            methods to query and store compiled CIM elements.	    b) Error handling.            c) Data format conversions.            d) Tokenizer manipulation            e) Pragma handling            f) Alias Handling  */#define YYSTACKSIZE 2000#include <cstdlib>#if !defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) && !defined(__OS400__) && !defined(PEGASUS_OS_VMS)#if defined(PEGASUS_OS_DARWIN)#include <sys/malloc.h>#else#include <malloc.h>#endif#endif#include <cstdio>#include <cstring>#include <Pegasus/Common/String.h>#include <Pegasus/Common/CIMName.h>#include "cimmofParser.h"#include "valueFactory.h"#include "memobjs.h"#include "qualifierList.h"#include "objname.h"//include any useful debugging stuff here/* Debugging the parser.  Debugging is provided through   1. debug functions in Bison that are controlled by a compile time      flag (YYDEBUG) and a runtime flag (yydebug) which is redefined      to cimmof_debug.   2. Debug functions defined through YACCTRACE, a macro defined      in cimmofparser.h and turned on and off manually.   All debugging must be turned on manually at this point by   setting the YYDEBUG compile flag and also setting YACCTRACE.   ATTN: TODO: automate the debug information flags.*/// Enable this define to compie Bison/Yacc tracing// ATTN: p3 03092003 ks Enabling this flag currently causes a compile error#define YYDEBUG 1//static int cimmof_debug;//extern cimmofParser g_cimmofParser;extern int   cimmof_lex(void);extern int   cimmof_error(...);extern char *cimmof_text;extern void  cimmof_yy_less(int n);extern int   cimmof_leng;/* ------------------------------------------------------------------- *//* These globals provide continuity between various pieces of a        *//* declaration.  They are usually interpreted as "these modifiers were *//* encountered and need to be applied to the finished object".  For    *//* example, qualifiers are accumulated in g_qualifierList[] as they    *//* encountered, then applied to the production they qualify when it    *//* is completed.                                                       *//* ------------------------------------------------------------------- */  CIMFlavor g_flavor = CIMFlavor (CIMFlavor::NONE);  CIMScope g_scope = CIMScope ();  //ATTN: BB 2001 BB P1 - Fixed size qualifier list max 20. Make larger or var  qualifierList g_qualifierList(20);  CIMMethod *g_currentMethod = 0;  CIMClass *g_currentClass = 0;  CIMInstance *g_currentInstance = 0;  String g_currentAliasRef;  // Alias reference  String g_currentAliasDecl; // Alias declaration  CIMName g_referenceClassName = CIMName();  Array<CIMKeyBinding> g_KeyBindingArray; // it gets created empty  TYPED_INITIALIZER_VALUE g_typedInitializerValue; /* ------------------------------------------------------------------- *//* Pragmas, except for the Include pragma, are not handled yet    *//* I don't understand them, so it may be a while before they are       */ /* ------------------------------------------------------------------- */  struct pragma {    String name;    String value;  };/* ---------------------------------------------------------------- *//* Use our general wrap manager to handle end-of-file               *//* ---------------------------------------------------------------- */extern "C" {intcimmof_wrap() {  return cimmofParser::Instance()->wrapCurrentBuffer();}}/* ---------------------------------------------------------------- *//* Pass errors to our general log manager.                          *//* ---------------------------------------------------------------- */voidcimmof_error(const char *msg) {  cimmofParser::Instance()->log_parse_error(cimmof_text, msg);  // printf("Error: %s\n", msg);}static void MOF_error(const char * str, const char * S);static void MOF_trace(const char* str);static void MOF_trace2(const char * str, const char * S);/* Enabling traces.  */#ifndef YYDEBUG# define YYDEBUG 0#endif/* Enabling verbose error messages.  */#ifdef YYERROR_VERBOSE

⌨️ 快捷键说明

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