
/*  A Bison parser, made from Gram.y
 by  GNU Bison version 1.25
  */

#define YYBISON 1  /* Identify Bison output.  */

#define	IDL_ANY	258
#define	IDL_ATTRIBUTE	259
#define	IDL_BOOLEAN	260
#define	IDL_CASE	261
#define	IDL_CHAR	262
#define	IDL_CONST	263
#define	IDL_CONTEXT	264
#define	IDL_DEFAULT	265
#define	IDL_DOUBLE	266
#define	IDL_ENUM	267
#define	IDL_EXCEPTION	268
#define	IDL_FLOAT	269
#define	IDL_IN	270
#define	IDL_INOUT	271
#define	IDL_INTERFACE	272
#define	IDL_LONG	273
#define	IDL_MODULE	274
#define	IDL_OCTET	275
#define	IDL_ONEWAY	276
#define	IDL_OUT	277
#define	IDL_RAISES	278
#define	IDL_READONLY	279
#define	IDL_SEQUENCE	280
#define	IDL_SHORT	281
#define	IDL_STRING	282
#define	IDL_STRUCT	283
#define	IDL_SWITCH	284
#define	IDL_TYPEDEF	285
#define	IDL_UNSIGNED	286
#define	IDL_UNION	287
#define	IDL_VOID	288
#define	IDL_LEFT_SHIFT	289
#define	IDL_RIGHT_SHIFT	290
#define	IDL_SCOPE_DELIMITOR	291
#define	IDL_IDENTIFIER	292
#define	IDL_INTEGER_LITERAL	293
#define	IDL_STRING_LITERAL	294
#define	IDL_CHARACTER_LITERAL	295
#define	IDL_FLOATING_PT_LITERAL	296
#define	IDL_FALSE	297
#define	IDL_TRUE	298
#define	IDL_PRAGMA	299

#line 1 "Gram.y"


// **********************************************************************
//
// Copyright (c) 1999
// Object Oriented Concepts, Inc.
// Billerica, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

#include <OB/CORBA.h>
#include <Types.h>
#include <Util.h>
#include <GramUtil.h>

#include <stdlib.h>
#include <ctype.h>

#ifdef WIN32
#   include <malloc.h>
#ifndef BORLAND
#   define alloca _alloca
#endif
#endif

#ifdef __DECCXX
#   include <alloca.h>
#endif

void yyerror(const char* s);
int yylex();

static void TranslateAny(const CORBA_Any&,
			 CORBA_ULong&, CORBA_Boolean&,
			 CORBA_Long&, CORBA_Boolean&,
			 CORBA_Double&, CORBA_Boolean&);

//
// The current line number and the filename stack
//
long IdlLineno;
IdlStringSeq IdlFileStack;

//
// The current documentation comment
//
CORBA_String_var IdlDocComment;

//
// The ORB
//
CORBA_ORB_ptr IdlORB;

//
// The repository that is to be feeded
//
CORBA_Repository_ptr IdlRepository;

//
// All repository ids of all definitions in the top-level IDL file
//
CORBA_RepositoryIdSeq* IdlTopFileContent;

//
// All IDL files that are directly included from the top-level IDL file
//
IdlStringSeq* IdlIncludes;

//
// All comments for all repository ids
//
IdlCommentSeq* IdlComments;

//
// The stack for the containers
//
IdlContainerSeq IdlContStack;

//
// A stack of stacks for the prefixes
// 
IdlStringSeqSeq IdlPrefStackStack;

//
// This is needed for unions
//
CORBA_IDLType_ptr IdlUnionSwitchType;

//
// Sequence with interface that have been forward declared
//
IdlStringSeq IdlFwdInterfaces;


#line 105 "Gram.y"
typedef union
{
    //
    // General types
    //
    char* string;
    IdlStringSeq* stringSeq;

    CORBA_Long longVal;
    CORBA_ULong uLongVal;
    CORBA_Char charVal;
    CORBA_Double doubleVal;
    CORBA_Boolean booleanVal;

    CORBA_Any* any;
    IdlAnySeq* anySeq;

    //
    // Special types
    //
    IdlDeclarator* declarator;
    IdlDeclaratorSeq* declaratorSeq;

    //
    // Types from the IR
    //
    CORBA_IDLType_ptr idlType;
    CORBA_StructDef_ptr structDef;
    CORBA_UnionDef_ptr unionDef;
    CORBA_ExceptionDef_ptr exceptionDef;
    CORBA_AttributeMode attributeMode;
    CORBA_StructMemberSeq* structMemberSeq;
    CORBA_UnionMemberSeq* unionMemberSeq;
    CORBA_UnionMember* unionMember;
    CORBA_InterfaceDefSeq* interfaceDefSeq;
    CORBA_OperationMode operationMode;
    CORBA_ParameterMode parameterMode;
    CORBA_ParameterDescription* parameterDescription;
    CORBA_ParDescriptionSeq* parDescriptionSeq;
    CORBA_ExceptionDefSeq* exceptionDefSeq;
} YYSTYPE;
#ifndef YYDEBUG
#define YYDEBUG 1
#endif

#include <stdio.h>

#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif



#define	YYFINAL		298
#define	YYFLAG		-32768
#define	YYNTBASE	66

#define YYTRANSLATE(x) ((unsigned)(x) <= 299 ? yytranslate[x] : 169)

static const char yytranslate[] = {     0,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,    58,    53,     2,    60,
    61,    56,    54,    49,    55,     2,    57,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,    48,    45,    62,
    50,    63,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    64,     2,    65,    52,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,    46,    51,    47,    59,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
    36,    37,    38,    39,    40,    41,    42,    43,    44
};

#if YYDEBUG != 0
static const short yyprhs[] = {     0,
     0,     2,     3,     4,     7,     9,    12,    15,    17,    20,
    22,    24,    26,    28,    30,    32,    33,    40,    42,    44,
    49,    52,    56,    58,    59,    61,    64,    65,    68,    70,
    73,    75,    77,    79,    81,    83,    85,    89,    93,    94,
    96,    99,   103,   109,   111,   113,   115,   117,   119,   121,
   123,   125,   129,   131,   135,   137,   141,   143,   147,   151,
   153,   157,   161,   163,   167,   171,   175,   178,   180,   182,
   184,   186,   188,   190,   194,   196,   198,   200,   202,   204,
   206,   208,   210,   213,   215,   217,   219,   222,   224,   226,
   228,   230,   232,   234,   236,   238,   240,   242,   244,   246,
   248,   250,   252,   254,   257,   261,   262,   264,   266,   268,
   272,   273,   275,   277,   279,   281,   283,   285,   287,   289,
   291,   293,   295,   298,   301,   303,   305,   307,   309,   310,
   317,   319,   321,   324,   327,   329,   332,   333,   344,   346,
   348,   350,   352,   354,   356,   358,   361,   364,   366,   369,
   371,   374,   378,   381,   384,   391,   395,   396,   398,   400,
   407,   412,   417,   419,   422,   424,   427,   431,   437,   439,
   440,   441,   448,   451,   452,   459,   461,   462,   464,   465,
   467,   468,   470,   472,   474,   479,   482,   486,   487,   491,
   493,   496,   499,   501,   503,   505,   511,   517,   521,   522,
   524,   526,   528
};

static const short yyrhs[] = {    67,
     0,     0,     0,    68,    69,     0,    70,     0,    70,    69,
     0,    71,    45,     0,    71,     0,     1,    45,     0,    44,
     0,   101,     0,    86,     0,   152,     0,    74,     0,    72,
     0,     0,    19,    37,    73,    46,    69,    47,     0,    75,
     0,    76,     0,    77,    46,    79,    47,     0,    17,    37,
     0,    17,    37,    78,     0,    83,     0,     0,    80,     0,
    81,    80,     0,     0,    82,    45,     0,    82,     0,     1,
    45,     0,    44,     0,   101,     0,    86,     0,   152,     0,
   150,     0,   155,     0,    48,    85,    84,     0,    49,    85,
    84,     0,     0,    37,     0,    36,    37,     0,    85,    36,
    37,     0,     8,    87,    37,    50,    88,     0,   115,     0,
   122,     0,   123,     0,   114,     0,   146,     0,    85,     0,
    89,     0,    90,     0,    89,    51,    90,     0,    91,     0,
    90,    52,    91,     0,    92,     0,    91,    53,    92,     0,
    93,     0,    92,    35,    93,     0,    92,    34,    93,     0,
    94,     0,    93,    54,    94,     0,    93,    55,    94,     0,
    95,     0,    94,    56,    95,     0,    94,    57,    95,     0,
    94,    58,    95,     0,    96,    97,     0,    97,     0,    55,
     0,    54,     0,    59,     0,    85,     0,    98,     0,    60,
    88,    61,     0,    38,     0,    39,     0,    40,     0,    41,
     0,    99,     0,    43,     0,    42,     0,    88,     0,    30,
   102,     0,   126,     0,   132,     0,   142,     0,   103,   108,
     0,   104,     0,   107,     0,   105,     0,   106,     0,    85,
     0,   114,     0,   115,     0,   122,     0,   123,     0,   124,
     0,   125,     0,   145,     0,   146,     0,   126,     0,   132,
     0,   142,     0,   110,   109,     0,    49,   110,   109,     0,
     0,   111,     0,   113,     0,    37,     0,    49,   111,   112,
     0,     0,   147,     0,    14,     0,    11,     0,   116,     0,
   119,     0,   117,     0,   118,     0,    18,     0,    26,     0,
   120,     0,   121,     0,    31,    18,     0,    31,    26,     0,
     7,     0,     5,     0,    20,     0,     3,     0,     0,    28,
    37,   127,    46,   128,    47,     0,   129,     0,   130,     0,
   130,   129,     0,   131,    45,     0,   131,     0,   103,   108,
     0,     0,    32,    37,    29,    60,   134,    61,   133,    46,
   135,    47,     0,   115,     0,   122,     0,   123,     0,   142,
     0,    85,     0,   136,     0,   137,     0,   137,   136,     0,
   138,    45,     0,   138,     0,   139,   141,     0,   140,     0,
   140,   139,     0,     6,    88,    48,     0,    10,    48,     0,
   103,   110,     0,    12,    37,    46,   144,   143,    47,     0,
    49,   144,   143,     0,     0,    49,     0,    37,     0,    25,
    62,   104,    49,   100,    63,     0,    25,    62,   104,    63,
     0,    27,    62,   100,    63,     0,    27,     0,    37,   148,
     0,   149,     0,   149,   148,     0,    64,   100,    65,     0,
   151,     4,   168,   111,   112,     0,    24,     0,     0,     0,
    13,    37,   153,    46,   154,    47,     0,   130,   154,     0,
     0,   156,   160,    37,   161,   157,   158,     0,   159,     0,
     0,   165,     0,     0,   166,     0,     0,    21,     0,   168,
     0,    33,     0,    60,   163,   162,    61,     0,    60,    61,
     0,    49,   163,   162,     0,     0,   164,   168,   111,     0,
   168,     0,   168,   111,     0,   164,   168,     0,    15,     0,
    22,     0,    16,     0,    23,    60,    85,    84,    61,     0,
     9,    60,    39,   167,    61,     0,    49,    39,   167,     0,
     0,   105,     0,   145,     0,   146,     0,    85,     0
};

#endif

#if YYDEBUG != 0
static const short yyrline[] = { 0,
   286,   289,   294,   310,   333,   336,   341,   344,   349,   353,
   363,   366,   369,   372,   375,   380,   473,   494,   497,   502,
   524,   618,   788,   792,   798,   803,   806,   811,   814,   819,
   823,   833,   836,   839,   842,   845,   850,   933,   938,   944,
   948,   956,   969,  1187,  1191,  1195,  1199,  1203,  1207,  1262,
  1268,  1272,  1314,  1318,  1360,  1364,  1406,  1410,  1459,  1510,
  1514,  1556,  1606,  1610,  1652,  1694,  1736,  1808,  1814,  1818,
  1822,  1828,  1910,  1914,  1920,  1926,  1944,  1950,  1956,  1964,
  1969,  1976,  2039,  2042,  2046,  2050,  2056,  2118,  2122,  2128,
  2132,  2136,  2174,  2178,  2182,  2186,  2190,  2194,  2200,  2204,
  2210,  2214,  2218,  2224,  2232,  2238,  2244,  2248,  2254,  2261,
  2268,  2274,  2280,  2284,  2290,  2294,  2300,  2304,  2310,  2316,
  2322,  2326,  2332,  2338,  2344,  2350,  2356,  2362,  2368,  2410,
  2441,  2447,  2451,  2483,  2487,  2495,  2536,  2592,  2824,  2828,
  2832,  2836,  2840,  2894,  2900,  2904,  2937,  2941,  2949,  2968,
  2974,  2982,  3083,  3090,  3119,  3164,  3189,  3193,  3201,  3207,
  3217,  3228,  3237,  3246,  3253,  3258,  3265,  3271,  3338,  3342,
  3348,  3390,  3421,  3451,  3457,  3559,  3563,  3569,  3573,  3579,
  3583,  3589,  3595,  3599,  3605,  3611,  3617,  3623,  3629,  3646,
  3655,  3664,  3674,  3678,  3682,  3688,  3742,  3793,  3812,  3818,
  3822,  3831,  3835
};
#endif


#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)

static const char * const yytname[] = {   "$","error","$undefined.","IDL_ANY",
"IDL_ATTRIBUTE","IDL_BOOLEAN","IDL_CASE","IDL_CHAR","IDL_CONST","IDL_CONTEXT",
"IDL_DEFAULT","IDL_DOUBLE","IDL_ENUM","IDL_EXCEPTION","IDL_FLOAT","IDL_IN","IDL_INOUT",
"IDL_INTERFACE","IDL_LONG","IDL_MODULE","IDL_OCTET","IDL_ONEWAY","IDL_OUT","IDL_RAISES",
"IDL_READONLY","IDL_SEQUENCE","IDL_SHORT","IDL_STRING","IDL_STRUCT","IDL_SWITCH",
"IDL_TYPEDEF","IDL_UNSIGNED","IDL_UNION","IDL_VOID","IDL_LEFT_SHIFT","IDL_RIGHT_SHIFT",
"IDL_SCOPE_DELIMITOR","IDL_IDENTIFIER","IDL_INTEGER_LITERAL","IDL_STRING_LITERAL",
"IDL_CHARACTER_LITERAL","IDL_FLOATING_PT_LITERAL","IDL_FALSE","IDL_TRUE","IDL_PRAGMA",
"';'","'{'","'}'","':'","','","'='","'|'","'^'","'&'","'+'","'-'","'*'","'/'",
"'%'","'~'","'('","')'","'<'","'>'","'['","']'","start","specification","@1",
"definition_PLUS","definition","definition_NO_SEM","module","@2","interface",
"interface_dcl","forward_dcl","interface_header","inheritance_spec_OPT","interface_body",
"export_STAR","export","export_NO_SEM","inheritance_spec","COMMA_scoped_name_STAR",
"scoped_name","const_dcl","const_type","const_exp","or_expr","xor_expr","and_expr",
"shift_expr","add_expr","mult_expr","unary_expr","unary_operator","primary_expr",
"literal","boolean_literal","positive_int_const","type_dcl","type_declarator",
"type_spec","simple_type_spec","base_type_spec","template_type_spec","constr_type_spec",
"declarators","COMMA_declarator_STAR","declarator","simple_declarator","COMMA_simple_declarator_STAR",
"complex_declarator","floating_pt_type","integer_type","signed_int","signed_long_int",
"signed_short_int","unsigned_int","unsigned_long_int","unsigned_short_int","char_type",
"boolean_type","octet_type","any_type","struct_type","@3","member_list","member_PLUS",
"member","member_NO_SEM","union_type","@4","switch_type_spec","switch_body",
"case_PLUS","case","case_NO_SEM","case_label_PLUS","case_label","element_spec",
"enum_type","COMMA_enumerator_STAR","enumerator","sequence_type","string_type",
"array_declarator","fixed_array_size_PLUS","fixed_array_size","attr_dcl","readonly_OPT",
"except_dcl","@5","member_STAR","op_dcl","op_attribute_OPT","raises_expr_OPT",
"context_expr_OPT","op_attribute","op_type_spec","parameter_dcls","COMMA_param_dcl_STAR",
"param_dcl","param_attribute","raises_expr","context_expr","COMMA_string_literal_STAR",
"param_type_spec", NULL
};
#endif

