(file) Return to mofyaccinc.c CVS log (file) (dir) Up to [OMI] / omi / mof

   1 mike  1.1 
   2 krisbash 1.3 # line 2 "mof.y"
   3 mike     1.1 
   4              #include "config.h"
   5              #include <stdio.h>
   6              #include <stdlib.h>
   7              #include <string.h>
   8              #include "config.h"
   9              #include "buffer.h"
  10              #include "types.h"
  11              #include "state.h"
  12              #include "ptrarray.h"
  13              
  14              #define ARRAYOF(TYPE) ((MI_Uint32)TYPE | (MI_Uint32)MI_ARRAY_BIT)
  15              
  16              extern int yylex();
  17              extern int openIncludeFile(const char* path);
  18              
  19 krisbash 1.3 
  20              # line 20 "mof.y"
  21              typedef union
  22              #ifdef __cplusplus
  23                      YYSTYPE
  24 mike     1.1 #endif
  25 krisbash 1.3 
  26 mike     1.1 {
  27                  MI_Boolean boolean;
  28                  MI_Sint64 integer;
  29                  MI_Real64 real;
  30                  MI_Char16 character;
  31                  char* string;
  32                  char* identifier;
  33                  char* dollarIdentifier;
  34                  MI_Type type;
  35                  MI_PropertyDecl* property;
  36                  MI_MethodDecl* methodDecl;
  37                  MI_ParameterDecl* parameter;
  38                  MOF_ParameterList parameterList;
  39                  MOF_FeatureList featureList;
  40                  MI_QualifierDecl* qualifierDeclaration;
  41                  MOF_ConstantValue constantValue;
  42                  MOF_Initializer initializer;
  43                  MI_Uint32 flags;
  44                  MI_Qualifier* qualifier;
  45                  MOF_QualifierList qualifierList;
  46                  MI_ClassDecl* classDeclaration;
  47 mike     1.1     MI_InstanceDecl* instanceDeclaration;
  48              } YYSTYPE;
  49 krisbash 1.3 # define TOK_ERROR 257
  50              # define TOK_BOOLEAN 258
  51              # define TOK_SINT8 259
  52              # define TOK_UINT8 260
  53              # define TOK_SINT16 261
  54              # define TOK_UINT16 262
  55              # define TOK_SINT32 263
  56              # define TOK_UINT32 264
  57              # define TOK_SINT64 265
  58              # define TOK_UINT64 266
  59              # define TOK_REAL32 267
  60              # define TOK_REAL64 268
  61              # define TOK_DATETIME 269
  62              # define TOK_CHAR16 270
  63              # define TOK_STRING 271
  64              # define TOK_OBJECT 272
  65              # define TOK_BOOLEAN_VALUE 273
  66              # define TOK_REF 274
  67              # define TOK_SCOPE 275
  68              # define TOK_CLASS 276
  69              # define TOK_ASSOCIATION 277
  70 krisbash 1.3 # define TOK_INDICATION 278
  71              # define TOK_QUALIFIER 279
  72              # define TOK_PROPERTY 280
  73              # define TOK_REFERENCE 281
  74              # define TOK_METHOD 282
  75              # define TOK_PARAMETER 283
  76              # define TOK_ANY 284
  77              # define TOK_FLAVOR 285
  78              # define TOK_ENABLEOVERRIDE 286
  79              # define TOK_DISABLEOVERRIDE 287
  80              # define TOK_RESTRICTED 288
  81              # define TOK_TOSUBCLASS 289
  82              # define TOK_TOINSTANCE 290
  83              # define TOK_TRANSLATABLE 291
  84              # define TOK_INSTANCE 292
  85              # define TOK_OF 293
  86              # define TOK_AS 294
  87              # define TOK_PRAGMA 295
  88              # define TOK_SCHEMA 296
  89              # define TOK_INTEGER_VALUE 297
  90              # define TOK_REAL_VALUE 298
  91 krisbash 1.3 # define TOK_STRING_VALUE 299
  92              # define TOK_CHAR_VALUE 300
  93              # define TOK_IDENT 301
  94              # define TOK_ALIAS_IDENTIFIER 302
  95              # define TOK_NULL 303
  96 mike     1.1 
  97 krisbash 1.3 #ifdef __STDC__
  98              #include <stdlib.h>
  99              #include <string.h>
 100              #define YYCONST const
 101 mike     1.1 #else
 102 krisbash 1.3 #include <malloc.h>
 103              #include <memory.h>
 104              #define YYCONST
 105 mike     1.1 #endif
 106              
 107 krisbash 1.3 #if defined(__cplusplus) || defined(__STDC__)
 108              
 109              #if defined(__cplusplus) && defined(__EXTERN_C__)
 110              extern "C" {
 111              #endif
 112              #ifndef yyerror
 113              #if defined(__cplusplus)
 114                      void yyerror(YYCONST char *);
 115              #endif
 116              #endif
 117              #ifndef yylex
 118                      int yylex(void);
 119              #endif
 120                      int yyparse(void);
 121              #if defined(__cplusplus) && defined(__EXTERN_C__)
 122              }
 123 mike     1.1 #endif
 124              
 125              #endif
 126              
 127 krisbash 1.3 #define yyclearin yychar = -1
 128              #define yyerrok yyerrflag = 0
 129              extern int yychar;
 130              extern int yyerrflag;
 131              YYSTYPE yylval;
 132              YYSTYPE yyval;
 133              typedef int yytabelem;
 134              #ifndef YYMAXDEPTH
 135              #define YYMAXDEPTH 150
 136              #endif
 137              #if YYMAXDEPTH > 0
 138              int yy_yys[YYMAXDEPTH], *yys = yy_yys;
 139              YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
 140              #else   /* user does initial allocation */
 141              int *yys;
 142              YYSTYPE *yyv;
 143              #endif
 144              static int yymaxdepth = YYMAXDEPTH;
 145              # define YYERRCODE 256
 146              static YYCONST yytabelem yyexca[] ={
 147              -1, 1,
 148 krisbash 1.3         0, -1,
 149                      -2, 0,
 150                      };
 151              # define YYNPROD 190
 152              # define YYLAST 1108
 153              static YYCONST yytabelem yyact[]={
 154              
 155                 151,   147,   149,   201,   102,   155,   119,    15,    13,   120,
 156                 121,    61,    96,   190,   240,    13,    98,   202,   257,    48,
 157                 152,   103,   104,   105,   106,   107,   108,    39,   183,   145,
 158                 310,   265,    33,   210,    42,    75,    76,    77,    78,    79,
 159                  80,    81,    82,    83,    84,    85,    87,    86,    88,   134,
 160                 208,   185,    90,    19,    22,    23,    26,    25,    24,   304,
 161                  52,    21,    30,    31,    45,    44,    27,    28,    29,   335,
 162                  20,   160,    18,    95,    96,    42,    46,   250,    17,    32,
 163                 241,   242,   243,    57,   244,   245,   246,   247,   248,    36,
 164                 101,   282,   131,   284,   135,   137,   148,   146,    54,    66,
 165                  37,    56,    38,    35,   100,   171,   157,    19,    22,    23,
 166                  26,    25,    24,    89,   188,    21,    30,    46,   354,   114,
 167                  27,    28,    29,   148,    20,   207,    18,   148,   122,    46,
 168                  97,   353,    17,   164,   322,   349,   323,   173,   206,   177,
 169 krisbash 1.3    303,   161,   259,   110,   111,    61,   112,    53,   205,   115,
 170                 192,   348,   159,   167,   168,   170,   318,   175,   319,   179,
 171                 347,   157,    70,   125,   144,   140,    59,   345,    59,   215,
 172                 219,   154,   223,   343,   196,    36,   342,   231,   228,   142,
 173                  69,   236,   234,    98,   341,   340,    37,    13,    38,    35,
 174                 221,   156,   225,    19,    22,    23,    26,    25,    24,   252,
 175                   9,    21,    30,    11,   255,   180,    27,    28,    29,   292,
 176                  20,   293,    18,    68,   334,   181,    12,   189,    17,     8,
 177                 270,   123,   141,   278,   275,   260,   129,   283,   281,   272,
 178                 330,   285,   264,    13,   287,   328,   288,   290,   289,    67,
 179                 249,   294,    65,   296,   128,   326,    19,    22,    23,    26,
 180                  25,    24,   325,   321,    21,    30,   316,   314,   300,    27,
 181                  28,    29,   312,    20,   121,    18,   307,    64,   271,   305,
 182                 217,    17,   301,   311,   209,   114,   299,   127,   315,    13,
 183                 279,   317,   280,   273,   320,   274,   308,   309,   324,   214,
 184                 114,   216,    50,   327,   206,   291,   306,   329,   286,   110,
 185                 111,    61,   112,   126,   205,   115,   124,   263,   256,   206,
 186                 337,   338,   117,   333,   110,   111,    61,   112,   114,   205,
 187                 115,   148,   336,   344,    13,   251,   193,   346,   166,   182,
 188                 268,   339,   269,   253,   162,   254,   350,   332,   351,   130,
 189                 331,   352,   110,   111,    61,   112,    93,   163,   115,   165,
 190 krisbash 1.3    198,   276,   192,   277,    75,    76,    77,    78,    79,    80,
 191                  81,    82,    83,    84,    85,    87,    86,    88,    74,    13,
 192                   4,   158,    19,    22,    23,    26,    25,    24,   238,   148,
 193                  21,    30,   232,   148,   233,    27,    28,    29,   226,    20,
 194                 227,    18,   235,   229,   237,   230,   222,    17,   224,   184,
 195                  75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
 196                  85,    87,    86,    88,    74,   199,    41,   200,    19,    22,
 197                  23,    26,    25,    24,   148,   148,    21,    30,   148,    43,
 198                   7,    27,    28,    29,   194,    20,   195,    18,   218,     5,
 199                 220,    13,   176,    17,   178,   187,    75,    76,    77,    78,
 200                  79,    80,    81,    82,    83,    84,    85,    87,    86,    88,
 201                 114,     2,   113,    14,    19,    22,    23,    26,    25,    24,
 202                 148,    99,    21,    30,   148,   355,    55,    27,    28,    29,
 203                  40,    20,    13,    18,   110,   111,    61,   112,    58,    17,
 204                 115,    75,    76,    77,    78,    79,    80,    81,    82,    83,
 205                  84,    85,    87,    86,    88,   114,    60,   143,   295,    19,
 206                  22,    23,    26,    25,    24,    92,   191,    21,    30,   172,
 207                 239,   174,    27,    28,    29,   116,    20,    13,    18,   110,
 208                 111,    61,   112,   258,    17,   115,    75,    76,    77,    78,
 209                  79,    80,    81,    82,    83,    84,    85,    87,    86,    88,
 210                 313,   148,   203,   262,    19,    22,    23,    26,    25,    24,
 211 krisbash 1.3     49,   150,    21,    30,     6,    63,     1,    27,    28,    29,
 212                   0,    20,   297,    18,   261,   298,     0,   262,     0,    17,
 213                  75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
 214                  85,    87,    86,    88,     0,     0,     0,     0,    19,    22,
 215                  23,    26,    25,    24,     0,     0,    21,    30,    36,     0,
 216                   0,    27,    28,    29,     0,    20,     0,    18,     0,    37,
 217                   0,    38,    35,    17,     0,     0,    19,    22,    23,    26,
 218                  25,    24,     0,     0,    21,    30,     0,     0,     0,    27,
 219                  28,    29,     0,    20,     0,    18,    13,     0,     0,    36,
 220                   0,    17,     0,     0,     0,    34,     0,     0,     0,     0,
 221                  37,     0,    38,    35,     0,    16,     0,    19,    22,    23,
 222                  26,    25,    24,     0,     0,    21,    30,     0,     0,     0,
 223                  27,    28,    29,   211,    20,     0,    18,    47,     0,     0,
 224                   0,     0,    17,     0,    36,    51,     0,     0,     0,     0,
 225                   0,    62,    73,     0,    91,    37,     0,    38,    35,     0,
 226                   0,     0,    19,    22,    23,    26,    25,    24,     0,    73,
 227                  21,    30,    36,     0,     0,    27,    28,    29,   133,    20,
 228                  71,    18,     0,    37,    94,    38,    35,    17,   169,     0,
 229                  19,    22,    23,    26,    25,    24,   139,    71,    21,    30,
 230                  36,     0,     0,    27,    28,    29,   132,    20,   204,    18,
 231                   0,    37,     0,    38,    35,    17,   138,     0,    19,    22,
 232 krisbash 1.3     23,    26,    25,    24,     0,     0,    21,    30,    36,     0,
 233                   0,    27,    28,    29,     0,    20,     0,    18,     0,    37,
 234                   0,    38,    35,    17,   136,     0,    19,    22,    23,    26,
 235                  25,    24,     0,     0,    21,    30,    36,     0,     0,    27,
 236                  28,    29,     3,    20,     0,    18,   109,    37,   118,    38,
 237                  35,    17,   212,     0,    19,    22,    23,    26,    25,    24,
 238                   0,     9,    21,    30,    11,     0,     0,    27,    28,    29,
 239                   0,    20,     0,    18,   153,    10,    10,    12,     0,    17,
 240                   8,    75,    76,    77,    78,    79,    80,    81,    82,    83,
 241                  84,    85,    87,    86,    88,     0,     0,     0,     0,   267,
 242                   0,     0,     0,   212,     0,     0,     0,     0,     0,     0,
 243                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 244                   0,    72,     0,     0,     0,     0,     0,   266,     0,     0,
 245                   0,     0,     0,     0,     0,   186,     0,     0,    72,     0,
 246                   0,     0,     0,   302,     0,     0,     0,     0,   212,   197,
 247                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 248                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 249                   0,     0,     0,     0,     0,     0,     0,   186,     0,     0,
 250                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 251                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 252                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 253 krisbash 1.3      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 254                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 255                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 256                   0,   213,     0,     0,     0,     0,     0,     0,     0,     0,
 257                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 258                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 259                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 260                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 261                   0,     0,   213,     0,     0,     0,     0,     0,     0,     0,
 262                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 263                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 264                   0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 265                   0,     0,     0,     0,     0,     0,     0,   213 };
 266              static YYCONST yytabelem yypact[]={
 267              
 268                 555,   -76,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -294,   -30,
 269                -213,   548,  -266,   548,-10000000,   389,     6,-10000000,-10000000,-10000000,
 270              -10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
 271              -10000000,   -30,  -274,   234,-10000000,-10000000,-10000000,-10000000,-10000000,   548,
 272                  54,-10000000,    43,  -288,-10000000,   -30,   142,    -6,   -30,   302,
 273                 593,   -49,  -278,-10000000,   548,    46,  -265,   232,-10000000,   187,
 274 krisbash 1.3    -35,-10000000,   -47,    96,   280,-10000000,-10000000,-10000000,-10000000,-10000000,
 275              -10000000,   548,  -223,   520,   492,-10000000,-10000000,-10000000,-10000000,-10000000,
 276              -10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
 277                 -30,  -111,   120,  -246,    36,-10000000,   436,   -49,  -297,-10000000,
 278                -265,  -265,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,   330,
 279              -10000000,-10000000,-10000000,  -289,-10000000,-10000000,    27,-10000000,-10000000,-10000000,
 280                 548,-10000000,-10000000,   275,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
 281              -10000000,   288,   548,   464,  -169,   460,   548,   383,   548,   -47,
 282              -10000000,   -49,-10000000,   270,  -257,   359,    45,    53,   -80,   391,
 283                 267,-10000000,   375,   548,-10000000,-10000000,  -265,-10000000,-10000000,-10000000,
 284                 232,   309,-10000000,-10000000,   356,     2,   233,   230,   379,   548,
 285                 337,   548,-10000000,   329,     2,   334,-10000000,   323,     2,   333,
 286              -10000000,-10000000,-10000000,   338,  -196,-10000000,-10000000,-10000000,    45,   -16,
 287              -10000000,   266,-10000000,-10000000,-10000000,     2,   274,-10000000,-10000000,-10000000,
 288                   2,   249,-10000000,-10000000,-10000000,-10000000,  -275,    17,   533,   248,
 289              -10000000,   548,  -243,   322,-10000000,   271,     2,   188,-10000000,   224,
 290                   2,   292,-10000000,   221,     2,    32,-10000000,     2,   239,-10000000,
 291                   2,   177,-10000000,     2,   236,-10000000,   150,     2,  -265,   531,
 292              -10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
 293              -10000000,-10000000,   217,-10000000,     2,   213,-10000000,   -30,    15,-10000000,
 294              -10000000,   210,   278,-10000000,     5,   548,   548,  -244,-10000000,     2,
 295 krisbash 1.3    203,   509,   198,-10000000,     2,   197,-10000000,     2,    97,-10000000,
 296                   2,   194,-10000000,    75,     2,   193,-10000000,   186,-10000000,     2,
 297                 176,-10000000,-10000000,     2,   171,   296,-10000000,-10000000,  -196,-10000000,
 298                 155,-10000000,   -54,-10000000,  -154,-10000000,-10000000,-10000000,     5,     5,
 299                 548,   126,-10000000,   125,-10000000,   117,-10000000,   114,-10000000,     2,
 300                 108,-10000000,-10000000,     2,   101,-10000000,-10000000,    92,-10000000,    76,
 301              -10000000,  -265,-10000000,-10000000,-10000000,   -83,-10000000,-10000000,-10000000,     5,
 302              -10000000,-10000000,-10000000,-10000000,    72,-10000000,    59,-10000000,-10000000,-10000000,
 303              -10000000,   350,-10000000,-10000000,-10000000,-10000000 };
 304              static YYCONST yytabelem yypgo[]={
 305              
 306                   0,   566,   462,   655,    20,   130,   758,   683,   242,    33,
 307                  50,   239,   213,   180,   162,    99,   565,    65,    73,   564,
 308                 560,     1,     3,   552,   533,    17,    51,   445,   525,    14,
 309                 520,   515,     4,   508,    90,   507,   416,   480,   844,   476,
 310                 439,   430,     0,     2,   461,   370 };
 311              static YYCONST yytabelem yyr1[]={
 312              
 313                   0,     1,     1,     1,    44,    44,    44,    44,    45,    45,
 314                  40,    40,    40,    40,    17,    17,    16,    16,    16,    16,
 315                  16,    16,    16,    16,    16,    16,    16,    16,    38,    37,
 316 krisbash 1.3     37,    36,    36,    36,    36,    39,    39,    33,    33,    34,
 317                  34,    32,    32,    32,    32,    32,    32,     8,     8,     8,
 318                   8,     8,     8,     8,     8,    13,    13,    13,    13,    13,
 319                  13,    13,    13,    14,    14,    14,    14,    14,    14,    14,
 320                  14,    11,    11,    11,    11,    11,    11,    11,    11,    12,
 321                  12,    12,    12,    12,    12,    12,    12,    15,    15,    15,
 322                  15,    10,    10,     9,     9,     9,     9,     9,     9,     9,
 323                   9,    21,    21,    22,    22,    23,    23,    24,    24,    25,
 324                  25,    25,    26,    26,    27,    27,    28,    28,     6,     6,
 325                   6,     6,     6,     6,     2,     2,    19,    19,    20,    20,
 326                  20,    20,    31,    30,    30,    29,    29,    29,    29,    29,
 327                  29,    29,    29,    35,    41,    41,    41,    41,    18,    18,
 328                   5,    43,    43,    42,    42,    42,    42,     4,     4,     4,
 329                   4,     4,     3,     3,     3,     3,     3,     3,     3,     3,
 330                   3,     3,     3,     3,     3,     3,     7,     7,     7,     7,
 331                   7,     7,     7,     7,     7,     7,     7,     7,     7,     7 };
 332              static YYCONST yytabelem yyr2[]={
 333              
 334                   0,     3,     5,     3,     3,     3,     3,     3,    11,    15,
 335                   7,    11,     9,    13,     9,     7,     3,     3,     3,     3,
 336                   3,     3,     5,     5,     5,     5,     5,     5,     7,     3,
 337 krisbash 1.3      7,     3,     5,     7,     9,     7,     3,     3,     7,     3,
 338                   5,     3,     3,     3,     3,     3,     3,     7,     9,     9,
 339                  11,    11,    13,    13,    15,     7,     9,     9,    11,    11,
 340                  13,    13,    15,     7,     9,     9,    11,    11,    13,    13,
 341                  15,     9,    11,    13,    15,    11,    13,    15,    17,     9,
 342                  11,    11,    13,    13,    15,    15,    17,    13,    15,    11,
 343                  13,     3,     7,     5,     7,     7,     9,     7,     9,     9,
 344                  11,     7,     5,     3,     3,     7,     5,     3,     7,     3,
 345                   3,    13,     3,     3,     7,     5,     3,     7,     3,     3,
 346                   3,     3,     3,     3,     3,     5,    11,    13,     5,     9,
 347                   7,    11,    11,     3,     7,     3,     3,     3,     3,     3,
 348                   3,     3,     3,    11,     9,    11,    11,    13,     9,     7,
 349                   5,     3,     5,     5,     7,     9,    11,     3,     3,     3,
 350                   3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
 351                   3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
 352                   3,     3,     3,     3,     3,     3,     3,     3,     3,     3 };
 353              static YYCONST yytabelem yychk[]={
 354              
 355              -10000000,    -1,   -44,   257,   -45,   -40,   -19,   -41,   295,   276,
 356                 -38,   279,   292,    91,   -44,   301,    -3,   301,   295,   276,
 357                 293,   284,   277,   278,   281,   280,   279,   289,   290,   291,
 358 krisbash 1.3    285,   276,   292,    -4,    -3,   272,   258,   269,   271,   293,
 359                 -37,   -36,    -4,    40,   -17,    58,   123,    -3,   293,   -20,
 360                  58,    -3,    -4,    93,    44,   -39,    58,    40,   -27,   123,
 361                  -2,   299,    -3,   -16,   125,    -8,   -15,   -11,   -12,   -13,
 362                 -14,    -7,   -38,    -3,   272,   258,   259,   260,   261,   262,
 363                 263,   264,   265,   266,   267,   268,   270,   269,   271,   -17,
 364                  58,    -3,   -31,    44,    -7,   -18,   123,    -5,   294,   -36,
 365                  58,   -34,   -32,   286,   287,   288,   289,   290,   291,    -6,
 366                 297,   298,   300,    -2,   273,   303,   -28,   125,    -6,    41,
 367                  44,   299,   -17,   125,    -8,   -15,   -11,   -12,   -13,   -14,
 368                  59,    -4,    -7,    -3,   272,    -4,   274,    -4,   274,    -3,
 369                 -18,    -5,    59,   -35,    44,   275,    61,   -21,    91,   -43,
 370                 125,   -42,    -4,   -38,   -18,   302,   -34,   -32,    41,   125,
 371                  44,    -4,    59,    59,   -21,    61,    40,    -4,    -4,   274,
 372                  -4,   274,    59,   -21,    61,    -4,    59,   -21,    61,    -4,
 373                 -17,   -18,    59,   285,    40,   -26,    -6,   -27,    61,   297,
 374                  93,   125,   -42,    59,    59,    61,    -4,    -6,    41,    59,
 375                  61,   -22,   -25,   -23,    -6,   302,   292,   123,   -10,    41,
 376                  -9,    -7,    -3,   -38,    59,   -21,    61,    40,    59,   -21,
 377                  61,    -4,    59,   -21,    61,    -4,    59,    61,   -22,    59,
 378                  61,   -21,    59,    61,   -22,    59,   -21,    61,    40,   -30,
 379 krisbash 1.3    -29,   276,   277,   278,   280,   281,   282,   283,   284,   -26,
 380                  93,    59,   -22,    59,    61,   -22,    59,   293,   -24,   125,
 381                 -25,    41,    44,    59,    -4,   274,    -7,    -3,    59,    61,
 382                 -22,   -10,    41,    59,    61,   -22,    59,    61,   -21,    59,
 383                  61,   -22,    59,   -21,    61,   -22,    59,   -22,    59,    61,
 384                 -22,    59,    59,    61,   -22,   -33,   -32,    41,    44,    59,
 385                 -22,    59,    -3,   125,    44,    59,    -9,   -21,    -4,    -4,
 386                 274,   -22,    59,    41,    59,   -22,    59,   -22,    59,    61,
 387                 -22,    59,    59,    61,   -22,    59,    59,   -22,    59,   -22,
 388                  59,    44,    41,   -29,    59,   123,   -25,   -21,   -21,    -4,
 389                  59,    59,    59,    59,   -22,    59,   -22,    59,    59,    59,
 390                 -32,   -43,   -21,    59,    59,   125 };
 391              static YYCONST yytabelem yydef[]={
 392              
 393                   0,    -2,     1,     3,     4,     5,     6,     7,     0,     0,
 394                   0,     0,     0,     0,     2,     0,     0,   162,   163,   164,
 395                 165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
 396                 175,     0,     0,     0,   157,   158,   159,   160,   161,     0,
 397                   0,    29,    31,     0,    10,     0,     0,     0,     0,     0,
 398                   0,   157,     0,    28,     0,    32,     0,     0,    36,     0,
 399                   0,   124,     0,     0,     0,    16,    17,    18,    19,    20,
 400 krisbash 1.3     21,     0,     0,     0,     0,   176,   177,   178,   179,   180,
 401                 181,   182,   183,   184,   185,   186,   187,   188,   189,    12,
 402                   0,     0,     0,     0,   128,   144,     0,     0,     0,    30,
 403                   0,    33,    39,    41,    42,    43,    44,    45,    46,     0,
 404                 118,   119,   120,   121,   122,   123,     0,   115,   116,     8,
 405                   0,   125,    11,     0,    22,    23,    24,    25,    26,    27,
 406                  15,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 407                 145,     0,   126,     0,     0,     0,     0,   130,     0,     0,
 408                   0,   151,     0,     0,   146,   150,    34,    40,    35,   114,
 409                   0,     0,    14,    47,     0,     0,     0,     0,     0,     0,
 410                   0,     0,    55,     0,     0,     0,    63,     0,     0,     0,
 411                  13,   147,   127,     0,     0,   129,   112,   113,     0,     0,
 412                 102,     0,   152,   149,   153,     0,     0,   117,     9,    49,
 413                   0,     0,   103,   104,   109,   110,     0,     0,     0,     0,
 414                  91,     0,     0,     0,    48,     0,     0,     0,    56,     0,
 415                   0,     0,    64,     0,     0,     0,    57,     0,     0,    71,
 416                   0,     0,    65,     0,     0,    79,     0,     0,     0,     0,
 417                 133,   135,   136,   137,   138,   139,   140,   141,   142,   131,
 418                 101,   148,     0,   154,     0,     0,    51,     0,     0,   106,
 419                 107,     0,     0,    89,    93,     0,     0,     0,    50,     0,
 420                   0,     0,     0,    58,     0,     0,    72,     0,     0,    66,
 421 krisbash 1.3      0,     0,    80,     0,     0,     0,    59,     0,    75,     0,
 422                   0,    67,    81,     0,     0,     0,    37,   132,     0,   155,
 423                   0,    53,     0,   105,     0,    87,    92,    97,    94,    95,
 424                   0,     0,    52,     0,    90,     0,    60,     0,    76,     0,
 425                   0,    68,    82,     0,     0,    61,    73,     0,    69,     0,
 426                  83,     0,   143,   134,   156,     0,   108,    98,    99,    96,
 427                  54,    88,    62,    74,     0,    70,     0,    85,    77,    84,
 428                  38,     0,   100,    78,    86,   111 };
 429              typedef struct
 430              #ifdef __cplusplus
 431                      yytoktype
 432 mike     1.1 #endif
 433 krisbash 1.3 {
 434              #ifdef __cplusplus
 435              const
 436 mike     1.1 #endif
 437 krisbash 1.3 char *t_name; int t_val; } yytoktype;
 438              #ifndef YYDEBUG
 439              #       define YYDEBUG  0       /* don't allow debugging */
 440 mike     1.1 #endif
 441              
 442 krisbash 1.3 #if YYDEBUG
 443 mike     1.1 
 444 krisbash 1.3 yytoktype yytoks[] =
 445              {
 446                      { "TOK_ERROR",  257 },
 447                      { "TOK_BOOLEAN",        258 },
 448                      { "TOK_SINT8",  259 },
 449                      { "TOK_UINT8",  260 },
 450                      { "TOK_SINT16", 261 },
 451                      { "TOK_UINT16", 262 },
 452                      { "TOK_SINT32", 263 },
 453                      { "TOK_UINT32", 264 },
 454                      { "TOK_SINT64", 265 },
 455                      { "TOK_UINT64", 266 },
 456                      { "TOK_REAL32", 267 },
 457                      { "TOK_REAL64", 268 },
 458                      { "TOK_DATETIME",       269 },
 459                      { "TOK_CHAR16", 270 },
 460                      { "TOK_STRING", 271 },
 461                      { "TOK_OBJECT", 272 },
 462                      { "TOK_BOOLEAN_VALUE",  273 },
 463                      { "TOK_REF",    274 },
 464                      { "TOK_SCOPE",  275 },
 465 krisbash 1.3         { "TOK_CLASS",  276 },
 466                      { "TOK_ASSOCIATION",    277 },
 467                      { "TOK_INDICATION",     278 },
 468                      { "TOK_QUALIFIER",      279 },
 469                      { "TOK_PROPERTY",       280 },
 470                      { "TOK_REFERENCE",      281 },
 471                      { "TOK_METHOD", 282 },
 472                      { "TOK_PARAMETER",      283 },
 473                      { "TOK_ANY",    284 },
 474                      { "TOK_FLAVOR", 285 },
 475                      { "TOK_ENABLEOVERRIDE", 286 },
 476                      { "TOK_DISABLEOVERRIDE",        287 },
 477                      { "TOK_RESTRICTED",     288 },
 478                      { "TOK_TOSUBCLASS",     289 },
 479                      { "TOK_TOINSTANCE",     290 },
 480                      { "TOK_TRANSLATABLE",   291 },
 481                      { "TOK_INSTANCE",       292 },
 482                      { "TOK_OF",     293 },
 483                      { "TOK_AS",     294 },
 484                      { "TOK_PRAGMA", 295 },
 485                      { "TOK_SCHEMA", 296 },
 486 krisbash 1.3         { "TOK_INTEGER_VALUE",  297 },
 487                      { "TOK_REAL_VALUE",     298 },
 488                      { "TOK_STRING_VALUE",   299 },
 489                      { "TOK_CHAR_VALUE",     300 },
 490                      { "TOK_IDENT",  301 },
 491                      { "TOK_ALIAS_IDENTIFIER",       302 },
 492                      { "TOK_NULL",   303 },
 493                      { "-unknown-", }        -1      /* ends search */
 494              }; 
 495 mike     1.1 
 496 krisbash 1.3 #ifdef __cplusplus
 497              const
 498 mike     1.1 #endif
 499 krisbash 1.3 char * yyreds[] =
 500              {
 501                      "-no such reduction-",
 502                      "mofSpecification : mofProduction",
 503                      "mofSpecification : mofSpecification mofProduction",
 504                      "mofSpecification : TOK_ERROR",
 505                      "mofProduction : compilerDirective",
 506                      "mofProduction : classDeclaration",
 507                      "mofProduction : qualifierDeclaration",
 508                      "mofProduction : instanceDeclaration",
 509                      "compilerDirective : TOK_PRAGMA TOK_IDENT '(' stringValue ')'",
 510                      "compilerDirective : TOK_PRAGMA TOK_IDENT '(' stringValue ',' identifier ')'",
 511                      "classDeclaration : TOK_CLASS classNameIdentifier classBody",
 512                      "classDeclaration : TOK_CLASS classNameIdentifier ':' classNameIdentifier classBody",
 513                      "classDeclaration : qualifierExpr TOK_CLASS classNameIdentifier classBody",
 514                      "classDeclaration : qualifierExpr TOK_CLASS classNameIdentifier ':' classNameIdentifier classBody",
 515                      "classBody : '{' classFeatureList '}' ';'",
 516                      "classBody : '{' '}' ';'",
 517                      "classFeatureList : propertyDeclaration",
 518                      "classFeatureList : methodDeclaration",
 519                      "classFeatureList : referenceDeclaration",
 520 krisbash 1.3         "classFeatureList : dynamicReferenceDeclaration",
 521                      "classFeatureList : staticEmbeddedInstanceDeclaration",
 522                      "classFeatureList : dynamicEmbeddedInstanceDeclaration",
 523                      "classFeatureList : classFeatureList propertyDeclaration",
 524                      "classFeatureList : classFeatureList methodDeclaration",
 525                      "classFeatureList : classFeatureList referenceDeclaration",
 526                      "classFeatureList : classFeatureList dynamicReferenceDeclaration",
 527                      "classFeatureList : classFeatureList staticEmbeddedInstanceDeclaration",
 528                      "classFeatureList : classFeatureList dynamicEmbeddedInstanceDeclaration",
 529                      "qualifierExpr : '[' qualifierList ']'",
 530                      "qualifierList : qualifier",
 531                      "qualifierList : qualifierList ',' qualifier",
 532                      "qualifier : identifier",
 533                      "qualifier : identifier qualifierParameter",
 534                      "qualifier : identifier ':' qualifierFlavorList",
 535                      "qualifier : identifier qualifierParameter ':' qualifierFlavorList",
 536                      "qualifierParameter : '(' constantValue ')'",
 537                      "qualifierParameter : nonAggregateArrayInitializer",
 538                      "flavorList : flavor",
 539                      "flavorList : flavorList ',' flavor",
 540                      "qualifierFlavorList : flavor",
 541 krisbash 1.3         "qualifierFlavorList : qualifierFlavorList flavor",
 542                      "flavor : TOK_ENABLEOVERRIDE",
 543                      "flavor : TOK_DISABLEOVERRIDE",
 544                      "flavor : TOK_RESTRICTED",
 545                      "flavor : TOK_TOSUBCLASS",
 546                      "flavor : TOK_TOINSTANCE",
 547                      "flavor : TOK_TRANSLATABLE",
 548                      "propertyDeclaration : dataType identifier ';'",
 549                      "propertyDeclaration : qualifierExpr dataType identifier ';'",
 550                      "propertyDeclaration : dataType identifier subscript ';'",
 551                      "propertyDeclaration : qualifierExpr dataType identifier subscript ';'",
 552                      "propertyDeclaration : dataType identifier '=' initializer ';'",
 553                      "propertyDeclaration : qualifierExpr dataType identifier '=' initializer ';'",
 554                      "propertyDeclaration : dataType identifier subscript '=' initializer ';'",
 555                      "propertyDeclaration : qualifierExpr dataType identifier subscript '=' initializer ';'",
 556                      "staticEmbeddedInstanceDeclaration : classNameIdentifier identifier ';'",
 557                      "staticEmbeddedInstanceDeclaration : qualifierExpr classNameIdentifier identifier ';'",
 558                      "staticEmbeddedInstanceDeclaration : classNameIdentifier identifier subscript ';'",
 559                      "staticEmbeddedInstanceDeclaration : qualifierExpr classNameIdentifier identifier subscript ';'",
 560                      "staticEmbeddedInstanceDeclaration : classNameIdentifier identifier '=' initializer ';'",
 561                      "staticEmbeddedInstanceDeclaration : qualifierExpr classNameIdentifier identifier '=' initializer ';'",
 562 krisbash 1.3         "staticEmbeddedInstanceDeclaration : classNameIdentifier identifier subscript '=' initializer ';'",
 563                      "staticEmbeddedInstanceDeclaration : qualifierExpr classNameIdentifier identifier subscript '=' initializer ';'",
 564                      "dynamicEmbeddedInstanceDeclaration : TOK_OBJECT identifier ';'",
 565                      "dynamicEmbeddedInstanceDeclaration : qualifierExpr TOK_OBJECT identifier ';'",
 566                      "dynamicEmbeddedInstanceDeclaration : TOK_OBJECT identifier subscript ';'",
 567                      "dynamicEmbeddedInstanceDeclaration : qualifierExpr TOK_OBJECT identifier subscript ';'",
 568                      "dynamicEmbeddedInstanceDeclaration : TOK_OBJECT identifier '=' initializer ';'",
 569                      "dynamicEmbeddedInstanceDeclaration : qualifierExpr TOK_OBJECT identifier '=' initializer ';'",
 570                      "dynamicEmbeddedInstanceDeclaration : TOK_OBJECT identifier subscript '=' initializer ';'",
 571                      "dynamicEmbeddedInstanceDeclaration : qualifierExpr TOK_OBJECT identifier subscript '=' initializer ';'",
 572                      "referenceDeclaration : classNameIdentifier TOK_REF identifier ';'",
 573                      "referenceDeclaration : qualifierExpr classNameIdentifier TOK_REF identifier ';'",
 574                      "referenceDeclaration : classNameIdentifier TOK_REF identifier '=' initializer ';'",
 575                      "referenceDeclaration : qualifierExpr classNameIdentifier TOK_REF identifier '=' initializer ';'",
 576                      "referenceDeclaration : classNameIdentifier TOK_REF identifier subscript ';'",
 577                      "referenceDeclaration : qualifierExpr classNameIdentifier TOK_REF identifier subscript ';'",
 578                      "referenceDeclaration : classNameIdentifier TOK_REF identifier subscript '=' initializer ';'",
 579                      "referenceDeclaration : qualifierExpr classNameIdentifier TOK_REF identifier subscript '=' initializer ';'",
 580                      "dynamicReferenceDeclaration : TOK_OBJECT TOK_REF identifier ';'",
 581                      "dynamicReferenceDeclaration : qualifierExpr TOK_OBJECT TOK_REF identifier ';'",
 582                      "dynamicReferenceDeclaration : TOK_OBJECT TOK_REF identifier subscript ';'",
 583 krisbash 1.3         "dynamicReferenceDeclaration : qualifierExpr TOK_OBJECT TOK_REF identifier subscript ';'",
 584                      "dynamicReferenceDeclaration : TOK_OBJECT TOK_REF identifier '=' initializer ';'",
 585                      "dynamicReferenceDeclaration : TOK_OBJECT TOK_REF identifier subscript '=' initializer ';'",
 586                      "dynamicReferenceDeclaration : qualifierExpr TOK_OBJECT TOK_REF identifier '=' initializer ';'",
 587                      "dynamicReferenceDeclaration : qualifierExpr TOK_OBJECT TOK_REF identifier subscript '=' initializer ';'",
 588                      "methodDeclaration : dataType identifier '(' parameterList ')' ';'",
 589                      "methodDeclaration : qualifierExpr dataType identifier '(' parameterList ')' ';'",
 590                      "methodDeclaration : dataType identifier '(' ')' ';'",
 591                      "methodDeclaration : qualifierExpr dataType identifier '(' ')' ';'",
 592                      "parameterList : parameter",
 593                      "parameterList : parameterList ',' parameter",
 594                      "parameter : dataType identifier",
 595                      "parameter : classNameIdentifier TOK_REF identifier",
 596                      "parameter : qualifierExpr dataType identifier",
 597                      "parameter : qualifierExpr classNameIdentifier TOK_REF identifier",
 598                      "parameter : dataType identifier subscript",
 599                      "parameter : classNameIdentifier TOK_REF identifier subscript",
 600                      "parameter : qualifierExpr dataType identifier subscript",
 601                      "parameter : qualifierExpr classNameIdentifier TOK_REF identifier subscript",
 602                      "subscript : '[' TOK_INTEGER_VALUE ']'",
 603                      "subscript : '[' ']'",
 604 krisbash 1.3         "initializer : scalarInitializer",
 605                      "initializer : arrayInitializer",
 606                      "arrayInitializer : '{' arrayInitializerList '}'",
 607                      "arrayInitializer : '{' '}'",
 608                      "arrayInitializerList : scalarInitializer",
 609                      "arrayInitializerList : arrayInitializerList ',' scalarInitializer",
 610                      "scalarInitializer : constantValue",
 611                      "scalarInitializer : TOK_ALIAS_IDENTIFIER",
 612                      "scalarInitializer : TOK_INSTANCE TOK_OF classNameIdentifier '{' valueInitializerList '}'",
 613                      "nonAggregateInitializer : constantValue",
 614                      "nonAggregateInitializer : nonAggregateArrayInitializer",
 615                      "nonAggregateArrayInitializer : '{' nonAggregateArrayInitializerList '}'",
 616                      "nonAggregateArrayInitializer : '{' '}'",
 617                      "nonAggregateArrayInitializerList : constantValue",
 618                      "nonAggregateArrayInitializerList : nonAggregateArrayInitializerList ',' constantValue",
 619                      "constantValue : TOK_INTEGER_VALUE",
 620                      "constantValue : TOK_REAL_VALUE",
 621                      "constantValue : TOK_CHAR_VALUE",
 622                      "constantValue : stringValue",
 623                      "constantValue : TOK_BOOLEAN_VALUE",
 624                      "constantValue : TOK_NULL",
 625 krisbash 1.3         "stringValue : TOK_STRING_VALUE",
 626                      "stringValue : stringValue TOK_STRING_VALUE",
 627                      "qualifierDeclaration : TOK_QUALIFIER identifier qualifierType scopeExpr ';'",
 628                      "qualifierDeclaration : TOK_QUALIFIER identifier qualifierType scopeExpr flavorExpr ';'",
 629                      "qualifierType : ':' dataType",
 630                      "qualifierType : ':' dataType '=' nonAggregateInitializer",
 631                      "qualifierType : ':' dataType subscript",
 632                      "qualifierType : ':' dataType subscript '=' nonAggregateInitializer",
 633                      "scopeExpr : ',' TOK_SCOPE '(' scopeList ')'",
 634                      "scopeList : scope",
 635                      "scopeList : scopeList ',' scope",
 636                      "scope : TOK_CLASS",
 637                      "scope : TOK_ASSOCIATION",
 638                      "scope : TOK_INDICATION",
 639                      "scope : TOK_PROPERTY",
 640                      "scope : TOK_REFERENCE",
 641                      "scope : TOK_METHOD",
 642                      "scope : TOK_PARAMETER",
 643                      "scope : TOK_ANY",
 644                      "flavorExpr : ',' TOK_FLAVOR '(' flavorList ')'",
 645                      "instanceDeclaration : TOK_INSTANCE TOK_OF classNameIdentifier instanceBody",
 646 krisbash 1.3         "instanceDeclaration : qualifierExpr TOK_INSTANCE TOK_OF classNameIdentifier instanceBody",
 647                      "instanceDeclaration : TOK_INSTANCE TOK_OF identifier alias instanceBody",
 648                      "instanceDeclaration : qualifierExpr TOK_INSTANCE TOK_OF classNameIdentifier alias instanceBody",
 649                      "instanceBody : '{' valueInitializerList '}' ';'",
 650                      "instanceBody : '{' '}' ';'",
 651                      "alias : TOK_AS TOK_ALIAS_IDENTIFIER",
 652                      "valueInitializerList : valueInitializer",
 653                      "valueInitializerList : valueInitializerList valueInitializer",
 654                      "valueInitializer : identifier ';'",
 655                      "valueInitializer : qualifierExpr identifier ';'",
 656                      "valueInitializer : identifier '=' initializer ';'",
 657                      "valueInitializer : qualifierExpr identifier '=' initializer ';'",
 658                      "identifier : classNameIdentifier",
 659                      "identifier : TOK_OBJECT",
 660                      "identifier : TOK_BOOLEAN",
 661                      "identifier : TOK_DATETIME",
 662                      "identifier : TOK_STRING",
 663                      "classNameIdentifier : TOK_IDENT",
 664                      "classNameIdentifier : TOK_PRAGMA",
 665                      "classNameIdentifier : TOK_CLASS",
 666                      "classNameIdentifier : TOK_OF",
 667 krisbash 1.3         "classNameIdentifier : TOK_ANY",
 668                      "classNameIdentifier : TOK_ASSOCIATION",
 669                      "classNameIdentifier : TOK_INDICATION",
 670                      "classNameIdentifier : TOK_REFERENCE",
 671                      "classNameIdentifier : TOK_PROPERTY",
 672                      "classNameIdentifier : TOK_QUALIFIER",
 673                      "classNameIdentifier : TOK_TOSUBCLASS",
 674                      "classNameIdentifier : TOK_TOINSTANCE",
 675                      "classNameIdentifier : TOK_TRANSLATABLE",
 676                      "classNameIdentifier : TOK_FLAVOR",
 677                      "dataType : TOK_BOOLEAN",
 678                      "dataType : TOK_SINT8",
 679                      "dataType : TOK_UINT8",
 680                      "dataType : TOK_SINT16",
 681                      "dataType : TOK_UINT16",
 682                      "dataType : TOK_SINT32",
 683                      "dataType : TOK_UINT32",
 684                      "dataType : TOK_SINT64",
 685                      "dataType : TOK_UINT64",
 686                      "dataType : TOK_REAL32",
 687                      "dataType : TOK_REAL64",
 688 krisbash 1.3         "dataType : TOK_CHAR16",
 689                      "dataType : TOK_DATETIME",
 690                      "dataType : TOK_STRING",
 691              };
 692              #endif /* YYDEBUG */
 693              # line  1 "/usr/ccs/bin/yaccpar"
 694              /*
 695               * Copyright (c) 1993 by Sun Microsystems, Inc.
 696               */
 697              
 698              /*
 699              ** Skeleton parser driver for yacc output
 700              */
 701 mike     1.1 
 702 krisbash 1.3 /*
 703              ** yacc user known macros and defines
 704              */
 705              #define YYERROR         goto yyerrlab
 706              #define YYACCEPT        return(0)
 707              #define YYABORT         return(1)
 708              #define YYBACKUP( newtoken, newvalue )\
 709              {\
 710                      if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
 711                      {\
 712                              yyerror( "syntax error - cannot backup" );\
 713                              goto yyerrlab;\
 714                      }\
 715                      yychar = newtoken;\
 716                      yystate = *yyps;\
 717                      yylval = newvalue;\
 718                      goto yynewstate;\
 719              }
 720              #define YYRECOVERING()  (!!yyerrflag)
 721              #define YYNEW(type)     PAL_Malloc(sizeof(type) * yynewmax)
 722              #define YYCOPY(to, from, type) \
 723 krisbash 1.3         (type *) memcpy(to, (char *) from, yymaxdepth * sizeof (type))
 724              #define YYENLARGE( from, type) \
 725                      (type *) PAL_Realloc((char *) from, yynewmax * sizeof(type))
 726              #ifndef YYDEBUG
 727              #       define YYDEBUG  1       /* make debugging available */
 728              #endif
 729 mike     1.1 
 730 krisbash 1.3 /*
 731              ** user known globals
 732              */
 733              int yydebug;                    /* set to 1 to get debugging */
 734 mike     1.1 
 735 krisbash 1.3 /*
 736              ** driver internal defines
 737              */
 738              #define YYFLAG          (-10000000)
 739 mike     1.1 
 740 krisbash 1.3 /*
 741              ** global variables used by the parser
 742              */
 743              YYSTYPE *yypv;                  /* top of value stack */
 744              int *yyps;                      /* top of state stack */
 745 mike     1.1 
 746 krisbash 1.3 int yystate;                    /* current state */
 747              int yytmp;                      /* extra var (lasts between blocks) */
 748 mike     1.1 
 749 krisbash 1.3 int yynerrs;                    /* number of errors */
 750              int yyerrflag;                  /* error recovery flag */
 751              int yychar;                     /* current input token number */
 752 mike     1.1 
 753              
 754              
 755 krisbash 1.3 #ifdef YYNMBCHARS
 756              #define YYLEX()         yycvtok(yylex())
 757              /*
 758              ** yycvtok - return a token if i is a wchar_t value that exceeds 255.
 759              **      If i<255, i itself is the token.  If i>255 but the neither 
 760              **      of the 30th or 31st bit is on, i is already a token.
 761              */
 762              #if defined(__STDC__) || defined(__cplusplus)
 763              int yycvtok(int i)
 764              #else
 765              int yycvtok(i) int i;
 766              #endif
 767 mike     1.1 {
 768 krisbash 1.3         int first = 0;
 769                      int last = YYNMBCHARS - 1;
 770                      int mid;
 771                      wchar_t j;
 772              
 773                      if(i&0x60000000){/*Must convert to a token. */
 774                              if( yymbchars[last].character < i ){
 775                                      return i;/*Giving up*/
 776                              }
 777                              while ((last>=first)&&(first>=0)) {/*Binary search loop*/
 778                                      mid = (first+last)/2;
 779                                      j = yymbchars[mid].character;
 780                                      if( j==i ){/*Found*/ 
 781                                              return yymbchars[mid].tvalue;
 782                                      }else if( j<i ){
 783                                              first = mid + 1;
 784                                      }else{
 785                                              last = mid -1;
 786                                      }
 787                              }
 788                              /*No entry in the table.*/
 789 krisbash 1.3                 return i;/* Giving up.*/
 790                      }else{/* i is already a token. */
 791                              return i;
 792                      }
 793 mike     1.1 }
 794 krisbash 1.3 #else/*!YYNMBCHARS*/
 795              #define YYLEX()         yylex()
 796              #endif/*!YYNMBCHARS*/
 797              
 798              /*
 799              ** yyparse - return 0 if worked, 1 if syntax error not recovered from
 800              */
 801              #if defined(__STDC__) || defined(__cplusplus)
 802              int yyparse(void)
 803 mike     1.1 #else
 804 krisbash 1.3 int yyparse()
 805 mike     1.1 #endif
 806 krisbash 1.3 {
 807                      register YYSTYPE *yypvt = 0;    /* top of value stack for $vars */
 808 mike     1.1 
 809 krisbash 1.3 #if defined(__cplusplus) || defined(lint)
 810              /*
 811                      workarounds to please C++ and lint - goto's inside
 812                      switch should never be executed
 813              */
 814                      static int __yaccpar_lint_workaround__ = 0;
 815                      switch (__yaccpar_lint_workaround__)
 816                      {
 817                              case 1: goto yyerrlab;
 818                              case 2: goto yynewstate;
 819                      }
 820              #endif
 821 mike     1.1 
 822 krisbash 1.3         /*
 823                      ** Initialize externals - yyparse may be called more than once
 824                      */
 825                      yypv = &yyv[-1];
 826                      yyps = &yys[-1];
 827                      yystate = 0;
 828                      yytmp = 0;
 829                      yynerrs = 0;
 830                      yyerrflag = 0;
 831                      yychar = -1;
 832 mike     1.1 
 833 krisbash 1.3 #if YYMAXDEPTH <= 0
 834                      if (yymaxdepth <= 0)
 835 mike     1.1         {
 836 krisbash 1.3                 if ((yymaxdepth = YYEXPAND(0)) <= 0)
 837                              {
 838                                      yyerror("yacc initialization error");
 839                                      YYABORT;
 840                              }
 841 mike     1.1         }
 842              #endif
 843 krisbash 1.3 
 844                      {
 845                              register YYSTYPE *yy_pv;        /* top of value stack */
 846                              register int *yy_ps;            /* top of state stack */
 847                              register int yy_state;          /* current state */
 848                              register int  yy_n;             /* internal state number info */
 849                      goto yystack;   /* moved from 6 lines above to here to please C++ */
 850              
 851                              /*
 852                              ** get globals into registers.
 853                              ** branch to here only if YYBACKUP was called.
 854                              */
 855                      yynewstate:
 856                              yy_pv = yypv;
 857                              yy_ps = yyps;
 858                              yy_state = yystate;
 859                              goto yy_newstate;
 860              
 861                              /*
 862                              ** get globals into registers.
 863                              ** either we just started, or we just finished a reduction
 864 krisbash 1.3                 */
 865                      yystack:
 866                              yy_pv = yypv;
 867                              yy_ps = yyps;
 868                              yy_state = yystate;
 869              
 870                              /*
 871                              ** top of for (;;) loop while no reductions done
 872                              */
 873                      yy_stack:
 874                              /*
 875                              ** put a state and value onto the stacks
 876                              */
 877 mike     1.1 #if YYDEBUG
 878 krisbash 1.3                 /*
 879                              ** if debugging, look up token value in list of value vs.
 880                              ** name pairs.  0 and negative (-1) are special values.
 881                              ** Note: linear search is used since time is not a real
 882                              ** consideration while debugging.
 883                              */
 884                              if ( yydebug )
 885                              {
 886                                      register int yy_i;
 887              
 888                                      printf( "State %d, token ", yy_state );
 889                                      if ( yychar == 0 )
 890                                              printf( "end-of-file\n" );
 891                                      else if ( yychar < 0 )
 892                                              printf( "-none-\n" );
 893                                      else
 894                                      {
 895                                              for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
 896                                                      yy_i++ )
 897                                              {
 898                                                      if ( yytoks[yy_i].t_val == yychar )
 899 krisbash 1.3                                                 break;
 900                                              }
 901                                              printf( "%s\n", yytoks[yy_i].t_name );
 902                                      }
 903                              }
 904              #endif /* YYDEBUG */
 905                              if ( ++yy_ps >= &yys[ yymaxdepth ] )    /* room on stack? */
 906                              {
 907                                      /*
 908                                      ** reallocate and recover.  Note that pointers
 909                                      ** have to be reset, or bad things will happen
 910                                      */
 911                                      long yyps_index = (yy_ps - yys);
 912                                      long yypv_index = (yy_pv - yyv);
 913                                      long yypvt_index = (yypvt - yyv);
 914                                      int yynewmax;
 915              #ifdef YYEXPAND
 916                                      yynewmax = YYEXPAND(yymaxdepth);
 917              #else
 918                                      yynewmax = 2 * yymaxdepth;      /* double table size */
 919                                      if (yymaxdepth == YYMAXDEPTH)   /* first time growth */
 920 krisbash 1.3                         {
 921                                              char *newyys = (char *)YYNEW(int);
 922                                              char *newyyv = (char *)YYNEW(YYSTYPE);
 923                                              if (newyys != 0 && newyyv != 0)
 924                                              {
 925                                                      yys = YYCOPY(newyys, yys, int);
 926                                                      yyv = YYCOPY(newyyv, yyv, YYSTYPE);
 927                                              }
 928                                              else
 929                                                      yynewmax = 0;   /* failed */
 930                                      }
 931                                      else                            /* not first time */
 932                                      {
 933                                              yys = YYENLARGE(yys, int);
 934                                              yyv = YYENLARGE(yyv, YYSTYPE);
 935                                              if (yys == 0 || yyv == 0)
 936                                                      yynewmax = 0;   /* failed */
 937                                      }
 938              #endif
 939                                      if (yynewmax <= yymaxdepth)     /* tables not expanded */
 940                                      {
 941 krisbash 1.3                                 yyerror( "yacc stack overflow" );
 942                                              YYABORT;
 943                                      }
 944                                      yymaxdepth = yynewmax;
 945              
 946                                      yy_ps = yys + yyps_index;
 947                                      yy_pv = yyv + yypv_index;
 948                                      yypvt = yyv + yypvt_index;
 949                              }
 950                              *yy_ps = yy_state;
 951                              *++yy_pv = yyval;
 952              
 953                              /*
 954                              ** we have a new state - find out what to do
 955                              */
 956                      yy_newstate:
 957                              if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
 958                                      goto yydefault;         /* simple state */
 959 mike     1.1 #if YYDEBUG
 960 krisbash 1.3                 /*
 961                              ** if debugging, need to mark whether new token grabbed
 962                              */
 963                              yytmp = yychar < 0;
 964 mike     1.1 #endif
 965 krisbash 1.3                 if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
 966                                      yychar = 0;             /* reached EOF */
 967              #if YYDEBUG
 968                              if ( yydebug && yytmp )
 969 mike     1.1                 {
 970 krisbash 1.3                         register int yy_i;
 971              
 972                                      printf( "Received token " );
 973                                      if ( yychar == 0 )
 974                                              printf( "end-of-file\n" );
 975                                      else if ( yychar < 0 )
 976                                              printf( "-none-\n" );
 977                                      else
 978                                      {
 979                                              for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
 980                                                      yy_i++ )
 981                                              {
 982                                                      if ( yytoks[yy_i].t_val == yychar )
 983                                                              break;
 984                                              }
 985                                              printf( "%s\n", yytoks[yy_i].t_name );
 986                                      }
 987                              }
 988              #endif /* YYDEBUG */
 989                              if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
 990                                      goto yydefault;
 991 krisbash 1.3                 if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )  /*valid shift*/
 992                              {
 993                                      yychar = -1;
 994                                      yyval = yylval;
 995                                      yy_state = yy_n;
 996                                      if ( yyerrflag > 0 )
 997                                              yyerrflag--;
 998                                      goto yy_stack;
 999 mike     1.1                 }