static const short yyr1[] = {     0,
    66,    66,    68,    67,    69,    69,    70,    70,    70,    70,
    71,    71,    71,    71,    71,    73,    72,    74,    74,    75,
    76,    77,    78,    78,    79,    80,    80,    81,    81,    81,
    81,    82,    82,    82,    82,    82,    83,    84,    84,    85,
    85,    85,    86,    87,    87,    87,    87,    87,    87,    88,
    89,    89,    90,    90,    91,    91,    92,    92,    92,    93,
    93,    93,    94,    94,    94,    94,    95,    95,    96,    96,
    96,    97,    97,    97,    98,    98,    98,    98,    98,    99,
    99,   100,   101,   101,   101,   101,   102,   103,   103,   104,
   104,   104,   105,   105,   105,   105,   105,   105,   106,   106,
   107,   107,   107,   108,   109,   109,   110,   110,   111,   112,
   112,   113,   114,   114,   115,   115,   116,   116,   117,   118,
   119,   119,   120,   121,   122,   123,   124,   125,   127,   126,
   128,   129,   129,   130,   130,   131,   133,   132,   134,   134,
   134,   134,   134,   135,   136,   136,   137,   137,   138,   139,
   139,   140,   140,   141,   142,   143,   143,   143,   144,   145,
   145,   146,   146,   147,   148,   148,   149,   150,   151,   151,
   153,   152,   154,   154,   155,   156,   156,   157,   157,   158,
   158,   159,   160,   160,   161,   161,   162,   162,   163,   163,
   163,   163,   164,   164,   164,   165,   166,   167,   167,   168,
   168,   168,   168
};

static const short yyr2[] = {     0,
     1,     0,     0,     2,     1,     2,     2,     1,     2,     1,
     1,     1,     1,     1,     1,     0,     6,     1,     1,     4,
     2,     3,     1,     0,     1,     2,     0,     2,     1,     2,
     1,     1,     1,     1,     1,     1,     3,     3,     0,     1,
     2,     3,     5,     1,     1,     1,     1,     1,     1,     1,
     1,     3,     1,     3,     1,     3,     1,     3,     3,     1,
     3,     3,     1,     3,     3,     3,     2,     1,     1,     1,
     1,     1,     1,     3,     1,     1,     1,     1,     1,     1,
     1,     1,     2,     1,     1,     1,     2,     1,     1,     1,
     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
     1,     1,     1,     2,     3,     0,     1,     1,     1,     3,
     0,     1,     1,     1,     1,     1,     1,     1,     1,     1,
     1,     1,     2,     2,     1,     1,     1,     1,     0,     6,
     1,     1,     2,     2,     1,     2,     0,    10,     1,     1,
     1,     1,     1,     1,     1,     2,     2,     1,     2,     1,
     2,     3,     2,     2,     6,     3,     0,     1,     1,     6,
     4,     4,     1,     2,     1,     2,     3,     5,     1,     0,
     0,     6,     2,     0,     6,     1,     0,     1,     0,     1,
     0,     1,     1,     1,     4,     2,     3,     0,     3,     1,
     2,     2,     1,     1,     1,     5,     5,     3,     0,     1,
     1,     1,     1
};

static const short yydefact[] = {     3,
     1,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,    10,     4,     0,     8,    15,    14,    18,    19,     0,
    12,    11,    84,    85,    86,    13,     9,   126,   125,   114,
   113,   119,   120,   163,     0,     0,    40,    49,     0,    47,
    44,   115,   117,   118,   116,   121,   122,    45,    46,    48,
     0,   171,    21,    16,   129,   128,   127,     0,    92,    83,
     0,    88,    90,    91,    89,    93,    94,    95,    96,    97,
    98,   101,   102,   103,    99,   100,     0,     6,     7,     0,
     0,   123,   124,    41,     0,     0,     0,     0,     0,    22,
    23,     0,     0,     0,   109,    87,   106,   107,   108,   112,
     0,     0,   182,   169,    31,     0,    25,     0,    29,    33,
    32,    35,     0,    34,    36,     0,   176,    75,    76,    77,
    78,    81,    80,    70,    69,    71,     0,    72,    82,    50,
    51,    53,    55,    57,    60,    63,     0,    68,    73,    79,
     0,    42,     0,   159,   157,   174,    39,     0,     0,     0,
     0,   164,   165,     0,   104,     0,    30,    20,    26,    28,
     0,   184,   203,   200,   201,   202,     0,   183,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,    67,
   162,    43,   158,     0,     0,   174,   135,     0,     0,    37,
     0,     0,   131,   132,     0,   161,     0,   166,   106,   143,
   139,   140,   141,     0,   142,     0,     0,    74,    52,    54,
    56,    59,    58,    61,    62,    64,    65,    66,   157,   155,
   136,   173,   134,   172,    39,    17,   130,   133,     0,   167,
   105,   137,   109,   111,     0,   179,   156,    38,   160,     0,
     0,   168,   193,   195,   194,   186,   188,     0,   190,     0,
   181,   178,     0,   111,     0,     0,   192,   191,     0,     0,
   175,   180,     0,     0,     0,   144,   145,   148,     0,   150,
   110,   188,   185,   189,    39,     0,     0,   153,   138,   146,
   147,     0,   149,   151,   187,     0,   199,   152,   154,   196,
     0,     0,   199,   197,   198,     0,     0,     0
};

static const short yydefgoto[] = {   296,
     1,     2,    13,    14,    15,    16,    92,    17,    18,    19,
    20,    90,   106,   107,   108,   109,    91,   190,   128,    21,
    39,   129,   130,   131,   132,   133,   134,   135,   136,   137,
   138,   139,   140,   141,    22,    60,   185,    62,    63,    64,
    65,    96,   155,    97,    98,   242,    99,    66,    67,    42,
    43,    44,    45,    46,    47,    68,    69,    70,    71,    72,
    93,   192,   193,   186,   187,    73,   240,   204,   265,   266,
   267,   268,   269,   270,   283,    74,   184,   145,    75,    76,
   100,   152,   153,   112,   113,    26,    88,   188,   115,   116,
   251,   261,   117,   167,   236,   256,   247,   248,   252,   262,
   292,   249
};

static const short yypact[] = {    20,
-32768,    85,   -20,   379,     0,    10,    24,    30,    42,   192,
    44,-32768,-32768,   164,     6,-32768,-32768,-32768,-32768,    -5,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,    22,    12,    50,-32768,    21,    59,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
    57,-32768,    32,-32768,-32768,-32768,-32768,    39,    21,-32768,
    70,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,    89,-32768,-32768,   263,
   393,-32768,-32768,-32768,    82,    71,    83,    76,    55,-32768,
-32768,    77,    78,   352,    61,-32768,    79,-32768,-32768,-32768,
    67,    86,-32768,-32768,-32768,    88,-32768,   263,    87,-32768,
-32768,-32768,   126,-32768,-32768,   325,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,   393,    21,-32768,    93,
    81,    84,    60,    45,    14,-32768,   198,-32768,-32768,-32768,
    73,-32768,   393,-32768,    91,   192,   -22,    85,   192,   -23,
   393,-32768,    61,    70,-32768,   391,-32768,-32768,-32768,-32768,
   352,-32768,    21,-32768,-32768,-32768,   101,-32768,    92,   393,
   393,   393,   393,   393,   393,   393,   393,   393,   393,-32768,
-32768,-32768,    83,   102,    70,   192,   117,   119,    55,-32768,
   120,   121,-32768,   192,   393,-32768,   104,-32768,    79,    21,
-32768,-32768,-32768,   109,-32768,   134,   113,-32768,    81,    84,
    60,    45,    45,    14,    14,-32768,-32768,-32768,    91,-32768,
-32768,-32768,-32768,-32768,   -22,-32768,-32768,-32768,   111,-32768,
-32768,-32768,-32768,   129,    28,   152,-32768,-32768,-32768,   133,
   134,-32768,-32768,-32768,-32768,-32768,   131,   352,   134,   124,
   177,-32768,    26,   129,   298,   127,   134,-32768,    55,   138,
-32768,-32768,   393,   139,   142,-32768,    26,   146,   192,    26,
-32768,   131,-32768,-32768,   -22,   154,   153,-32768,-32768,-32768,
-32768,    70,-32768,-32768,-32768,   141,   151,-32768,-32768,-32768,
   166,   148,   151,-32768,-32768,   207,   213,-32768
};

static const short yypgoto[] = {-32768,
-32768,-32768,    15,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,   106,-32768,-32768,-32768,  -207,    -4,   -59,
-32768,  -115,-32768,    46,    51,    43,   -68,   -67,  -102,-32768,
    90,-32768,-32768,  -132,   -46,-32768,    -9,   132,  -109,-32768,
-32768,    36,    31,  -141,  -183,   -29,-32768,   228,    -1,-32768,
-32768,-32768,-32768,-32768,-32768,     4,     5,-32768,-32768,     3,
-32768,-32768,    48,  -125,-32768,     8,-32768,-32768,-32768,   -24,
-32768,-32768,   -25,-32768,-32768,     2,    29,    64,  -101,    -2,
-32768,    96,-32768,-32768,-32768,   -35,-32768,    66,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,   -18,     1,-32768,-32768,-32768,
   -43,  -105
};


#define	YYLAST		453


static const short yytable[] = {    38,
    61,    50,    41,    25,    23,    59,   164,    48,    49,    24,
   168,   169,   199,    85,   165,    25,    23,   238,   197,    -2,
   110,    24,   234,   194,    27,   195,   189,   182,    78,    82,
    56,   263,    28,   111,    29,   264,    51,    83,    30,   196,
    80,    31,   243,   244,   114,    32,    52,    57,   110,   245,
    79,   164,    58,    33,    34,   206,    85,   254,    35,   165,
    53,   111,   229,    36,    37,   258,    54,   286,   194,   177,
   178,   179,   114,   274,   216,   217,   218,   -24,    55,    89,
    77,    25,    23,    81,   147,     3,    84,    24,   246,    59,
    36,    37,     4,   173,   174,    86,     5,     6,   175,   176,
    94,     7,    87,     8,   212,   213,    95,   214,   215,    25,
    23,   163,     9,   166,    10,    24,    11,   101,   142,   144,
   143,   146,   148,   149,   151,   164,   156,   154,    12,   161,
   157,   160,   171,   165,   158,   181,   172,   207,   164,   183,
   289,    59,   257,   170,    59,   164,   165,   277,   220,    25,
    23,   200,   208,   165,   201,    24,   163,   205,   166,   202,
   203,   223,   191,    -5,     3,   224,   226,   227,   230,   232,
   233,     4,   235,   239,   250,     5,     6,   241,   253,   255,
     7,    59,     8,   259,   225,   260,   278,   273,   279,    59,
   281,     9,   287,    10,    56,    11,    28,   276,    29,   291,
   288,   290,    30,     5,   293,    31,   297,    12,   294,    32,
    -5,    57,   298,   159,   211,   209,    58,    33,    34,     9,
   221,   210,    35,    11,   271,   150,   180,    36,    37,   231,
   163,    40,   166,    36,    37,   118,   119,   120,   121,   122,
   123,   228,   280,   163,   284,   166,   219,   237,   198,   295,
   163,   222,   166,   285,   275,   272,     0,   127,     0,   282,
     0,     0,     0,   102,    59,  -177,  -170,  -177,     0,  -177,
     4,     0,     0,  -177,     5,     6,  -177,     0,     0,     0,
  -177,     0,  -177,   103,     0,     0,   104,  -177,  -177,  -177,
     9,     0,    10,  -177,    11,  -177,     0,     0,  -177,  -177,
    56,     0,    28,     0,    29,     0,   105,     0,    30,   -27,
     0,    31,   243,   244,     0,    32,     0,    57,     0,   245,
     0,     0,    58,    33,    34,     0,     0,    56,    35,    28,
     0,    29,     0,    36,    37,    30,     0,     0,    31,     0,
     0,     0,    32,     0,    57,     0,     0,     0,     0,    58,
    33,    34,     0,     0,    56,    35,    28,   162,    29,     0,
    36,    37,    30,     0,     0,    31,     0,     0,     0,    32,
     0,    57,     0,     0,     0,     0,    58,    33,    34,     0,
     0,     0,    35,    28,     0,    29,     0,    36,    37,    30,
     0,     0,    31,     0,     0,    28,    32,    29,     0,     0,
     0,     0,     5,     0,    33,    34,     0,     0,    32,    35,
     0,     0,     0,     0,    36,    37,    33,     0,     0,     0,
     0,    35,     0,     0,     0,     0,    36,    37,    36,    37,
   118,   119,   120,   121,   122,   123,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,   124,   125,     0,     0,
     0,   126,   127
};

static const short yycheck[] = {     4,
    10,     4,     4,     2,     2,    10,   116,     4,     4,     2,
   116,   127,   154,    36,   116,    14,    14,   225,   151,     0,
    80,    14,   206,   149,    45,    49,    49,   143,    14,    18,
     3,     6,     5,    80,     7,    10,    37,    26,    11,    63,
    46,    14,    15,    16,    80,    18,    37,    20,   108,    22,
    45,   161,    25,    26,    27,   161,    36,   241,    31,   161,
    37,   108,   195,    36,    37,   249,    37,   275,   194,    56,
    57,    58,   108,   257,   177,   178,   179,    46,    37,    48,
    37,    80,    80,    62,    89,     1,    37,    80,    61,    94,
    36,    37,     8,    34,    35,    37,    12,    13,    54,    55,
    62,    17,    46,    19,   173,   174,    37,   175,   176,   108,
   108,   116,    28,   116,    30,   108,    32,    29,    37,    37,
    50,    46,    46,    46,    64,   235,    60,    49,    44,     4,
    45,    45,    52,   235,    47,    63,    53,    37,   248,    49,
   282,   146,   248,    51,   149,   255,   248,   263,    47,   148,
   148,   156,    61,   255,   156,   148,   161,   156,   161,   156,
   156,    45,   148,     0,     1,    47,    47,    47,    65,    61,
    37,     8,    60,    63,    23,    12,    13,    49,    46,    49,
    17,   186,    19,    60,   189,     9,    48,    61,    47,   194,
    45,    28,    39,    30,     3,    32,     5,    60,     7,    49,
    48,    61,    11,    12,    39,    14,     0,    44,    61,    18,
    47,    20,     0,   108,   172,   170,    25,    26,    27,    28,
   185,   171,    31,    32,   254,    94,   137,    36,    37,   199,
   235,     4,   235,    36,    37,    38,    39,    40,    41,    42,
    43,   194,   267,   248,   270,   248,   183,   219,   153,   293,
   255,   186,   255,   272,   259,   255,    -1,    60,    -1,   269,
    -1,    -1,    -1,     1,   269,     3,     4,     5,    -1,     7,
     8,    -1,    -1,    11,    12,    13,    14,    -1,    -1,    -1,
    18,    -1,    20,    21,    -1,    -1,    24,    25,    26,    27,
    28,    -1,    30,    31,    32,    33,    -1,    -1,    36,    37,
     3,    -1,     5,    -1,     7,    -1,    44,    -1,    11,    47,
    -1,    14,    15,    16,    -1,    18,    -1,    20,    -1,    22,
    -1,    -1,    25,    26,    27,    -1,    -1,     3,    31,     5,
    -1,     7,    -1,    36,    37,    11,    -1,    -1,    14,    -1,
    -1,    -1,    18,    -1,    20,    -1,    -1,    -1,    -1,    25,
    26,    27,    -1,    -1,     3,    31,     5,    33,     7,    -1,
    36,    37,    11,    -1,    -1,    14,    -1,    -1,    -1,    18,
    -1,    20,    -1,    -1,    -1,    -1,    25,    26,    27,    -1,
    -1,    -1,    31,     5,    -1,     7,    -1,    36,    37,    11,
    -1,    -1,    14,    -1,    -1,     5,    18,     7,    -1,    -1,
    -1,    -1,    12,    -1,    26,    27,    -1,    -1,    18,    31,
    -1,    -1,    -1,    -1,    36,    37,    26,    -1,    -1,    -1,
    -1,    31,    -1,    -1,    -1,    -1,    36,    37,    36,    37,
    38,    39,    40,    41,    42,    43,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    54,    55,    -1,    -1,
    -1,    59,    60
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/freeware/share/bison.simple"

/* Skeleton output parser for bison,
   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C.  */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
 #pragma alloca
#else /* not MSDOS, __TURBOC__, or _AIX */
#ifdef __hpux
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* __hpux */
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc.  */
#endif /* not GNU C.  */
#endif /* alloca not defined.  */

/* This is the parser code that is written into each bison parser
  when the %semantic_parser declaration is not specified in the grammar.
  It was written by Richard Stallman by simplifying the hairy parser
  used when %semantic_parser is specified.  */

/* Note: there must be only one dollar sign in this file.
   It is replaced by the list of actions, each action
   as one case of the switch.  */

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0
#define YYACCEPT	return(0)
#define YYABORT 	return(1)
#define YYERROR		goto yyerrlab1
/* Like YYERROR except do call yyerror.
   This remains here temporarily to ease the
   transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL		goto yyerrlab
#define YYRECOVERING()  (!!yyerrstatus)
#define YYBACKUP(token, value) \
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    { yychar = (token), yylval = (value);			\
      yychar1 = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
while (0)

#define YYTERROR	1
#define YYERRCODE	256

#ifndef YYPURE
#define YYLEX		yylex()
#endif

#ifdef YYPURE
#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
#define YYLEX		yylex(&yylval, &yylloc)
#endif
#else /* not YYLSP_NEEDED */
#ifdef YYLEX_PARAM
#define YYLEX		yylex(&yylval, YYLEX_PARAM)
#else
#define YYLEX		yylex(&yylval)
#endif
#endif /* not YYLSP_NEEDED */
#endif

/* If nonreentrant, generate the variables here */

#ifndef YYPURE

int	yychar;			/*  the lookahead symbol		*/
YYSTYPE	yylval;			/*  the semantic value of the		*/
				/*  lookahead symbol			*/

#ifdef YYLSP_NEEDED
YYLTYPE yylloc;			/*  location data for the lookahead	*/
				/*  symbol				*/
#endif

int yynerrs;			/*  number of parse errors so far       */
#endif  /* not YYPURE */

#if YYDEBUG != 0
int yydebug;			/*  nonzero means print parse trace	*/
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif

/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/

#ifndef	YYINITDEPTH
#define YYINITDEPTH 200
#endif

/*  YYMAXDEPTH is the maximum size the stacks can grow to
    (effective only if the built-in stack extension method is used).  */

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif

/* Prevent warning if -Wstrict-prototypes.  */
#ifdef __GNUC__
int yyparse (void);
#endif

#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
#define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
#else				/* not GNU C or C++ */
#ifndef __cplusplus

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_memcpy (to, from, count)
     char *to;
     char *from;
     int count;
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#else /* __cplusplus */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_memcpy (char *to, char *from, int count)
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#endif
#endif

#line 196 "/usr/freeware/share/bison.simple"

/* The user can define YYPARSE_PARAM as the name of an argument to be passed
   into yyparse.  The argument should have type void *.
   It should actually point to an object.
   Grammar actions can access the variable by casting it
   to the proper pointer type.  */

#ifdef YYPARSE_PARAM
#ifdef __cplusplus
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#define YYPARSE_PARAM_DECL
#else /* not __cplusplus */
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
#endif /* not __cplusplus */
#else /* not YYPARSE_PARAM */
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */

int
yyparse(YYPARSE_PARAM_ARG)
     YYPARSE_PARAM_DECL
{
  register int yystate;
  register int yyn;
  register short *yyssp;
  register YYSTYPE *yyvsp;
  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */

  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/

  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */

#ifdef YYLSP_NEEDED
  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;

#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK   (yyvsp--, yyssp--)
#endif

  int yystacksize = YYINITDEPTH;

#ifdef YYPURE
  int yychar;
  YYSTYPE yylval;
  int yynerrs;
#ifdef YYLSP_NEEDED
  YYLTYPE yylloc;
#endif
#endif

  YYSTYPE yyval;		/*  the variable used to return		*/
				/*  semantic values from the action	*/
				/*  routines				*/

  int yylen;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Starting parse\n");
#endif

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss - 1;
  yyvsp = yyvs;
#ifdef YYLSP_NEEDED
  yylsp = yyls;
#endif

/* Push a new state, which is found in  yystate  .  */
/* In all cases, when you get here, the value and location stacks
   have just been pushed. so pushing a state here evens the stacks.  */
yynewstate:

  *++yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* Give user a chance to reallocate the stack */
      /* Use copies of these so that the &'s don't force the real ones into memory. */
      YYSTYPE *yyvs1 = yyvs;
      short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
      YYLTYPE *yyls1 = yyls;
#endif

      /* Get the current used size of the three stacks, in elements.  */
      int size = yyssp - yyss + 1;

#ifdef yyoverflow
      /* Each stack pointer address is followed by the size of
	 the data in use in that stack, in bytes.  */
#ifdef YYLSP_NEEDED
      /* This used to be a conditional around just the two extra args,
	 but that might be undefined if yyoverflow is a macro.  */
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yyls1, size * sizeof (*yylsp),
		 &yystacksize);
#else
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yystacksize);
#endif

      yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
      yyls = yyls1;
#endif
#else /* no yyoverflow */
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
	{
	  yyerror("parser stack overflow");
	  return 2;
	}
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
	yystacksize = YYMAXDEPTH;
      yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
      __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
      yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
      __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
      yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
      __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */

      yyssp = yyss + size - 1;
      yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
      yylsp = yyls + size - 1;
#endif

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif

      if (yyssp >= yyss + yystacksize - 1)
	YYABORT;
    }

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Entering state %d\n", yystate);
#endif

  goto yybackup;
 yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Reading a token: ");