1000 krisbash 1.3 
1001                      yydefault:
1002                              if ( ( yy_n = yydef[ yy_state ] ) == -2 )
1003                              {
1004 mike     1.1 #if YYDEBUG
1005 krisbash 1.3                         yytmp = yychar < 0;
1006              #endif
1007                                      if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
1008                                              yychar = 0;             /* reached EOF */
1009 mike     1.1 #if YYDEBUG
1010 krisbash 1.3                         if ( yydebug && yytmp )
1011                                      {
1012                                              register int yy_i;
1013              
1014                                              printf( "Received token " );
1015                                              if ( yychar == 0 )
1016                                                      printf( "end-of-file\n" );
1017                                              else if ( yychar < 0 )
1018                                                      printf( "-none-\n" );
1019                                              else
1020                                              {
1021                                                      for ( yy_i = 0;
1022                                                              yytoks[yy_i].t_val >= 0;
1023                                                              yy_i++ )
1024                                                      {
1025                                                              if ( yytoks[yy_i].t_val
1026                                                                      == yychar )
1027                                                              {
1028                                                                      break;
1029                                                              }
1030                                                      }
1031 krisbash 1.3                                         printf( "%s\n", yytoks[yy_i].t_name );
1032                                              }
1033                                      }
1034              #endif /* YYDEBUG */
1035                                      /*
1036                                      ** look through exception table
1037                                      */
1038                                      {
1039                                              register YYCONST int *yyxi = yyexca;
1040              
1041                                              while ( ( *yyxi != -1 ) ||
1042                                                      ( yyxi[1] != yy_state ) )
1043                                              {
1044                                                      yyxi += 2;
1045                                              }
1046                                              while ( ( *(yyxi += 2) >= 0 ) &&
1047                                                      ( *yyxi != yychar ) )
1048                                                      ;
1049                                              if ( ( yy_n = yyxi[1] ) < 0 )
1050                                                      YYACCEPT;
1051                                      }
1052 krisbash 1.3                 }
1053 mike     1.1 
1054 krisbash 1.3                 /*
1055                              ** check for syntax error
1056                              */
1057                              if ( yy_n == 0 )        /* have an error */
1058                              {
1059                                      /* no worry about speed here! */
1060                                      switch ( yyerrflag )
1061                                      {
1062                                      case 0:         /* new error */
1063                                              yyerror( "syntax error" );
1064                                              goto skip_init;
1065                                      yyerrlab:
1066                                              /*
1067                                              ** get globals into registers.
1068                                              ** we have a user generated syntax type error
1069                                              */
1070                                              yy_pv = yypv;
1071                                              yy_ps = yyps;
1072                                              yy_state = yystate;
1073                                      skip_init:
1074                                              yynerrs++;
1075 krisbash 1.3                                 /* FALLTHRU */
1076                                      case 1:
1077                                      case 2:         /* incompletely recovered error */
1078                                                      /* try again... */
1079                                              yyerrflag = 3;
1080                                              /*
1081                                              ** find state where "error" is a legal
1082                                              ** shift action
1083                                              */
1084                                              while ( yy_ps >= yys )
1085                                              {
1086                                                      yy_n = yypact[ *yy_ps ] + YYERRCODE;
1087                                                      if ( yy_n >= 0 && yy_n < YYLAST &&
1088                                                              yychk[yyact[yy_n]] == YYERRCODE)                                        {
1089                                                              /*
1090                                                              ** simulate shift of "error"
1091                                                              */
1092                                                              yy_state = yyact[ yy_n ];
1093                                                              goto yy_stack;
1094                                                      }
1095                                                      /*
1096 krisbash 1.3                                         ** current state has no shift on
1097                                                      ** "error", pop stack
1098                                                      */
1099 mike     1.1 #if YYDEBUG
1100 krisbash 1.3 #       define _POP_ "Error recovery pops state %d, uncovers state %d\n"
1101                                                      if ( yydebug )
1102                                                              printf( _POP_, *yy_ps,
1103                                                                      yy_ps[-1] );
1104              #       undef _POP_
1105              #endif
1106                                                      yy_ps--;
1107                                                      yy_pv--;
1108                                              }
1109                                              /*
1110                                              ** there is no state on stack with "error" as
1111                                              ** a valid shift.  give up.
1112                                              */
1113                                              YYABORT;
1114                                      case 3:         /* no shift yet; eat a token */
1115              #if YYDEBUG
1116                                              /*
1117                                              ** if debugging, look up token in list of
1118                                              ** pairs.  0 and negative shouldn't occur,
1119                                              ** but since timing doesn't matter when
1120                                              ** debugging, it doesn't hurt to leave the
1121 krisbash 1.3                                 ** tests here.
1122                                              */
1123                                              if ( yydebug )
1124                                              {
1125                                                      register int yy_i;
1126              
1127                                                      printf( "Error recovery discards " );
1128                                                      if ( yychar == 0 )
1129                                                              printf( "token end-of-file\n" );
1130                                                      else if ( yychar < 0 )
1131                                                              printf( "token -none-\n" );
1132                                                      else
1133                                                      {
1134                                                              for ( yy_i = 0;
1135                                                                      yytoks[yy_i].t_val >= 0;
1136                                                                      yy_i++ )
1137                                                              {
1138                                                                      if ( yytoks[yy_i].t_val
1139                                                                              == yychar )
1140                                                                      {
1141                                                                              break;
1142 krisbash 1.3                                                         }
1143                                                              }
1144                                                              printf( "token %s\n",
1145                                                                      yytoks[yy_i].t_name );
1146                                                      }
1147                                              }
1148              #endif /* YYDEBUG */
1149                                              if ( yychar == 0 )      /* reached EOF. quit */
1150                                                      YYABORT;
1151                                              yychar = -1;
1152                                              goto yy_newstate;
1153                                      }
1154                              }/* end if ( yy_n == 0 ) */
1155                              /*
1156                              ** reduction by production yy_n
1157                              ** put stack tops, etc. so things right after switch
1158                              */
1159              #if YYDEBUG
1160                              /*
1161                              ** if debugging, print the string that is the user's
1162                              ** specification of the reduction which is just about
1163 krisbash 1.3                 ** to be done.
1164                              */
1165                              if ( yydebug )
1166                                      printf( "Reduce by (%d) \"%s\"\n",
1167                                              yy_n, yyreds[ yy_n ] );
1168              #endif
1169                              yytmp = yy_n;                   /* value to switch over */
1170                              yypvt = yy_pv;                  /* $vars top of value stack */
1171                              /*
1172                              ** Look in goto table for next state
1173                              ** Sorry about using yy_state here as temporary
1174                              ** register variable, but why not, if it works...
1175                              ** If yyr2[ yy_n ] doesn't have the low order bit
1176                              ** set, then there is no action to be done for
1177                              ** this reduction.  So, no saving & unsaving of
1178                              ** registers done.  The only difference between the
1179                              ** code just after the if and the body of the if is
1180                              ** the goto yy_stack in the body.  This way the test
1181                              ** can be made before the choice of what to do is needed.
1182                              */
1183                              {
1184 krisbash 1.3                         /* length of production doubled with extra bit */
1185                                      register int yy_len = yyr2[ yy_n ];
1186              
1187                                      if ( !( yy_len & 01 ) )
1188                                      {
1189                                              yy_len >>= 1;
1190                                              yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
1191                                              yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
1192                                                      *( yy_ps -= yy_len ) + 1;
1193                                              if ( yy_state >= YYLAST ||
1194                                                      yychk[ yy_state =
1195                                                      yyact[ yy_state ] ] != -yy_n )
1196                                              {
1197                                                      yy_state = yyact[ yypgo[ yy_n ] ];
1198                                              }
1199                                              goto yy_stack;
1200                                      }
1201                                      yy_len >>= 1;
1202                                      yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
1203                                      yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
1204                                              *( yy_ps -= yy_len ) + 1;
1205 krisbash 1.3                         if ( yy_state >= YYLAST ||
1206                                              yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
1207                                      {
1208                                              yy_state = yyact[ yypgo[ yy_n ] ];
1209                                      }
1210                              }
1211                                                      /* save until reenter driver code */
1212                              yystate = yy_state;
1213                              yyps = yy_ps;
1214                              yypv = yy_pv;
1215                      }
1216                      /*
1217                      ** code supplied by user is placed in this switch
1218                      */
1219                      switch( yytmp )
1220                      {
1221                              
1222 mike     1.1 case 1:
1223 krisbash 1.3 # line 167 "mof.y"
1224              {
1225                  } break;
1226 mike     1.1 case 2:
1227 krisbash 1.3 # line 170 "mof.y"
1228              { 
1229                  } break;
1230 mike     1.1 case 3:
1231 krisbash 1.3 # line 173 "mof.y"
1232              {
1233 mike     1.1         YYABORT;
1234 krisbash 1.3     } break;
1235 mike     1.1 case 4:
1236 krisbash 1.3 # line 179 "mof.y"
1237              {
1238                  } break;
1239 mike     1.1 case 5:
1240 krisbash 1.3 # line 182 "mof.y"
1241              {
1242 mike     1.1         /* [TODO: validate the class here] */
1243 krisbash 1.3         yypvt[-0].classDeclaration->flags = MI_FLAG_CLASS;
1244                      yypvt[-0].classDeclaration->flags |= GetQualFlags(yypvt[-0].classDeclaration->qualifiers, yypvt[-0].classDeclaration->numQualifiers);
1245                      if (FinalizeClass(yypvt[-0].classDeclaration) != 0)
1246 mike     1.1             YYABORT;
1247                          
1248 krisbash 1.3         AddClassDecl(yypvt[-0].classDeclaration);
1249 mike     1.1 
1250                      if (state.classDeclCallback)
1251 krisbash 1.3             (*state.classDeclCallback)(yypvt[-0].classDeclaration, state.classDeclCallbackData);
1252                  } break;
1253 mike     1.1 case 6:
1254 krisbash 1.3 # line 195 "mof.y"
1255              {
1256                      AddQualifierDeclaration(yypvt[-0].qualifierDeclaration);
1257 mike     1.1 
1258                      if (state.qualifierDeclCallback)
1259 krisbash 1.3             (*state.qualifierDeclCallback)(yypvt[-0].qualifierDeclaration, state.qualifierDeclCallbackData);
1260                  } break;
1261 mike     1.1 case 7:
1262 krisbash 1.3 # line 202 "mof.y"
1263              {
1264                      if (FinalizeInstance(yypvt[-0].instanceDeclaration) != 0)
1265 mike     1.1             YYABORT;
1266              
1267 krisbash 1.3         AddInstanceDecl(yypvt[-0].instanceDeclaration);
1268 mike     1.1 
1269                      if (state.instanceDeclCallback)
1270 krisbash 1.3             (*state.instanceDeclCallback)(yypvt[-0].instanceDeclaration, state.instanceDeclCallbackData);
1271                  } break;
1272 mike     1.1 case 8:
1273 krisbash 1.3 # line 214 "mof.y"
1274              {
1275                      if (strcmp(yypvt[-3].string, "include") == 0)
1276 mike     1.1         {
1277 krisbash 1.3             if (openIncludeFile(yypvt[-1].string) != 0)
1278 mike     1.1                 YYABORT;
1279                      }
1280 krisbash 1.3         else if (strcmp(yypvt[-3].string, "instancelocale") == 0)
1281                      {
1282                          if (state.pragmaCallback)
1283                              (*state.pragmaCallback)(yypvt[-3].string, yypvt[-1].string, state.pragmaCallbackData);
1284                      }
1285                      else if (strcmp(yypvt[-3].string, "locale") == 0)
1286 mike     1.1         {
1287                          if (state.pragmaCallback)
1288 krisbash 1.3                 (*state.pragmaCallback)(yypvt[-3].string, yypvt[-1].string, state.pragmaCallbackData);
1289 mike     1.1         }
1290 krisbash 1.3         else if (strcmp(yypvt[-3].string, "namespace") == 0)
1291 mike     1.1         {
1292                          if (state.pragmaCallback)
1293 krisbash 1.3                 (*state.pragmaCallback)(yypvt[-3].string, yypvt[-1].string, state.pragmaCallbackData);
1294 mike     1.1         }
1295 krisbash 1.3         else if (state.extensionsEnabled == MI_TRUE && strcmp(yypvt[-3].string, "deleteclass") == 0)
1296 mike     1.1         {
1297 krisbash 1.3             yywarnf(ID_UNKNOWN_PRAGMA, 
1298                              "warning: nonstandard pragma: %s(%s)", yypvt[-5].string, yypvt[-3].string);
1299              
1300 mike     1.1             if (state.pragmaCallback)
1301 krisbash 1.3                 (*state.pragmaCallback)(yypvt[-3].string, yypvt[-1].string, state.pragmaCallbackData);
1302 mike     1.1         }
1303                      else
1304                      {
1305                          yywarnf(ID_UNKNOWN_PRAGMA, 
1306 krisbash 1.3                 "warning: unknown pragma: %s(%s)", yypvt[-3].string, yypvt[-1].string);
1307 mike     1.1 
1308                          if (state.pragmaCallback)
1309 krisbash 1.3                 (*state.pragmaCallback)(yypvt[-3].string, yypvt[-1].string, state.pragmaCallbackData);
1310 mike     1.1         }
1311 krisbash 1.3     } break;
1312 mike     1.1 case 9:
1313 krisbash 1.3 # line 250 "mof.y"
1314              {
1315                      if (state.extensionsEnabled == MI_TRUE && strcmp(yypvt[-5].string, "deleteclass") == 0)
1316                      {
1317                          yywarnf(ID_UNKNOWN_PRAGMA, 
1318                              "warning: nonstandard pragma: %s(%s)", yypvt[-5].string, yypvt[-3].string);
1319              
1320                          if (state.pragmaCallback)
1321                              (*state.pragmaCallback)(yypvt[-5].string, yypvt[-3].string, state.pragmaCallbackData);
1322                      }
1323                      else
1324                      {
1325                          yywarnf(ID_UNKNOWN_PRAGMA, 
1326                              "warning: unknown pragma: %s(%s)", yypvt[-5].string, yypvt[-3].string);
1327              
1328                          if (state.pragmaCallback)
1329                              (*state.pragmaCallback)(yypvt[-5].string, yypvt[-3].string, state.pragmaCallbackData);
1330                      }
1331                  } break;
1332              case 10:
1333              # line 268 "mof.y"
1334 krisbash 1.3 {
1335 mike     1.1         /* Check whether class already exists */
1336 krisbash 1.3         if (FindClassDecl(yypvt[-1].string))
1337 mike     1.1         {
1338 krisbash 1.3             if (state.extensionsEnabled == MI_FALSE)
1339                          {
1340                              yyerrorf(ID_CLASS_ALREADY_DEFINED, 
1341                                  "class already defined: \"%s\"", yypvt[-1].string);
1342                              YYABORT;
1343                          }
1344                          else
1345                              yywarnf(ID_CLASS_ALREADY_DEFINED, 
1346                                  "class already defined: \"%s\"", yypvt[-1].string);
1347 mike     1.1         }
1348              
1349                      yyval.classDeclaration = CALLOC_T(MI_ClassDecl, 1);
1350                      yyval.classDeclaration->flags = MI_FLAG_CLASS;
1351 krisbash 1.3         yyval.classDeclaration->name = yypvt[-1].string;
1352                      yyval.classDeclaration->properties = yypvt[-0].featureList.propertySet.data;
1353                      yyval.classDeclaration->numProperties = yypvt[-0].featureList.propertySet.size;
1354                      yyval.classDeclaration->methods = yypvt[-0].featureList.methodList.data;
1355                      yyval.classDeclaration->numMethods = yypvt[-0].featureList.methodList.size;
1356                  } break;
1357              case 11:
1358              # line 292 "mof.y"
1359              {
1360 mike     1.1         const MI_ClassDecl* scd;
1361              
1362                      /* Check whether class already exists */
1363 krisbash 1.3         if (FindClassDecl(yypvt[-3].string))
1364 mike     1.1         {
1365 krisbash 1.3             if (state.extensionsEnabled == MI_FALSE)
1366                          {
1367                              yyerrorf(ID_CLASS_ALREADY_DEFINED, 
1368                                  "class already defined: \"%s\"", yypvt[-3].string);
1369                              YYABORT;
1370                          }
1371                          else
1372                              yywarnf(ID_CLASS_ALREADY_DEFINED, 
1373                                  "class already defined: \"%s\"", yypvt[-3].string);
1374 mike     1.1         }
1375               
1376                      /* Check whether superclass exists */
1377 krisbash 1.3         scd = FindClassDecl(yypvt[-1].string);
1378 mike     1.1 
1379                      if (!scd)
1380                      {
1381                          yyerrorf(ID_UNDEFINED_SUPERCLASS, 
1382 krisbash 1.3                 "super class of \"%s\" is undefined: \"%s\"", yypvt[-3].string, yypvt[-1].string);
1383 mike     1.1             YYABORT;
1384                      }
1385              
1386                      yyval.classDeclaration = CALLOC_T(MI_ClassDecl, 1);
1387                      yyval.classDeclaration->flags = MI_FLAG_CLASS;
1388 krisbash 1.3         yyval.classDeclaration->name = yypvt[-3].string;
1389                      yyval.classDeclaration->superClass = yypvt[-1].string;
1390 mike     1.1         yyval.classDeclaration->superClassDecl = (MI_ClassDecl*)scd;
1391 krisbash 1.3         yyval.classDeclaration->properties = yypvt[-0].featureList.propertySet.data;
1392                      yyval.classDeclaration->numProperties = yypvt[-0].featureList.propertySet.size;
1393                      yyval.classDeclaration->methods = yypvt[-0].featureList.methodList.data;
1394                      yyval.classDeclaration->numMethods = yypvt[-0].featureList.methodList.size;
1395                  } break;
1396              case 12:
1397              # line 330 "mof.y"
1398              {
1399 mike     1.1         /* Check qualifier scope */
1400 krisbash 1.3         if (CheckScope(MI_FLAG_CLASS, &yypvt[-3].qualifierList) != 0)
1401 mike     1.1             YYABORT;
1402              
1403                      /* Check whether class already exists */
1404 krisbash 1.3         if (FindClassDecl(yypvt[-1].string))
1405 mike     1.1         {
1406 krisbash 1.3             if (state.extensionsEnabled == MI_FALSE)
1407                          {
1408                              yyerrorf(ID_CLASS_ALREADY_DEFINED, 
1409                                  "class already defined: \"%s\"", yypvt[-1].string);
1410                              YYABORT;
1411                          }
1412                          else
1413                              yywarnf(ID_CLASS_ALREADY_DEFINED, 
1414                                  "class already defined: \"%s\"", yypvt[-1].string);
1415 mike     1.1         }
1416              
1417                      yyval.classDeclaration = CALLOC_T(MI_ClassDecl, 1);
1418                      yyval.classDeclaration->flags = MI_FLAG_CLASS;
1419 krisbash 1.3         yyval.classDeclaration->name = yypvt[-1].string;
1420                      yyval.classDeclaration->properties = yypvt[-0].featureList.propertySet.data;
1421                      yyval.classDeclaration->numProperties = yypvt[-0].featureList.propertySet.size;
1422                      yyval.classDeclaration->methods = yypvt[-0].featureList.methodList.data;
1423                      yyval.classDeclaration->numMethods = yypvt[-0].featureList.methodList.size;
1424                      yyval.classDeclaration->qualifiers = yypvt[-3].qualifierList.data;
1425                      yyval.classDeclaration->numQualifiers = yypvt[-3].qualifierList.size;
1426                  } break;
1427              case 13:
1428              # line 360 "mof.y"
1429              {
1430 mike     1.1         const MI_ClassDecl* scd;
1431              
1432                      /* Check qualifier scope */
1433 krisbash 1.3         if (CheckScope(MI_FLAG_CLASS, &yypvt[-5].qualifierList) != 0)
1434 mike     1.1             YYABORT;
1435              
1436                      /* Check whether class already exists */
1437 krisbash 1.3         if (FindClassDecl(yypvt[-3].string))
1438 mike     1.1         {
1439 krisbash 1.3             if (state.extensionsEnabled == MI_FALSE)
1440                          {
1441                              yyerrorf(ID_CLASS_ALREADY_DEFINED, 
1442                                  "class already defined: \"%s\"", yypvt[-3].string);
1443                              YYABORT;
1444                          }
1445                          else
1446                              yywarnf(ID_CLASS_ALREADY_DEFINED, 
1447                                  "class already defined: \"%s\"", yypvt[-3].string);
1448 mike     1.1         }
1449              
1450                      /* Check whether superclass exists */
1451 krisbash 1.3         scd = FindClassDecl(yypvt[-1].string);
1452 mike     1.1 
1453                      if (!scd)
1454                      {
1455                          yyerrorf(ID_UNDEFINED_SUPERCLASS, 
1456 krisbash 1.3                 "super class of \"%s\" is undefined: \"%s\"", yypvt[-3].string, yypvt[-1].string);
1457 mike     1.1             YYABORT;
1458                      }
1459              
1460                      yyval.classDeclaration = CALLOC_T(MI_ClassDecl, 1);
1461                      yyval.classDeclaration->flags = MI_FLAG_CLASS;
1462 krisbash 1.3         yyval.classDeclaration->name = yypvt[-3].string;
1463 mike     1.1         yyval.classDeclaration->superClass = scd->name;
1464                      yyval.classDeclaration->superClassDecl = (MI_ClassDecl*)scd;
1465 krisbash 1.3         yyval.classDeclaration->properties = yypvt[-0].featureList.propertySet.data;
1466                      yyval.classDeclaration->numProperties = yypvt[-0].featureList.propertySet.size;
1467                      yyval.classDeclaration->methods = yypvt[-0].featureList.methodList.data;
1468                      yyval.classDeclaration->numMethods = yypvt[-0].featureList.methodList.size;
1469                      yyval.classDeclaration->qualifiers = yypvt[-5].qualifierList.data;
1470                      yyval.classDeclaration->numQualifiers = yypvt[-5].qualifierList.size;
1471                  } break;
1472 mike     1.1 case 14:
1473 krisbash 1.3 # line 406 "mof.y"
1474              {
1475                      yyval.featureList = yypvt[-2].featureList;
1476                  } break;
1477              case 15:
1478              # line 410 "mof.y"
1479              {
1480 mike     1.1         yyval.featureList.propertySet.data = NULL;
1481                      yyval.featureList.propertySet.size = 0;
1482                      yyval.featureList.methodList.data = NULL;
1483                      yyval.featureList.methodList.size = 0;
1484 krisbash 1.3     } break;
1485              case 16:
1486              # line 419 "mof.y"
1487              {
1488                      if (CheckPropertyValueConstraints(yypvt[-0].property) != 0)
1489 mike     1.1         {
1490                          YYABORT;
1491                      }
1492                      yyval.featureList.propertySet.data = NULL;
1493                      yyval.featureList.propertySet.size = 0;
1494                      yyval.featureList.methodList.data = NULL;
1495                      yyval.featureList.methodList.size = 0;
1496 krisbash 1.3         yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1497                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1498                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1499                  } break;
1500              case 17:
1501              # line 433 "mof.y"
1502              {
1503                      yyval.featureList.propertySet.data = NULL;
1504                      yyval.featureList.propertySet.size = 0;
1505                      yyval.featureList.methodList.data = NULL;
1506                      yyval.featureList.methodList.size = 0;
1507                      yypvt[-0].methodDecl->flags = MI_FLAG_METHOD;
1508                      yypvt[-0].methodDecl->flags |= GetQualFlags(yypvt[-0].methodDecl->qualifiers, yypvt[-0].methodDecl->numQualifiers);
1509                      PtrArray_Append((PtrArray*)&yyval.featureList.methodList, yypvt[-0].methodDecl);
1510                  } break;
1511              case 18:
1512              # line 443 "mof.y"
1513              {
1514                      yyval.featureList.propertySet.data = NULL;
1515                      yyval.featureList.propertySet.size = 0;
1516                      yyval.featureList.methodList.data = NULL;
1517 krisbash 1.3         yyval.featureList.methodList.size = 0;
1518                      yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1519                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1520                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1521                  } break;
1522              case 19:
1523              # line 453 "mof.y"
1524              {
1525                      yyval.featureList.propertySet.data = NULL;
1526                      yyval.featureList.propertySet.size = 0;
1527                      yyval.featureList.methodList.data = NULL;
1528                      yyval.featureList.methodList.size = 0;
1529                      yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1530                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1531                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1532                  } break;
1533              case 20:
1534              # line 463 "mof.y"
1535              {
1536 mike     1.1         yyval.featureList.propertySet.data = NULL;
1537                      yyval.featureList.propertySet.size = 0;
1538                      yyval.featureList.methodList.data = NULL;
1539                      yyval.featureList.methodList.size = 0;
1540 krisbash 1.3         yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1541                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1542                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1543                  } break;
1544              case 21:
1545              # line 473 "mof.y"
1546              {
1547 mike     1.1         yyval.featureList.propertySet.data = NULL;
1548                      yyval.featureList.propertySet.size = 0;
1549                      yyval.featureList.methodList.data = NULL;
1550                      yyval.featureList.methodList.size = 0;
1551 krisbash 1.3         yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1552                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1553                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1554                  } break;
1555              case 22:
1556              # line 483 "mof.y"
1557              {
1558                      if (CheckPropertyValueConstraints(yypvt[-0].property) != 0)
1559 mike     1.1         {
1560                          YYABORT;
1561                      }
1562              
1563 krisbash 1.3         if (FindProperty(&yypvt[-1].featureList.propertySet, yypvt[-0].property->name))
1564 mike     1.1         {
1565                          yyerrorf(ID_CLASS_FEATURE_ALREADY_DEFINED, 
1566 krisbash 1.3                 "class feature already defined: \"%s\"", yypvt[-0].property->name);
1567 mike     1.1             YYABORT;
1568                      }
1569              
1570 krisbash 1.3         yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1571                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1572                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1573                  } break;
1574              case 23:
1575              # line 501 "mof.y"
1576              {
1577                      if (FindMethod(&yypvt[-1].featureList.methodList, yypvt[-0].methodDecl->name))
1578 mike     1.1         {
1579                          yyerrorf(ID_CLASS_FEATURE_ALREADY_DEFINED, 
1580 krisbash 1.3                 "class feature already defined: \"%s\"", yypvt[-0].methodDecl->name);
1581 mike     1.1             YYABORT;
1582                      }
1583              
1584 krisbash 1.3         yypvt[-0].methodDecl->flags = MI_FLAG_METHOD;
1585                      yypvt[-0].methodDecl->flags |= GetQualFlags(yypvt[-0].methodDecl->qualifiers, yypvt[-0].methodDecl->numQualifiers);
1586                      PtrArray_Append((PtrArray*)&yyval.featureList.methodList, yypvt[-0].methodDecl);
1587                  } break;
1588              case 24:
1589              # line 514 "mof.y"
1590              {
1591                      if (FindProperty(&yypvt[-1].featureList.propertySet, yypvt[-0].property->name))
1592 mike     1.1         {
1593                          yyerrorf(ID_CLASS_FEATURE_ALREADY_DEFINED, 
1594 krisbash 1.3                 "class feature already defined: \"%s\"", yypvt[-0].property->name);
1595                          YYABORT;
1596                      }
1597              
1598                      yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1599                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1600                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1601                  } break;
1602              case 25:
1603              # line 527 "mof.y"
1604              {
1605                      if (FindProperty(&yypvt[-1].featureList.propertySet, yypvt[-0].property->name))
1606                      {
1607                          yyerrorf(ID_CLASS_FEATURE_ALREADY_DEFINED,
1608                              "class feature already defined: \"%s\"", yypvt[-0].property->name);
1609                          YYABORT;
1610                      }
1611                      yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1612                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1613                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1614                  } break;
1615 krisbash 1.3 case 26:
1616              # line 539 "mof.y"
1617              {
1618                      if (FindProperty(&yypvt[-1].featureList.propertySet, yypvt[-0].property->name))
1619                      {
1620                          yyerrorf(ID_CLASS_FEATURE_ALREADY_DEFINED,
1621                              "class feature already defined: \"%s\"", yypvt[-0].property->name);
1622 mike     1.1             YYABORT;
1623                      }
1624              
1625 krisbash 1.3         yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1626                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1627                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1628                  } break;
1629              case 27:
1630              # line 552 "mof.y"
1631              {
1632                      if (FindProperty(&yypvt[-1].featureList.propertySet, yypvt[-0].property->name))
1633                      {
1634                          yyerrorf(ID_CLASS_FEATURE_ALREADY_DEFINED,
1635                              "class feature already defined: \"%s\"", yypvt[-0].property->name);
1636                          YYABORT;
1637                      }
1638              
1639                      yypvt[-0].property->flags = MI_FLAG_PROPERTY;
1640                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
1641                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
1642                  } break;
1643              case 28:
1644              # line 567 "mof.y"
1645              {
1646 krisbash 1.3         yyval.qualifierList = yypvt[-1].qualifierList;
1647                  } break;
1648              case 29:
1649              # line 573 "mof.y"
1650              {
1651 mike     1.1         yyval.qualifierList.data = NULL;
1652                      yyval.qualifierList.size = 0;
1653 krisbash 1.3         PtrArray_Append((PtrArray*)&yyval.qualifierList, yypvt[-0].qualifier);
1654                  } break;
1655              case 30:
1656              # line 579 "mof.y"
1657              {
1658                      if (FindQualifier(&yypvt[-2].qualifierList, yypvt[-0].qualifier->name))
1659 mike     1.1         {
1660                          yyerrorf(ID_DUPLICATE_QUALIFIER, 
1661 krisbash 1.3                 "duplicate qualifier: \"%s\"", yypvt[-0].qualifier->name);
1662 mike     1.1             YYABORT;
1663                      }
1664              
1665 krisbash 1.3         PtrArray_Append((PtrArray*)&yyval.qualifierList, yypvt[-0].qualifier);
1666                  } break;
1667              case 31:
1668              # line 592 "mof.y"
1669              {
1670 mike     1.1         MI_Qualifier* q;
1671                      const MI_QualifierDecl* qd;
1672              
1673 krisbash 1.3         qd = FindQualifierDeclaration(yypvt[-0].string);
1674 mike     1.1 
1675                      if (!qd)
1676                      {
1677 krisbash 1.3             yyerrorf(ID_UNDEFINED_QUALIFIER, "undefined qualifier: \"%s\"", yypvt[-0].string);
1678 mike     1.1             YYABORT;
1679                      }
1680              
1681                      if (qd->type != MI_BOOLEAN)
1682                      {
1683                          yyerrorf(ID_MISSING_QUALIFIER_INITIALIZER, 
1684 krisbash 1.3                 "qualifier is missing initializer: \"%s\"", yypvt[-0].string);
1685 mike     1.1             YYABORT;
1686                      }
1687                      
1688                      
1689                      q = CALLOC_T(MI_Qualifier, 1);
1690                      q->name = qd->name; /* use casing of qualifier declaration name */
1691                      q->type = qd->type;
1692                      q->flavor = qd->flavor;
1693                      q->value = NewTrueValue();
1694                      yyval.qualifier = q;
1695 krisbash 1.3     } break;
1696              case 32:
1697              # line 620 "mof.y"
1698              {
1699 mike     1.1         MI_Qualifier* q;
1700                      const MI_QualifierDecl* qd;
1701                      void* value;
1702              
1703 krisbash 1.3         qd = FindQualifierDeclaration(yypvt[-1].string);
1704 mike     1.1 
1705                      if (!qd)
1706                      {
1707 krisbash 1.3             yyerrorf(ID_UNDEFINED_QUALIFIER, "undefined qualifier: \"%s\"", yypvt[-1].string);
1708 mike     1.1             YYABORT;
1709                      }
1710              
1711 krisbash 1.3         if (InitializerToValue(&yypvt[-0].initializer, qd->type, &value) != 0)
1712 mike     1.1         {
1713                          yyerrorf(ID_INVALID_QUALIFIER_INITIALIZER, 
1714 krisbash 1.3                 "invalid initializer for qualifer: \"%s\"", yypvt[-1].string);
1715 mike     1.1             YYABORT;
1716                      }
1717                      
1718                      q = CALLOC_T(MI_Qualifier, 1);
1719                      q->name = qd->name; /* use casing of qualifier declaration name */
1720                      q->type = qd->type;
1721                      q->flavor = qd->flavor;
1722                      q->value = value;
1723                      yyval.qualifier = q;
1724 krisbash 1.3     } break;
1725              case 33:
1726              # line 648 "mof.y"
1727              {
1728 mike     1.1         MI_Qualifier* q;
1729                      const MI_QualifierDecl* qd;
1730              
1731 krisbash 1.3         qd = FindQualifierDeclaration(yypvt[-2].string);
1732 mike     1.1 
1733                      if (!qd)
1734                      {
1735 krisbash 1.3             yyerrorf(ID_UNDEFINED_QUALIFIER, "undefined qualifier: \"%s\"", yypvt[-2].string);
1736 mike     1.1             YYABORT;
1737                      }
1738              
1739                      if (qd->type != MI_BOOLEAN)
1740                      {
1741                          yyerrorf(ID_MISSING_QUALIFIER_INITIALIZER, 
1742 krisbash 1.3                 "qualifier is missing initializer: \"%s\"", yypvt[-2].string);
1743 mike     1.1             YYABORT;
1744                      }
1745                      
1746                      q = CALLOC_T(MI_Qualifier, 1);
1747                      q->name = qd->name; /* use casing of qualifier declaration name */
1748                      q->type = qd->type;
1749 krisbash 1.3         q->flavor = PropagateFlavors(yypvt[-0].flags, qd->flavor);
1750 mike     1.1         q->value = NewTrueValue();
1751                      yyval.qualifier = q;
1752 krisbash 1.3     } break;
1753              case 34:
1754              # line 675 "mof.y"
1755              {
1756 mike     1.1         MI_Qualifier* q;
1757                      const MI_QualifierDecl* qd;
1758                      void* value;
1759              
1760 krisbash 1.3         qd = FindQualifierDeclaration(yypvt[-3].string);
1761 mike     1.1 
1762                      if (!qd)
1763                      {
1764 krisbash 1.3             yyerrorf(ID_UNDEFINED_QUALIFIER, "undefined qualifier: \"%s\"", yypvt[-3].string);
1765 mike     1.1             YYABORT;
1766                      }
1767              
1768 krisbash 1.3         if (InitializerToValue(&yypvt[-2].initializer, qd->type, &value) != 0)
1769 mike     1.1         {
1770                          yyerrorf(ID_INVALID_QUALIFIER_INITIALIZER, 
1771 krisbash 1.3                 "invalid initializer for qualifer: \"%s\"", yypvt[-3].string);
1772 mike     1.1             YYABORT;
1773                      }
1774                      
1775                      q = CALLOC_T(MI_Qualifier, 1);
1776                      q->name = qd->name; /* use casing of qualifier declaration name */
1777                      q->type = qd->type;
1778                      q->value = value;
1779 krisbash 1.3         q->flavor = PropagateFlavors(yypvt[-0].flags, qd->flavor);
1780 mike     1.1         yyval.qualifier = q;
1781 krisbash 1.3     } break;
1782              case 35:
1783              # line 705 "mof.y"
1784              {
1785 mike     1.1         memset(&yyval.initializer, 0, sizeof(yyval.initializer));
1786                      yyval.initializer.data = CALLOC_T(MOF_ConstantValue, 1);
1787 krisbash 1.3         yyval.initializer.data[0] = yypvt[-1].constantValue;
1788 mike     1.1         yyval.initializer.size = 1;
1789 krisbash 1.3     } break;
1790              case 36:
1791              # line 712 "mof.y"
1792              {
1793                      yyval.initializer = yypvt[-0].initializer;
1794                  } break;
1795              case 37:
1796              # line 718 "mof.y"
1797              {
1798                      yyval.flags = yypvt[-0].flags;
1799                  } break;
1800              case 38:
1801              # line 722 "mof.y"
1802              {
1803                      yyval.flags |= yypvt[-0].flags;
1804                  } break;
1805              case 39:
1806              # line 728 "mof.y"
1807              {
1808                      yyval.flags = yypvt[-0].flags;
1809                  } break;
1810 krisbash 1.3 case 40:
1811              # line 732 "mof.y"
1812              {
1813                      yyval.flags |= yypvt[-0].flags;
1814                  } break;
1815              case 41:
1816              # line 738 "mof.y"
1817              {
1818 mike     1.1         yyval.flags = MI_FLAG_ENABLEOVERRIDE;
1819 krisbash 1.3     } break;
1820              case 42:
1821              # line 742 "mof.y"
1822              {
1823 mike     1.1         yyval.flags = MI_FLAG_DISABLEOVERRIDE;
1824 krisbash 1.3     } break;
1825              case 43:
1826              # line 746 "mof.y"
1827              {
1828 mike     1.1         yyval.flags = MI_FLAG_RESTRICTED;
1829 krisbash 1.3     } break;
1830              case 44:
1831              # line 750 "mof.y"
1832              {
1833 mike     1.1         yyval.flags = MI_FLAG_TOSUBCLASS;
1834 krisbash 1.3     } break;
1835              case 45:
1836              # line 754 "mof.y"
1837              {
1838                      yyval.flags = MI_FLAG_TOINSTANCE;
1839                      if (state.extensionsEnabled == MI_FALSE)
1840                      {
1841                          yyerrorf(ID_UNSUPPORTED, "Unsupported flavor: ToInstance");
1842                          YYABORT;
1843                      }
1844                  } break;
1845              case 46:
1846              # line 763 "mof.y"
1847              {
1848 mike     1.1         yyval.flags = MI_FLAG_TRANSLATABLE;
1849 krisbash 1.3     } break;
1850              case 47:
1851              # line 769 "mof.y"
1852              {
1853 mike     1.1         yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1854 krisbash 1.3         yyval.property->name = yypvt[-1].string;
1855                      yyval.property->type = yypvt[-2].type;
1856                  } break;
1857              case 48:
1858              # line 775 "mof.y"
1859              {
1860 mike     1.1         /* Check qualifier scope */
1861 krisbash 1.3         if (CheckScope(MI_FLAG_PROPERTY, &yypvt[-3].qualifierList) != 0)
1862 mike     1.1             YYABORT;
1863              
1864                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1865 krisbash 1.3         yyval.property->name = yypvt[-1].string;
1866                      yyval.property->type = yypvt[-2].type;
1867                      yyval.property->qualifiers = yypvt[-3].qualifierList.data;
1868                      yyval.property->numQualifiers = yypvt[-3].qualifierList.size;
1869                  } break;
1870              case 49:
1871              # line 787 "mof.y"
1872              {
1873 mike     1.1         yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1874 krisbash 1.3         yyval.property->name = yypvt[-2].string;
1875                      yyval.property->type = ARRAYOF(yypvt[-3].type);
1876                      yyval.property->subscript = (MI_Uint32)yypvt[-1].integer;
1877                  } break;
1878              case 50:
1879              # line 794 "mof.y"
1880              {
1881 mike     1.1         /* Check qualifier scope */
1882 krisbash 1.3         if (CheckScope(MI_FLAG_PROPERTY, &yypvt[-4].qualifierList) != 0)
1883 mike     1.1             YYABORT;
1884              
1885                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1886 krisbash 1.3         yyval.property->name = yypvt[-2].string;
1887                      yyval.property->type = ARRAYOF(yypvt[-3].type);
1888                      yyval.property->qualifiers = yypvt[-4].qualifierList.data;
1889                      yyval.property->numQualifiers = yypvt[-4].qualifierList.size;
1890                      yyval.property->subscript = (MI_Uint32)yypvt[-1].integer;
1891                  } break;
1892              case 51:
1893              # line 807 "mof.y"
1894              {
1895 mike     1.1         void* value;
1896              
1897 krisbash 1.3         if (InitializerToValue(&yypvt[-1].initializer, yypvt[-4].type, &value) != 0)
1898 mike     1.1         {
1899                          yyerrorf(ID_INVALID_INITIALIZER, "invalid initializer");
1900                          YYABORT;
1901                      }
1902              
1903                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1904 krisbash 1.3         yyval.property->name = yypvt[-3].string;
1905                      yyval.property->type = yypvt[-4].type;
1906 mike     1.1         yyval.property->value = value;
1907 krisbash 1.3     } break;
1908              case 52:
1909              # line 822 "mof.y"
1910              {
1911 mike     1.1         void* value;
1912              
1913                      /* Check qualifier scope */
1914 krisbash 1.3         if (CheckScope(MI_FLAG_PROPERTY, &yypvt[-5].qualifierList) != 0)
1915 mike     1.1             YYABORT;
1916              
1917 krisbash 1.3         if (InitializerToValue(&yypvt[-1].initializer, yypvt[-4].type, &value) != 0)
1918 mike     1.1         {
1919                          yyerrorf(ID_INVALID_INITIALIZER, "invalid initializer");
1920                          YYABORT;
1921                      }
1922              
1923                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1924 krisbash 1.3         yyval.property->name = yypvt[-3].string;
1925                      yyval.property->type = yypvt[-4].type;
1926                      yyval.property->qualifiers = yypvt[-5].qualifierList.data;
1927                      yyval.property->numQualifiers = yypvt[-5].qualifierList.size;
1928 mike     1.1         yyval.property->value = value;
1929 krisbash 1.3     } break;
1930              case 53:
1931              # line 843 "mof.y"
1932              {
1933 mike     1.1         void* value;
1934              
1935 krisbash 1.3         if (InitializerToValue(&yypvt[-1].initializer, ARRAYOF(yypvt[-5].type), &value) != 0)
1936 mike     1.1         {
1937                          yyerrorf(ID_INVALID_INITIALIZER, "invalid initializer");
1938                          YYABORT;
1939                      }
1940              
1941                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1942 krisbash 1.3         yyval.property->name = yypvt[-4].string;
1943                      yyval.property->type = ARRAYOF(yypvt[-5].type);
1944                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
1945 mike     1.1         yyval.property->value = value;
1946 krisbash 1.3     } break;
1947              case 54:
1948              # line 859 "mof.y"
1949              {
1950 mike     1.1         void* value;
1951              
1952                      /* Check qualifier scope */
1953 krisbash 1.3         if (CheckScope(MI_FLAG_PROPERTY, &yypvt[-6].qualifierList) != 0)
1954 mike     1.1             YYABORT;
1955              
1956 krisbash 1.3         if (InitializerToValue(&yypvt[-1].initializer, ARRAYOF(yypvt[-5].type), &value) != 0)
1957 mike     1.1         {
1958                          yyerrorf(ID_INVALID_INITIALIZER, "invalid initializer");
1959                          YYABORT;
1960                      }
1961              
1962                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1963 krisbash 1.3         yyval.property->name = yypvt[-4].string;
1964                      yyval.property->type = ARRAYOF(yypvt[-5].type);
1965                      yyval.property->qualifiers = yypvt[-6].qualifierList.data;
1966                      yyval.property->numQualifiers = yypvt[-6].qualifierList.size;
1967                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
1968 mike     1.1         yyval.property->value = value;
1969 krisbash 1.3     } break;
1970              case 55:
1971              # line 883 "mof.y"
1972              {
1973                      const MI_ClassDecl* cd;
1974              
1975                      /* Verify that class exists */
1976                      cd = FindClassDecl(yypvt[-2].string);
1977                      if (!cd)
1978                      {
1979                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-2].string);
1980                          YYABORT;
1981                      }
1982              
1983                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
1984                      yyval.property->type = MI_INSTANCE;
1985                      yyval.property->name = yypvt[-1].string;
1986                      yyval.property->className = cd->name;
1987                  } break;
1988              case 56:
1989              # line 900 "mof.y"
1990 krisbash 1.3 {
1991                      const MI_ClassDecl* cd;
1992              
1993                      /* Verify that class exists */
1994                      cd = FindClassDecl(yypvt[-2].string);
1995                      if (!cd)
1996                      {
1997                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-2].string);
1998                          YYABORT;
1999                      }
2000              
2001                      /* Check qualifier scope */
2002                      if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-3].qualifierList) != 0)
2003                          YYABORT;
2004              
2005                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2006                      yyval.property->type = MI_INSTANCE;
2007                      yyval.property->name = yypvt[-1].string;
2008                      yyval.property->className = cd->name;
2009                      yyval.property->qualifiers = yypvt[-3].qualifierList.data;
2010                      yyval.property->numQualifiers = yypvt[-3].qualifierList.size;
2011 krisbash 1.3     } break;
2012              case 57:
2013              # line 923 "mof.y"
2014              {
2015                      const MI_ClassDecl* cd;
2016              
2017                      /* Verify that class exists */
2018                      cd = FindClassDecl(yypvt[-3].string);
2019                      if (!cd)
2020                      {
2021                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-3].string);
2022                          YYABORT;
2023                      }
2024              
2025                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2026                      yyval.property->type = MI_INSTANCEA;
2027                      yyval.property->name = yypvt[-2].string;
2028                      yyval.property->className = cd->name;
2029                      yyval.property->subscript = (MI_Uint32)yypvt[-1].integer;
2030                  } break;
2031              case 58:
2032 krisbash 1.3 # line 941 "mof.y"
2033              {
2034                      const MI_ClassDecl* cd;
2035              
2036                      /* Verify that class exists */
2037                      cd = FindClassDecl(yypvt[-3].string);
2038                      if (!cd)
2039                      {
2040                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-3].string);
2041                          YYABORT;
2042                      }
2043              
2044                      /* Check qualifier scope */
2045                      if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-4].qualifierList) != 0)
2046                          YYABORT;
2047              
2048                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2049                      yyval.property->type = MI_INSTANCEA;
2050                      yyval.property->name = yypvt[-2].string;
2051                      yyval.property->className = cd->name;
2052                      yyval.property->subscript = (MI_Uint32)yypvt[-1].integer;
2053 krisbash 1.3         yyval.property->qualifiers = yypvt[-4].qualifierList.data;
2054                      yyval.property->numQualifiers = yypvt[-4].qualifierList.size;
2055                  } break;
2056              case 59:
2057              # line 965 "mof.y"
2058              {
2059                      const MI_ClassDecl* cd;
2060              
2061                      /* Verify that class exists */
2062                      cd = FindClassDecl(yypvt[-4].string);
2063                      if (!cd)
2064                      {
2065                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-4].string);
2066                          YYABORT;
2067                      }
2068              
2069                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2070                      yyval.property->type = MI_INSTANCE;
2071                      yyval.property->name = yypvt[-3].string;
2072                      yyval.property->className = cd->name;
2073                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2074 krisbash 1.3         /* TODO: use initializer */
2075                  } break;
2076              case 60:
2077              # line 984 "mof.y"
2078              {
2079                      const MI_ClassDecl* cd;
2080              
2081                      /* Verify that class exists */
2082                      cd = FindClassDecl(yypvt[-4].string);
2083                      if (!cd)
2084                      {
2085                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-4].string);
2086                          YYABORT;
2087                      }
2088              
2089                      /* Check qualifier scope */
2090                      if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-5].qualifierList) != 0)
2091                          YYABORT;
2092              
2093                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2094                      yyval.property->type = MI_INSTANCE;
2095 krisbash 1.3         yyval.property->name = yypvt[-3].string;
2096                      yyval.property->className = cd->name;
2097                      yyval.property->qualifiers = yypvt[-5].qualifierList.data;
2098                      yyval.property->numQualifiers = yypvt[-5].qualifierList.size;
2099                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2100                      /* TODO: use initializer */
2101                  } break;
2102              case 61:
2103              # line 1009 "mof.y"
2104              {
2105                      const MI_ClassDecl* cd;
2106              
2107                      /* Verify that class exists */
2108                      cd = FindClassDecl(yypvt[-5].string);
2109                      if (!cd)
2110                      {
2111                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-5].string);
2112                          YYABORT;
2113                      }
2114              
2115                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2116 krisbash 1.3         yyval.property->type = MI_INSTANCEA;
2117                      yyval.property->name = yypvt[-4].string;
2118                      yyval.property->className = cd->name;
2119                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
2120                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2121                      /* TODO: use initializer */
2122                  } break;
2123              case 62:
2124              # line 1029 "mof.y"
2125              {
2126                      const MI_ClassDecl* cd;
2127              
2128                      /* Verify that class exists */
2129                      cd = FindClassDecl(yypvt[-5].string);
2130                      if (!cd)
2131                      {
2132                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-5].string);
2133                          YYABORT;
2134                      }
2135              
2136                      /* Check qualifier scope */
2137 krisbash 1.3         if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-6].qualifierList) != 0)
2138                          YYABORT;
2139              
2140                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2141                      yyval.property->type = MI_INSTANCEA;
2142                      yyval.property->name = yypvt[-4].string;
2143                      yyval.property->className = cd->name;
2144                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
2145                      yyval.property->qualifiers = yypvt[-6].qualifierList.data;
2146                      yyval.property->numQualifiers = yypvt[-6].qualifierList.size;
2147                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2148                      /* TODO: use initializer */
2149                  } break;
2150              case 63:
2151              # line 1057 "mof.y"
2152              {
2153                      if (state.extensionsEnabled == MI_FALSE)
2154                          yywarnf(ID_UNSUPPORTED, "warning: OBJECT keyword is not supported");
2155                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2156                      yyval.property->type = MI_INSTANCE;
2157                      yyval.property->name = yypvt[-1].string;
2158 krisbash 1.3         yyval.property->className = "?";
2159                  } break;
2160              case 64:
2161              # line 1066 "mof.y"
2162              {
2163                      if (state.extensionsEnabled == MI_FALSE)
2164                          yywarnf(ID_UNSUPPORTED, "warning: OBJECT keyword is not supported");
2165                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2166                      yyval.property->type = MI_INSTANCE;
2167                      yyval.property->name = yypvt[-1].string;
2168                      yyval.property->className = "?";
2169                      yyval.property->qualifiers = yypvt[-3].qualifierList.data;
2170                      yyval.property->numQualifiers = yypvt[-3].qualifierList.size;
2171                  } break;
2172              case 65:
2173              # line 1077 "mof.y"
2174              {
2175                      if (state.extensionsEnabled == MI_FALSE)
2176                          yywarnf(ID_UNSUPPORTED, "warning: OBJECT keyword is not supported");
2177                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2178                      yyval.property->type = MI_INSTANCEA;
2179 krisbash 1.3         yyval.property->name = yypvt[-2].string;
2180                      yyval.property->className = "?";
2181                      yyval.property->subscript = 0;
2182                  } break;
2183              case 66:
2184              # line 1087 "mof.y"
2185              {
2186                      if (state.extensionsEnabled == MI_FALSE)
2187                          yywarnf(ID_UNSUPPORTED, "warning: OBJECT keyword is not supported");
2188                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2189                      yyval.property->type = MI_INSTANCEA;
2190                      yyval.property->name = yypvt[-2].string;
2191                      yyval.property->className = "?";
2192                      yyval.property->subscript = 0;
2193                      yyval.property->qualifiers = yypvt[-4].qualifierList.data;
2194                      yyval.property->numQualifiers = yypvt[-4].qualifierList.size;
2195                  } break;
2196              case 67:
2197              # line 1099 "mof.y"
2198              {
2199                      if (state.extensionsEnabled == MI_FALSE)
2200 krisbash 1.3             yywarnf(ID_UNSUPPORTED, "warning: OBJECT keyword is not supported");
2201                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2202                      yyval.property->type = MI_INSTANCE;
2203                      yyval.property->name = yypvt[-3].string;
2204                      yyval.property->className = "?";
2205                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2206                      /* TODO: use initializer */
2207                  } break;
2208              case 68:
2209              # line 1110 "mof.y"
2210              {
2211                      if (state.extensionsEnabled == MI_FALSE)
2212                          yywarnf(ID_UNSUPPORTED, "warning: OBJECT keyword is not supported");
2213                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2214                      yyval.property->type = MI_INSTANCE;
2215                      yyval.property->name = yypvt[-3].string;
2216                      yyval.property->className = "?";
2217                      yyval.property->qualifiers = yypvt[-5].qualifierList.data;
2218                      yyval.property->numQualifiers = yypvt[-5].qualifierList.size;
2219                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2220                      /* TODO: use initializer */
2221 krisbash 1.3     } break;
2222              case 69:
2223              # line 1123 "mof.y"
2224              {
2225                      if (state.extensionsEnabled == MI_FALSE)
2226                          yywarnf(ID_UNSUPPORTED, "warning: OBJECT keyword is not supported");
2227                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2228                      yyval.property->type = MI_INSTANCEA;
2229                      yyval.property->name = yypvt[-4].string;
2230                      yyval.property->className = "?";
2231                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
2232                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2233                      /* TODO: use initializer */
2234                  } break;
2235              case 70:
2236              # line 1135 "mof.y"
2237              {
2238                      if (state.extensionsEnabled == MI_FALSE)
2239                          yywarnf(ID_UNSUPPORTED, "warning: OBJECT keyword is not supported");
2240                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2241                      yyval.property->type = MI_INSTANCEA;
2242 krisbash 1.3         yyval.property->name = yypvt[-4].string;
2243                      yyval.property->className = "?";
2244                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
2245                      yyval.property->qualifiers = yypvt[-6].qualifierList.data;
2246                      yyval.property->numQualifiers = yypvt[-6].qualifierList.size;
2247                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2248                      /* TODO: use initializer */
2249                  } break;
2250              case 71:
2251              # line 1151 "mof.y"
2252              {
2253 mike     1.1         const MI_ClassDecl* cd;
2254              
2255                      /* Verify that class exists */
2256 krisbash 1.3         cd = FindClassDecl(yypvt[-3].string);
2257 mike     1.1         if (!cd)
2258                      {
2259 krisbash 1.3             yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-3].string);
2260 mike     1.1             YYABORT;
2261                      }
2262              
2263                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2264                      yyval.property->type = MI_REFERENCE;
2265 krisbash 1.3         yyval.property->name = yypvt[-1].string;
2266 mike     1.1         yyval.property->className = cd->name;
2267 krisbash 1.3     } break;
2268              case 72:
2269              # line 1168 "mof.y"
2270              {
2271 mike     1.1         const MI_ClassDecl* cd;
2272              
2273                      /* Verify that class exists */
2274 krisbash 1.3         cd = FindClassDecl(yypvt[-3].string);
2275 mike     1.1         if (!cd)
2276                      {
2277 krisbash 1.3             yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-3].string);
2278 mike     1.1             YYABORT;
2279                      }
2280              
2281                      /* Check qualifier scope */
2282 krisbash 1.3         if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-4].qualifierList) != 0)
2283 mike     1.1             YYABORT;
2284              
2285                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2286                      yyval.property->type = MI_REFERENCE;
2287 krisbash 1.3         yyval.property->name = yypvt[-1].string;
2288 mike     1.1         yyval.property->className = cd->name;
2289 krisbash 1.3         yyval.property->qualifiers = yypvt[-4].qualifierList.data;
2290                      yyval.property->numQualifiers = yypvt[-4].qualifierList.size;
2291                  } break;
2292              case 73:
2293              # line 1191 "mof.y"
2294              {
2295 mike     1.1         const MI_ClassDecl* cd;
2296              
2297                      /* Verify that class exists */
2298 krisbash 1.3         cd = FindClassDecl(yypvt[-5].string);
2299 mike     1.1         if (!cd)
2300                      {
2301 krisbash 1.3             yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-5].string);
2302 mike     1.1             YYABORT;
2303                      }
2304              
2305                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2306                      yyval.property->type = MI_REFERENCE;
2307 krisbash 1.3         yyval.property->name = yypvt[-3].string;
2308 mike     1.1         yyval.property->className = cd->name;
2309                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2310                      /* [TODO: use initializer */
2311 krisbash 1.3     } break;
2312              case 74:
2313              # line 1210 "mof.y"
2314              {
2315 mike     1.1         const MI_ClassDecl* cd;
2316              
2317                      /* Verify that class exists */
2318 krisbash 1.3         cd = FindClassDecl(yypvt[-5].string);
2319 mike     1.1         if (!cd)
2320                      {
2321 krisbash 1.3             yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-5].string);
2322 mike     1.1             YYABORT;
2323                      }
2324              
2325                      /* Check qualifier scope */
2326 krisbash 1.3         if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-6].qualifierList) != 0)
2327 mike     1.1             YYABORT;
2328              
2329                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2330                      yyval.property->type = MI_REFERENCE;
2331 krisbash 1.3         yyval.property->name = yypvt[-3].string;
2332 mike     1.1         yyval.property->className = cd->name;
2333 krisbash 1.3         yyval.property->qualifiers = yypvt[-6].qualifierList.data;
2334                      yyval.property->numQualifiers = yypvt[-6].qualifierList.size;
2335 mike     1.1         yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2336                      /* [TODO: use initializer */
2337 krisbash 1.3     } break;
2338              case 75:
2339              # line 1235 "mof.y"
2340              {
2341                      const MI_ClassDecl* cd;
2342              
2343                      /* Verify that class exists */
2344                      cd = FindClassDecl(yypvt[-4].string);
2345                      if (!cd)
2346                      {
2347                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-4].string);
2348                          YYABORT;
2349                      }
2350              
2351                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2352                      yyval.property->type = MI_REFERENCEA;
2353                      yyval.property->name = yypvt[-2].string;
2354                      yyval.property->className = cd->name;
2355                      yyval.property->subscript = (MI_Uint32)yypvt[-1].integer;
2356                  } break;
2357              case 76:
2358 krisbash 1.3 # line 1253 "mof.y"
2359              {
2360                      const MI_ClassDecl* cd;
2361              
2362                      /* Verify that class exists */
2363                      cd = FindClassDecl(yypvt[-4].string);
2364                      if (!cd)
2365                      {
2366                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-4].string);
2367                          YYABORT;
2368                      }
2369              
2370                      /* Check qualifier scope */
2371                      if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-5].qualifierList) != 0)
2372                          YYABORT;
2373              
2374                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2375                      yyval.property->type = MI_REFERENCEA;
2376                      yyval.property->name = yypvt[-2].string;
2377                      yyval.property->className = cd->name;
2378                      yyval.property->subscript = (MI_Uint32)yypvt[-1].integer;
2379 krisbash 1.3         yyval.property->qualifiers = yypvt[-5].qualifierList.data;
2380                      yyval.property->numQualifiers = yypvt[-5].qualifierList.size;
2381                  } break;
2382              case 77:
2383              # line 1277 "mof.y"
2384              {
2385                      const MI_ClassDecl* cd;
2386              
2387                      /* Verify that class exists */
2388                      cd = FindClassDecl(yypvt[-6].string);
2389                      if (!cd)
2390                      {
2391                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-6].string);
2392                          YYABORT;
2393                      }
2394              
2395                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2396                      yyval.property->type = MI_REFERENCEA;
2397                      yyval.property->name = yypvt[-4].string;
2398                      yyval.property->className = cd->name;
2399                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
2400 krisbash 1.3         yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2401                      /* TODO: use initializer */
2402                  } break;
2403              case 78:
2404              # line 1297 "mof.y"
2405              {
2406                      const MI_ClassDecl* cd;
2407              
2408                      /* Verify that class exists */
2409                      cd = FindClassDecl(yypvt[-6].string);
2410                      if (!cd)
2411                      {
2412                          yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-6].string);
2413                          YYABORT;
2414                      }
2415              
2416                      /* Check qualifier scope */
2417                      if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-7].qualifierList) != 0)
2418                          YYABORT;
2419              
2420                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2421 krisbash 1.3         yyval.property->type = MI_REFERENCEA;
2422                      yyval.property->name = yypvt[-4].string;
2423                      yyval.property->className = cd->name;
2424                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
2425                      yyval.property->qualifiers = yypvt[-7].qualifierList.data;
2426                      yyval.property->numQualifiers = yypvt[-7].qualifierList.size;
2427                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2428                      /* TODO: use initializer */
2429                  } break;
2430              case 79:
2431              # line 1325 "mof.y"
2432              {
2433                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2434                      yyval.property->type = MI_REFERENCE;
2435                      yyval.property->name = yypvt[-1].string;
2436                      yyval.property->className = "?";
2437                  } break;
2438              case 80:
2439              # line 1332 "mof.y"
2440              {
2441                      /* Check qualifier scope */
2442 krisbash 1.3         if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-4].qualifierList) != 0)
2443                          YYABORT;
2444              
2445                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2446                      yyval.property->type = MI_REFERENCE;
2447                      yyval.property->name = yypvt[-1].string;
2448                      yyval.property->className = "?";
2449                      yyval.property->qualifiers = yypvt[-4].qualifierList.data;
2450                      yyval.property->numQualifiers = yypvt[-4].qualifierList.size;
2451                  } break;
2452              case 81:
2453              # line 1345 "mof.y"
2454              {
2455                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2456                      yyval.property->type = MI_REFERENCEA;
2457                      yyval.property->name = yypvt[-2].string;
2458                      yyval.property->className = "?";
2459                      yyval.property->subscript = (MI_Uint32)yypvt[-1].integer;
2460                  } break;
2461              case 82:
2462              # line 1353 "mof.y"
2463 krisbash 1.3 {
2464                      /* Check qualifier scope */
2465                      if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-5].qualifierList) != 0)
2466                          YYABORT;
2467              
2468                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2469                      yyval.property->type = MI_REFERENCEA;
2470                      yyval.property->name = yypvt[-2].string;
2471                      yyval.property->className = "?";
2472                      yyval.property->subscript = (MI_Uint32)yypvt[-1].integer;
2473                      yyval.property->qualifiers = yypvt[-5].qualifierList.data;
2474                      yyval.property->numQualifiers = yypvt[-5].qualifierList.size;
2475                  } break;
2476              case 83:
2477              # line 1367 "mof.y"
2478              {
2479                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2480                      yyval.property->type = MI_REFERENCE;
2481                      yyval.property->name = yypvt[-3].string;
2482                      yyval.property->className = "?";
2483                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2484 krisbash 1.3         /* TODO: use initializer */
2485                  } break;
2486              case 84:
2487              # line 1376 "mof.y"
2488              {
2489                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2490                      yyval.property->type = MI_REFERENCEA;
2491                      yyval.property->name = yypvt[-4].string;
2492                      yyval.property->className = "?";
2493                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
2494                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2495                      /* TODO: use initializer */
2496                  } break;
2497              case 85:
2498              # line 1386 "mof.y"
2499              {
2500                      /* Check qualifier scope */
2501                      if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-6].qualifierList) != 0)
2502                          YYABORT;
2503              
2504                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2505 krisbash 1.3         yyval.property->type = MI_REFERENCE;
2506                      yyval.property->name = yypvt[-3].string;
2507                      yyval.property->className = "?";
2508                      yyval.property->qualifiers = yypvt[-6].qualifierList.data;
2509                      yyval.property->numQualifiers = yypvt[-6].qualifierList.size;
2510                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2511                      /* TODO: use initializer */
2512                      } break;
2513              case 86:
2514              # line 1401 "mof.y"
2515              {
2516                      /* Check qualifier scope */
2517                      if (CheckScope(MI_FLAG_REFERENCE, &yypvt[-7].qualifierList) != 0)
2518                          YYABORT;
2519              
2520                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
2521                      yyval.property->type = MI_REFERENCEA;
2522                      yyval.property->name = yypvt[-4].string;
2523                      yyval.property->className = "?";
2524                      yyval.property->subscript = (MI_Uint32)yypvt[-3].integer;
2525                      yyval.property->qualifiers = yypvt[-7].qualifierList.data;
2526 krisbash 1.3         yyval.property->numQualifiers = yypvt[-7].qualifierList.size;
2527                      yywarnf(ID_IGNORED_INITIALIZER, "warning: ignored initializer");
2528                      /* TODO: use initializer */
2529                      } break;
2530              case 87:
2531              # line 1419 "mof.y"
2532              {
2533 mike     1.1         yyval.methodDecl = CALLOC_T(MI_MethodDecl, 1);
2534 krisbash 1.3         yyval.methodDecl->name = yypvt[-4].string;
2535                      yyval.methodDecl->parameters = yypvt[-2].parameterList.data;
2536                      yyval.methodDecl->numParameters = yypvt[-2].parameterList.size;
2537                      yyval.methodDecl->returnType = yypvt[-5].type;
2538                  } break;
2539              case 88:
2540              # line 1427 "mof.y"
2541              {
2542 mike     1.1         /* Check qualifier scope */
2543 krisbash 1.3         if (CheckScope(MI_FLAG_METHOD, &yypvt[-6].qualifierList) != 0)
2544 mike     1.1             YYABORT;
2545              
2546                      yyval.methodDecl = CALLOC_T(MI_MethodDecl, 1);
2547 krisbash 1.3         yyval.methodDecl->name = yypvt[-4].string;
2548                      yyval.methodDecl->parameters = yypvt[-2].parameterList.data;
2549                      yyval.methodDecl->numParameters = yypvt[-2].parameterList.size;
2550                      yyval.methodDecl->qualifiers = yypvt[-6].qualifierList.data;
2551                      yyval.methodDecl->numQualifiers = yypvt[-6].qualifierList.size;
2552                      yyval.methodDecl->returnType = yypvt[-5].type;
2553                  } break;
2554              case 89:
2555              # line 1441 "mof.y"
2556              {
2557 mike     1.1         MOF_ParameterList parameterList = PTRARRAY_INITIALIZER;
2558              
2559                      yyval.methodDecl = CALLOC_T(MI_MethodDecl, 1);
2560 krisbash 1.3         yyval.methodDecl->name = yypvt[-3].string;
2561 mike     1.1         yyval.methodDecl->parameters = parameterList.data;
2562                      yyval.methodDecl->numParameters = parameterList.size;
2563 krisbash 1.3         yyval.methodDecl->returnType = yypvt[-4].type;
2564                  } break;
2565              case 90:
2566              # line 1451 "mof.y"
2567              {
2568 mike     1.1         MOF_ParameterList parameterList = PTRARRAY_INITIALIZER;
2569              
2570                      /* Check qualifier scope */
2571 krisbash 1.3         if (CheckScope(MI_FLAG_METHOD, &yypvt[-5].qualifierList) != 0)
2572 mike     1.1             YYABORT;
2573              
2574                      yyval.methodDecl = CALLOC_T(MI_MethodDecl, 1);
2575 krisbash 1.3         yyval.methodDecl->name = yypvt[-3].string;
2576 mike     1.1         yyval.methodDecl->parameters = parameterList.data;
2577                      yyval.methodDecl->numParameters = parameterList.size;
2578 krisbash 1.3         yyval.methodDecl->qualifiers = yypvt[-5].qualifierList.data;
2579                      yyval.methodDecl->numQualifiers = yypvt[-5].qualifierList.size;
2580                      yyval.methodDecl->returnType = yypvt[-4].type;
2581                  } break;
2582              case 91:
2583              # line 1469 "mof.y"
2584              {
2585                      yypvt[-0].parameter->flags = MI_FLAG_PARAMETER;
2586                      yypvt[-0].parameter->flags |= GetQualFlags(yypvt[-0].parameter->qualifiers, yypvt[-0].parameter->numQualifiers);
2587 mike     1.1         yyval.parameterList.data = NULL;
2588                      yyval.parameterList.size = 0;
2589 krisbash 1.3         PtrArray_Append((PtrArray*)&yyval.parameterList, yypvt[-0].parameter);
2590                  } break;
2591              case 92:
2592              # line 1477 "mof.y"
2593              {
2594                      if (FindParameter(&yypvt[-2].parameterList, yypvt[-0].parameter->name))
2595 mike     1.1         {
2596                          yyerrorf(ID_PARAMETER_ALREADY_DEFINED, 
2597 krisbash 1.3                 "parameter already defined: \"%s\"", yypvt[-0].parameter->name);
2598 mike     1.1             YYABORT;
2599                      }
2600              
2601 krisbash 1.3         yypvt[-0].parameter->flags = MI_FLAG_PARAMETER;
2602                      yypvt[-0].parameter->flags |= GetQualFlags(yypvt[-0].parameter->qualifiers, yypvt[-0].parameter->numQualifiers);
2603                      PtrArray_Append((PtrArray*)&yyval.parameterList, yypvt[-0].parameter);
2604                  } break;
2605              case 93:
2606              # line 1492 "mof.y"
2607              {
2608 mike     1.1         yyval.parameter = CALLOC_T(MI_ParameterDecl, 1);
2609 krisbash 1.3         yyval.parameter->name = yypvt[-0].string;
2610                      yyval.parameter->type = yypvt[-1].type;
2611                  } break;
2612              case 94:
2613              # line 1498 "mof.y"
2614              {
2615 mike     1.1         const MI_ClassDecl* cd;
2616              
2617                      /* Verify that class exists */
2618 krisbash 1.3         cd = FindClassDecl(yypvt[-2].string);
2619 mike     1.1         if (!cd)
2620                      {
2621 krisbash 1.3             yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-2].string);
2622 mike     1.1             YYABORT;
2623                      }
2624              
2625                      yyval.parameter = CALLOC_T(MI_ParameterDecl, 1);
2626 krisbash 1.3         yyval.parameter->name = yypvt[-0].string;
2627 mike     1.1         yyval.parameter->type = MI_REFERENCE;
2628                      yyval.parameter->className = cd->name;
2629 krisbash 1.3     } break;
2630              case 95:
2631              # line 1515 "mof.y"
2632              {
2633 mike     1.1         /* Check qualifier scope */
2634 krisbash 1.3         if (CheckScope(MI_FLAG_PARAMETER, &yypvt[-2].qualifierList) != 0)
2635 mike     1.1             YYABORT;
2636              
2637                      yyval.parameter = CALLOC_T(MI_ParameterDecl, 1);
2638 krisbash 1.3         yyval.parameter->name = yypvt[-0].string;
2639                      yyval.parameter->type = yypvt[-1].type;
2640                      yyval.parameter->qualifiers = yypvt[-2].qualifierList.data;
2641                      yyval.parameter->numQualifiers = yypvt[-2].qualifierList.size;
2642                  } break;
2643              case 96:
2644              # line 1527 "mof.y"
2645              {
2646 mike     1.1         const MI_ClassDecl* cd;
2647              
2648                      /* Verify that class exists */
2649 krisbash 1.3         cd = FindClassDecl(yypvt[-2].string);
2650 mike     1.1         if (!cd)
2651                      {
2652 krisbash 1.3             yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-2].string);
2653 mike     1.1             YYABORT;
2654                      }
2655              
2656                      /* Check qualifier scope */
2657 krisbash 1.3         if (CheckScope(MI_FLAG_PARAMETER, &yypvt[-3].qualifierList) != 0)
2658 mike     1.1             YYABORT;
2659              
2660                      yyval.parameter = CALLOC_T(MI_ParameterDecl, 1);
2661 krisbash 1.3         yyval.parameter->name = yypvt[-0].string;
2662 mike     1.1         yyval.parameter->type = MI_REFERENCE;
2663                      yyval.parameter->className = cd->name;
2664 krisbash 1.3         yyval.parameter->qualifiers = yypvt[-3].qualifierList.data;
2665                      yyval.parameter->numQualifiers = yypvt[-3].qualifierList.size;
2666                  } break;
2667              case 97:
2668              # line 1550 "mof.y"
2669              {
2670 mike     1.1         yyval.parameter = CALLOC_T(MI_ParameterDecl, 1);
2671 krisbash 1.3         yyval.parameter->name = yypvt[-1].string;
2672                      yyval.parameter->type = ARRAYOF(yypvt[-2].type);
2673                      yyval.parameter->subscript = (MI_Uint32)yypvt[-0].integer;
2674                  } break;
2675              case 98:
2676              # line 1557 "mof.y"
2677              {
2678 mike     1.1         const MI_ClassDecl* cd;
2679              
2680                      /* Verify that class exists */
2681 krisbash 1.3         cd = FindClassDecl(yypvt[-3].string);
2682 mike     1.1         if (!cd)
2683                      {
2684 krisbash 1.3             yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-3].string);
2685 mike     1.1             YYABORT;
2686                      }
2687              
2688                      yyval.parameter = CALLOC_T(MI_ParameterDecl, 1);
2689 krisbash 1.3         yyval.parameter->name = yypvt[-1].string;
2690 mike     1.1         yyval.parameter->type = ARRAYOF(MI_REFERENCE);
2691                      yyval.parameter->className = cd->name;
2692 krisbash 1.3         yyval.parameter->subscript = (MI_Uint32)yypvt[-0].integer;
2693                  } break;
2694              case 99:
2695              # line 1575 "mof.y"
2696              {
2697 mike     1.1         /* Check qualifier scope */
2698 krisbash 1.3         if (CheckScope(MI_FLAG_PARAMETER, &yypvt[-3].qualifierList) != 0)
2699 mike     1.1             YYABORT;
2700              
2701                      yyval.parameter = CALLOC_T(MI_ParameterDecl, 1);
2702 krisbash 1.3         yyval.parameter->name = yypvt[-1].string;
2703                      yyval.parameter->type = ARRAYOF(yypvt[-2].type);
2704                      yyval.parameter->subscript = (MI_Uint32)yypvt[-0].integer;
2705                      yyval.parameter->qualifiers = yypvt[-3].qualifierList.data;
2706                      yyval.parameter->numQualifiers = yypvt[-3].qualifierList.size;
2707                  } break;
2708              case 100:
2709              # line 1588 "mof.y"
2710              {
2711 mike     1.1         const MI_ClassDecl* cd;
2712              
2713                      /* Verify that class exists */
2714 krisbash 1.3         cd = FindClassDecl(yypvt[-3].string);
2715 mike     1.1         if (!cd)
2716                      {
2717 krisbash 1.3             yyerrorf(ID_UNDEFINED_CLASS, "undefined class: \"%s\"", yypvt[-3].string);
2718 mike     1.1             YYABORT;
2719                      }
2720              
2721                      /* Check qualifier scope */
2722 krisbash 1.3         if (CheckScope(MI_FLAG_PARAMETER, &yypvt[-4].qualifierList) != 0)
2723 mike     1.1             YYABORT;
2724              
2725                      yyval.parameter = CALLOC_T(MI_ParameterDecl, 1);
2726 krisbash 1.3         yyval.parameter->name = yypvt[-1].string;
2727 mike     1.1         yyval.parameter->type = ARRAYOF(MI_REFERENCE);
2728                      yyval.parameter->className = cd->name;
2729 krisbash 1.3         yyval.parameter->subscript = (MI_Uint32)yypvt[-0].integer;
2730                      yyval.parameter->qualifiers = yypvt[-4].qualifierList.data;
2731                      yyval.parameter->numQualifiers = yypvt[-4].qualifierList.size;
2732                  } break;
2733              case 101:
2734              # line 1614 "mof.y"
2735              {
2736                      if (yypvt[-1].integer <= 0)
2737 mike     1.1         {
2738                          yyerrorf(ID_ILLEGAL_ARRAY_SUBSCRIPT, 
2739 krisbash 1.3                 "illegal array subscript: " SINT64_FMT, yypvt[-1].integer);
2740 mike     1.1             YYABORT;
2741                      }
2742              
2743 krisbash 1.3         yyval.integer = yypvt[-1].integer;
2744                  } break;
2745              case 102:
2746              # line 1625 "mof.y"
2747              {
2748 mike     1.1         /* 0 signifies a dynamic array */
2749                      yyval.integer = 0;
2750 krisbash 1.3     } break;
2751              case 103:
2752              # line 1632 "mof.y"
2753              {
2754                      yyval.initializer = yypvt[-0].initializer;
2755                  } break;
2756              case 104:
2757              # line 1636 "mof.y"
2758              {
2759                      yyval.initializer = yypvt[-0].initializer;
2760                  } break;
2761              case 105:
2762              # line 1642 "mof.y"
2763              {
2764                      yyval.initializer = yypvt[-1].initializer;
2765                  } break;
2766              case 106:
2767              # line 1646 "mof.y"
2768              {
2769                      yyval.initializer.data = NULL;
2770                      yyval.initializer.size = 0;
2771 krisbash 1.3         yyval.initializer.isArray = 1;
2772                  } break;
2773              case 107:
2774              # line 1654 "mof.y"
2775              {
2776                      memset(&yyval.initializer, 0, sizeof(yyval.initializer));
2777                      yyval.initializer.data = CALLOC_T(MOF_ConstantValue, 1);
2778                      yyval.initializer.data[0] = yypvt[-0].initializer.data[0];
2779                      yyval.initializer.size = 1;
2780                      yyval.initializer.isArray = 1;
2781                  } break;
2782              case 108:
2783              # line 1662 "mof.y"
2784              {
2785                      yypvt[-2].initializer.data = REALLOC_T(MOF_ConstantValue, yypvt[-2].initializer.data, yypvt[-2].initializer.size + 1);
2786                      yypvt[-2].initializer.data[yypvt[-2].initializer.size] = yypvt[-0].initializer.data[0];
2787                      yypvt[-2].initializer.size++;
2788                      yyval.initializer = yypvt[-2].initializer;
2789                  } break;
2790              case 109:
2791              # line 1671 "mof.y"
2792 krisbash 1.3 {
2793                      memset(&yyval.initializer, 0, sizeof(yyval.initializer));
2794                      yyval.initializer.data = CALLOC_T(MOF_ConstantValue, 1);
2795                      yyval.initializer.data[0] = yypvt[-0].constantValue;
2796                      yyval.initializer.size = 1;
2797                  } break;
2798              case 110:
2799              # line 1678 "mof.y"
2800              {
2801 mike     1.1         memset(&yyval.initializer, 0, sizeof(yyval.initializer));
2802                      yyval.initializer.data = CALLOC_T(MOF_ConstantValue, 1);
2803 krisbash 1.3         yyval.initializer.data[0].type = TOK_STRING_VALUE;
2804                      yyval.initializer.data[0].value.string = yypvt[-0].string;
2805 mike     1.1         yyval.initializer.size = 1;
2806 krisbash 1.3         /* TODO: look up alias, get and store instance decl. for alias */
2807                  } break;
2808              case 111:
2809              # line 1687 "mof.y"
2810              {
2811 mike     1.1         memset(&yyval.initializer, 0, sizeof(yyval.initializer));
2812                      yyval.initializer.data = CALLOC_T(MOF_ConstantValue, 1);
2813                      yyval.initializer.data[0].type = TOK_STRING_VALUE;
2814 krisbash 1.3         yyval.initializer.data[0].value.string = yypvt[-3].string;
2815                      yyval.initializer.size = 1;
2816                      /* TODO: look up class $3, validate property names/types, store dynamic instance properties in this instance */
2817                  } break;
2818              case 112:
2819              # line 1698 "mof.y"
2820              {
2821                      memset(&yyval.initializer, 0, sizeof(yyval.initializer));
2822                      yyval.initializer.data = CALLOC_T(MOF_ConstantValue, 1);
2823                      yyval.initializer.data[0] = yypvt[-0].constantValue;
2824                      yyval.initializer.size = 1;
2825                  } break;
2826              case 113:
2827              # line 1705 "mof.y"
2828              {
2829                      yyval.initializer = yypvt[-0].initializer;
2830                  } break;
2831              case 114:
2832              # line 1711 "mof.y"
2833              {
2834                      yyval.initializer = yypvt[-1].initializer;
2835 krisbash 1.3     } break;
2836              case 115:
2837              # line 1715 "mof.y"
2838              {
2839                      yyval.initializer.data = NULL;
2840 mike     1.1         yyval.initializer.size = 0;
2841 krisbash 1.3         yyval.initializer.isArray = MI_TRUE;
2842                  } break;
2843              case 116:
2844              # line 1723 "mof.y"
2845              {
2846 mike     1.1         memset(&yyval.initializer, 0, sizeof(yyval.initializer));
2847                      yyval.initializer.data = CALLOC_T(MOF_ConstantValue, 1);
2848 krisbash 1.3         yyval.initializer.data[0] = yypvt[-0].constantValue;
2849 mike     1.1         yyval.initializer.size = 1;
2850 krisbash 1.3         yyval.initializer.isArray = MI_TRUE;
2851                  } break;
2852              case 117:
2853              # line 1731 "mof.y"
2854              {
2855                      yypvt[-2].initializer.data = REALLOC_T(MOF_ConstantValue, yypvt[-2].initializer.data, yypvt[-2].initializer.size + 1);
2856                      yypvt[-2].initializer.data[yypvt[-2].initializer.size] = yypvt[-0].constantValue;
2857                      yypvt[-2].initializer.size++;
2858                      yypvt[-2].initializer.isArray = MI_TRUE;
2859                      yyval.initializer = yypvt[-2].initializer;
2860                  } break;
2861              case 118:
2862              # line 1741 "mof.y"
2863              {
2864 mike     1.1         yyval.constantValue.type = TOK_INTEGER_VALUE;
2865 krisbash 1.3         yyval.constantValue.value.integer = yypvt[-0].integer;
2866                  } break;
2867              case 119:
2868              # line 1746 "mof.y"
2869              {
2870 mike     1.1         yyval.constantValue.type = TOK_REAL_VALUE;
2871 krisbash 1.3         yyval.constantValue.value.real = yypvt[-0].real;
2872                  } break;
2873              case 120:
2874              # line 1751 "mof.y"
2875              {
2876 mike     1.1         yyval.constantValue.type = TOK_CHAR_VALUE;
2877 krisbash 1.3         yyval.constantValue.value.character = yypvt[-0].character;
2878                  } break;
2879              case 121:
2880              # line 1756 "mof.y"
2881              {
2882 mike     1.1         yyval.constantValue.type = TOK_STRING_VALUE;
2883 krisbash 1.3         yyval.constantValue.value.string = yypvt[-0].string;
2884                  } break;
2885              case 122:
2886              # line 1761 "mof.y"
2887              {
2888 mike     1.1         yyval.constantValue.type = TOK_BOOLEAN_VALUE;
2889 krisbash 1.3         yyval.constantValue.value.boolean = yypvt[-0].boolean;
2890                  } break;
2891              case 123:
2892              # line 1766 "mof.y"
2893              {
2894 mike     1.1         yyval.constantValue.type = TOK_NULL;
2895 krisbash 1.3     } break;
2896              case 124:
2897              # line 1772 "mof.y"
2898              {
2899                      yyval.string = yypvt[-0].string;
2900                  } break;
2901              case 125:
2902              # line 1776 "mof.y"
2903              {
2904                      size_t size = strlen(yypvt[-1].string) + strlen(yypvt[-0].string) + 1;
2905                      yyval.string = (char*)MOF_Realloc(&state.heap, yypvt[-1].string, size);
2906                      Strcat(yyval.string, size, yypvt[-0].string);
2907                      MOF_Free(&state.heap, yypvt[-0].string);
2908                  } break;
2909              case 126:
2910              # line 1785 "mof.y"
2911              {
2912                      yypvt[-2].qualifierDeclaration->name = yypvt[-3].string;
2913                      yypvt[-2].qualifierDeclaration->scope = yypvt[-1].flags;
2914                      yypvt[-2].qualifierDeclaration->flavor = 0;
2915                      yyval.qualifierDeclaration = yypvt[-2].qualifierDeclaration;
2916 krisbash 1.3     } break;
2917              case 127:
2918              # line 1792 "mof.y"
2919              {
2920                      yypvt[-3].qualifierDeclaration->name = yypvt[-4].string;
2921                      yypvt[-3].qualifierDeclaration->scope = yypvt[-2].flags;
2922                      yypvt[-3].qualifierDeclaration->flavor = yypvt[-1].flags;
2923                      yyval.qualifierDeclaration = yypvt[-3].qualifierDeclaration;
2924                  } break;
2925              case 128:
2926              # line 1801 "mof.y"
2927              {
2928 mike     1.1         yyval.qualifierDeclaration = CALLOC_T(MI_QualifierDecl, 1);
2929 krisbash 1.3         yyval.qualifierDeclaration->type = yypvt[-0].type;
2930                  } break;
2931              case 129:
2932              # line 1806 "mof.y"
2933              {
2934 mike     1.1         void* value;
2935              
2936 krisbash 1.3         if (InitializerToValue(&yypvt[-0].initializer, yypvt[-2].type, &value) != 0)
2937 mike     1.1         {
2938                          yyerrorf(ID_INVALID_INITIALIZER, "invalid initializer");
2939                          YYABORT;
2940                      }
2941              
2942                      yyval.qualifierDeclaration = CALLOC_T(MI_QualifierDecl, 1);
2943 krisbash 1.3         yyval.qualifierDeclaration->type = yypvt[-2].type;
2944 mike     1.1         yyval.qualifierDeclaration->value = value;
2945 krisbash 1.3         ReleaseInitializer(&yypvt[-0].initializer);
2946                  } break;
2947              case 130:
2948              # line 1821 "mof.y"
2949              {
2950 mike     1.1         yyval.qualifierDeclaration = CALLOC_T(MI_QualifierDecl, 1);
2951 krisbash 1.3         yyval.qualifierDeclaration->type = ARRAYOF(yypvt[-1].type);
2952                      yyval.qualifierDeclaration->subscript = (MI_Uint32)yypvt[-0].integer;
2953                  } break;
2954              case 131:
2955              # line 1827 "mof.y"
2956              {
2957 mike     1.1         void* value = NULL;
2958              
2959 krisbash 1.3         if (InitializerToValue(&yypvt[-0].initializer, ARRAYOF(yypvt[-3].type), &value) != 0)
2960 mike     1.1         {
2961                          yyerrorf(ID_INVALID_INITIALIZER, "invalid initializer");
2962                          YYABORT;
2963                      }
2964              
2965                      yyval.qualifierDeclaration = CALLOC_T(MI_QualifierDecl, 1);
2966 krisbash 1.3         yyval.qualifierDeclaration->type = ARRAYOF(yypvt[-3].type);
2967                      yyval.qualifierDeclaration->subscript = (MI_Uint32)yypvt[-2].integer;
2968 mike     1.1         yyval.qualifierDeclaration->value = value;
2969 krisbash 1.3         ReleaseInitializer(&yypvt[-0].initializer);
2970                  } break;
2971              case 132:
2972              # line 1845 "mof.y"
2973              {
2974                      yyval.flags = yypvt[-1].flags;
2975                  } break;
2976              case 133:
2977              # line 1851 "mof.y"
2978              {
2979                      yyval.flags = yypvt[-0].flags;
2980                  } break;
2981              case 134:
2982              # line 1855 "mof.y"
2983              {
2984                      yyval.flags |= yypvt[-0].flags;
2985                  } break;
2986              case 135:
2987              # line 1861 "mof.y"
2988              {
2989 mike     1.1         yyval.flags = MI_FLAG_CLASS;
2990 krisbash 1.3     } break;
2991              case 136:
2992              # line 1865 "mof.y"
2993              {
2994 mike     1.1         yyval.flags = MI_FLAG_ASSOCIATION;
2995 krisbash 1.3     } break;
2996              case 137:
2997              # line 1869 "mof.y"
2998              {
2999 mike     1.1         yyval.flags = MI_FLAG_INDICATION;
3000 krisbash 1.3     } break;
3001              case 138:
3002              # line 1873 "mof.y"
3003              {
3004 mike     1.1         yyval.flags = MI_FLAG_PROPERTY;
3005 krisbash 1.3     } break;
3006              case 139:
3007              # line 1877 "mof.y"
3008              {
3009 mike     1.1         yyval.flags = MI_FLAG_REFERENCE;
3010 krisbash 1.3     } break;
3011              case 140:
3012              # line 1881 "mof.y"
3013              {
3014 mike     1.1         yyval.flags = MI_FLAG_METHOD;
3015 krisbash 1.3     } break;
3016              case 141:
3017              # line 1885 "mof.y"
3018              {
3019 mike     1.1         yyval.flags = MI_FLAG_PARAMETER;
3020 krisbash 1.3     } break;
3021              case 142:
3022              # line 1889 "mof.y"
3023              {
3024 mike     1.1         yyval.flags = MI_FLAG_ANY;
3025 krisbash 1.3     } break;
3026              case 143:
3027              # line 1895 "mof.y"
3028              {
3029 mike     1.1         /* Reject incompatiable ToSubclass and Restricted flavors */
3030 krisbash 1.3         if (yypvt[-1].flags & MI_FLAG_TOSUBCLASS && yypvt[-1].flags & MI_FLAG_RESTRICTED)
3031 mike     1.1         {
3032                          yyerrorf(ID_INCOMPATIBLE_FLAVORS, "incompatible flavors: %s/%s", 
3033                              "ToSubclass", "Restricted");
3034                          YYABORT;
3035                      }
3036              
3037                      /* Reject incompatiable EnableOverride and DisableOverride flavors */
3038 krisbash 1.3         if (yypvt[-1].flags & MI_FLAG_ENABLEOVERRIDE && yypvt[-1].flags & MI_FLAG_DISABLEOVERRIDE)
3039 mike     1.1         {
3040                          yyerrorf(ID_INCOMPATIBLE_FLAVORS, "incompatible flavors: %s/%s", 
3041                              "EnableOverride", "DisableOverride");
3042                          YYABORT;
3043                      }
3044              
3045 krisbash 1.3         yyval.flags = yypvt[-1].flags;
3046                  } break;
3047              case 144:
3048              # line 1917 "mof.y"
3049              {
3050 mike     1.1         yyval.instanceDeclaration = CALLOC_T(MI_InstanceDecl, 1);
3051                      yyval.instanceDeclaration->flags = 0;
3052 krisbash 1.3         yyval.instanceDeclaration->name = yypvt[-1].string;
3053                      yyval.instanceDeclaration->properties = yypvt[-0].featureList.propertySet.data;
3054                      yyval.instanceDeclaration->numProperties = yypvt[-0].featureList.propertySet.size;
3055                  } break;
3056              case 145:
3057              # line 1925 "mof.y"
3058              {
3059 mike     1.1         yyval.instanceDeclaration = CALLOC_T(MI_InstanceDecl, 1);
3060                      yyval.instanceDeclaration->flags = 0;
3061 krisbash 1.3         yyval.instanceDeclaration->name = yypvt[-1].string;
3062                      yyval.instanceDeclaration->properties = yypvt[-0].featureList.propertySet.data;
3063                      yyval.instanceDeclaration->numProperties = yypvt[-0].featureList.propertySet.size;
3064                      yyval.instanceDeclaration->qualifiers = yypvt[-4].qualifierList.data;
3065                      yyval.instanceDeclaration->numQualifiers = yypvt[-4].qualifierList.size;
3066                  } break;
3067              case 146:
3068              # line 1935 "mof.y"
3069              {
3070 mike     1.1         /* [TODO]: handle alias */
3071                      yyval.instanceDeclaration = CALLOC_T(MI_InstanceDecl, 1);
3072                      yyval.instanceDeclaration->flags = 0;
3073 krisbash 1.3         yyval.instanceDeclaration->name = yypvt[-2].string;
3074                      yyval.instanceDeclaration->properties = yypvt[-0].featureList.propertySet.data;
3075                      yyval.instanceDeclaration->numProperties = yypvt[-0].featureList.propertySet.size;
3076                  } break;
3077              case 147:
3078              # line 1944 "mof.y"
3079              {
3080 mike     1.1         /* [TODO]: handle alias */
3081                      yyval.instanceDeclaration = CALLOC_T(MI_InstanceDecl, 1);
3082                      yyval.instanceDeclaration->flags = 0;
3083 krisbash 1.3         yyval.instanceDeclaration->name = yypvt[-2].string;
3084                      yyval.instanceDeclaration->properties = yypvt[-0].featureList.propertySet.data;
3085                      yyval.instanceDeclaration->numProperties = yypvt[-0].featureList.propertySet.size;
3086                      yyval.instanceDeclaration->qualifiers = yypvt[-5].qualifierList.data;
3087                      yyval.instanceDeclaration->numQualifiers = yypvt[-5].qualifierList.size;
3088                  } break;
3089              case 148:
3090              # line 1957 "mof.y"
3091              {
3092                      yyval.featureList = yypvt[-2].featureList;
3093                  } break;
3094              case 149:
3095              # line 1961 "mof.y"
3096              {
3097                      yyval.featureList.propertySet.data = NULL;
3098                      yyval.featureList.propertySet.size = 0;
3099                      yyval.featureList.methodList.data = NULL;
3100                      yyval.featureList.methodList.size = 0;
3101                  } break;
3102              case 150:
3103              # line 1970 "mof.y"
3104 krisbash 1.3 {
3105                      yyval.string = yypvt[-0].string;
3106                  } break;
3107              case 151:
3108              # line 1976 "mof.y"
3109              {
3110 mike     1.1         yyval.featureList.propertySet.data = NULL;
3111                      yyval.featureList.propertySet.size = 0;
3112 krisbash 1.3         yypvt[-0].property->flags = MI_FLAG_PROPERTY;
3113                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
3114                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
3115                  } break;
3116              case 152:
3117              # line 1984 "mof.y"
3118              {
3119                      if (FindProperty(&yypvt[-1].featureList.propertySet, yypvt[-0].property->name))
3120 mike     1.1         {
3121                          yyerrorf(ID_CLASS_FEATURE_ALREADY_DEFINED, 
3122 krisbash 1.3                 "instance property already defined: \"%s\"", yypvt[-0].property->name);
3123 mike     1.1             YYABORT;
3124                      }
3125              
3126 krisbash 1.3         yypvt[-0].property->flags = MI_FLAG_PROPERTY;
3127                      yypvt[-0].property->flags |= GetQualFlags(yypvt[-0].property->qualifiers, yypvt[-0].property->numQualifiers);
3128                      PtrArray_Append((PtrArray*)&yyval.featureList.propertySet, yypvt[-0].property);
3129                  } break;
3130              case 153:
3131              # line 1999 "mof.y"
3132              {
3133                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
3134                      yyval.property->name = yypvt[-1].string;
3135                      yyval.property->type = TOK_NULL;
3136                  } break;
3137              case 154:
3138              # line 2005 "mof.y"
3139              {
3140                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
3141                      yyval.property->name = yypvt[-1].string;
3142                      yyval.property->type = TOK_NULL;
3143                      yyval.property->qualifiers = yypvt[-2].qualifierList.data;
3144                      yyval.property->numQualifiers = yypvt[-2].qualifierList.size;
3145                  } break;
3146              case 155:
3147 krisbash 1.3 # line 2013 "mof.y"
3148              {
3149 mike     1.1         void* value;
3150 krisbash 1.3         MI_Type type = InitializerToType(&yypvt[-1].initializer);
3151                      if (InitializerToValue(&yypvt[-1].initializer, type, &value) != 0)
3152 mike     1.1         {
3153                          yyerrorf(ID_INVALID_INITIALIZER, "invalid initializer");
3154                          YYABORT;
3155                      }
3156              
3157                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
3158 krisbash 1.3         yyval.property->name = yypvt[-3].string;
3159 mike     1.1         yyval.property->type = type;
3160                      yyval.property->value = value;
3161 krisbash 1.3     } break;
3162              case 156:
3163              # line 2028 "mof.y"
3164              {
3165 mike     1.1         void* value;
3166 krisbash 1.3         MI_Type type = InitializerToType(&yypvt[-1].initializer);
3167 mike     1.1 
3168 krisbash 1.3         if (InitializerToValue(&yypvt[-1].initializer, type, &value) != 0)
3169 mike     1.1         {
3170                          yyerrorf(ID_INVALID_INITIALIZER, "invalid initializer");
3171                          YYABORT;
3172                      }
3173              
3174                      yyval.property = CALLOC_T(MI_PropertyDecl, 1);
3175 krisbash 1.3         yyval.property->name = yypvt[-3].string;
3176 mike     1.1         yyval.property->type = type;
3177                      yyval.property->value = value;
3178 krisbash 1.3         yyval.property->qualifiers = yypvt[-4].qualifierList.data;
3179                      yyval.property->numQualifiers = yypvt[-4].qualifierList.size;
3180                  } break;
3181              case 157:
3182              # line 2048 "mof.y"
3183              {
3184                      yyval.string = yypvt[-0].string;
3185                  } break;
3186              case 158:
3187              # line 2052 "mof.y"
3188              {
3189                      yyval.string = "Object";
3190                  } break;
3191              case 159:
3192              # line 2056 "mof.y"
3193              {
3194                      yyval.string = "Boolean";
3195                  } break;
3196              case 160:
3197              # line 2060 "mof.y"
3198              {
3199 krisbash 1.3         yyval.string = "Datetime";
3200                  } break;
3201              case 161:
3202              # line 2064 "mof.y"
3203              {
3204                      yyval.string = "String";
3205                  } break;
3206              case 162:
3207              # line 2074 "mof.y"
3208              {
3209                      yyval.string = yypvt[-0].string;
3210                  } break;
3211              case 163:
3212              # line 2078 "mof.y"
3213              {
3214                      yyval.string = yypvt[-0].string;
3215                  } break;
3216              case 164:
3217              # line 2082 "mof.y"
3218              {
3219                      yyval.string = yypvt[-0].string;
3220 krisbash 1.3     } break;
3221              case 165:
3222              # line 2086 "mof.y"
3223              {
3224                      yyval.string = yypvt[-0].string;
3225                  } break;
3226              case 166:
3227              # line 2090 "mof.y"
3228              {
3229                      yyval.string = yypvt[-0].string;
3230                  } break;
3231              case 167:
3232              # line 2094 "mof.y"
3233              {
3234                      yyval.string = yypvt[-0].string;
3235                  } break;
3236              case 168:
3237              # line 2098 "mof.y"
3238              {
3239                      yyval.string = yypvt[-0].string;
3240                  } break;
3241 krisbash 1.3 case 169:
3242              # line 2102 "mof.y"
3243              {
3244                      yyval.string = yypvt[-0].string;
3245                  } break;
3246              case 170:
3247              # line 2106 "mof.y"
3248              {
3249                      yyval.string = yypvt[-0].string;
3250                  } break;
3251              case 171:
3252              # line 2110 "mof.y"
3253              {
3254                      yyval.string = yypvt[-0].string;
3255                  } break;
3256              case 172:
3257              # line 2114 "mof.y"
3258              {
3259                      yyval.string = yypvt[-0].string;
3260                  } break;
3261              case 173:
3262 krisbash 1.3 # line 2118 "mof.y"
3263              {
3264                      yyval.string = yypvt[-0].string;
3265                  } break;
3266              case 174:
3267              # line 2122 "mof.y"
3268              {
3269                      yyval.string = yypvt[-0].string;
3270                  } break;
3271              case 175:
3272              # line 2126 "mof.y"
3273              {
3274                      yyval.string = yypvt[-0].string;
3275                  } break;
3276              case 176:
3277              # line 2132 "mof.y"
3278              {
3279                      yyval.type = MI_BOOLEAN;
3280                  } break;
3281              case 177:
3282              # line 2136 "mof.y"
3283 krisbash 1.3 {
3284                      yyval.type = MI_SINT8;
3285                  } break;
3286              case 178:
3287              # line 2140 "mof.y"
3288              {
3289                      yyval.type = MI_UINT8;
3290                  } break;
3291              case 179:
3292              # line 2144 "mof.y"
3293              {
3294                      yyval.type = MI_SINT16;
3295                  } break;
3296              case 180:
3297              # line 2148 "mof.y"
3298              {
3299                      yyval.type = MI_UINT16;
3300                  } break;
3301              case 181:
3302              # line 2152 "mof.y"
3303              {
3304 krisbash 1.3         yyval.type = MI_SINT32;
3305                  } break;
3306              case 182:
3307              # line 2156 "mof.y"
3308              {
3309                      yyval.type = MI_UINT32;
3310                  } break;
3311              case 183:
3312              # line 2160 "mof.y"
3313              {
3314                      yyval.type = MI_SINT64;
3315                  } break;
3316              case 184:
3317              # line 2164 "mof.y"
3318              {
3319                      yyval.type = MI_UINT64;
3320                  } break;
3321              case 185:
3322              # line 2168 "mof.y"
3323              {
3324                      yyval.type = MI_REAL32;
3325 krisbash 1.3     } break;
3326              case 186:
3327              # line 2172 "mof.y"
3328              {
3329                      yyval.type = MI_REAL64;
3330                  } break;
3331              case 187:
3332              # line 2176 "mof.y"
3333              {
3334                      yyval.type = MI_CHAR16;
3335                  } break;
3336              case 188:
3337              # line 2180 "mof.y"
3338              {
3339                      yyval.type = MI_DATETIME;
3340                  } break;
3341              case 189:
3342              # line 2184 "mof.y"
3343              {
3344                      yyval.type = MI_STRING;
3345                  } break;
3346 krisbash 1.3 # line  531 "/usr/ccs/bin/yaccpar"
3347 mike     1.1         }
3348 krisbash 1.3         goto yystack;           /* reset registers in driver code */
3349 mike     1.1 }
3350 krisbash 1.3 

ViewCVS 0.9.2