#endif
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with */

  if (yychar <= 0)		/* This means end of input. */
    {
      yychar1 = 0;
      yychar = YYEOF;		/* Don't call YYLEX any more */

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      yychar1 = YYTRANSLATE(yychar);

#if YYDEBUG != 0
      if (yydebug)
	{
	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
	  /* Give the individual parser a way to print the precise meaning
	     of a token, for further debugging info.  */
#ifdef YYPRINT
	  YYPRINT (stderr, yychar, yylval);
#endif
	  fprintf (stderr, ")\n");
	}
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  /* count tokens shifted since error; after three, turn off error status.  */
  if (yyerrstatus) yyerrstatus--;

  yystate = yyn;
  goto yynewstate;

/* Do the default action for the current state.  */
yydefault:

  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;

/* Do a reduction.  yyn is the number of a rule to reduce with.  */
yyreduce:
  yylen = yyr2[yyn];
  if (yylen > 0)
    yyval = yyvsp[1-yylen]; /* implement default value of the action */

#if YYDEBUG != 0
  if (yydebug)
    {
      int i;

      fprintf (stderr, "Reducing via rule %d (line %d), ",
	       yyn, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif


  switch (yyn) {

case 1:
#line 287 "Gram.y"
{
		;
    break;}
case 2:
#line 290 "Gram.y"
{
		;
    break;}
case 3:
#line 295 "Gram.y"
{
		    //
		    // Push repository on the container stack
		    //
		    IdlContStack.append(CORBA_Repository::
					_duplicate(IdlRepository));

		    //
		    // Push new empty prefix on the prefix stacks
		    //
		    for(CORBA_ULong i = 0 ; i < IdlPrefStackStack.length() ;
			i++)
			IdlPrefStackStack[i].append(CORBA_string_dup(""));
                ;
    break;}
case 4:
#line 310 "Gram.y"
{
		    //
		    // Pop container from the stack
		    //
		    assert(IdlContStack.length() > 0);
		    IdlContStack.length(IdlContStack.length() - 1);
		    assert(yynerrs > 0 || IdlContStack.length() == 0);

		    //
		    // Pop prefix from the prefix stacks
		    //
		    for(CORBA_ULong i = 0 ; i < IdlPrefStackStack.length() ;
			i++)
		    {
			assert(IdlPrefStackStack[i].length() > 0);
			IdlPrefStackStack[i].length(
			    IdlPrefStackStack[i].length() - 1);
			assert(yynerrs > 0 ||
			       IdlPrefStackStack[i].length() == 0);
		    }
		;
    break;}
case 5:
#line 334 "Gram.y"
{
		;
    break;}
case 6:
#line 337 "Gram.y"
{
		;
    break;}
case 7:
#line 342 "Gram.y"
{
		;
    break;}
case 8:
#line 345 "Gram.y"
{
		    IdlError("`;' missing after definition");
		    yynerrs++;
		;
    break;}
case 9:
#line 350 "Gram.y"
{
		    yyerrok;
		;
    break;}
case 10:
#line 354 "Gram.y"
{
		    CORBA_String_var s = yyvsp[0].string;
		    if(IdlParsePragma(s) == false)
		    {
			yynerrs++;
		    }
		;
    break;}
case 11:
#line 364 "Gram.y"
{
		;
    break;}
case 12:
#line 367 "Gram.y"
{
		;
    break;}
case 13:
#line 370 "Gram.y"
{
		;
    break;}
case 14:
#line 373 "Gram.y"
{
		;
    break;}
case 15:
#line 376 "Gram.y"
{
		;
    break;}
case 16:
#line 381 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Get name, id and version
		    //
		    CORBA_Identifier_var name = yyvsp[0].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Check if name already exists
		    //
		    CORBA_Contained_var c;
		    try
		    {
			c = container -> lookup(name);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    CORBA_ModuleDef_var module;
		    if(!CORBA_is_nil(c))
		    {
			//
			// Name exists, check if it is an module declaration
			//
			module = CORBA_ModuleDef::_narrow(c);

			if(CORBA_is_nil(module))
			{	
			    CORBA_String_var err = CORBA_string_dup("`");
			    err += name;
			    err += "' is not a module";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}
		    }
		    else
		    {
			//
			// Create new module
			//
			try
			{
			    module =
				container -> create_module(id, name, version);
			}
			catch(const CORBA_INTF_REPOS& ex)
			{
			    IdlPrintException(ex.minor(), id, name);
			    yynerrs++;
			    YYERROR;
			}
		    }

		    assert(!CORBA_is_nil(module));

		    //
		    // Push new container on the stack
		    //
		    IdlContStack.append(CORBA_ModuleDef::_duplicate(module));

		    //
		    // Push new prefix on the prefix stacks
		    //
		    for(CORBA_ULong i = 0 ; i < IdlPrefStackStack.length() ;
			i++)
		    {
			CORBA_String_var prefix =
			    IdlPrefStackStack[i][IdlPrefStackStack[i].length()
						- 1];
			prefix += name;
			prefix += "/";
			IdlPrefStackStack[i].append(prefix);
		    }

		    //
		    // Add ID to IdlTopFileContent and IdlComments
		    //
		    IdlAddID(id);
		;
    break;}
case 17:
#line 474 "Gram.y"
{
		    //
		    // Pop container from the stack
		    //
		    assert(IdlContStack.length() > 0);
		    IdlContStack.length(IdlContStack.length() - 1);

		    //
		    // Pop prefix from the prefix stacks
		    //
		    for(CORBA_ULong i = 0 ; i < IdlPrefStackStack.length() ;
			i++)
		    {
			assert(IdlPrefStackStack[i].length() > 0);
			IdlPrefStackStack[i].length(
			    IdlPrefStackStack[i].length() - 1);
		    }
		;
    break;}
case 18:
#line 495 "Gram.y"
{
		;
    break;}
case 19:
#line 498 "Gram.y"
{
		;
    break;}
case 20:
#line 503 "Gram.y"
{
		    //
		    // Pop container from the stack
		    // Pop prefixes from the stack
		    //
		    assert(IdlContStack.length() > 0);
		    IdlContStack.length(IdlContStack.length() - 1);

		    //
		    // Pop prefix from the prefix stacks
		    //
		    for(CORBA_ULong i = 0 ; i < IdlPrefStackStack.length() ;
			i++)
		    {
			assert(IdlPrefStackStack[i].length() > 0);
			IdlPrefStackStack[i].length(
			    IdlPrefStackStack[i].length() - 1);
		    }
		;
    break;}
case 21:
#line 525 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Get name, id and version
		    //
		    CORBA_Identifier_var name = yyvsp[0].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Check if name already exists
		    //
		    CORBA_Contained_var c;
		    try
		    {
			c = container -> lookup(name);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    if(!CORBA_is_nil(c))
		    {
			//
			// Check for ID equivalence
			//
// 			CORBA_RepositoryId_var oldId = c -> id();
// 			if(strcmp(oldId, id) != 0)
// 			{
// 			    CORBA_String_var err =
// 				CORBA_string_dup("conflicting repository ids "
// 						 "for `interface ");
// 			    err += name;
// 			    err += "'";
// 			    IdlError(err);
// 			    yynerrs++;
// 			    YYERROR;
// 			}

			//
			// Name exists, check if it is an interface
			//
			CORBA_InterfaceDef_var i =
			    CORBA_InterfaceDef::_narrow(c);

			if(CORBA_is_nil(i))
			{
			    CORBA_String_var err =
				CORBA_string_dup("conflicting types for "
						 "`interface ");
			    err += name;
			    err += "'";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}
		    }
		    else
		    {
			//
			// Create "empty" interface as forward
			// declaration, do not put it on the container
			// stack, but put it in the list of forward
			// declared interfaces
			//
			CORBA_InterfaceDefSeq seq;

			try
			{
			    CORBA_InterfaceDef_var interf =
				container -> create_interface(id, name,
							      version, seq);
			    IdlFwdInterfaces.append(interf -> absolute_name());
		        }
			catch(const CORBA_INTF_REPOS& ex)
			{
			    IdlPrintException(ex.minor(), id, name);
			    yynerrs++;
			    YYERROR;
			}
		    }
		;
    break;}
case 22:
#line 619 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Get name, id and version
		    //
		    CORBA_Identifier_var name = yyvsp[-1].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Get inheritance specification sequence
		    //
		    CORBA_InterfaceDefSeq_var seq = yyvsp[0].interfaceDefSeq;
		    
		    //
		    // Check if name already exists
		    //
		    CORBA_Contained_var c;
		    try
		    {
			c = container -> lookup(name);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    CORBA_InterfaceDef_var interf;
		    if(!CORBA_is_nil(c))
		    {
			//
			// Check for ID equivalence
			//
// 			CORBA_RepositoryId_var oldId = c -> id();
// 			if(strcmp(oldId, id) != 0)
// 			{
// 			    CORBA_String_var err =
// 				CORBA_string_dup("conflicting repository ids "
// 						 "for `interface ");
// 			    err += name;
// 			    err += "'";
// 			    IdlError(err);
// 			    yynerrs++;
// 			    YYERROR;
// 			}

			//
			// Name exists, check if it is an interface
			// forward declaration
			//
			interf = CORBA_InterfaceDef::_narrow(c);
			
			if(CORBA_is_nil(interf))
			{	
			    CORBA_String_var err =
				CORBA_string_dup("conflicting types for "
						 "`interface ");
			    err += name;
			    err += "'";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}

			//
			// Don't use ID for comparison, because it's
			// possible that the ID was changed with
			// #pragma
			//
			CORBA_ScopedName_var abs = interf -> absolute_name();
			CORBA_ULong i;
			for(i = 0 ; i < IdlFwdInterfaces.length() ; i++)
			{
			    if(strcmp(abs, IdlFwdInterfaces[i]) == 0)
				break;
			}

			if(i >= IdlFwdInterfaces.length())
			{
			    CORBA_String_var err =
				CORBA_string_dup("redefinition of "
						 "`interface ");
			    err += name;
			    err += "'";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}
			
			IdlFwdInterfaces.remove(i);

			try
			{
			    //
			    // Fill interface
			    //
			    interf -> id(id);
			    // Not necessary, move() sets new name and
			    // version:
			    //interf -> name(name);
			    //interf -> version(version);
			    interf -> base_interfaces(seq);
			    
			    //
			    // Move interface (this will make this interface
			    // the last entry in the container)
			    //
			    interf -> move(container, name, version);
			}
			catch(const CORBA_INTF_REPOS& ex)
			{
			    IdlPrintException(ex.minor(), id, name);
			    yynerrs++;
			    YYERROR;
			}
		    }
		    else
		    {
			//
			// Push new container on the stack
			//
			try
			{
			    interf = container ->
				create_interface(id, name, version, seq);
			}
			catch(const CORBA_INTF_REPOS& ex)
			{
			    IdlPrintException(ex.minor(), id, name);
			    yynerrs++;
			    YYERROR;
			}
		    }
		    
		    //
		    // Push filled interface on the stack
		    //
		    IdlContStack.append(CORBA_InterfaceDef::
					_duplicate(interf));
		    
		    //
		    // Push new prefix on the prefix stacks
		    //
		    for(CORBA_ULong i = 0 ; i < IdlPrefStackStack.length() ;
			i++)
		    {
			CORBA_String_var prefix =
			    IdlPrefStackStack[i][IdlPrefStackStack[i].length()
						- 1];
			prefix += name;
			prefix += "/";
			IdlPrefStackStack[i].append(prefix);
		    }
		    
		    //
		    // Add ID to IdlTopFileContent and IdlComments
		    //
		    IdlAddID(id);
		;
    break;}
case 23:
#line 789 "Gram.y"
{
		    yyval.interfaceDefSeq = yyvsp[0].interfaceDefSeq;
		;
    break;}
case 24:
#line 793 "Gram.y"
{
		    yyval.interfaceDefSeq = new CORBA_InterfaceDefSeq;
		;
    break;}
case 25:
#line 799 "Gram.y"
{
		;
    break;}
case 26:
#line 804 "Gram.y"
{
		;
    break;}
case 27:
#line 807 "Gram.y"
{
		;
    break;}
case 28:
#line 812 "Gram.y"
{
		;
    break;}
case 29:
#line 815 "Gram.y"
{
		    IdlError("`;' missing after definition");
		    yynerrs++;
		;
    break;}
case 30:
#line 820 "Gram.y"
{
		    yyerrok;
		;
    break;}
case 31:
#line 824 "Gram.y"
{
		    CORBA_String_var s = yyvsp[0].string;
		    if(!IdlParsePragma(s))
		    {
			yynerrs++;
		    }
		;
    break;}
case 32:
#line 834 "Gram.y"
{
		;
    break;}
case 33:
#line 837 "Gram.y"
{
		;
    break;}
case 34:
#line 840 "Gram.y"
{
		;
    break;}
case 35:
#line 843 "Gram.y"
{
		;
    break;}
case 36:
#line 846 "Gram.y"
{
		;
    break;}
case 37:
#line 851 "Gram.y"
{
		    IdlStringSeq_var scopedNameSeq = yyvsp[0].stringSeq;
		    scopedNameSeq -> insert(yyvsp[-1].string);
		
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Create inheritance specification sequence
		    //
		    CORBA_InterfaceDefSeq_var iDefSeq =
			new CORBA_InterfaceDefSeq(scopedNameSeq -> length());

		    for(CORBA_ULong i = 0 ;
			i < scopedNameSeq -> length() ;	i++)
		    {
			//
			// Find scoped name
			//
			const char* scoped = scopedNameSeq[i];
			CORBA_IRObject_var irObj =
			    IdlFindScopedName(container, scoped);

			if(CORBA_is_nil(irObj))
			{
			    yynerrs++;
			    YYERROR;
			}
			
			while(true)
			{
			    CORBA_AliasDef_var aliasDef =
				CORBA_AliasDef::_narrow(irObj);
			    
			    if(CORBA_is_nil(aliasDef))
				break;
			    
			    irObj = aliasDef -> original_type_def();
			}

			CORBA_InterfaceDef_var interfaceDef =
			    CORBA_InterfaceDef::_narrow(irObj);

			if(CORBA_is_nil(interfaceDef))
			{	
			    CORBA_String_var err = CORBA_string_dup("`");
			    err += scoped;
			    err += "' is not an interface type";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}

			CORBA_ScopedName_var abs =
			    interfaceDef -> absolute_name();
			for(CORBA_ULong j = 0 ;
			    j < IdlFwdInterfaces.length() ; j++)
			{
			    if(strcmp(abs, IdlFwdInterfaces[j]) == 0)
			    {
				CORBA_String_var err =
				    CORBA_string_dup("can't inherit from "
						     "undefined interface `");
				err += scoped;
				err += "'";
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			}

			iDefSeq -> append(interfaceDef);
		    }

		    yyval.interfaceDefSeq = iDefSeq._retn();
		;
    break;}
case 38:
#line 934 "Gram.y"
{
		    yyvsp[0].stringSeq -> insert(yyvsp[-1].string);
		    yyval.stringSeq = yyvsp[0].stringSeq;
		;
    break;}
case 39:
#line 939 "Gram.y"
{
		    yyval.stringSeq = new IdlStringSeq;
		;
    break;}
case 40:
#line 945 "Gram.y"
{
		    yyval.string = yyvsp[0].string;
		;
    break;}
case 41:
#line 949 "Gram.y"
{
		    CORBA_Identifier_var ident = yyvsp[0].string;

		    yyval.string = CORBA_string_alloc(2 + strlen(ident));
		    strcpy(yyval.string, "::");
		    strcat(yyval.string, ident);
		;
    break;}
case 42:
#line 957 "Gram.y"
{
		    CORBA_Identifier_var scoped = yyvsp[-2].string;
		    CORBA_Identifier_var ident = yyvsp[0].string;

		    yyval.string = CORBA_string_alloc(strlen(scoped) + 2 +
					    strlen(ident));
		    strcpy(yyval.string, scoped);
		    strcat(yyval.string, "::");
		    strcat(yyval.string, ident);
		;
    break;}
case 43:
#line 970 "Gram.y"
{
		    //
		    // Get type and value
		    //
		    CORBA_IDLType_var idlType = yyvsp[-3].idlType;
		    CORBA_Any_var any = yyvsp[0].any;

		    //
		    // Get name, id and version
		    //
		    CORBA_Identifier_var name = yyvsp[-2].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Check if conversion is necessary
		    //
		    CORBA_TypeCode_var tc1 = idlType -> type();
		    tc1 = OBGetOrigType(tc1);
		    CORBA_TypeCode_var tc2 = any -> type();

		    if(!tc1 -> equal(tc2))
		    {
			CORBA_ULong ul;
			CORBA_Boolean ulb;
			CORBA_Long l;
			CORBA_Boolean lb;
			CORBA_Double d;
			CORBA_Boolean db;
			TranslateAny(any, ul, ulb, l, lb, d, db);
			
			const char* err =
			    "wrong type for constant initialization";
		    
			//
			// Convert value type
			//
			switch(tc1 -> kind())
			{
			case CORBA_tk_short:
			    
			    if(ulb)
				any <<= (CORBA_Short)ul;
			    else if(lb)
				any <<= (CORBA_Short)l;
			    else if(db)
			    {
				IdlWarning("converting floating point to "
					   "short");
				any <<= (CORBA_Short)d;
			    }
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			case CORBA_tk_long:
			    
			    if(ulb)
				any <<= (CORBA_Long)ul;
			    else if(lb)
				any <<= (CORBA_Long)l;
			    else if(db)
			    {
				IdlWarning("converting floating point to "
					   "long");
				any <<= (CORBA_Long)d;
			    }
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			case CORBA_tk_ushort:
			    
			    if(ulb)
				any <<= (CORBA_UShort)ul;
			    else if(lb)
			    {
				if(l < 0)
				    IdlWarning("converting negative value to "
					       "unsigned short");
				any <<= (CORBA_UShort)l;
			    }
			    else if(db)
			    {
				IdlWarning("converting floating point to "
					   "unsigned short");
				any <<= (CORBA_UShort)d;
			    }
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			case CORBA_tk_ulong:
			    
			    if(ulb)
				any <<= (CORBA_ULong)ul;
			    else if(lb)
			    {
				if(l < 0)
				    IdlWarning("converting negative value to "
					       "unsigned short");
				any <<= (CORBA_ULong)l;
			    }
			    else if(db)
			    {
				IdlWarning("converting floating point to "
					   "unsigned long");
				any <<= (CORBA_ULong)d;
			    }
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			case CORBA_tk_float:
			    
			    if(ulb)
				any <<= (CORBA_Float)ul;
			    else if(lb)
				any <<= (CORBA_Float)l;
			    else if(db)
				any <<= (CORBA_Float)d;
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			case CORBA_tk_double:
			    
			    if(ulb)
				any <<= (CORBA_Double)ul;
			    else if(lb)
				any <<= (CORBA_Double)l;
			    else if(db)
				any <<= (CORBA_Double)d;
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;

			case CORBA_tk_string:
			{
			    char* s;
			    if(any >>= s)
			    {
				CORBA_ULong len = tc1 -> length();
				CORBA_Any::from_string from(s, len);
				any <<= from;
			    }
			    break;
			}

			default:
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			    break;
			}
		    }

		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Create constant definition
		    //
		    try
		    {
			CORBA_release(container ->
				      create_constant(id, name, version,
						      idlType, any));
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    //
		    // Add ID to IdlTopFileContent and IdlComments
		    //
		    IdlAddID(id);
		;
    break;}
case 44:
#line 1188 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 45:
#line 1192 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 46:
#line 1196 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 47:
#line 1200 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 48:
#line 1204 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 49:
#line 1208 "Gram.y"
{
		    CORBA_ScopedName_var scoped = yyvsp[0].string;

		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];
			
		    //
		    // Find scoped name
		    //
		    CORBA_IRObject_var irObj =
			IdlFindScopedName(container, scoped);

		    if(CORBA_is_nil(irObj))
		    {
			yynerrs++;
			YYERROR;
		    }

		    bool valid = false;

		    CORBA_IDLType_var idlType = CORBA_IDLType::_narrow(irObj);
		    if(!CORBA_is_nil(idlType))
		    {
			CORBA_TypeCode_var tc = idlType -> type();
			tc = OBGetOrigType(tc);
			
			CORBA_TCKind k = tc -> kind();
			
			if(k == CORBA_tk_short || k == CORBA_tk_ushort ||
			   k == CORBA_tk_long || k == CORBA_tk_ulong ||
			   k == CORBA_tk_float || k == CORBA_tk_double ||
			   k == CORBA_tk_char || k == CORBA_tk_boolean ||
			   (k == CORBA_tk_string && tc -> length() == 0))
			    valid = true;
		    }

		    if(!valid)
		    {
			CORBA_String_var err = CORBA_string_dup("`");
			err += scoped;
			err += "' is not a valid constant type";
			IdlError(err);
			yynerrs++;
			YYERROR;
		    }

		    yyval.idlType = idlType._retn();
		;
    break;}
case 50:
#line 1263 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 51:
#line 1269 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 52:
#line 1273 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool) &&
		       (uLongRBool || longRBool))
		    {
			if(longLBool || longRBool)
			    result <<= (longL | longR);
			else
			    result <<= (uLongL | uLongR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator |");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 53:
#line 1315 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 54:
#line 1319 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool) &&
		       (uLongRBool || longRBool))
		    {
			if(longLBool || longRBool)
			    result <<= (longL ^ longR);
			else
			    result <<= (uLongL ^ uLongR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator ^");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 55:
#line 1361 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 56:
#line 1365 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool) &&
		       (uLongRBool || longRBool))
		    {
			if(longLBool || longRBool)
			    result <<= (longL & longR);
			else
			    result <<= (uLongL & uLongR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator &");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 57:
#line 1407 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 58:
#line 1411 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool) &&
		       (uLongRBool || longRBool))
		    {
			if(!(0 <= longR && longR < 32))
			{
			    IdlError("right operand of binary operator >> "
				     "must be in the range 0 <= right "
				     "operand < 32");
			    yynerrs++;
			    YYERROR;
			}

			if(longLBool)
			    result <<= (longL >> longR);
			else
			    result <<= (uLongL >> longR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator >>");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 59:
#line 1460 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool) &&
		       (uLongRBool || longRBool))
		    {
			if(!(0 <= longR && longR < 32))
			{
			    IdlError("right operand of binary operator << "
				     "must be in the range 0 <= right "
				     "operand < 32");
			    yynerrs++;
			    YYERROR;
			}

			if(longLBool)
			    result <<= (longL << longR);
			else
			    result <<= (uLongL << longR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator <<");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 60:
#line 1511 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 61:
#line 1515 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool || doubleLBool) &&
		       (uLongRBool || longRBool || doubleRBool))
		    {
			if(doubleLBool || doubleRBool)
			    result <<= (doubleL + doubleR);
			else if(longLBool || longRBool)
			    result <<= (longL + longR);
			else
			    result <<= (uLongL + uLongR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator +");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 62:
#line 1557 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool || doubleLBool) &&
		       (uLongRBool || longRBool || doubleRBool))
		    {
			if(doubleLBool || doubleRBool)
			    result <<= (doubleL - doubleR);
			else if(longLBool || longRBool)
			    result <<= (longL - longR);
			else
			{
			    if(uLongR > uLongL)
				result <<= ((CORBA_Long)uLongL -
					    (CORBA_Long)uLongR);
			    else
				result <<= (uLongL - uLongR);
			}
		    }
		    else
		    {
			IdlError("invalid operand for binary operator -");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 63:
#line 1607 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 64:
#line 1611 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool || doubleLBool) &&
		       (uLongRBool || longRBool || doubleRBool))
		    {
			if(doubleLBool || doubleRBool)
			    result <<= (doubleL * doubleR);
			else if(longLBool || longRBool)
			    result <<= (longL * longR);
			else
			    result <<= (uLongL * uLongR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator *");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 65:
#line 1653 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool || doubleLBool) &&
		       (uLongRBool || longRBool || doubleRBool))
		    {
			if(doubleLBool || doubleRBool)
			    result <<= (doubleL / doubleR);
			else if(longLBool || longRBool)
			    result <<= (longL / longR);
			else
			    result <<= (uLongL / uLongR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator /");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 66:
#line 1695 "Gram.y"
{
		    CORBA_Any_var left = yyvsp[-2].any;
		    CORBA_Any_var right = yyvsp[0].any;
		    CORBA_Any_var result = new CORBA_Any;

		    CORBA_ULong uLongL, uLongR;
		    CORBA_Boolean uLongLBool, uLongRBool;
		    CORBA_Long longL, longR;
		    CORBA_Boolean longLBool, longRBool;
		    CORBA_Double doubleL, doubleR;
		    CORBA_Boolean doubleLBool, doubleRBool;

		    TranslateAny(left,
				 uLongL, uLongLBool,
				 longL, longLBool,
				 doubleL, doubleLBool);

		    TranslateAny(right,
				 uLongR, uLongRBool,
				 longR, longRBool,
				 doubleR, doubleRBool);

		    if((uLongLBool || longLBool) &&
		       (uLongRBool || longRBool))
		    {
			if(longLBool || longRBool)
			    result <<= (longL % longR);
			else
			    result <<= (uLongL % uLongR);
		    }
		    else
		    {
			IdlError("invalid operand for binary operator %");
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 67:
#line 1737 "Gram.y"
{
		    CORBA_Any_var result = yyvsp[0].any;
		    
		    const char* err = 0;
		    
		    if(yyvsp[-1].charVal == '~')
			err = "wrong argument type for bit-complement";
		    else if(yyvsp[-1].charVal == '+')
			err = "wrong argument type for unary plus";
		    else if(yyvsp[-1].charVal == '-')
			err = "wrong argument type for unary minus";
		    else
			assert(false);

		    CORBA_ULong ul;
		    CORBA_Boolean ulb;
		    CORBA_Long l;
		    CORBA_Boolean lb;
		    CORBA_Double d;
		    CORBA_Boolean db;
		    TranslateAny(result, ul, ulb, l, lb, d, db);

		    if(ulb)
		    {
			if(yyvsp[-1].charVal == '-')
			{
			    l = -(CORBA_Long)ul;
			    result <<= l;
			}
			else if(yyvsp[-1].charVal == '~')
			{
			    ul = ~ul;
			    result <<= ul;
			}
		    }
		    else if(lb)
		    {
			if(yyvsp[-1].charVal == '-')
			{
			    l = -l;
			    result <<= l;
			}
			else if(yyvsp[-1].charVal == '~')
			{
			    l = ~l;
			    result <<= l;
			}
		    }
		    else if(db)
		    {
			if(yyvsp[-1].charVal == '-')
			{
			    d = -d;
			    result <<= d;
			}
			else if(yyvsp[-1].charVal == '~')
			{
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}
		    }
		    else
		    {
			IdlError(err);
			yynerrs++;
			YYERROR;
		    }

		    yyval.any = result._retn();
		;
    break;}
case 68:
#line 1809 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 69:
#line 1815 "Gram.y"
{
		    yyval.charVal = '-';
		;
    break;}
case 70:
#line 1819 "Gram.y"
{
		    yyval.charVal = '+';
		;
    break;}
case 71:
#line 1823 "Gram.y"
{
		    yyval.charVal = '~';
		;
    break;}
case 72:
#line 1829 "Gram.y"
{
		    CORBA_ScopedName_var scoped = yyvsp[0].string;
		    yyval.any = 0;
		    
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];
		    
		    if(!CORBA_is_nil(IdlUnionSwitchType))
		    {
			//
			// Special treatment for unions with enums
			//
			CORBA_IDLType_var switchType =
			    CORBA_IDLType::_duplicate(IdlUnionSwitchType);
			
			while(true)
			{
			    CORBA_AliasDef_var aliasDef =
				CORBA_AliasDef::_narrow(switchType);
			    
			    if(CORBA_is_nil(aliasDef))
				break;
			    
			    switchType = aliasDef -> original_type_def();
			}
			
			CORBA_EnumDef_var enumDef =
			    CORBA_EnumDef::_narrow(switchType);
			
			if(!CORBA_is_nil(enumDef))
			{
			    CORBA_Long memberNum =
				IdlFindEnumMember(container, enumDef, scoped);
			    
			    if(memberNum == -1)
			    {
				yynerrs++;
				YYERROR;
			    }
			    
			    CORBA_TypeCode_var tc = enumDef -> type();
			    CORBA_ULong* p = new CORBA_ULong;
			    *p = (CORBA_ULong)memberNum;
			    yyval.any = new CORBA_Any;
			    yyval.any -> replace(tc, p, true);
			}
		    }

		    if(yyval.any == 0)
		    {
			//
			// Find scoped name
			//
			CORBA_IRObject_var irObj =
			    IdlFindScopedName(container, scoped);
			
			if(CORBA_is_nil(irObj))
			{
			    yynerrs++;
			    YYERROR;
			}
			
			CORBA_ConstantDef_var co =
			    CORBA_ConstantDef::_narrow(irObj);
			if(CORBA_is_nil(co))
			{
			    CORBA_String_var err = CORBA_string_dup("`");
			    err += scoped;
			    err += "' is not a constant";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}
			
			yyval.any = co -> value();
		    }
		;
    break;}
case 73:
#line 1911 "Gram.y"
{
		    yyval.any = yyvsp[0].any;
		;
    break;}
case 74:
#line 1915 "Gram.y"
{
		    yyval.any = yyvsp[-1].any;
		;
    break;}
case 75:
#line 1921 "Gram.y"
{
		    CORBA_Any* any = new CORBA_Any;
		    *any <<= yyvsp[0].uLongVal;
		    yyval.any = any;
		;
    break;}
case 76:
#line 1927 "Gram.y"
{
		    CORBA_String_var origString = CORBA_string_dup(yyvsp[0].string);

		    if(!IdlRemoveEscapes(yyvsp[0].string, true))
		    {
			CORBA_String_var err = CORBA_string_dup("`");
			err += origString;
			err += "' contains \\0 character";
			IdlError(err);
			yynerrs++;
			YYERROR;
		    }

		    CORBA_Any* any = new CORBA_Any;
		    *any <<= yyvsp[0].string;
		    yyval.any = any;
		;
    break;}
case 77:
#line 1945 "Gram.y"
{
		    CORBA_Any* any = new CORBA_Any;
		    *any <<= CORBA_Any::from_char(yyvsp[0].charVal);
		    yyval.any = any;
		;
    break;}
case 78:
#line 1951 "Gram.y"
{
		    CORBA_Any* any = new CORBA_Any;
		    *any <<= yyvsp[0].doubleVal;
		    yyval.any = any;
		;
    break;}
case 79:
#line 1957 "Gram.y"
{
		    CORBA_Any* any = new CORBA_Any;
		    *any <<= CORBA_Any::from_boolean(yyvsp[0].booleanVal);
		    yyval.any = any;
		;
    break;}
case 80:
#line 1965 "Gram.y"
{
		    assert(yyvsp[0].booleanVal == CORBA_TRUE);
		    yyval.booleanVal = true;
		;
    break;}
case 81:
#line 1970 "Gram.y"
{
		    assert(yyvsp[0].booleanVal == CORBA_FALSE);
		    yyval.booleanVal = false;
		;
    break;}
case 82:
#line 1977 "Gram.y"
{
		    CORBA_Any_var any = yyvsp[0].any;
		    CORBA_TypeCode_var tc = any -> type();
		    tc = OBGetOrigType(tc);
		    
		    switch(tc -> kind())
		    {
		    case CORBA_tk_short:
		    {
			CORBA_Short v;
			any >>= v;
			if(v <= 0)
			{
			    IdlError("integer constant must be > 0");
			    yynerrs++;
			    YYERROR;
			}
			yyval.uLongVal = (CORBA_ULong)v;
			break;
		    }

		    case CORBA_tk_long:
		    {
			CORBA_Long v;
			any >>= v;
			if(v <= 0)
			{
			    IdlError("integer constant must be > 0");
			    yynerrs++;
			    YYERROR;
			}
			yyval.uLongVal = (CORBA_ULong)v;
			break;
		    }
		    
		    case CORBA_tk_ushort:
		    {
			CORBA_UShort v;
			any >>= v;
			yyval.uLongVal = (CORBA_ULong)v;
			break;
		    }

		    case CORBA_tk_ulong:
		    {
			CORBA_ULong v;
			any >>= v;
			yyval.uLongVal = (CORBA_ULong)v;
			break;
		    }
		    
		    default:
		    {
			IdlError("not an integer constant");
			yynerrs++;
			YYERROR;
			break;
		    }
		    }
		;
    break;}
case 83:
#line 2040 "Gram.y"
{
		;
    break;}
case 84:
#line 2043 "Gram.y"
{
		    CORBA_release(yyvsp[0].structDef);
		;
    break;}
case 85:
#line 2047 "Gram.y"
{
		    CORBA_release(yyvsp[0].unionDef);
		;
    break;}
case 86:
#line 2051 "Gram.y"
{
		    CORBA_release(yyvsp[0].idlType);
		;
    break;}
case 87:
#line 2057 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    CORBA_IDLType_var simpleIDLType = yyvsp[-1].idlType;
		    IdlDeclaratorSeq_var declarators = yyvsp[0].declaratorSeq;

		    for(CORBA_ULong i = 0 ; i < declarators -> length() ; i++)
		    {
			IdlDeclarator declarator = declarators[i];

			//
			// Get name, id and version
			//
			CORBA_Identifier_var name = declarator.identifier;
			CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
			CORBA_VersionSpec_var version =
			    CORBA_string_dup("1.0");

			//	
			// Handle arrays
			//
			CORBA_IDLType_var idlType = simpleIDLType;

			for(CORBA_Long j = declarator.sizes.length() - 1 ;
			    j >= 0 ; j--)
			{
			    CORBA_ArrayDef_var arrayDef = IdlRepository ->
				create_array(declarator.sizes[j], idlType);

			    idlType = CORBA_IDLType::_duplicate(arrayDef);
			}

			//
			// Create alias
			//
			try
			{
			    CORBA_release(container ->
					  create_alias(id, name, version,
						       idlType));
			}
			catch(const CORBA_INTF_REPOS& ex)
			{
			    IdlPrintException(ex.minor(), id, name);
			    yynerrs++;
			    YYERROR;
			}

			//
			// Add ID to IdlTopFileContent and IdlComments
			//
			IdlAddID(id);
		    }
		;
    break;}
case 88:
#line 2119 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 89:
#line 2123 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 90:
#line 2129 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 91:
#line 2133 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 92:
#line 2137 "Gram.y"
{
		    CORBA_ScopedName_var scoped = yyvsp[0].string;

		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];
			
		    //
		    // Find scoped name
		    //
		    CORBA_IRObject_var irObj =
			IdlFindScopedName(container, scoped);

		    if(CORBA_is_nil(irObj))
		    {
			yynerrs++;
			YYERROR;
		    }

		    CORBA_IDLType_var idlType = CORBA_IDLType::_narrow(irObj);
		    if(CORBA_is_nil(idlType))
		    {
			CORBA_String_var err = CORBA_string_dup("`");
			err += scoped;
			err += "' is not a type specification";
			IdlError(err);
			yynerrs++;
			YYERROR;
		    }

		    yyval.idlType = idlType._retn();
		;
    break;}
case 93:
#line 2175 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 94:
#line 2179 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 95:
#line 2183 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 96:
#line 2187 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 97:
#line 2191 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 98:
#line 2195 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 99:
#line 2201 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 100:
#line 2205 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 101:
#line 2211 "Gram.y"
{
		    yyval.idlType = yyvsp[0].structDef;
		;
    break;}
case 102:
#line 2215 "Gram.y"
{
		    yyval.idlType = yyvsp[0].unionDef;
		;
    break;}
case 103:
#line 2219 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 104:
#line 2225 "Gram.y"
{
		    IdlDeclarator_var declarator = yyvsp[-1].declarator;
		    yyvsp[0].declaratorSeq -> insert(declarator);
		    yyval.declaratorSeq = yyvsp[0].declaratorSeq;
		;
    break;}
case 105:
#line 2233 "Gram.y"
{
		    IdlDeclarator_var declarator = yyvsp[-1].declarator;
		    yyvsp[0].declaratorSeq -> insert(declarator);
		    yyval.declaratorSeq = yyvsp[0].declaratorSeq;
		;
    break;}
case 106:
#line 2239 "Gram.y"
{
		    yyval.declaratorSeq = new IdlDeclaratorSeq;
		;
    break;}
case 107:
#line 2245 "Gram.y"
{
		    yyval.declarator = yyvsp[0].declarator;
		;
    break;}
case 108:
#line 2249 "Gram.y"
{
		    yyval.declarator = yyvsp[0].declarator;
		;
    break;}
case 109:
#line 2255 "Gram.y"
{
		    yyval.declarator = new IdlDeclarator;
		    yyval.declarator -> identifier = yyvsp[0].string;
		;
    break;}
case 110:
#line 2263 "Gram.y"
{
		    IdlDeclarator_var declarator = yyvsp[-1].declarator;
		    yyvsp[0].declaratorSeq -> insert(declarator);
		    yyval.declaratorSeq = yyvsp[0].declaratorSeq;
		;
    break;}
case 111:
#line 2269 "Gram.y"
{
		    yyval.declaratorSeq = new IdlDeclaratorSeq;
		;
    break;}
case 112:
#line 2275 "Gram.y"
{
		    yyval.declarator = yyvsp[0].declarator;
		;
    break;}
case 113:
#line 2281 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_float);
		;
    break;}
case 114:
#line 2285 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_double);
		;
    break;}
case 115:
#line 2291 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 116:
#line 2295 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 117:
#line 2301 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 118:
#line 2305 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 119:
#line 2311 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_long);
		;
    break;}
case 120:
#line 2317 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_short);
		;
    break;}
case 121:
#line 2323 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 122:
#line 2327 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 123:
#line 2333 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_ulong);
		;
    break;}
case 124:
#line 2339 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_ushort);
		;
    break;}
case 125:
#line 2345 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_char);
		;
    break;}
case 126:
#line 2351 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_boolean);
		;
    break;}
case 127:
#line 2357 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_octet);
		;
    break;}
case 128:
#line 2363 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_any);
		;
    break;}
case 129:
#line 2369 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Get name, id and version
		    //
		    const char* name = yyvsp[0].string; // No _var here!
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Create empty member sequence
		    //
		    CORBA_StructMemberSeq_var members =
		        new CORBA_StructMemberSeq;

		    //
		    // Create struct
		    //
		    try
                    {
			yyval.structDef = container ->
			    create_struct(id, name, version, members);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    //
		    // Add ID to IdlTopFileContent and IdlComments
		    //
		    IdlAddID(id);
                ;
    break;}
case 130:
#line 2411 "Gram.y"
{
		    yyval.structDef = yyvsp[-3].structDef;

		    //
		    // Get name and id
		    //
		    CORBA_Identifier_var name = yyvsp[-4].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);

		    //
		    // Get member sequence
		    //
		    CORBA_StructMemberSeq_var members = yyvsp[-1].structMemberSeq;

		    //
		    // Set the member sequence
		    //
		    try
                    {
			yyval.structDef -> members(members);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, yyvsp[-4].string);
			yynerrs++;
			YYERROR;
		    }
                ;
    break;}
case 131:
#line 2442 "Gram.y"
{
		    yyval.structMemberSeq = yyvsp[0].structMemberSeq;
		;
    break;}
case 132:
#line 2448 "Gram.y"
{
		    yyval.structMemberSeq = yyvsp[0].structMemberSeq;
		;
    break;}
case 133:
#line 2452 "Gram.y"
{
		    CORBA_StructMemberSeq_var members1 = yyvsp[-1].structMemberSeq;
		    CORBA_StructMemberSeq_var members2 = yyvsp[0].structMemberSeq;

		    for(CORBA_ULong i = 0 ; i < members2 -> length() ; i++)
		    {
			//
			// Check for duplicate struct members
			//
			for(CORBA_ULong j = 0 ; j < members1 -> length() ; j++)
			{
			    if(strcmp(members2[i].name, members1[j].name) == 0)
			    {
				CORBA_String_var err =
				    CORBA_string_dup("duplicate struct "
						     "member `");
				err += members2[i].name;
				err += "'";
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			}

			members1 -> append(members2[i]);
		    }

		    yyval.structMemberSeq = members1._retn();
		;
    break;}
case 134:
#line 2484 "Gram.y"
{
		    yyval.structMemberSeq = yyvsp[-1].structMemberSeq;
		;
    break;}
case 135:
#line 2488 "Gram.y"
{
		    yyval.structMemberSeq = yyvsp[0].structMemberSeq;
		    IdlError("`;' missing after struct member");
		    yynerrs++;
		;
    break;}
case 136:
#line 2496 "Gram.y"
{
		    CORBA_IDLType_var typeSpec = yyvsp[-1].idlType;
		    IdlDeclaratorSeq_var declarators = yyvsp[0].declaratorSeq;

		    CORBA_StructMemberSeq_var memberSeq =
			new CORBA_StructMemberSeq(declarators -> length());

		    for(CORBA_ULong i = 0 ; i < declarators -> length() ; i++)
		    {
			IdlDeclarator declarator = declarators[i];

			//	
			// Handle arrays
			//
			CORBA_IDLType_var idlType = typeSpec;

			for(CORBA_Long j = declarator.sizes.length() - 1 ;
			    j >= 0 ; j--)
			{
			    CORBA_ArrayDef_var arrayDef = IdlRepository ->
				create_array(declarator.sizes[j], idlType);

			    idlType = CORBA_IDLType::_duplicate(arrayDef);
			}

			//
			// Create member
			//
			CORBA_StructMember member;
			member.name = declarator.identifier;
			member.type = idlType -> type();
			member.type_def = idlType;
			
			memberSeq -> append(member);
		    }

		    yyval.structMemberSeq = memberSeq._retn();
		;
    break;}
case 137:
#line 2537 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Get name, id and version
		    //
		    const char* name = yyvsp[-4].string; // No _var here!
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Get union switch type
		    //
		    CORBA_IDLType_ptr disc = yyvsp[-1].idlType; // No _var here!

		    //
		    // Create empty member sequence
		    //
		    CORBA_UnionMemberSeq_var members =
		        new CORBA_UnionMemberSeq;

		    //
		    // Create union
		    //
		    try
                    {
			yyval.unionDef = container ->
			    create_union(id, name, version, disc, members);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    //
		    // Add ID to IdlTopFileContent and IdlComments
		    //
		    IdlAddID(id);

		    //
		    // Set IdlUnionSwitchType
		    //
		    // assert(CORBA_is_nil(IdlUnionSwitchType));
		    // ^^^ Don't do this. In case of an syntax error
		    // IdlUnionSwitchType will not be set to nil.
		    //
		    IdlUnionSwitchType = CORBA_IDLType::_duplicate(disc);
		;
    break;}
case 138:
#line 2593 "Gram.y"
{
		    yyval.unionDef = yyvsp[-3].unionDef;

		    //
		    // Reset IdlUnionSwitchType
		    //
		    CORBA_release(IdlUnionSwitchType);
		    IdlUnionSwitchType = CORBA_IDLType::_nil();
		    
		    //
		    // Get name and id
		    //
		    CORBA_Identifier_var name = yyvsp[-8].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);

		    //
		    // Get union switch type
		    //
		    CORBA_IDLType_var disc = yyvsp[-5].idlType;

		    //
		    // Get member sequence
		    //
		    CORBA_UnionMemberSeq_var members = yyvsp[-1].unionMemberSeq;

		    bool haveDefault = false;
		    for(CORBA_ULong i = 0 ; i < members -> length() ; i++)
		    {
			//
			// Check for multiple default labels
			//
			CORBA_Octet oct;
			CORBA_Boolean b =
			    members[i].label >>= CORBA_Any::to_octet(oct);

			if(b)
			{
			    assert(oct == 0);

			    if(haveDefault)
			    {
				IdlError("multiple default labels");
				yynerrs++;
				YYERROR;
			    }

			    haveDefault = true;
			}
			else
			{
			    //
			    // Check for duplicate labels
			    //
			    for(CORBA_ULong j = 0 ;
				j < members -> length() ; j++)
			    {
				if(i == j)
				    continue;

				CORBA_TypeCode_var tc1 =
				    members[i].label.type();
				CORBA_TypeCode_var tc2 =
				    members[j].label.type();
				
				tc1 = OBGetOrigType(tc1);
				tc2 = OBGetOrigType(tc2);

				if(tc2 -> kind() == CORBA_tk_octet)
				    continue;

				assert(tc1 -> equal(tc2)); 

				const void* v1 = members[i].label.value();
				const void* v2 = members[j].label.value();
				
				switch(tc1 -> kind())
				{
				case CORBA_tk_short:
				    if(*(CORBA_Short*)v1 ==
				       *(CORBA_Short*)v2)
				    {
					CORBA_String_var err =
					    CORBA_string_dup("duplicate label "
							     "`");
					err += *(CORBA_Short*)v1;
					err += "'";
					IdlError(err);
					yynerrs++;
					YYERROR;
				    }
				    break;

				case CORBA_tk_ushort:
				    if(*(CORBA_UShort*)v1 ==
				       *(CORBA_UShort*)v2)
				    {
					CORBA_String_var err =
					    CORBA_string_dup("duplicate label "
							     "`");
					err += *(CORBA_UShort*)v1;
					err += "'";
					IdlError(err);
					yynerrs++;
					YYERROR;
				    }
				    break;

				case CORBA_tk_long:
				    if(*(CORBA_Long*)v1 ==
				       *(CORBA_Long*)v2)
				    {
					CORBA_String_var err =
					    CORBA_string_dup("duplicate label "
							     "`");
					err += *(CORBA_Long*)v1;
					err += "'";
					IdlError(err);
					yynerrs++;
					YYERROR;
				    }
				    break;

				case CORBA_tk_ulong:
				    if(*(CORBA_ULong*)v1 ==
				       *(CORBA_ULong*)v2)
				    {
					CORBA_String_var err =
					    CORBA_string_dup("duplicate label "
							     "`");
					err += *(CORBA_ULong*)v1;
					err += "'";
					IdlError(err);
					yynerrs++;
					YYERROR;
				    }
				    break;

				case CORBA_tk_enum:
				    if(*(CORBA_ULong*)v1 ==
				       *(CORBA_ULong*)v2)
				    {
					CORBA_String_var err =
					    CORBA_string_dup("duplicate label "
							     "`");
					CORBA_String_var s =
					    tc1 ->
					    member_name(*(CORBA_ULong*)v1);
					err += "'";
					IdlError(err);
					yynerrs++;
					YYERROR;
				    }
				    break;
				    
				case CORBA_tk_char:
				    if(*(CORBA_Char*)v1 ==
				       *(CORBA_Char*)v2)
				    {
					CORBA_String_var err =
					    CORBA_string_dup("duplicate label "
							     "`");
					err += (char)*(CORBA_Char*)v1;
					err += "'";
					IdlError(err);
					yynerrs++;
					YYERROR;
				    }
				    break;

				case CORBA_tk_boolean:
				    if(*(CORBA_Boolean*)v1 ==
				       *(CORBA_Boolean*)v2)
				    {
					CORBA_String_var err =
					    CORBA_string_dup("duplicate label "
							     "`");
					err += *(CORBA_Boolean*)v1 ?
					    "TRUE" : "FALSE";
					err += "'";
					IdlError(err);
					yynerrs++;
					YYERROR;
				    }
				    break;
				    
				default:
				    assert(false);
				    break;
				}
			    }
			}
		    }

		    //
		    // Check for illegal default label
		    //
		    if(haveDefault)
		    {
			CORBA_TypeCode_var tc = disc -> type();
			tc = OBGetOrigType(tc);
			
			if((tc -> kind() == CORBA_tk_char &&
			    members -> length() > 256) ||
			   (tc -> kind() == CORBA_tk_boolean &&
			    members -> length() > 2) ||
			   (tc -> kind() == CORBA_tk_enum &&
			    members -> length() > tc -> member_count()))
			{
			    IdlError("No value available for an explicit "
				     "default label");
			    yynerrs++;
			    YYERROR;
			}
		    }

		    //
		    // Set the member sequence
		    //
		    try
                    {
			yyval.unionDef -> members(members);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, yyvsp[-8].string);
			yynerrs++;
			YYERROR;
		    }
		;
    break;}
case 139:
#line 2825 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 140:
#line 2829 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 141:
#line 2833 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 142:
#line 2837 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 143:
#line 2841 "Gram.y"
{
		    CORBA_ScopedName_var scoped = yyvsp[0].string;

		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];
			
		    //
		    // Find scoped name
		    //
		    CORBA_IRObject_var irObj =
			IdlFindScopedName(container, scoped);

		    if(CORBA_is_nil(irObj))
		    {
			yynerrs++;
			YYERROR;
		    }

		    bool valid = false;

		    CORBA_IDLType_var idlType = CORBA_IDLType::_narrow(irObj);
		    if(!CORBA_is_nil(idlType))
		    {
			CORBA_TypeCode_var tc = idlType -> type();
			tc = OBGetOrigType(tc);
			
			CORBA_TCKind k = tc -> kind();
			
			if(k == CORBA_tk_short || k == CORBA_tk_ushort ||
			   k == CORBA_tk_long || k == CORBA_tk_ulong ||
			   k == CORBA_tk_char || k == CORBA_tk_boolean ||
			   k == CORBA_tk_enum)
			    valid = true;
		    }

		    if(!valid)
		    {
			CORBA_String_var err = CORBA_string_dup("`");
			err += scoped;
			err += "' is not a valid union discriminator type";
			IdlError(err);
			yynerrs++;
			YYERROR;
		    }

		    yyval.idlType = idlType._retn();
		;
    break;}
case 144:
#line 2895 "Gram.y"
{
		    yyval.unionMemberSeq = yyvsp[0].unionMemberSeq;
		;
    break;}
case 145:
#line 2901 "Gram.y"
{
		    yyval.unionMemberSeq = yyvsp[0].unionMemberSeq;
		;
    break;}
case 146:
#line 2905 "Gram.y"
{
		    CORBA_UnionMemberSeq_var members1 = yyvsp[-1].unionMemberSeq;
		    CORBA_UnionMemberSeq_var members2 = yyvsp[0].unionMemberSeq;

		    //
		    // Check for duplicate union members
		    //
		    for(CORBA_ULong i = 0 ; i < members2 -> length() ; i++)
		    {
			//
			// It's only necessary to compare against the
			// first element of members1, since all
			// elements in members1 are equal.
			//
			if(strcmp(members2[i].name, members1[0].name) == 0)
			{
			    CORBA_String_var err =
				CORBA_string_dup("duplicate union member `");
			    err += members2[i].name;
			    err += "'";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}

			members1 -> append(members2[i]);
		    }

		    yyval.unionMemberSeq = members1._retn();
		;
    break;}
case 147:
#line 2938 "Gram.y"
{
		    yyval.unionMemberSeq = yyvsp[-1].unionMemberSeq;
		;
    break;}
case 148:
#line 2942 "Gram.y"
{
		    yyval.unionMemberSeq = yyvsp[0].unionMemberSeq;
		    IdlError("`;' missing after union member");
		    yynerrs++;
		;
    break;}
case 149:
#line 2950 "Gram.y"
{
		    IdlAnySeq_var anySeq = yyvsp[-1].anySeq;
		    CORBA_UnionMember_var member = yyvsp[0].unionMember;

		    CORBA_UnionMemberSeq_var memberSeq =
			new CORBA_UnionMemberSeq(anySeq -> length());
		    memberSeq -> length(anySeq -> length());

		    for(CORBA_ULong i = 0 ; i < anySeq -> length() ; i++)
		    {
			memberSeq[i] = member;
			memberSeq[i].label = anySeq[i];
		    }

		    yyval.unionMemberSeq = memberSeq._retn();
		;
    break;}
case 150:
#line 2969 "Gram.y"
{
		    CORBA_Any_var any = yyvsp[0].any;
		    yyval.anySeq = new IdlAnySeq;
		    yyval.anySeq -> insert(any);
		;
    break;}
case 151:
#line 2975 "Gram.y"
{
		    CORBA_Any_var any = yyvsp[-1].any;
		    yyvsp[0].anySeq -> insert(any);
		    yyval.anySeq = yyvsp[0].anySeq;
		;
    break;}
case 152:
#line 2983 "Gram.y"
{
		    CORBA_Any_var result = yyvsp[-1].any;

		    //
		    // Check if discriminator type is matched
		    //
		    assert(!CORBA_is_nil(IdlUnionSwitchType));
		    CORBA_TypeCode_var tc1 = IdlUnionSwitchType -> type();
		    tc1 = OBGetOrigType(tc1);
		    CORBA_TypeCode_var tc2 = result -> type();
		    tc2 = OBGetOrigType(tc2);

		    if(!tc1 -> equal(tc2))
		    {
			//
			// Check if conversion is possible
			//
			CORBA_ULong ul;
			CORBA_Boolean ulb;
			CORBA_Long l;
			CORBA_Boolean lb;
			CORBA_Double d;
			CORBA_Boolean db;
			TranslateAny(result, ul, ulb, l, lb, d, db);
			
			const char* err =
			    "case label type doesn't "
			    "match the discriminator type";
			
			//
			// Convert value type
			//
			switch(tc1 -> kind())
			{
			case CORBA_tk_short:
			    
			    if(ulb)
				result <<= (CORBA_Short)ul;
			    else if(lb)
				result <<= (CORBA_Short)l;
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			case CORBA_tk_long:
			    
			    if(ulb)
				result <<= (CORBA_Long)ul;
			    else if(lb)
				result <<= (CORBA_Long)l;
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			case CORBA_tk_ushort:
			    
			    if(ulb)
				result <<= (CORBA_UShort)ul;
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			case CORBA_tk_ulong:
			    
			    if(ulb)
				result <<= (CORBA_ULong)ul;
			    else
			    {
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			    
			    break;
			    
			default:
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			    break;
			}
		    }

		    yyval.any = result._retn();
		;
    break;}
case 153:
#line 3084 "Gram.y"
{
		    yyval.any = new CORBA_Any;
		    *yyval.any <<= CORBA_Any::from_octet(0);
		;
    break;}
case 154:
#line 3091 "Gram.y"
{
		    CORBA_IDLType_var typeSpec = yyvsp[-1].idlType;
		    IdlDeclarator_var declarator = yyvsp[0].declarator;

		    //	
		    // Handle arrays
		    //
		    CORBA_IDLType_var idlType = typeSpec;
		    
		    for(CORBA_Long j = declarator -> sizes.length() - 1 ;
			j >= 0 ; j--)
		    {
			CORBA_ArrayDef_var arrayDef = IdlRepository ->
			    create_array(declarator -> sizes[j], idlType);
			
			idlType = CORBA_IDLType::_duplicate(arrayDef);
		    }
		    
		    //
		    // Create member
		    //
		    yyval.unionMember = new CORBA_UnionMember;
		    yyval.unionMember -> name = declarator -> identifier;
		    yyval.unionMember -> type = idlType -> type();
		    yyval.unionMember -> type_def = idlType;
		;
    break;}
case 155:
#line 3121 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Get member sequence
		    //
		    CORBA_EnumMemberSeq_var members = yyvsp[-1].stringSeq;
		    members -> insert(yyvsp[-2].string);

		    //
		    // Get name, id and version
		    //
		    CORBA_Identifier_var name = yyvsp[-4].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Create enumerator
		    //
		    try
		    {
			yyval.idlType = container -> create_enum(id, name, version,
						      members);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    //
		    // Add ID to IdlTopFileContent and IdlComments
		    //
		    IdlAddID(id);
		;
    break;}
case 156:
#line 3165 "Gram.y"
{
		    CORBA_Identifier_var member = yyvsp[-1].string;
		    CORBA_EnumMemberSeq_var members = yyvsp[0].stringSeq;
		    
		    //
		    // Check for duplicate enum members
		    //
		    for(CORBA_ULong i = 0 ; i < members -> length() ; i++)
		    {
			if(strcmp(members[i], member) == 0)
			{
			    CORBA_String_var err =
				CORBA_string_dup("duplicate enum member `");
			    err += member;
			    err += "'";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}
		    }

		    members -> insert(member);
		    yyval.stringSeq = members._retn();
		;
    break;}
case 157:
#line 3190 "Gram.y"
{
		    yyval.stringSeq = new CORBA_EnumMemberSeq;
		;
    break;}
case 158:
#line 3194 "Gram.y"
{
		    IdlError("unexpected `,'");
		    yynerrs++;
		    YYERROR;
		;
    break;}
case 159:
#line 3202 "Gram.y"
{
		    yyval.string = yyvsp[0].string;
		;
    break;}
case 160:
#line 3208 "Gram.y"
{
		    CORBA_IDLType_var idlType = yyvsp[-3].idlType;
		    CORBA_ULong bound = yyvsp[-1].uLongVal;

		    //
		    // Create sequence
		    //
		    yyval.idlType = IdlRepository -> create_sequence(bound, idlType);
		;
    break;}
case 161:
#line 3218 "Gram.y"
{
		    CORBA_IDLType_var idlType = yyvsp[-1].idlType;

		    //
		    // Create sequence
		    //
		    yyval.idlType = IdlRepository -> create_sequence(0, idlType);
		;
    break;}
case 162:
#line 3229 "Gram.y"
{
		    CORBA_ULong bound = yyvsp[-1].uLongVal;

		    //
		    // Create string
		    //
		    yyval.idlType = IdlRepository -> create_string(bound);
		;
    break;}
case 163:
#line 3238 "Gram.y"
{
		    //
		    // Get string primitive
		    //
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_string);
		;
    break;}
case 164:
#line 3247 "Gram.y"
{
		    yyval.declarator = yyvsp[0].declarator;
		    yyval.declarator -> identifier = yyvsp[-1].string;
		;
    break;}
case 165:
#line 3254 "Gram.y"
{
		    yyval.declarator = new IdlDeclarator;
		    yyval.declarator -> sizes.insert(yyvsp[0].uLongVal);
		;
    break;}
case 166:
#line 3259 "Gram.y"
{
		    yyval.declarator = yyvsp[0].declarator;
		    yyval.declarator -> sizes.insert(yyvsp[-1].uLongVal);
		;
    break;}
case 167:
#line 3266 "Gram.y"
{
		    yyval.uLongVal = yyvsp[-1].uLongVal;
		;
    break;}
case 168:
#line 3273 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    CORBA_InterfaceDef_var interf =
			CORBA_InterfaceDef::_narrow(container);
		    assert(!CORBA_is_nil(interf));

		    //
		    // Get attribute mode
		    //
		    CORBA_AttributeMode mode = yyvsp[-4].attributeMode;

		    //
		    // Get parameter/return type
		    //
		    CORBA_IDLType_var idlType = yyvsp[-2].idlType;

		    //
		    // Get declarators
		    //
		    IdlDeclarator_var declarator = yyvsp[-1].declarator;
		    IdlDeclaratorSeq_var declarators = yyvsp[0].declaratorSeq;
		    declarators -> insert(declarator);

		    for(CORBA_ULong i = 0 ; i < declarators -> length() ; i++)
		    {
			assert(declarators[i].sizes.length() == 0);

			//
			// Get name, id and version
			//
			CORBA_Identifier_var name = declarators[i].identifier;
			CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
			CORBA_VersionSpec_var version =
			    CORBA_string_dup("1.0");

			//
			// Create attribute
			//
			try
			{
			    CORBA_release(interf ->
					  create_attribute(id, name, version,
							   idlType, mode));
			}
			catch(const CORBA_INTF_REPOS& ex)
			{
			    IdlPrintException(ex.minor(), id, name);
			    yynerrs++;
			    YYERROR;
			}

			//
			// Add ID to IdlTopFileContent and IdlComments
			//
			IdlAddID(id);
		    }
		;
    break;}
case 169:
#line 3339 "Gram.y"
{
		    yyval.attributeMode = CORBA_ATTR_READONLY;
		;
    break;}
case 170:
#line 3343 "Gram.y"
{
		    yyval.attributeMode = CORBA_ATTR_NORMAL;
		;
    break;}
case 171:
#line 3349 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Get name, id and version
		    //
		    const char* name = yyvsp[0].string; // No _var here!
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Create empty member sequence
		    //
		    CORBA_StructMemberSeq_var members =
		        new CORBA_StructMemberSeq;

		    //
		    // Create exception
		    //
		    try
                    {
			yyval.exceptionDef = container ->
			    create_exception(id, name, version, members);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    //
		    // Add ID to IdlTopFileContent and IdlComments
		    //
		    IdlAddID(id);
                ;
    break;}
case 172:
#line 3391 "Gram.y"
{
		    CORBA_ExceptionDef_var ex = yyvsp[-3].exceptionDef;

		    //
		    // Get name and id
		    //
		    CORBA_Identifier_var name = yyvsp[-4].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);

		    //
		    // Get member sequence
		    //
		    CORBA_StructMemberSeq_var members = yyvsp[-1].structMemberSeq;

		    //
		    // Set the member sequence
		    //
		    try
                    {
			ex -> members(members);
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, yyvsp[-4].string);
			yynerrs++;
			YYERROR;
		    }
                ;
    break;}
case 173:
#line 3422 "Gram.y"
{
		    CORBA_StructMemberSeq_var members1 = yyvsp[-1].structMemberSeq;
		    CORBA_StructMemberSeq_var members2 = yyvsp[0].structMemberSeq;

		    for(CORBA_ULong i = 0 ; i < members2 -> length() ; i++)
		    {
			//
			// Check for duplicate exception members
			//
			for(CORBA_ULong j = 0 ; j < members1 -> length() ; j++)
			{
			    if(strcmp(members2[i].name, members1[j].name) == 0)
			    {
				CORBA_String_var err =
				    CORBA_string_dup("duplicate exception "
						     "member `");
				err += members2[i].name;
				err += "'";
				IdlError(err);
				yynerrs++;
				YYERROR;
			    }
			}

			members1 -> append(members2[i]);
		    }

		    yyval.structMemberSeq = members1._retn();
		;
    break;}
case 174:
#line 3452 "Gram.y"
{
		    yyval.structMemberSeq = new CORBA_StructMemberSeq;
		;
    break;}
case 175:
#line 3459 "Gram.y"
{
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    CORBA_InterfaceDef_var interf =
			CORBA_InterfaceDef::_narrow(container);
		    assert(!CORBA_is_nil(interf));

		    //
		    // Get operation mode
		    //
		    CORBA_OperationMode mode = yyvsp[-5].operationMode;

		    //
		    // Get return type
		    //
		    CORBA_IDLType_var result = yyvsp[-4].idlType;

		    //
		    // Get member sequence
		    //
		    CORBA_ParDescriptionSeq_var params = yyvsp[-2].parDescriptionSeq;

		    //
		    // Get exceptions definition sequence
		    //
		    CORBA_ExceptionDefSeq_var exceptions = yyvsp[-1].exceptionDefSeq;

		    //
		    // Get context ID sequence
		    //
		    CORBA_ContextIdSeq_var contexts = yyvsp[0].stringSeq;

		    //
		    // Get name, id and version
		    //
		    CORBA_Identifier_var name = yyvsp[-3].string;
		    CORBA_RepositoryId_var id = IdlGetRepositoryId(name);
		    CORBA_VersionSpec_var version = CORBA_string_dup("1.0");

		    //
		    // Check for oneway constraints
		    //
		    if(mode == CORBA_OP_ONEWAY)
		    {
			CORBA_TypeCode_var resultTC = result -> type();
			if(resultTC -> kind() != CORBA_tk_void)
			{
			    IdlError("oneway operations cannot have "
				     "return value");
			    yynerrs++;
			    YYERROR;
			}

			for(CORBA_ULong i = 0 ; i < params -> length() ; i++)
			    if(params[i].mode != CORBA_PARAM_IN)
			    {
				IdlError("oneway operations can only have "
					 "`in' parameters");
				yynerrs++;
				YYERROR;
			    }

			if(exceptions -> length() > 0)
			{
			    IdlError("oneway operations cannot have "
				     "user defined exceptions");
			    yynerrs++;
			    YYERROR;
			}
		    }

		    //
		    // Create operation
		    //
		    try
		    {
			CORBA_release(interf ->
				      create_operation(id, name, version,
						       result, mode, params,
						       exceptions, contexts));
		    }
		    catch(const CORBA_INTF_REPOS& ex)
		    {
			IdlPrintException(ex.minor(), id, name);
			yynerrs++;
			YYERROR;
		    }

		    //
		    // Add ID to IdlTopFileContent and IdlComments
		    //
		    IdlAddID(id);
		;
    break;}
case 176:
#line 3560 "Gram.y"
{
		     yyval.operationMode = yyvsp[0].operationMode;
		;
    break;}
case 177:
#line 3564 "Gram.y"
{
		     yyval.operationMode = CORBA_OP_NORMAL;
		;
    break;}
case 178:
#line 3570 "Gram.y"
{
		    yyval.exceptionDefSeq = yyvsp[0].exceptionDefSeq;
		;
    break;}
case 179:
#line 3574 "Gram.y"
{
		    yyval.exceptionDefSeq = new CORBA_ExceptionDefSeq;
		;
    break;}
case 180:
#line 3580 "Gram.y"
{
		    yyval.stringSeq = yyvsp[0].stringSeq;
		;
    break;}
case 181:
#line 3584 "Gram.y"
{
		    yyval.stringSeq = new CORBA_ContextIdSeq;
		;
    break;}
case 182:
#line 3590 "Gram.y"
{
		    yyval.operationMode = CORBA_OP_ONEWAY;
		;
    break;}
case 183:
#line 3596 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 184:
#line 3600 "Gram.y"
{
		    yyval.idlType = IdlRepository -> get_primitive(CORBA_pk_void);
		;
    break;}
case 185:
#line 3606 "Gram.y"
{
		    CORBA_ParameterDescription_var param = yyvsp[-2].parameterDescription;
		    yyvsp[-1].parDescriptionSeq -> insert(param);
		    yyval.parDescriptionSeq = yyvsp[-1].parDescriptionSeq;
		;
    break;}
case 186:
#line 3612 "Gram.y"
{
		    yyval.parDescriptionSeq = new CORBA_ParDescriptionSeq;
		;
    break;}
case 187:
#line 3618 "Gram.y"
{
		    CORBA_ParameterDescription_var param = yyvsp[-1].parameterDescription;
		    yyvsp[0].parDescriptionSeq -> insert(param);
		    yyval.parDescriptionSeq = yyvsp[0].parDescriptionSeq;
		;
    break;}
case 188:
#line 3624 "Gram.y"
{
		    yyval.parDescriptionSeq = new CORBA_ParDescriptionSeq;
		;
    break;}
case 189:
#line 3630 "Gram.y"
{
		    CORBA_ParameterMode mode = yyvsp[-2].parameterMode;
		    CORBA_IDLType_var typeSpec = yyvsp[-1].idlType;
		    IdlDeclarator_var declarator = yyvsp[0].declarator;
		    assert(declarator -> sizes.length() == 0);

		    CORBA_ParameterDescription_var param =
			new CORBA_ParameterDescription;

		    param -> name = declarator -> identifier;
		    param -> type = typeSpec -> type();
		    param -> type_def = typeSpec;
		    param -> mode = mode;

		    yyval.parameterDescription = param._retn();
		;
    break;}
case 190:
#line 3647 "Gram.y"
{
		    CORBA_IDLType_var typeSpec = yyvsp[0].idlType;

		    IdlError("`in', `inout' or `out' missing");
		    IdlError("parameter name missing");
		    yynerrs++;
		    YYERROR;
		;
    break;}
case 191:
#line 3656 "Gram.y"
{
		    CORBA_IDLType_var typeSpec = yyvsp[-1].idlType;
		    IdlDeclarator_var declarator = yyvsp[0].declarator;

		    IdlError("`in', `inout' or `out' missing");
		    yynerrs++;
		    YYERROR;
		;
    break;}
case 192:
#line 3665 "Gram.y"
{
		    CORBA_IDLType_var typeSpec = yyvsp[0].idlType;

		    IdlError("parameter name missing");
		    yynerrs++;
		    YYERROR;
		;
    break;}
case 193:
#line 3675 "Gram.y"
{
		    yyval.parameterMode = CORBA_PARAM_IN;
		;
    break;}
case 194:
#line 3679 "Gram.y"
{
		    yyval.parameterMode = CORBA_PARAM_OUT;
		;
    break;}
case 195:
#line 3683 "Gram.y"
{
		    yyval.parameterMode = CORBA_PARAM_INOUT;
		;
    break;}
case 196:
#line 3689 "Gram.y"
{
		    IdlStringSeq_var scopedNameSeq = yyvsp[-1].stringSeq;
		    scopedNameSeq -> insert(yyvsp[-2].string);
		
		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];

		    //
		    // Create exception definition sequence
		    //
		    CORBA_ExceptionDefSeq_var exDefSeq =
			new CORBA_ExceptionDefSeq(scopedNameSeq -> length());

		    for(CORBA_ULong i = 0 ;
			i < scopedNameSeq -> length() ; i++)
		    {
			//
			// Find scoped name
			//
			const char* scoped = scopedNameSeq[i];
			CORBA_IRObject_var irObj =
			    IdlFindScopedName(container, scoped);

			if(CORBA_is_nil(irObj))
			{
			    yynerrs++;
			    YYERROR;
			}

			CORBA_ExceptionDef_var exceptionDef =
			    CORBA_ExceptionDef::_narrow(irObj);

			if(CORBA_is_nil(exceptionDef))
			{	
			    CORBA_String_var err = CORBA_string_dup("`");
			    err += scoped;
			    err += "' is not an exception type";
			    IdlError(err);
			    yynerrs++;
			    YYERROR;
			}

			exDefSeq -> append(exceptionDef);
		    }

		    yyval.exceptionDefSeq = exDefSeq._retn();
		;
    break;}
case 197:
#line 3744 "Gram.y"
{
		    CORBA_String_var string = yyvsp[-2].string;
		    CORBA_String_var origString = CORBA_string_dup(string);
		    IdlStringSeq_var result = yyvsp[-1].stringSeq;

		    if(!IdlRemoveEscapes(string.inout(), true))
		    {
			CORBA_String_var err = CORBA_string_dup("`");
			err += origString;
			err += "' contains \\0 character";
			IdlError(err);
			yynerrs++;
			YYERROR;
		    }

		    CORBA_String_var err2 = CORBA_string_dup("`");
		    err2 += origString;
		    err2 += "' is not a valid context name";

		    if(strlen(string) == 0)
		    {
			IdlError(err2);
			yynerrs++;
			YYERROR;
		    }

		    for(CORBA_ULong i = 0 ; i < strlen(string) ; i++)
		    {
			char c = string[i];

			if(isalpha(c))
			    continue;

			if(i != 0 && (isdigit(c) || c == '_' || c == '.'))
			    continue;

			if(i == strlen(string) - 1 && c == '*')
			    continue;

			IdlError(err2);
			yynerrs++;
			YYERROR;
		    }

		    result -> insert(string);
		    yyval.stringSeq = result._retn();
		;
    break;}
case 198:
#line 3794 "Gram.y"
{
		    CORBA_String_var string = yyvsp[-1].string;
		    CORBA_String_var origString = CORBA_string_dup(string);
		    IdlStringSeq_var result = yyvsp[0].stringSeq;

		    if(!IdlRemoveEscapes(string.inout(), true))
		    {
			CORBA_String_var err = CORBA_string_dup("`");
			err += origString;
			err += "' contains \\0 character";
			IdlError(err);
			yynerrs++;
			YYERROR;
		    }

		    result -> insert(string);
		    yyval.stringSeq = result._retn();
		;
    break;}
case 199:
#line 3813 "Gram.y"
{
		    yyval.stringSeq = new IdlStringSeq;
		;
    break;}
case 200:
#line 3819 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 201:
#line 3823 "Gram.y"
{
		    CORBA_IDLType_var typeSpec = yyvsp[0].idlType;

		    IdlError("typedefs must be used for sequence type "
			     "parameters");
		    yynerrs++;
		    YYERROR;
		;
    break;}
case 202:
#line 3832 "Gram.y"
{
		    yyval.idlType = yyvsp[0].idlType;
		;
    break;}
case 203:
#line 3836 "Gram.y"
{
		    CORBA_ScopedName_var scoped = yyvsp[0].string;

		    //
		    // Get container from container stack
		    //
		    assert(IdlContStack.length() > 0);
		    CORBA_Container_var container =
			IdlContStack[IdlContStack.length() - 1];
			
		    //
		    // Find scoped name
		    //
		    CORBA_IRObject_var irObj =
			IdlFindScopedName(container, scoped);

		    if(CORBA_is_nil(irObj))
		    {
			yynerrs++;
			YYERROR;
		    }

		    CORBA_IDLType_var idlType = CORBA_IDLType::_narrow(irObj);
		    if(CORBA_is_nil(idlType))
		    {
			CORBA_String_var err = CORBA_string_dup("`");
			err += scoped;
			err += "' is not a parameter type specification";
			IdlError(err);
			yynerrs++;
			YYERROR;
		    }

		    yyval.idlType = idlType._retn();
		;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
#line 498 "/usr/freeware/share/bison.simple"

  yyvsp -= yylen;
  yyssp -= yylen;
#ifdef YYLSP_NEEDED
  yylsp -= yylen;
#endif

#if YYDEBUG != 0
  if (yydebug)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;

#ifdef YYLSP_NEEDED
  yylsp++;
  if (yylen == 0)
    {
      yylsp->first_line = yylloc.first_line;
      yylsp->first_column = yylloc.first_column;
      yylsp->last_line = (yylsp-1)->last_line;
      yylsp->last_column = (yylsp-1)->last_column;
      yylsp->text = 0;
    }
  else
    {
      yylsp->last_line = (yylsp+yylen-1)->last_line;
      yylsp->last_column = (yylsp+yylen-1)->last_column;
    }
#endif

  /* Now "shift" the result of the reduction.
     Determine what state that goes to,
     based on the state we popped back to
     and the rule number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;

yyerrlab:   /* here on detecting error */

  if (! yyerrstatus)
    /* If not already recovering from an error, report this error.  */
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  int size = 0;
	  char *msg;
	  int x, count;

	  count = 0;
	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
	  for (x = (yyn < 0 ? -yyn : 0);
	       x < (sizeof(yytname) / sizeof(char *)); x++)
	    if (yycheck[x + yyn] == x)
	      size += strlen(yytname[x]) + 15, count++;
	  msg = (char *) malloc(size + 15);
	  if (msg != 0)
	    {
	      strcpy(msg, "parse error");

	      if (count < 5)
		{
		  count = 0;
		  for (x = (yyn < 0 ? -yyn : 0);
		       x < (sizeof(yytname) / sizeof(char *)); x++)
		    if (yycheck[x + yyn] == x)
		      {
			strcat(msg, count == 0 ? ", expecting `" : " or `");
			strcat(msg, yytname[x]);
			strcat(msg, "'");
			count++;
		      }
		}
	      yyerror(msg);
	      free(msg);
	    }
	  else
	    yyerror ("parse error; also virtual memory exceeded");
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror("parse error");
    }

  goto yyerrlab1;
yyerrlab1:   /* here on error raised explicitly by an action */

  if (yyerrstatus == 3)
    {
      /* if just tried and failed to reuse lookahead token after an error, discard it.  */

      /* return failure if at end of input */
      if (yychar == YYEOF)
	YYABORT;

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif

      yychar = YYEMPTY;
    }

  /* Else will try to reuse lookahead token
     after shifting the error token.  */

  yyerrstatus = 3;		/* Each real token shifted decrements this */

  goto yyerrhandle;

yyerrdefault:  /* current state does not do anything special for the error token. */

#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (yyn) goto yydefault;
#endif

yyerrpop:   /* pop the current state because it cannot handle the error token */

  if (yyssp == yyss) YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#ifdef YYLSP_NEEDED
  yylsp--;
#endif

#if YYDEBUG != 0
  if (yydebug)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "Error: state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

yyerrhandle:

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting error token, ");
#endif

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;
}
#line 3872 "Gram.y"


// ----------------------------------------------------------------------
// Do parsing
// ----------------------------------------------------------------------

int
IdlParse(CORBA_ORB_ptr orb,
	 CORBA_Repository_ptr repository,
	 CORBA_RepositoryIdSeq*& topFileContent,
	 IdlStringSeq*& includes,
	 IdlCommentSeq*& comments)
{
    //
    // Initialize global variables
    //   
    IdlLineno = 1;
    IdlDocComment = CORBA_string_dup("");
    IdlORB = orb;
    IdlRepository = repository;
    IdlTopFileContent = new CORBA_RepositoryIdSeq;
    IdlIncludes = new IdlStringSeq;
    IdlComments = new IdlCommentSeq;
    IdlUnionSwitchType = CORBA_IDLType::_nil();
    IdlFwdInterfaces.length(0);    

    //
    // Set out parameters
    //
    topFileContent = IdlTopFileContent;
    includes = IdlIncludes;
    comments = IdlComments;

    //
    // Add empty file name to file name stack
    // Add empty prefix stack to the prefix stack stack
    //
    IdlFileStack.append(CORBA_string_dup(""));
    IdlPrefStackStack.length(1);
    
    //
    // Parse
    //
    yynerrs = 0;
    int yyparse();
    int status = yyparse();
    assert(yynerrs > 0 || status == 0);

    //
    // Do some cleanup
    //
    IdlFileStack.length(0);
    IdlPrefStackStack.length(0);

    //
    // Check whether there are some interface that have been forward
    // declared but never defined
    //
    for(CORBA_ULong i = 0 ; i < IdlFwdInterfaces.length() ; i++)
    {
        //
        // Don't use IdlError here, because filename and linenumber
        // are not defined
        //
        fflush(stderr);
        fprintf(stderr, "interface `%s' has been declared but not defined\n",
	        IdlFwdInterfaces[i].in() + 2); // Don't show the leading "::"

        yynerrs++;
    }

    //
    // Important note:
    //
    // If IdlParse returns with a status != 0, it is most certain that
    // there are memory leaks. The reason for that is that in case of
    // an error, it is not possible to free any values of the yyval
    // union that have been created with "new".
    //

    //
    // Return the status
    //
    return yynerrs;
}

// ----------------------------------------------------------------------
// Translate an Any into ULong, Long and Double
// ----------------------------------------------------------------------

static void TranslateAny(const CORBA_Any& any,
			 CORBA_ULong& ul, CORBA_Boolean& ulBool,
			 CORBA_Long& l, CORBA_Boolean& lBool,
			 CORBA_Double& d, CORBA_Boolean& dBool)
{
    ulBool = any >>= ul;
    lBool = any >>= l;
    dBool = any >>= d;

    //
    // If it's not a Long, or ULong, or a Double check if it's a short
    // or an unsigned short. If it's either of these then assign the
    // value to the long.
    //
    if(!ulBool && !lBool && !dBool)
    {
	CORBA_Short u;
	CORBA_UShort us;
	if(any >>= u)
	{
	    lBool = true;
	    l = u;
	}
	else if(any >>= us)
	{
	    lBool = true;
	    l = us;
	}
    }

    if(!lBool)
	if(ulBool)
	    l = (CORBA_Long)ul;
			
    if(!dBool)
    {
	if(ulBool)
	    d = (CORBA_Double)ul;
	else if(lBool)
	    d = (CORBA_Double)l;
    }
}

// ----------------------------------------------------------------------
// Error output
// ----------------------------------------------------------------------

void
yyerror(const char* s)
{
    IdlError(s);
}
