/* A Bison parser, made by GNU Bison 3.8.2.  */

/* Bison implementation for Yacc-like parsers in C

   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */

/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
   especially those whose name start with YY_ or yy_.  They are
   private implementation details that can be changed or removed.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output, and Bison version.  */
#define YYBISON 30802

/* Bison version string.  */
#define YYBISON_VERSION "3.8.2"

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 0

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1




/* First part of user prologue.  */
#line 51 "soapcpp2_yacc.y"


#include "soapcpp2.h"

#ifdef WIN32
#ifndef __STDC__
#define __STDC__
#endif
#define YYINCLUDED_STDLIB_H
#ifdef WIN32_WITHOUT_SOLARIS_FLEX
extern int soapcpp2lex(void);
#else
extern int yylex(void);
#endif
#else
extern int yylex(void);
#endif

extern int is_XML(Tnode*);

#define MAXNEST 16	/* max. nesting depth of scopes */

struct Scope
{	Table	*table;
	Entry	*entry;
	Node	node;
	LONG64	val;
	int	offset;
	Bool	grow;	/* true if offset grows with declarations */
	Bool	mask;	/* true if enum is mask */
}	stack[MAXNEST],	/* stack of tables and offsets */
	*sp;		/* current scope stack pointer */

Table	*classtable = (Table*)0,
	*enumtable = (Table*)0,
	*typetable = (Table*)0,
	*booltable = (Table*)0,
	*templatetable = (Table*)0;

char	*namespaceid = NULL;
int	transient = 0;
int	permission = 0;
int	custom_header = 1;
int	custom_fault = 1;
Pragma	*pragmas = NULL;
Tnode	*qname = NULL;
Tnode	*xml = NULL;

/* function prototypes for support routine section */
static Entry	*undefined(Symbol*);
static Tnode	*mgtype(Tnode*, Tnode*);
static Node	op(const char*, Node, Node), iop(const char*, Node, Node), relop(const char*, Node, Node);
static void	mkscope(Table*, int), enterscope(Table*, int), exitscope(void);
static int	integer(Tnode*), real(Tnode*), numeric(Tnode*);
static void	add_soap(void), add_XML(void), add_qname(void), add_header(Table*), add_fault(Table*), add_response(Entry*, Entry*), add_result(Tnode*);
extern char	*c_storage(Storage), *c_type(Tnode*), *c_ident(Tnode*);
extern int	is_primitive_or_string(Tnode*), is_stdstr(Tnode*), is_binary(Tnode*), is_external(Tnode*), is_mutable(Tnode*);

/* Temporaries used in semantic rules */
int	i;
char	*s, *s1, *s2;
Symbol	*sym;
Entry	*p, *q;
Tnode	*t;
Node	tmp, c;
Pragma	**pp;


#line 140 "soapcpp2_yacc.c"

# ifndef YY_CAST
#  ifdef __cplusplus
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
#  else
#   define YY_CAST(Type, Val) ((Type) (Val))
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
#  endif
# endif
# ifndef YY_NULLPTR
#  if defined __cplusplus
#   if 201103L <= __cplusplus
#    define YY_NULLPTR nullptr
#   else
#    define YY_NULLPTR 0
#   endif
#  else
#   define YY_NULLPTR ((void*)0)
#  endif
# endif

/* Use api.header.include to #include this header
   instead of duplicating it here.  */
#ifndef YY_YY_Y_TAB_H_INCLUDED
# define YY_YY_Y_TAB_H_INCLUDED
/* Debug traces.  */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif

/* Token kinds.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
  enum yytokentype
  {
    YYEMPTY = -2,
    YYEOF = 0,                     /* "end of file"  */
    YYerror = 256,                 /* error  */
    YYUNDEF = 257,                 /* "invalid token"  */
    PRAGMA = 258,                  /* PRAGMA  */
    AUTO = 259,                    /* AUTO  */
    DOUBLE = 260,                  /* DOUBLE  */
    INT = 261,                     /* INT  */
    STRUCT = 262,                  /* STRUCT  */
    BREAK = 263,                   /* BREAK  */
    ELSE = 264,                    /* ELSE  */
    LONG = 265,                    /* LONG  */
    SWITCH = 266,                  /* SWITCH  */
    CASE = 267,                    /* CASE  */
    ENUM = 268,                    /* ENUM  */
    REGISTER = 269,                /* REGISTER  */
    TYPEDEF = 270,                 /* TYPEDEF  */
    CHAR = 271,                    /* CHAR  */
    EXTERN = 272,                  /* EXTERN  */
    RETURN = 273,                  /* RETURN  */
    UNION = 274,                   /* UNION  */
    CONST = 275,                   /* CONST  */
    FLOAT = 276,                   /* FLOAT  */
    SHORT = 277,                   /* SHORT  */
    UNSIGNED = 278,                /* UNSIGNED  */
    CONTINUE = 279,                /* CONTINUE  */
    FOR = 280,                     /* FOR  */
    SIGNED = 281,                  /* SIGNED  */
    VOID = 282,                    /* VOID  */
    DEFAULT = 283,                 /* DEFAULT  */
    GOTO = 284,                    /* GOTO  */
    SIZEOF = 285,                  /* SIZEOF  */
    VOLATILE = 286,                /* VOLATILE  */
    DO = 287,                      /* DO  */
    IF = 288,                      /* IF  */
    STATIC = 289,                  /* STATIC  */
    WHILE = 290,                   /* WHILE  */
    CLASS = 291,                   /* CLASS  */
    PRIVATE = 292,                 /* PRIVATE  */
    PROTECTED = 293,               /* PROTECTED  */
    PUBLIC = 294,                  /* PUBLIC  */
    VIRTUAL = 295,                 /* VIRTUAL  */
    INLINE = 296,                  /* INLINE  */
    OPERATOR = 297,                /* OPERATOR  */
    LLONG = 298,                   /* LLONG  */
    BOOL = 299,                    /* BOOL  */
    CFALSE = 300,                  /* CFALSE  */
    CTRUE = 301,                   /* CTRUE  */
    WCHAR = 302,                   /* WCHAR  */
    TIME = 303,                    /* TIME  */
    USING = 304,                   /* USING  */
    NAMESPACE = 305,               /* NAMESPACE  */
    ULLONG = 306,                  /* ULLONG  */
    MUSTUNDERSTAND = 307,          /* MUSTUNDERSTAND  */
    SIZE = 308,                    /* SIZE  */
    FRIEND = 309,                  /* FRIEND  */
    TEMPLATE = 310,                /* TEMPLATE  */
    EXPLICIT = 311,                /* EXPLICIT  */
    TYPENAME = 312,                /* TYPENAME  */
    RESTRICT = 313,                /* RESTRICT  */
    null = 314,                    /* null  */
    UCHAR = 315,                   /* UCHAR  */
    USHORT = 316,                  /* USHORT  */
    UINT = 317,                    /* UINT  */
    ULONG = 318,                   /* ULONG  */
    NONE = 319,                    /* NONE  */
    ID = 320,                      /* ID  */
    TAG = 321,                     /* TAG  */
    LAB = 322,                     /* LAB  */
    TYPE = 323,                    /* TYPE  */
    LNG = 324,                     /* LNG  */
    DBL = 325,                     /* DBL  */
    CHR = 326,                     /* CHR  */
    STR = 327,                     /* STR  */
    PA = 328,                      /* PA  */
    NA = 329,                      /* NA  */
    TA = 330,                      /* TA  */
    DA = 331,                      /* DA  */
    MA = 332,                      /* MA  */
    AA = 333,                      /* AA  */
    XA = 334,                      /* XA  */
    OA = 335,                      /* OA  */
    LA = 336,                      /* LA  */
    RA = 337,                      /* RA  */
    OR = 338,                      /* OR  */
    AN = 339,                      /* AN  */
    EQ = 340,                      /* EQ  */
    NE = 341,                      /* NE  */
    LE = 342,                      /* LE  */
    GE = 343,                      /* GE  */
    LS = 344,                      /* LS  */
    RS = 345,                      /* RS  */
    AR = 346,                      /* AR  */
    PP = 347,                      /* PP  */
    NN = 348                       /* NN  */
  };
  typedef enum yytokentype yytoken_kind_t;
#endif
/* Token kinds.  */
#define YYEMPTY -2
#define YYEOF 0
#define YYerror 256
#define YYUNDEF 257
#define PRAGMA 258
#define AUTO 259
#define DOUBLE 260
#define INT 261
#define STRUCT 262
#define BREAK 263
#define ELSE 264
#define LONG 265
#define SWITCH 266
#define CASE 267
#define ENUM 268
#define REGISTER 269
#define TYPEDEF 270
#define CHAR 271
#define EXTERN 272
#define RETURN 273
#define UNION 274
#define CONST 275
#define FLOAT 276
#define SHORT 277
#define UNSIGNED 278
#define CONTINUE 279
#define FOR 280
#define SIGNED 281
#define VOID 282
#define DEFAULT 283
#define GOTO 284
#define SIZEOF 285
#define VOLATILE 286
#define DO 287
#define IF 288
#define STATIC 289
#define WHILE 290
#define CLASS 291
#define PRIVATE 292
#define PROTECTED 293
#define PUBLIC 294
#define VIRTUAL 295
#define INLINE 296
#define OPERATOR 297
#define LLONG 298
#define BOOL 299
#define CFALSE 300
#define CTRUE 301
#define WCHAR 302
#define TIME 303
#define USING 304
#define NAMESPACE 305
#define ULLONG 306
#define MUSTUNDERSTAND 307
#define SIZE 308
#define FRIEND 309
#define TEMPLATE 310
#define EXPLICIT 311
#define TYPENAME 312
#define RESTRICT 313
#define null 314
#define UCHAR 315
#define USHORT 316
#define UINT 317
#define ULONG 318
#define NONE 319
#define ID 320
#define TAG 321
#define LAB 322
#define TYPE 323
#define LNG 324
#define DBL 325
#define CHR 326
#define STR 327
#define PA 328
#define NA 329
#define TA 330
#define DA 331
#define MA 332
#define AA 333
#define XA 334
#define OA 335
#define LA 336
#define RA 337
#define OR 338
#define AN 339
#define EQ 340
#define NE 341
#define LE 342
#define GE 343
#define LS 344
#define RS 345
#define AR 346
#define PP 347
#define NN 348

/* Value type.  */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 125 "soapcpp2_yacc.y"
	Symbol	*sym;
	LONG64	i;
	double	r;
	char	c;
	char	*s;
	Tnode	*typ;
	Storage	sto;
	Node	rec;
	Entry	*e;

#line 390 "soapcpp2_yacc.c"

};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif


extern YYSTYPE yylval;


int yyparse (void);


#endif /* !YY_YY_Y_TAB_H_INCLUDED  */
/* Symbol kind.  */
enum yysymbol_kind_t
{
  YYSYMBOL_YYEMPTY = -2,
  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
  YYSYMBOL_YYerror = 1,                    /* error  */
  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
  YYSYMBOL_PRAGMA = 3,                     /* PRAGMA  */
  YYSYMBOL_AUTO = 4,                       /* AUTO  */
  YYSYMBOL_DOUBLE = 5,                     /* DOUBLE  */
  YYSYMBOL_INT = 6,                        /* INT  */
  YYSYMBOL_STRUCT = 7,                     /* STRUCT  */
  YYSYMBOL_BREAK = 8,                      /* BREAK  */
  YYSYMBOL_ELSE = 9,                       /* ELSE  */
  YYSYMBOL_LONG = 10,                      /* LONG  */
  YYSYMBOL_SWITCH = 11,                    /* SWITCH  */
  YYSYMBOL_CASE = 12,                      /* CASE  */
  YYSYMBOL_ENUM = 13,                      /* ENUM  */
  YYSYMBOL_REGISTER = 14,                  /* REGISTER  */
  YYSYMBOL_TYPEDEF = 15,                   /* TYPEDEF  */
  YYSYMBOL_CHAR = 16,                      /* CHAR  */
  YYSYMBOL_EXTERN = 17,                    /* EXTERN  */
  YYSYMBOL_RETURN = 18,                    /* RETURN  */
  YYSYMBOL_UNION = 19,                     /* UNION  */
  YYSYMBOL_CONST = 20,                     /* CONST  */
  YYSYMBOL_FLOAT = 21,                     /* FLOAT  */
  YYSYMBOL_SHORT = 22,                     /* SHORT  */
  YYSYMBOL_UNSIGNED = 23,                  /* UNSIGNED  */
  YYSYMBOL_CONTINUE = 24,                  /* CONTINUE  */
  YYSYMBOL_FOR = 25,                       /* FOR  */
  YYSYMBOL_SIGNED = 26,                    /* SIGNED  */
  YYSYMBOL_VOID = 27,                      /* VOID  */
  YYSYMBOL_DEFAULT = 28,                   /* DEFAULT  */
  YYSYMBOL_GOTO = 29,                      /* GOTO  */
  YYSYMBOL_SIZEOF = 30,                    /* SIZEOF  */
  YYSYMBOL_VOLATILE = 31,                  /* VOLATILE  */
  YYSYMBOL_DO = 32,                        /* DO  */
  YYSYMBOL_IF = 33,                        /* IF  */
  YYSYMBOL_STATIC = 34,                    /* STATIC  */
  YYSYMBOL_WHILE = 35,                     /* WHILE  */
  YYSYMBOL_CLASS = 36,                     /* CLASS  */
  YYSYMBOL_PRIVATE = 37,                   /* PRIVATE  */
  YYSYMBOL_PROTECTED = 38,                 /* PROTECTED  */
  YYSYMBOL_PUBLIC = 39,                    /* PUBLIC  */
  YYSYMBOL_VIRTUAL = 40,                   /* VIRTUAL  */
  YYSYMBOL_INLINE = 41,                    /* INLINE  */
  YYSYMBOL_OPERATOR = 42,                  /* OPERATOR  */
  YYSYMBOL_LLONG = 43,                     /* LLONG  */
  YYSYMBOL_BOOL = 44,                      /* BOOL  */
  YYSYMBOL_CFALSE = 45,                    /* CFALSE  */
  YYSYMBOL_CTRUE = 46,                     /* CTRUE  */
  YYSYMBOL_WCHAR = 47,                     /* WCHAR  */
  YYSYMBOL_TIME = 48,                      /* TIME  */
  YYSYMBOL_USING = 49,                     /* USING  */
  YYSYMBOL_NAMESPACE = 50,                 /* NAMESPACE  */
  YYSYMBOL_ULLONG = 51,                    /* ULLONG  */
  YYSYMBOL_MUSTUNDERSTAND = 52,            /* MUSTUNDERSTAND  */
  YYSYMBOL_SIZE = 53,                      /* SIZE  */
  YYSYMBOL_FRIEND = 54,                    /* FRIEND  */
  YYSYMBOL_TEMPLATE = 55,                  /* TEMPLATE  */
  YYSYMBOL_EXPLICIT = 56,                  /* EXPLICIT  */
  YYSYMBOL_TYPENAME = 57,                  /* TYPENAME  */
  YYSYMBOL_RESTRICT = 58,                  /* RESTRICT  */
  YYSYMBOL_null = 59,                      /* null  */
  YYSYMBOL_UCHAR = 60,                     /* UCHAR  */
  YYSYMBOL_USHORT = 61,                    /* USHORT  */
  YYSYMBOL_UINT = 62,                      /* UINT  */
  YYSYMBOL_ULONG = 63,                     /* ULONG  */
  YYSYMBOL_NONE = 64,                      /* NONE  */
  YYSYMBOL_ID = 65,                        /* ID  */
  YYSYMBOL_TAG = 66,                       /* TAG  */
  YYSYMBOL_LAB = 67,                       /* LAB  */
  YYSYMBOL_TYPE = 68,                      /* TYPE  */
  YYSYMBOL_LNG = 69,                       /* LNG  */
  YYSYMBOL_DBL = 70,                       /* DBL  */
  YYSYMBOL_CHR = 71,                       /* CHR  */
  YYSYMBOL_STR = 72,                       /* STR  */
  YYSYMBOL_73_ = 73,                       /* ','  */
  YYSYMBOL_74_ = 74,                       /* '='  */
  YYSYMBOL_PA = 75,                        /* PA  */
  YYSYMBOL_NA = 76,                        /* NA  */
  YYSYMBOL_TA = 77,                        /* TA  */
  YYSYMBOL_DA = 78,                        /* DA  */
  YYSYMBOL_MA = 79,                        /* MA  */
  YYSYMBOL_AA = 80,                        /* AA  */
  YYSYMBOL_XA = 81,                        /* XA  */
  YYSYMBOL_OA = 82,                        /* OA  */
  YYSYMBOL_LA = 83,                        /* LA  */
  YYSYMBOL_RA = 84,                        /* RA  */
  YYSYMBOL_85_ = 85,                       /* '?'  */
  YYSYMBOL_86_ = 86,                       /* ':'  */
  YYSYMBOL_OR = 87,                        /* OR  */
  YYSYMBOL_AN = 88,                        /* AN  */
  YYSYMBOL_89_ = 89,                       /* '|'  */
  YYSYMBOL_90_ = 90,                       /* '^'  */
  YYSYMBOL_91_ = 91,                       /* '&'  */
  YYSYMBOL_EQ = 92,                        /* EQ  */
  YYSYMBOL_NE = 93,                        /* NE  */
  YYSYMBOL_94_ = 94,                       /* '<'  */
  YYSYMBOL_LE = 95,                        /* LE  */
  YYSYMBOL_96_ = 96,                       /* '>'  */
  YYSYMBOL_GE = 97,                        /* GE  */
  YYSYMBOL_LS = 98,                        /* LS  */
  YYSYMBOL_RS = 99,                        /* RS  */
  YYSYMBOL_100_ = 100,                     /* '+'  */
  YYSYMBOL_101_ = 101,                     /* '-'  */
  YYSYMBOL_102_ = 102,                     /* '*'  */
  YYSYMBOL_103_ = 103,                     /* '/'  */
  YYSYMBOL_104_ = 104,                     /* '%'  */
  YYSYMBOL_AR = 105,                       /* AR  */
  YYSYMBOL_PP = 106,                       /* PP  */
  YYSYMBOL_NN = 107,                       /* NN  */
  YYSYMBOL_108_ = 108,                     /* '{'  */
  YYSYMBOL_109_ = 109,                     /* '}'  */
  YYSYMBOL_110_ = 110,                     /* ';'  */
  YYSYMBOL_111_ = 111,                     /* '['  */
  YYSYMBOL_112_ = 112,                     /* ']'  */
  YYSYMBOL_113_ = 113,                     /* '!'  */
  YYSYMBOL_114_ = 114,                     /* '~'  */
  YYSYMBOL_115_ = 115,                     /* '('  */
  YYSYMBOL_116_ = 116,                     /* ')'  */
  YYSYMBOL_117_ = 117,                     /* '@'  */
  YYSYMBOL_118_ = 118,                     /* '$'  */
  YYSYMBOL_YYACCEPT = 119,                 /* $accept  */
  YYSYMBOL_prog = 120,                     /* prog  */
  YYSYMBOL_s1 = 121,                       /* s1  */
  YYSYMBOL_exts = 122,                     /* exts  */
  YYSYMBOL_exts1 = 123,                    /* exts1  */
  YYSYMBOL_ext = 124,                      /* ext  */
  YYSYMBOL_pragma = 125,                   /* pragma  */
  YYSYMBOL_decls = 126,                    /* decls  */
  YYSYMBOL_t1 = 127,                       /* t1  */
  YYSYMBOL_t2 = 128,                       /* t2  */
  YYSYMBOL_t3 = 129,                       /* t3  */
  YYSYMBOL_t4 = 130,                       /* t4  */
  YYSYMBOL_t5 = 131,                       /* t5  */
  YYSYMBOL_dclrs = 132,                    /* dclrs  */
  YYSYMBOL_dclr = 133,                     /* dclr  */
  YYSYMBOL_fdclr = 134,                    /* fdclr  */
  YYSYMBOL_id = 135,                       /* id  */
  YYSYMBOL_name = 136,                     /* name  */
  YYSYMBOL_constr = 137,                   /* constr  */
  YYSYMBOL_destr = 138,                    /* destr  */
  YYSYMBOL_func = 139,                     /* func  */
  YYSYMBOL_fname = 140,                    /* fname  */
  YYSYMBOL_fargso = 141,                   /* fargso  */
  YYSYMBOL_fargs = 142,                    /* fargs  */
  YYSYMBOL_farg = 143,                     /* farg  */
  YYSYMBOL_arg = 144,                      /* arg  */
  YYSYMBOL_texp = 145,                     /* texp  */
  YYSYMBOL_spec = 146,                     /* spec  */
  YYSYMBOL_tspec = 147,                    /* tspec  */
  YYSYMBOL_type = 148,                     /* type  */
  YYSYMBOL_struct = 149,                   /* struct  */
  YYSYMBOL_class = 150,                    /* class  */
  YYSYMBOL_enum = 151,                     /* enum  */
  YYSYMBOL_tname = 152,                    /* tname  */
  YYSYMBOL_base = 153,                     /* base  */
  YYSYMBOL_s2 = 154,                       /* s2  */
  YYSYMBOL_s3 = 155,                       /* s3  */
  YYSYMBOL_s4 = 156,                       /* s4  */
  YYSYMBOL_s5 = 157,                       /* s5  */
  YYSYMBOL_s6 = 158,                       /* s6  */
  YYSYMBOL_store = 159,                    /* store  */
  YYSYMBOL_constobj = 160,                 /* constobj  */
  YYSYMBOL_abstract = 161,                 /* abstract  */
  YYSYMBOL_virtual = 162,                  /* virtual  */
  YYSYMBOL_ptrs = 163,                     /* ptrs  */
  YYSYMBOL_array = 164,                    /* array  */
  YYSYMBOL_arrayck = 165,                  /* arrayck  */
  YYSYMBOL_init = 166,                     /* init  */
  YYSYMBOL_tag = 167,                      /* tag  */
  YYSYMBOL_occurs = 168,                   /* occurs  */
  YYSYMBOL_patt = 169,                     /* patt  */
  YYSYMBOL_cint = 170,                     /* cint  */
  YYSYMBOL_expr = 171,                     /* expr  */
  YYSYMBOL_cexp = 172,                     /* cexp  */
  YYSYMBOL_qexp = 173,                     /* qexp  */
  YYSYMBOL_oexp = 174,                     /* oexp  */
  YYSYMBOL_obex = 175,                     /* obex  */
  YYSYMBOL_aexp = 176,                     /* aexp  */
  YYSYMBOL_abex = 177,                     /* abex  */
  YYSYMBOL_rexp = 178,                     /* rexp  */
  YYSYMBOL_lexp = 179,                     /* lexp  */
  YYSYMBOL_pexp = 180                      /* pexp  */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;




#ifdef short
# undef short
#endif

/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
   <limits.h> and (if available) <stdint.h> are included
   so that the code can choose integer types of a good width.  */

#ifndef __PTRDIFF_MAX__
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
#  define YY_STDINT_H
# endif
#endif

/* Narrow types that promote to a signed type and that can represent a
   signed or unsigned integer of at least N bits.  In tables they can
   save space and decrease cache pressure.  Promoting to a signed type
   helps avoid bugs in integer arithmetic.  */

#ifdef __INT_LEAST8_MAX__
typedef __INT_LEAST8_TYPE__ yytype_int8;
#elif defined YY_STDINT_H
typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif

#ifdef __INT_LEAST16_MAX__
typedef __INT_LEAST16_TYPE__ yytype_int16;
#elif defined YY_STDINT_H
typedef int_least16_t yytype_int16;
#else
typedef short yytype_int16;
#endif

/* Work around bug in HP-UX 11.23, which defines these macros
   incorrectly for preprocessor constants.  This workaround can likely
   be removed in 2023, as HPE has promised support for HP-UX 11.23
   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
#ifdef __hpux
# undef UINT_LEAST8_MAX
# undef UINT_LEAST16_MAX
# define UINT_LEAST8_MAX 255
# define UINT_LEAST16_MAX 65535
#endif

#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST8_MAX <= INT_MAX)
typedef uint_least8_t yytype_uint8;
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
typedef unsigned char yytype_uint8;
#else
typedef short yytype_uint8;
#endif

#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
       && UINT_LEAST16_MAX <= INT_MAX)
typedef uint_least16_t yytype_uint16;
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
typedef unsigned short yytype_uint16;
#else
typedef int yytype_uint16;
#endif

#ifndef YYPTRDIFF_T
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
# elif defined PTRDIFF_MAX
#  ifndef ptrdiff_t
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  endif
#  define YYPTRDIFF_T ptrdiff_t
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
# else
#  define YYPTRDIFF_T long
#  define YYPTRDIFF_MAXIMUM LONG_MAX
# endif
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# else
#  define YYSIZE_T unsigned
# endif
#endif

#define YYSIZE_MAXIMUM                                  \
  YY_CAST (YYPTRDIFF_T,                                 \
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
            ? YYPTRDIFF_MAXIMUM                         \
            : YY_CAST (YYSIZE_T, -1)))

#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))


/* Stored state numbers (used for stacks). */
typedef yytype_int16 yy_state_t;

/* State numbers in computations.  */
typedef int yy_state_fast_t;

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(Msgid) Msgid
# endif
#endif


#ifndef YY_ATTRIBUTE_PURE
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
#  define YY_ATTRIBUTE_PURE
# endif
#endif

#ifndef YY_ATTRIBUTE_UNUSED
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
#  define YY_ATTRIBUTE_UNUSED
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
# define YY_USE(E) ((void) (E))
#else
# define YY_USE(E) /* empty */
#endif

/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# endif
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
    _Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif

#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
    _Pragma ("GCC diagnostic push")                            \
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
# define YY_IGNORE_USELESS_CAST_END            \
    _Pragma ("GCC diagnostic pop")
#endif
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_BEGIN
# define YY_IGNORE_USELESS_CAST_END
#endif


#define YY_ASSERT(E) ((void) (0 && (E)))

#if !defined yyoverflow

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
#   else
#    define YYSTACK_ALLOC alloca
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
#     ifndef EXIT_SUCCESS
#      define EXIT_SUCCESS 0
#     endif
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's 'empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
       && ! ((defined YYMALLOC || defined malloc) \
             && (defined YYFREE || defined free)))
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   ifndef EXIT_SUCCESS
#    define EXIT_SUCCESS 0
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
# endif
#endif /* !defined yyoverflow */

#if (! defined yyoverflow \
     && (! defined __cplusplus \
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  yy_state_t yyss_alloc;
  YYSTYPE yyvs_alloc;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

# define YYCOPY_NEEDED 1

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
    do                                                                  \
      {                                                                 \
        YYPTRDIFF_T yynewbytes;                                         \
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
        Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
      }                                                                 \
    while (0)

#endif

#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from SRC to DST.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(Dst, Src, Count) \
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
#  else
#   define YYCOPY(Dst, Src, Count)              \
      do                                        \
        {                                       \
          YYPTRDIFF_T yyi;                      \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (Dst)[yyi] = (Src)[yyi];            \
        }                                       \
      while (0)
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  3
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   1101

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  119
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  62
/* YYNRULES -- Number of rules.  */
#define YYNRULES  241
/* YYNSTATES -- Number of states.  */
#define YYNSTATES  374

/* YYMAXUTOK -- Last valid token kind.  */
#define YYMAXUTOK   348


/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex, with out-of-bounds checking.  */
#define YYTRANSLATE(YYX)                                \
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
   : YYSYMBOL_YYUNDEF)

/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
   as returned by yylex.  */
static const yytype_int8 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,   113,     2,     2,   118,   104,    91,     2,
     115,   116,   102,   100,    73,   101,     2,   103,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,    86,   110,
      94,    74,    96,    85,   117,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,   111,     2,   112,    90,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,   108,    89,   109,   114,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    75,    76,
      77,    78,    79,    80,    81,    82,    83,    84,    87,    88,
      92,    93,    95,    97,    98,    99,   105,   106,   107
};

#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
static const yytype_int16 yyrline[] =
{
       0,   199,   199,   215,   229,   231,   233,   237,   239,   240,
     241,   248,   249,   251,   274,   277,   279,   281,   283,   285,
     287,   289,   292,   295,   298,   301,   304,   305,   306,   308,
     309,   310,   311,   314,   432,   448,   449,   451,   452,   453,
     454,   455,   456,   457,   458,   459,   460,   461,   462,   463,
     464,   465,   466,   467,   468,   469,   470,   471,   472,   473,
     474,   475,   476,   477,   478,   479,   480,   481,   482,   483,
     484,   485,   486,   487,   488,   499,   509,   526,   584,   586,
     587,   589,   590,   592,   671,   678,   693,   695,   698,   702,
     712,   759,   765,   769,   779,   826,   827,   828,   829,   830,
     831,   832,   833,   834,   835,   836,   837,   838,   839,   840,
     841,   842,   843,   844,   845,   853,   875,   886,   905,   908,
     921,   943,   962,   977,   992,  1015,  1035,  1050,  1065,  1087,
    1106,  1125,  1133,  1141,  1159,  1168,  1173,  1178,  1183,  1189,
    1206,  1225,  1242,  1243,  1245,  1246,  1247,  1248,  1255,  1257,
    1264,  1272,  1278,  1279,  1281,  1289,  1290,  1291,  1292,  1293,
    1294,  1295,  1296,  1297,  1298,  1299,  1300,  1301,  1305,  1306,
    1308,  1309,  1311,  1312,  1314,  1315,  1317,  1318,  1325,  1330,
    1332,  1345,  1349,  1357,  1358,  1369,  1370,  1372,  1379,  1386,
    1393,  1400,  1408,  1409,  1411,  1412,  1413,  1422,  1423,  1426,
    1431,  1434,  1437,  1440,  1442,  1445,  1448,  1450,  1453,  1454,
    1455,  1456,  1457,  1458,  1459,  1460,  1461,  1462,  1463,  1464,
    1465,  1466,  1467,  1468,  1469,  1472,  1477,  1482,  1492,  1493,
    1500,  1504,  1509,  1512,  1513,  1520,  1524,  1528,  1532,  1536,
    1540,  1544
};
#endif

/** Accessing symbol of state STATE.  */
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])

#if YYDEBUG || 0
/* The user-facing name of the symbol whose (internal) number is
   YYSYMBOL.  No bounds checking.  */
static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;

/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "\"end of file\"", "error", "\"invalid token\"", "PRAGMA", "AUTO",
  "DOUBLE", "INT", "STRUCT", "BREAK", "ELSE", "LONG", "SWITCH", "CASE",
  "ENUM", "REGISTER", "TYPEDEF", "CHAR", "EXTERN", "RETURN", "UNION",
  "CONST", "FLOAT", "SHORT", "UNSIGNED", "CONTINUE", "FOR", "SIGNED",
  "VOID", "DEFAULT", "GOTO", "SIZEOF", "VOLATILE", "DO", "IF", "STATIC",
  "WHILE", "CLASS", "PRIVATE", "PROTECTED", "PUBLIC", "VIRTUAL", "INLINE",
  "OPERATOR", "LLONG", "BOOL", "CFALSE", "CTRUE", "WCHAR", "TIME", "USING",
  "NAMESPACE", "ULLONG", "MUSTUNDERSTAND", "SIZE", "FRIEND", "TEMPLATE",
  "EXPLICIT", "TYPENAME", "RESTRICT", "null", "UCHAR", "USHORT", "UINT",
  "ULONG", "NONE", "ID", "TAG", "LAB", "TYPE", "LNG", "DBL", "CHR", "STR",
  "','", "'='", "PA", "NA", "TA", "DA", "MA", "AA", "XA", "OA", "LA", "RA",
  "'?'", "':'", "OR", "AN", "'|'", "'^'", "'&'", "EQ", "NE", "'<'", "LE",
  "'>'", "GE", "LS", "RS", "'+'", "'-'", "'*'", "'/'", "'%'", "AR", "PP",
  "NN", "'{'", "'}'", "';'", "'['", "']'", "'!'", "'~'", "'('", "')'",
  "'@'", "'$'", "$accept", "prog", "s1", "exts", "exts1", "ext", "pragma",
  "decls", "t1", "t2", "t3", "t4", "t5", "dclrs", "dclr", "fdclr", "id",
  "name", "constr", "destr", "func", "fname", "fargso", "fargs", "farg",
  "arg", "texp", "spec", "tspec", "type", "struct", "class", "enum",
  "tname", "base", "s2", "s3", "s4", "s5", "s6", "store", "constobj",
  "abstract", "virtual", "ptrs", "array", "arrayck", "init", "tag",
  "occurs", "patt", "cint", "expr", "cexp", "qexp", "oexp", "obex", "aexp",
  "abex", "rexp", "lexp", "pexp", YY_NULLPTR
};

static const char *
yysymbol_name (yysymbol_kind_t yysymbol)
{
  return yytname[yysymbol];
}
#endif

#define YYPACT_NINF (-276)

#define yypact_value_is_default(Yyn) \
  ((Yyn) == YYPACT_NINF)

#define YYTABLE_NINF (-208)

#define yytable_value_is_error(Yyn) \
  0

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
static const yytype_int16 yypact[] =
{
    -276,    41,     3,  -276,     9,  -276,   213,   -20,   -60,  -276,
    -276,  -276,  -276,    15,  -276,    13,  -276,  -276,  -276,  -276,
    -276,    17,  -276,  -276,  -276,  -276,  -276,  -276,  -276,  -276,
      19,    -9,  -276,  -276,  -276,  -276,  -276,  -276,  -276,  -276,
    -276,    18,  -276,  -276,  -276,  -276,  -276,   -61,  -276,  -276,
    -276,  -276,  -276,  -276,  -276,  -276,   -47,  -276,  -276,   -43,
     974,    11,   -51,    36,   974,    25,  -276,  -276,    45,    43,
      48,  -276,  -276,    54,    43,    48,    42,  -276,  -276,    57,
      43,    48,  -276,    49,    58,  -276,  -276,  -276,  -276,    37,
     974,  -276,  -276,  -276,    33,  -276,  -276,  -276,     7,  -276,
      55,  -276,  -276,    21,  -276,  -276,  -276,   100,   676,  -276,
     443,  -276,    62,   906,  -276,   443,  -276,  -276,   443,  -276,
    -276,    42,    73,  -276,   974,   974,  -276,  -276,  -276,  -276,
     791,   -16,  -276,  -276,  -276,   443,   116,    21,    21,    21,
    -276,    74,   443,   906,  -276,  -276,    77,   102,   104,   107,
     103,   558,   -18,  -276,   148,   113,   443,   115,   129,  -276,
     -40,  -276,  -276,  -276,   974,  -276,  -276,  -276,  -276,  -276,
    -276,  -276,  -276,  -276,  -276,  -276,  -276,  -276,  -276,  -276,
    -276,  -276,  -276,  -276,  -276,  -276,  -276,  -276,  -276,  -276,
    -276,  -276,  -276,  -276,  -276,  -276,  -276,   125,  -276,  -276,
     122,  -276,    71,  -276,   175,   133,  -276,  -276,  -276,  -276,
    -276,   134,   148,  -276,  -276,  -276,  -276,  -276,   136,   328,
     906,   137,   141,  -276,   142,  -276,   209,   147,  -276,   146,
    -276,   179,  -276,  -276,  -276,   155,  -276,  -276,  -276,  -276,
    -276,  -276,  -276,  -276,   986,   986,   986,   986,   147,   986,
     986,   986,   151,    35,    39,   183,   184,   198,  -276,  -276,
    -276,   205,  -276,   443,  -276,   170,   328,   328,   328,   328,
    -276,   148,  -276,  -276,    42,  -276,   260,   974,     0,   974,
    -276,  -276,  -276,  -276,  -276,  -276,  -276,   -52,  -276,   147,
     986,   986,   986,   986,   986,   986,   986,   986,   986,   986,
     986,   986,   986,   986,   986,   986,   986,   986,   986,  -276,
     208,    28,   174,  -276,  -276,  -276,  -276,  -276,   176,  -276,
    -276,   210,  -276,  -276,   147,   187,   986,  -276,  -276,   236,
     226,   183,   198,   312,   426,   540,   656,   656,    76,    76,
      76,    76,    31,    31,   -80,   -80,  -276,  -276,  -276,   986,
    -276,  -276,   -31,   244,   245,   230,  -276,  -276,   248,  -276,
     205,  -276,  -276,   986,  -276,  -276,  -276,  -276,   -31,  -276,
     208,  -276,  -276,  -276
};

/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
   Performed when YYTABLE does not specify something else to do.  Zero
   means the default is an error.  */
static const yytype_uint8 yydefact[] =
{
       3,     0,     6,     1,     0,     2,     0,     0,     0,    13,
     155,   106,   100,     0,   101,     0,   156,   160,    97,   159,
     166,     0,   162,   105,    99,   108,   107,    95,   169,   157,
       0,   161,   164,   102,    96,    98,   113,   103,   165,   104,
     163,     0,   158,   109,   110,   111,   112,   133,    21,    22,
     167,   168,     7,     9,    11,    12,     0,    78,    78,   176,
      88,     0,   118,     0,    88,     0,     6,    10,     0,   122,
     123,   149,   139,     0,   131,   132,     0,   149,   141,     0,
     126,   127,   150,     0,     0,    35,    36,   149,   140,     0,
       0,   176,     8,    29,     0,    30,    27,    78,     0,   161,
     133,    90,   149,     0,   149,   149,    89,     0,     0,   136,
       0,   138,     0,    88,   137,     0,   150,   135,     0,   142,
     143,     0,     0,   176,    92,    91,    31,    78,   154,    28,
       0,   179,   178,   177,    34,     0,     0,     0,     0,     0,
     147,   119,     0,    88,    76,     4,     0,     0,     0,     0,
       0,     0,     0,   151,   152,     0,     0,     0,     0,   134,
     179,    94,    93,    32,    79,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    71,    69,    70,     0,    38,    39,
       0,    74,     0,   182,   185,     0,   148,   145,   144,   146,
     149,     0,   152,    20,    23,    24,    25,   120,     0,     0,
      88,   176,     0,   124,     0,   115,     0,   179,    86,     0,
      80,    81,   176,    72,    73,     0,   240,   241,   236,   234,
     235,   237,   238,   239,     0,     0,     0,     0,   179,     0,
       0,     0,     0,   200,     0,   203,     0,   206,   224,   232,
     186,   192,   121,     0,   116,     0,     0,     0,     0,     0,
      15,   152,   128,   125,     0,    87,   170,     0,    84,     0,
     230,   228,   227,   229,   181,   225,   226,     0,   198,   179,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   193,
     183,   187,     0,   129,    16,    17,    18,    19,     0,   114,
     171,   172,    82,    85,   179,     0,     0,   233,   180,   201,
       0,   202,   205,   208,   209,   210,   211,   212,   213,   214,
     215,   216,   217,   218,   219,   220,   221,   222,   223,     0,
      33,   194,     0,     0,     0,   188,   117,   130,     0,    77,
     192,   231,   197,     0,   184,   191,   195,   196,   189,   173,
     183,   199,   190,    83
};

/* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -276,  -276,  -276,  -276,   252,  -276,  -276,  -108,     5,   101,
    -276,  -276,  -276,    -5,   261,   262,   -15,  -276,  -276,  -276,
     -41,  -276,  -276,    51,  -276,  -276,  -126,    40,  -112,   -88,
    -276,  -276,  -276,  -276,     8,   -58,   206,  -276,  -181,  -276,
     -85,  -276,  -276,  -276,  -114,  -152,     2,   -34,  -276,   -23,
    -276,  -275,  -258,  -199,  -276,  -276,  -276,    65,  -276,   -97,
      61,  -276
};

/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
       0,     1,     2,     5,     6,    52,    53,   150,   151,    55,
     266,   267,   268,   152,   126,   127,    72,   134,    57,    58,
      93,    94,   229,   230,   231,   324,   122,    59,   123,    60,
      61,    62,    63,   121,   141,   110,   115,   220,   222,   164,
      64,   321,   359,    65,    98,   203,   204,   350,   261,   310,
     311,   355,   287,   288,   330,   253,   254,   255,   256,   257,
     258,   259
};

/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule whose
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
static const yytype_int16 yytable[] =
{
      78,    56,   124,   252,   201,   125,    83,   155,   228,   160,
     157,    54,   161,   162,    73,    88,    68,    95,    79,   113,
      84,   326,   306,   307,   308,   227,    91,   205,   136,   118,
     -26,   265,   329,    90,   211,   103,   124,   124,   351,   125,
     125,     3,   124,   218,   135,   125,   142,   143,   224,   130,
      67,   132,   232,     4,   -75,    91,   129,   104,   137,   138,
     139,   112,   133,    92,   327,   323,   -26,   -26,   362,   353,
     354,   202,   131,   119,     7,   275,   124,   365,    74,   125,
      69,    75,    80,    70,    85,    81,   163,    86,    66,   140,
     318,   132,   219,   372,   120,   202,   284,   351,   132,   -37,
     101,   235,   133,    56,   106,  -175,   158,    85,   154,   133,
      86,   270,    89,    54,   352,    76,   236,   237,   278,   102,
    -204,    77,  -204,    71,   290,    82,   291,    87,   353,   354,
     238,   304,   305,   306,   307,   308,   239,   328,   212,   107,
     240,   241,   242,   243,   105,   207,   208,   209,   128,    90,
     364,   -35,   263,   325,   109,   312,   -36,   116,   314,   315,
     316,   317,   244,   111,   371,   232,   114,   117,   144,   159,
     153,   245,   246,   247,   302,   303,   304,   305,   306,   307,
     308,   206,   210,   248,   249,   250,   251,   213,   214,   124,
     215,   124,   125,   216,   125,   332,   333,   334,   335,   336,
     337,   338,   339,   340,   341,   342,   343,   344,   345,   346,
     347,   348,   217,    -5,     8,   271,     9,    10,    11,    12,
      13,   221,   223,    14,   225,   226,    15,    16,    17,    18,
      19,    20,    21,    22,    23,    24,    25,   233,   234,    26,
      27,   260,   262,   264,    28,   274,  -153,    29,    49,    30,
     272,   273,   277,    31,    32,   -88,    33,    34,   202,   319,
      35,    36,   276,   289,    37,    38,    39,    40,    41,    42,
     279,  -207,   292,    43,    44,    45,    46,   309,   -88,   313,
     320,    47,   349,   356,   358,   357,   -88,   293,   294,   295,
     296,   297,   298,   299,   300,   301,   302,   303,   304,   305,
     306,   307,   308,   361,   -88,   280,   281,   282,   283,   326,
     285,   286,   363,   366,   367,   -88,   368,   369,   108,   269,
      96,    97,   156,   -88,    48,    49,   360,  -174,   322,   146,
      50,    51,    10,    11,    12,    13,   373,   370,    14,     0,
       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
      24,    25,     0,     0,    26,    27,   331,     0,     0,    28,
       0,     0,    29,     0,    30,   147,   148,   149,    31,    32,
     -88,    33,    34,     0,     0,    35,    36,     0,     0,    37,
      38,    39,    40,    41,    42,     0,     0,     0,    43,    44,
      45,    46,     0,   -88,     0,     0,    47,     0,     0,     0,
       0,   -88,   294,   295,   296,   297,   298,   299,   300,   301,
     302,   303,   304,   305,   306,   307,   308,     0,     0,   -88,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     -88,     0,     0,     0,     0,     0,     0,   -14,   -88,    48,
     -14,     0,  -174,     0,   146,    50,    51,    10,    11,    12,
      13,     0,     0,    14,     0,     0,    15,    16,    17,    18,
      19,    20,    21,    22,    23,    24,    25,     0,     0,    26,
      27,     0,     0,     0,    28,     0,     0,    29,     0,    30,
     147,   148,   149,    31,    32,   -88,    33,    34,     0,     0,
      35,    36,     0,     0,    37,    38,    39,    40,    41,    42,
       0,     0,     0,    43,    44,    45,    46,     0,   -88,     0,
       0,    47,     0,     0,     0,     0,   -88,   295,   296,   297,
     298,   299,   300,   301,   302,   303,   304,   305,   306,   307,
     308,     0,     0,     0,   -88,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   -88,     0,     0,     0,     0,
       0,     0,   -14,   -88,    48,     0,     0,  -174,     0,   146,
      50,    51,    10,    11,    12,    13,     0,     0,    14,     0,
       0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
      24,    25,     0,     0,    26,    27,     0,     0,     0,    28,
       0,     0,    29,     0,    30,   147,   148,   149,    31,    32,
     -88,    33,    34,     0,     0,    35,    36,     0,     0,    37,
      38,    39,    40,    41,    42,     0,     0,     0,    43,    44,
      45,    46,     0,   -88,     0,     0,    47,     0,     0,     0,
       0,   -88,   296,   297,   298,   299,   300,   301,   302,   303,
     304,   305,   306,   307,   308,     0,     0,     0,     0,   -88,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     -88,     0,     0,     0,     0,     0,     0,     0,   -88,    48,
     -14,     0,  -174,     0,     0,    50,    51,     8,     0,     9,
      10,    11,    12,    13,     0,     0,    14,     0,     0,    15,
      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
       0,     0,    26,    27,     0,     0,     0,    28,     0,     0,
      29,     0,    30,     0,     0,     0,    31,    32,   -88,    33,
      34,     0,     0,    35,    36,     0,     0,    37,    38,    39,
      40,    41,    42,     0,     0,     0,    43,    44,    45,    46,
       0,   -88,     0,     0,    47,     0,     0,     0,     0,   -88,
     298,   299,   300,   301,   302,   303,   304,   305,   306,   307,
     308,     0,     0,     0,     0,     0,     0,   -88,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   -88,     0,
       0,     0,     0,     0,     0,   145,   -88,    48,    49,     0,
    -174,     0,     0,    50,    51,    10,    11,    12,    13,     0,
       0,    14,     0,     0,    15,    16,    17,    18,    19,    20,
      21,    22,    23,    24,    25,     0,     0,    26,    27,     0,
       0,     0,    28,     0,     0,    29,     0,    30,     0,     0,
       0,    99,    32,     0,    33,    34,     0,     0,    35,    36,
       0,     0,    37,    38,    39,    40,    41,    42,     0,     0,
       0,    43,    44,    45,    46,     0,     0,     0,     0,   100,
       0,     0,     0,     0,     0,   165,   166,   167,   168,   169,
     170,   171,   172,   173,   174,   175,     0,     0,   176,   177,
     178,   179,   180,   181,   182,   183,   184,   185,   186,   187,
     188,   189,   190,   191,   192,   193,   194,   195,   196,     0,
       0,     0,   197,     0,   198,   199,   200,     0,    50,    51,
      10,    11,    12,    13,     0,     0,    14,     0,     0,    15,
      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
       0,     0,    26,    27,     0,     0,     0,    28,     0,     0,
      29,     0,    30,     0,     0,     0,    31,    32,     0,    33,
      34,     0,     0,    35,    36,     0,     0,    37,    38,    39,
      40,    41,    42,     0,     0,     0,    43,    44,    45,    46,
       0,     0,     0,     0,    47,     0,     0,     0,    10,    11,
      12,    13,     0,     0,    14,     0,     0,    15,    16,    17,
      18,    19,    20,    21,    22,    23,    24,    25,     0,     0,
      26,    27,     0,     0,     0,    28,     0,     0,    29,     0,
      30,     0,     0,     0,    99,    32,   235,    33,    34,     0,
    -174,    35,    36,    50,    51,    37,    38,    39,    40,    41,
      42,   236,   237,     0,    43,    44,    45,    46,     0,     0,
       0,     0,   100,     0,     0,   238,     0,     0,     0,     0,
       0,   239,     0,     0,     0,   240,   241,   242,   243,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,   244,     0,     0,
       0,     0,     0,     0,     0,     0,   245,   246,   247,     0,
       0,    50,    51,     0,     0,     0,     0,     0,     0,   249,
     250,   251
};

static const yytype_int16 yycheck[] =
{
      15,     6,    90,   202,   130,    90,    21,   115,   160,   123,
     118,     6,   124,   125,     1,    30,     1,    58,     1,    77,
       1,    73,   102,   103,   104,    65,    73,   135,     7,    87,
      73,   212,   290,    94,   142,    86,   124,   125,    69,   124,
     125,     0,   130,   151,   102,   130,   104,   105,   156,    42,
     110,    91,   164,    50,   115,    73,    97,   108,    37,    38,
      39,    76,   102,   110,   116,    65,   109,   110,   326,   100,
     101,   111,    65,    36,    65,   227,   164,   352,    65,   164,
      65,    68,    65,    68,    65,    68,   127,    68,   108,    68,
     271,    91,   110,   368,    57,   111,   248,    69,    91,   115,
      60,    30,   102,   108,    64,   114,   121,    65,   113,   102,
      68,   219,    94,   108,    86,   102,    45,    46,   232,   108,
      85,   108,    87,   108,    85,   108,    87,   108,   100,   101,
      59,   100,   101,   102,   103,   104,    65,   289,   143,   114,
      69,    70,    71,    72,   108,   137,   138,   139,   115,    94,
     349,   108,   210,   279,   109,   263,   108,   108,   266,   267,
     268,   269,    91,   109,   363,   277,   109,   109,    68,    96,
     108,   100,   101,   102,    98,    99,   100,   101,   102,   103,
     104,    65,   108,   112,   113,   114,   115,   110,    86,   277,
      86,   279,   277,    86,   279,   292,   293,   294,   295,   296,
     297,   298,   299,   300,   301,   302,   303,   304,   305,   306,
     307,   308,   109,     0,     1,   220,     3,     4,     5,     6,
       7,    73,   109,    10,   109,    96,    13,    14,    15,    16,
      17,    18,    19,    20,    21,    22,    23,   112,   116,    26,
      27,    66,   109,   109,    31,    36,   109,    34,   112,    36,
     109,   109,    73,    40,    41,    42,    43,    44,   111,   274,
      47,    48,   116,   112,    51,    52,    53,    54,    55,    56,
     115,    88,    88,    60,    61,    62,    63,    72,    65,   109,
      20,    68,    74,   109,    74,   109,    73,    89,    90,    91,
      92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
     102,   103,   104,   116,    91,   244,   245,   246,   247,    73,
     249,   250,    86,    69,    69,   102,    86,    69,    66,   218,
      59,    59,   116,   110,   111,   112,   324,   114,   277,     1,
     117,   118,     4,     5,     6,     7,   370,   360,    10,    -1,
      -1,    13,    14,    15,    16,    17,    18,    19,    20,    21,
      22,    23,    -1,    -1,    26,    27,   291,    -1,    -1,    31,
      -1,    -1,    34,    -1,    36,    37,    38,    39,    40,    41,
      42,    43,    44,    -1,    -1,    47,    48,    -1,    -1,    51,
      52,    53,    54,    55,    56,    -1,    -1,    -1,    60,    61,
      62,    63,    -1,    65,    -1,    -1,    68,    -1,    -1,    -1,
      -1,    73,    90,    91,    92,    93,    94,    95,    96,    97,
      98,    99,   100,   101,   102,   103,   104,    -1,    -1,    91,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     102,    -1,    -1,    -1,    -1,    -1,    -1,   109,   110,   111,
     112,    -1,   114,    -1,     1,   117,   118,     4,     5,     6,
       7,    -1,    -1,    10,    -1,    -1,    13,    14,    15,    16,
      17,    18,    19,    20,    21,    22,    23,    -1,    -1,    26,
      27,    -1,    -1,    -1,    31,    -1,    -1,    34,    -1,    36,
      37,    38,    39,    40,    41,    42,    43,    44,    -1,    -1,
      47,    48,    -1,    -1,    51,    52,    53,    54,    55,    56,
      -1,    -1,    -1,    60,    61,    62,    63,    -1,    65,    -1,
      -1,    68,    -1,    -1,    -1,    -1,    73,    91,    92,    93,
      94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
     104,    -1,    -1,    -1,    91,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   102,    -1,    -1,    -1,    -1,
      -1,    -1,   109,   110,   111,    -1,    -1,   114,    -1,     1,
     117,   118,     4,     5,     6,     7,    -1,    -1,    10,    -1,
      -1,    13,    14,    15,    16,    17,    18,    19,    20,    21,
      22,    23,    -1,    -1,    26,    27,    -1,    -1,    -1,    31,
      -1,    -1,    34,    -1,    36,    37,    38,    39,    40,    41,
      42,    43,    44,    -1,    -1,    47,    48,    -1,    -1,    51,
      52,    53,    54,    55,    56,    -1,    -1,    -1,    60,    61,
      62,    63,    -1,    65,    -1,    -1,    68,    -1,    -1,    -1,
      -1,    73,    92,    93,    94,    95,    96,    97,    98,    99,
     100,   101,   102,   103,   104,    -1,    -1,    -1,    -1,    91,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   110,   111,
     112,    -1,   114,    -1,    -1,   117,   118,     1,    -1,     3,
       4,     5,     6,     7,    -1,    -1,    10,    -1,    -1,    13,
      14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
      -1,    -1,    26,    27,    -1,    -1,    -1,    31,    -1,    -1,
      34,    -1,    36,    -1,    -1,    -1,    40,    41,    42,    43,
      44,    -1,    -1,    47,    48,    -1,    -1,    51,    52,    53,
      54,    55,    56,    -1,    -1,    -1,    60,    61,    62,    63,
      -1,    65,    -1,    -1,    68,    -1,    -1,    -1,    -1,    73,
      94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
     104,    -1,    -1,    -1,    -1,    -1,    -1,    91,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   102,    -1,
      -1,    -1,    -1,    -1,    -1,   109,   110,   111,   112,    -1,
     114,    -1,    -1,   117,   118,     4,     5,     6,     7,    -1,
      -1,    10,    -1,    -1,    13,    14,    15,    16,    17,    18,
      19,    20,    21,    22,    23,    -1,    -1,    26,    27,    -1,
      -1,    -1,    31,    -1,    -1,    34,    -1,    36,    -1,    -1,
      -1,    40,    41,    -1,    43,    44,    -1,    -1,    47,    48,
      -1,    -1,    51,    52,    53,    54,    55,    56,    -1,    -1,
      -1,    60,    61,    62,    63,    -1,    -1,    -1,    -1,    68,
      -1,    -1,    -1,    -1,    -1,    74,    75,    76,    77,    78,
      79,    80,    81,    82,    83,    84,    -1,    -1,    87,    88,
      89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
      99,   100,   101,   102,   103,   104,   105,   106,   107,    -1,
      -1,    -1,   111,    -1,   113,   114,   115,    -1,   117,   118,
       4,     5,     6,     7,    -1,    -1,    10,    -1,    -1,    13,
      14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
      -1,    -1,    26,    27,    -1,    -1,    -1,    31,    -1,    -1,
      34,    -1,    36,    -1,    -1,    -1,    40,    41,    -1,    43,
      44,    -1,    -1,    47,    48,    -1,    -1,    51,    52,    53,
      54,    55,    56,    -1,    -1,    -1,    60,    61,    62,    63,
      -1,    -1,    -1,    -1,    68,    -1,    -1,    -1,     4,     5,
       6,     7,    -1,    -1,    10,    -1,    -1,    13,    14,    15,
      16,    17,    18,    19,    20,    21,    22,    23,    -1,    -1,
      26,    27,    -1,    -1,    -1,    31,    -1,    -1,    34,    -1,
      36,    -1,    -1,    -1,    40,    41,    30,    43,    44,    -1,
     114,    47,    48,   117,   118,    51,    52,    53,    54,    55,
      56,    45,    46,    -1,    60,    61,    62,    63,    -1,    -1,
      -1,    -1,    68,    -1,    -1,    59,    -1,    -1,    -1,    -1,
      -1,    65,    -1,    -1,    -1,    69,    70,    71,    72,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    91,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,   100,   101,   102,    -1,
      -1,   117,   118,    -1,    -1,    -1,    -1,    -1,    -1,   113,
     114,   115
};

/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
   state STATE-NUM.  */
static const yytype_uint8 yystos[] =
{
       0,   120,   121,     0,    50,   122,   123,    65,     1,     3,
       4,     5,     6,     7,    10,    13,    14,    15,    16,    17,
      18,    19,    20,    21,    22,    23,    26,    27,    31,    34,
      36,    40,    41,    43,    44,    47,    48,    51,    52,    53,
      54,    55,    56,    60,    61,    62,    63,    68,   111,   112,
     117,   118,   124,   125,   127,   128,   132,   137,   138,   146,
     148,   149,   150,   151,   159,   162,   108,   110,     1,    65,
      68,   108,   135,     1,    65,    68,   102,   108,   135,     1,
      65,    68,   108,   135,     1,    65,    68,   108,   135,    94,
      94,    73,   110,   139,   140,   139,   133,   134,   163,    40,
      68,   146,   108,    86,   108,   108,   146,   114,   123,   109,
     154,   109,   135,   154,   109,   155,   108,   109,   154,    36,
      57,   152,   145,   147,   148,   159,   133,   134,   115,   139,
      42,    65,    91,   102,   136,   154,     7,    37,    38,    39,
      68,   153,   154,   154,    68,   109,     1,    37,    38,    39,
     126,   127,   132,   108,   132,   126,   155,   126,   135,    96,
     163,   147,   147,   139,   158,    74,    75,    76,    77,    78,
      79,    80,    81,    82,    83,    84,    87,    88,    89,    90,
      91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
     101,   102,   103,   104,   105,   106,   107,   111,   113,   114,
     115,   145,   111,   164,   165,   126,    65,   153,   153,   153,
     108,   126,   132,   110,    86,    86,    86,   109,   126,   110,
     156,    73,   157,   109,   126,   109,    96,    65,   164,   141,
     142,   143,   147,   112,   116,    30,    45,    46,    59,    65,
      69,    70,    71,    72,    91,   100,   101,   102,   112,   113,
     114,   115,   172,   174,   175,   176,   177,   178,   179,   180,
      66,   167,   109,   154,   109,   157,   129,   130,   131,   128,
     126,   132,   109,   109,    36,   164,   116,    73,   163,   115,
     179,   179,   179,   179,   164,   179,   179,   171,   172,   112,
      85,    87,    88,    89,    90,    91,    92,    93,    94,    95,
      96,    97,    98,    99,   100,   101,   102,   103,   104,    72,
     168,   169,   126,   109,   126,   126,   126,   126,   157,   135,
      20,   160,   142,    65,   144,   145,    73,   116,   164,   171,
     173,   176,   178,   178,   178,   178,   178,   178,   178,   178,
     178,   178,   178,   178,   178,   178,   178,   178,   178,    74,
     166,    69,    86,   100,   101,   170,   109,   109,    74,   161,
     165,   116,   171,    86,   172,   170,    69,    69,    86,    69,
     168,   172,   170,   166
};

/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
static const yytype_uint8 yyr1[] =
{
       0,   119,   120,   121,   122,   122,   123,   123,   124,   124,
     124,   124,   124,   125,   126,   126,   126,   126,   126,   126,
     126,   127,   128,   129,   130,   131,   132,   132,   132,   132,
     132,   132,   132,   133,   134,   135,   135,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   136,   136,   136,   136,   136,
     136,   136,   136,   136,   136,   137,   138,   139,   140,   141,
     141,   142,   142,   143,   144,   144,   145,   145,   146,   146,
     146,   147,   147,   147,   147,   148,   148,   148,   148,   148,
     148,   148,   148,   148,   148,   148,   148,   148,   148,   148,
     148,   148,   148,   148,   148,   148,   148,   148,   148,   148,
     148,   148,   148,   148,   148,   148,   148,   148,   148,   148,
     148,   148,   148,   148,   148,   148,   148,   148,   148,   149,
     150,   151,   152,   152,   153,   153,   153,   153,   153,   154,
     155,   156,   157,   157,   158,   159,   159,   159,   159,   159,
     159,   159,   159,   159,   159,   159,   159,   159,   159,   159,
     160,   160,   161,   161,   162,   162,   163,   163,   163,   164,
     164,   164,   165,   166,   166,   167,   167,   168,   168,   168,
     168,   168,   169,   169,   170,   170,   170,   171,   171,   172,
     172,   173,   174,   174,   175,   176,   176,   177,   178,   178,
     178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
     178,   178,   178,   178,   178,   179,   179,   179,   179,   179,
     179,   179,   179,   180,   180,   180,   180,   180,   180,   180,
     180,   180
};

/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
static const yytype_int8 yyr2[] =
{
       0,     2,     2,     0,     5,     1,     0,     2,     2,     1,
       2,     1,     1,     1,     0,     3,     4,     4,     4,     4,
       2,     1,     1,     0,     0,     0,     1,     2,     3,     2,
       2,     3,     4,     6,     2,     1,     1,     1,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     3,     3,     2,     1,     3,     7,     0,     0,
       1,     1,     3,     6,     0,     1,     3,     4,     0,     2,
       2,     1,     1,     2,     2,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     7,     5,     5,     7,     1,     3,
       5,     5,     2,     2,     5,     6,     2,     2,     6,     6,
       8,     2,     2,     1,     4,     3,     3,     3,     3,     2,
       2,     2,     1,     1,     2,     2,     2,     1,     2,     0,
       0,     0,     0,     1,     0,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       0,     1,     0,     2,     0,     1,     0,     2,     2,     0,
       4,     3,     1,     0,     2,     0,     1,     1,     2,     3,
       4,     3,     0,     1,     1,     2,     2,     3,     1,     5,
       1,     1,     3,     1,     1,     3,     1,     1,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     1,     2,     2,     2,     2,     2,
       2,     4,     1,     3,     1,     1,     1,     1,     1,     1,
       1,     1
};


enum { YYENOMEM = -2 };

#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)

#define YYACCEPT        goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrorlab
#define YYNOMEM         goto yyexhaustedlab


#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)                                    \
  do                                                              \
    if (yychar == YYEMPTY)                                        \
      {                                                           \
        yychar = (Token);                                         \
        yylval = (Value);                                         \
        YYPOPSTACK (yylen);                                       \
        yystate = *yyssp;                                         \
        goto yybackup;                                            \
      }                                                           \
    else                                                          \
      {                                                           \
        yyerror (YY_("syntax error: cannot back up")); \
        YYERROR;                                                  \
      }                                                           \
  while (0)

/* Backward compatibility with an undocumented macro.
   Use YYerror or YYUNDEF. */
#define YYERRCODE YYUNDEF


/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)                        \
do {                                            \
  if (yydebug)                                  \
    YYFPRINTF Args;                             \
} while (0)




# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
do {                                                                      \
  if (yydebug)                                                            \
    {                                                                     \
      YYFPRINTF (stderr, "%s ", Title);                                   \
      yy_symbol_print (stderr,                                            \
                  Kind, Value); \
      YYFPRINTF (stderr, "\n");                                           \
    }                                                                     \
} while (0)


/*-----------------------------------.
| Print this symbol's value on YYO.  |
`-----------------------------------*/

static void
yy_symbol_value_print (FILE *yyo,
                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
  FILE *yyoutput = yyo;
  YY_USE (yyoutput);
  if (!yyvaluep)
    return;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/*---------------------------.
| Print this symbol on YYO.  |
`---------------------------*/

static void
yy_symbol_print (FILE *yyo,
                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
{
  YYFPRINTF (yyo, "%s %s (",
             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));

  yy_symbol_value_print (yyo, yykind, yyvaluep);
  YYFPRINTF (yyo, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

static void
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
  YYFPRINTF (stderr, "Stack now");
  for (; yybottom <= yytop; yybottom++)
    {
      int yybot = *yybottom;
      YYFPRINTF (stderr, " %d", yybot);
    }
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)                            \
do {                                                            \
  if (yydebug)                                                  \
    yy_stack_print ((Bottom), (Top));                           \
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

static void
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
                 int yyrule)
{
  int yylno = yyrline[yyrule];
  int yynrhs = yyr2[yyrule];
  int yyi;
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
             yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
      yy_symbol_print (stderr,
                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
                       &yyvsp[(yyi + 1) - (yynrhs)]);
      YYFPRINTF (stderr, "\n");
    }
}

# define YY_REDUCE_PRINT(Rule)          \
do {                                    \
  if (yydebug)                          \
    yy_reduce_print (yyssp, yyvsp, Rule); \
} while (0)

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args) ((void) 0)
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif

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

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif






/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
yydestruct (const char *yymsg,
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
{
  YY_USE (yyvaluep);
  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  YY_USE (yykind);
  YY_IGNORE_MAYBE_UNINITIALIZED_END
}


/* Lookahead token kind.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;
/* Number of syntax errors so far.  */
int yynerrs;




/*----------.
| yyparse.  |
`----------*/

int
yyparse (void)
{
    yy_state_fast_t yystate = 0;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus = 0;

    /* Refer to the stacks through separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* Their size.  */
    YYPTRDIFF_T yystacksize = YYINITDEPTH;

    /* The state stack: array, bottom, top.  */
    yy_state_t yyssa[YYINITDEPTH];
    yy_state_t *yyss = yyssa;
    yy_state_t *yyssp = yyss;

    /* The semantic value stack: array, bottom, top.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs = yyvsa;
    YYSTYPE *yyvsp = yyvs;

  int yyn;
  /* The return value of yyparse.  */
  int yyresult;
  /* Lookahead symbol kind.  */
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;



#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yychar = YYEMPTY; /* Cause a token to be read.  */

  goto yysetstate;


/*------------------------------------------------------------.
| yynewstate -- push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;


/*--------------------------------------------------------------------.
| yysetstate -- set current state (the top of the stack) to yystate.  |
`--------------------------------------------------------------------*/
yysetstate:
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
  YY_IGNORE_USELESS_CAST_BEGIN
  *yyssp = YY_CAST (yy_state_t, yystate);
  YY_IGNORE_USELESS_CAST_END
  YY_STACK_PRINT (yyss, yyssp);

  if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
    YYNOMEM;
#else
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYPTRDIFF_T yysize = yyssp - yyss + 1;

# if defined yyoverflow
      {
        /* Give user a chance to reallocate the stack.  Use copies of
           these so that the &'s don't force the real ones into
           memory.  */
        yy_state_t *yyss1 = yyss;
        YYSTYPE *yyvs1 = yyvs;

        /* Each stack pointer address is followed by the size of the
           data in use in that stack, in bytes.  This used to be a
           conditional around just the two extra args, but that might
           be undefined if yyoverflow is a macro.  */
        yyoverflow (YY_("memory exhausted"),
                    &yyss1, yysize * YYSIZEOF (*yyssp),
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
                    &yystacksize);
        yyss = yyss1;
        yyvs = yyvs1;
      }
# else /* defined YYSTACK_RELOCATE */
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
        YYNOMEM;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
        yystacksize = YYMAXDEPTH;

      {
        yy_state_t *yyss1 = yyss;
        union yyalloc *yyptr =
          YY_CAST (union yyalloc *,
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
        if (! yyptr)
          YYNOMEM;
        YYSTACK_RELOCATE (yyss_alloc, yyss);
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  undef YYSTACK_RELOCATE
        if (yyss1 != yyssa)
          YYSTACK_FREE (yyss1);
      }
# endif

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;

      YY_IGNORE_USELESS_CAST_BEGIN
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
                  YY_CAST (long, yystacksize)));
      YY_IGNORE_USELESS_CAST_END

      if (yyss + yystacksize - 1 <= yyssp)
        YYABORT;
    }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */


  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;


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

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yypact_value_is_default (yyn))
    goto yydefault;

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

  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token\n"));
      yychar = yylex ();
    }

  if (yychar <= YYEOF)
    {
      yychar = YYEOF;
      yytoken = YYSYMBOL_YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else if (yychar == YYerror)
    {
      /* The scanner already issued an error message, process directly
         to error recovery.  But do not keep the error token as
         lookahead, it is too special and may lead us to an endless
         loop in error recovery. */
      yychar = YYUNDEF;
      yytoken = YYSYMBOL_YYerror;
      goto yyerrlab1;
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yytable_value_is_error (yyn))
        goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

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

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  yystate = yyn;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END

  /* Discard the shifted token.  */
  yychar = YYEMPTY;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     '$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
  case 2: /* prog: s1 exts  */
#line 199 "soapcpp2_yacc.y"
                        { if (lflag)
    			  {	custom_header = 0;
    			  	custom_fault = 0;
			  }
			  else
			  {	add_header(sp->table);
			  	add_fault(sp->table);
			  }
			  compile(sp->table);
			  freetable(classtable);
			  freetable(enumtable);
			  freetable(typetable);
			  freetable(booltable);
			  freetable(templatetable);
			}
#line 1993 "soapcpp2_yacc.c"
    break;

  case 3: /* s1: %empty  */
#line 215 "soapcpp2_yacc.y"
                        { classtable = mktable((Table*)0);
			  enumtable = mktable((Table*)0);
			  typetable = mktable((Table*)0);
			  booltable = mktable((Table*)0);
			  templatetable = mktable((Table*)0);
			  p = enter(booltable, lookup("false"));
			  p->info.typ = mkint();
			  p->info.val.i = 0;
			  p = enter(booltable, lookup("true"));
			  p->info.typ = mkint();
			  p->info.val.i = 1;
			  mkscope(mktable(mktable((Table*)0)), 0);
			}
#line 2011 "soapcpp2_yacc.c"
    break;

  case 4: /* exts: NAMESPACE ID '{' exts1 '}'  */
#line 230 "soapcpp2_yacc.y"
                        { namespaceid = (yyvsp[-3].sym)->name; }
#line 2017 "soapcpp2_yacc.c"
    break;

  case 5: /* exts: exts1  */
#line 231 "soapcpp2_yacc.y"
                        { }
#line 2023 "soapcpp2_yacc.c"
    break;

  case 6: /* exts1: %empty  */
#line 233 "soapcpp2_yacc.y"
                        { add_soap();
			  add_qname();
			  add_XML();
			}
#line 2032 "soapcpp2_yacc.c"
    break;

  case 7: /* exts1: exts1 ext  */
#line 237 "soapcpp2_yacc.y"
                        { }
#line 2038 "soapcpp2_yacc.c"
    break;

  case 8: /* ext: dclrs ';'  */
#line 239 "soapcpp2_yacc.y"
                        { }
#line 2044 "soapcpp2_yacc.c"
    break;

  case 9: /* ext: pragma  */
#line 240 "soapcpp2_yacc.y"
                        { }
#line 2050 "soapcpp2_yacc.c"
    break;

  case 10: /* ext: error ';'  */
#line 241 "soapcpp2_yacc.y"
                        { synerror("input before ; skipped");
			  while (sp > stack)
			  {	freetable(sp->table);
			  	exitscope();
			  }
			  yyerrok;
			}
#line 2062 "soapcpp2_yacc.c"
    break;

  case 11: /* ext: t1  */
#line 248 "soapcpp2_yacc.y"
                        { }
#line 2068 "soapcpp2_yacc.c"
    break;

  case 12: /* ext: t2  */
#line 249 "soapcpp2_yacc.y"
                        { }
#line 2074 "soapcpp2_yacc.c"
    break;

  case 13: /* pragma: PRAGMA  */
#line 251 "soapcpp2_yacc.y"
                        { if ((yyvsp[0].s)[1] >= 'a' && (yyvsp[0].s)[1] <= 'z')
			  {	for (pp = &pragmas; *pp; pp = &(*pp)->next)
			          ;
				*pp = (Pragma*)emalloc(sizeof(Pragma));
				(*pp)->pragma = (char*)emalloc(strlen((yyvsp[0].s))+1);
				strcpy((*pp)->pragma, (yyvsp[0].s));
				(*pp)->next = NULL;
			  }
			  else if ((i = atoi((yyvsp[0].s)+2)) > 0)
				yylineno = i;
			  else
			  {	sprintf(errbuf, "directive '%s' ignored (use #import to import files and/or use option -i)", (yyvsp[0].s));
			  	semwarn(errbuf);
			  }
			}
#line 2094 "soapcpp2_yacc.c"
    break;

  case 14: /* decls: %empty  */
#line 274 "soapcpp2_yacc.y"
                        { transient &= ~6;
			  permission = 0;
			}
#line 2102 "soapcpp2_yacc.c"
    break;

  case 15: /* decls: dclrs ';' decls  */
#line 278 "soapcpp2_yacc.y"
                        { }
#line 2108 "soapcpp2_yacc.c"
    break;

  case 16: /* decls: PRIVATE ':' t3 decls  */
#line 280 "soapcpp2_yacc.y"
                        { }
#line 2114 "soapcpp2_yacc.c"
    break;

  case 17: /* decls: PROTECTED ':' t4 decls  */
#line 282 "soapcpp2_yacc.y"
                        { }
#line 2120 "soapcpp2_yacc.c"
    break;

  case 18: /* decls: PUBLIC ':' t5 decls  */
#line 284 "soapcpp2_yacc.y"
                        { }
#line 2126 "soapcpp2_yacc.c"
    break;

  case 19: /* decls: t1 decls t2 decls  */
#line 286 "soapcpp2_yacc.y"
                        { }
#line 2132 "soapcpp2_yacc.c"
    break;

  case 20: /* decls: error ';'  */
#line 287 "soapcpp2_yacc.y"
                        { synerror("declaration expected"); yyerrok; }
#line 2138 "soapcpp2_yacc.c"
    break;

  case 21: /* t1: '['  */
#line 289 "soapcpp2_yacc.y"
                        { transient |= 1;
			}
#line 2145 "soapcpp2_yacc.c"
    break;

  case 22: /* t2: ']'  */
#line 292 "soapcpp2_yacc.y"
                        { transient &= ~1;
			}
#line 2152 "soapcpp2_yacc.c"
    break;

  case 23: /* t3: %empty  */
#line 295 "soapcpp2_yacc.y"
                        { permission = Sprivate;
			}
#line 2159 "soapcpp2_yacc.c"
    break;

  case 24: /* t4: %empty  */
#line 298 "soapcpp2_yacc.y"
                        { permission = Sprotected;
			}
#line 2166 "soapcpp2_yacc.c"
    break;

  case 25: /* t5: %empty  */
#line 301 "soapcpp2_yacc.y"
                        { permission = 0;
			}
#line 2173 "soapcpp2_yacc.c"
    break;

  case 26: /* dclrs: spec  */
#line 304 "soapcpp2_yacc.y"
                        { }
#line 2179 "soapcpp2_yacc.c"
    break;

  case 27: /* dclrs: spec dclr  */
#line 305 "soapcpp2_yacc.y"
                        { }
#line 2185 "soapcpp2_yacc.c"
    break;

  case 28: /* dclrs: spec fdclr func  */
#line 307 "soapcpp2_yacc.y"
                        { }
#line 2191 "soapcpp2_yacc.c"
    break;

  case 29: /* dclrs: constr func  */
#line 308 "soapcpp2_yacc.y"
                        { }
#line 2197 "soapcpp2_yacc.c"
    break;

  case 30: /* dclrs: destr func  */
#line 309 "soapcpp2_yacc.y"
                        { }
#line 2203 "soapcpp2_yacc.c"
    break;

  case 31: /* dclrs: dclrs ',' dclr  */
#line 310 "soapcpp2_yacc.y"
                        { }
#line 2209 "soapcpp2_yacc.c"
    break;

  case 32: /* dclrs: dclrs ',' fdclr func  */
#line 312 "soapcpp2_yacc.y"
                        { }
#line 2215 "soapcpp2_yacc.c"
    break;

  case 33: /* dclr: ptrs ID arrayck tag occurs init  */
#line 315 "soapcpp2_yacc.y"
                        { if (((yyvsp[-3].rec).sto & Stypedef) && sp->table->level == GLOBAL)
			  {	if (((yyvsp[-3].rec).typ->type != Tstruct && (yyvsp[-3].rec).typ->type != Tunion && (yyvsp[-3].rec).typ->type != Tenum) || strcmp((yyvsp[-4].sym)->name, (yyvsp[-3].rec).typ->id->name))
				{	p = enter(typetable, (yyvsp[-4].sym));
					p->info.typ = mksymtype((yyvsp[-3].rec).typ, (yyvsp[-4].sym));
			  		if ((yyvsp[-3].rec).sto & Sextern)
						p->info.typ->transient = -1;
					else
						p->info.typ->transient = (yyvsp[-3].rec).typ->transient;
			  		p->info.sto = (yyvsp[-3].rec).sto;
					p->info.typ->pattern = (yyvsp[-1].rec).pattern;
					p->info.typ->minLength = (yyvsp[-1].rec).minLength;
					p->info.typ->maxLength = (yyvsp[-1].rec).maxLength;
				}
				(yyvsp[-4].sym)->token = TYPE;
			  }
			  else
			  {	p = enter(sp->table, (yyvsp[-4].sym));
			  	p->tag = (yyvsp[-2].sym);
			  	p->info.typ = (yyvsp[-3].rec).typ;
			  	p->info.sto = (Storage)((int)(yyvsp[-3].rec).sto | permission);
				if ((yyvsp[0].rec).hasval)
				{	p->info.hasval = True;
					switch ((yyvsp[-3].rec).typ->type)
					{	case Tchar:
						case Tuchar:
						case Tshort:
						case Tushort:
						case Tint:
						case Tuint:
						case Tlong:
						case Tulong:
						case Tllong:
						case Tullong:
						case Tenum:
						case Ttime:
							if ((yyvsp[0].rec).typ->type == Tint || (yyvsp[0].rec).typ->type == Tchar || (yyvsp[0].rec).typ->type == Tenum)
								sp->val = p->info.val.i = (yyvsp[0].rec).val.i;
							else
							{	semerror("type error in initialization constant");
								p->info.hasval = False;
							}
							break;
						case Tfloat:
						case Tdouble:
						case Tldouble:
							if ((yyvsp[0].rec).typ->type == Tfloat || (yyvsp[0].rec).typ->type == Tdouble || (yyvsp[0].rec).typ->type == Tldouble)
								p->info.val.r = (yyvsp[0].rec).val.r;
							else if ((yyvsp[0].rec).typ->type == Tint)
								p->info.val.r = (double)(yyvsp[0].rec).val.i;
							else
							{	semerror("type error in initialization constant");
								p->info.hasval = False;
							}
							break;
						default:
							if ((yyvsp[-3].rec).typ->type == Tpointer
							 && ((Tnode*)(yyvsp[-3].rec).typ->ref)->type == Tchar
							 && (yyvsp[0].rec).typ->type == Tpointer
							 && ((Tnode*)(yyvsp[0].rec).typ->ref)->type == Tchar)
								p->info.val.s = (yyvsp[0].rec).val.s;
							else if (bflag
							 && (yyvsp[-3].rec).typ->type == Tarray
							 && ((Tnode*)(yyvsp[-3].rec).typ->ref)->type == Tchar
							 && (yyvsp[0].rec).typ->type == Tpointer
							 && ((Tnode*)(yyvsp[0].rec).typ->ref)->type == Tchar)
							{	if ((yyvsp[-3].rec).typ->width / ((Tnode*)(yyvsp[-3].rec).typ->ref)->width - 1 < strlen((yyvsp[0].rec).val.s))
								{	semerror("char[] initialization constant too long");
									p->info.val.s = "";
								}

								else
									p->info.val.s = (yyvsp[0].rec).val.s;
							}
							else if ((yyvsp[-3].rec).typ->type == Tpointer
							      && ((Tnode*)(yyvsp[-3].rec).typ->ref)->id == lookup("std::string"))
							      	p->info.val.s = (yyvsp[0].rec).val.s;
							else if ((yyvsp[-3].rec).typ->id == lookup("std::string"))
							      	p->info.val.s = (yyvsp[0].rec).val.s;
							else if ((yyvsp[-3].rec).typ->type == Tpointer
							      && (yyvsp[0].rec).typ->type == Tint
							      && (yyvsp[0].rec).val.i == 0)
								p->info.val.i = 0;
							else
							{	semerror("type error in initialization constant");
								p->info.hasval = False;
							}
							break;
					}
				}
				else
					p->info.val.i = sp->val;
			        if ((yyvsp[-1].rec).minOccurs < 0)
			        {	if (((yyvsp[-3].rec).sto & Sattribute) || (yyvsp[-3].rec).typ->type == Tpointer || (yyvsp[-3].rec).typ->type == Ttemplate || !strncmp((yyvsp[-4].sym)->name, "__size", 6))
			        		p->info.minOccurs = 0;
			        	else
			        		p->info.minOccurs = 1;
				}
				else
					p->info.minOccurs = (yyvsp[-1].rec).minOccurs;
				p->info.maxOccurs = (yyvsp[-1].rec).maxOccurs;
				if (sp->mask)
					sp->val <<= 1;
				else
					sp->val++;
			  	p->info.offset = sp->offset;
				if ((yyvsp[-3].rec).sto & Sextern)
					p->level = GLOBAL;
				else if ((yyvsp[-3].rec).sto & Stypedef)
					;
			  	else if (sp->grow)
					sp->offset += p->info.typ->width;
				else if (p->info.typ->width > sp->offset)
					sp->offset = p->info.typ->width;
			  }
			  sp->entry = p;
			}
#line 2336 "soapcpp2_yacc.c"
    break;

  case 34: /* fdclr: ptrs name  */
#line 432 "soapcpp2_yacc.y"
                        { if ((yyvsp[-1].rec).sto & Stypedef)
			  {	sprintf(errbuf, "invalid typedef qualifier for '%s'", (yyvsp[0].sym)->name);
				semwarn(errbuf);
			  }
			  p = enter(sp->table, (yyvsp[0].sym));
			  p->info.typ = (yyvsp[-1].rec).typ;
			  p->info.sto = (yyvsp[-1].rec).sto;
			  p->info.hasval = False;
			  p->info.offset = sp->offset;
			  if (sp->grow)
				sp->offset += p->info.typ->width;
			  else if (p->info.typ->width > sp->offset)
				sp->offset = p->info.typ->width;
			  sp->entry = p;
			}
#line 2356 "soapcpp2_yacc.c"
    break;

  case 35: /* id: ID  */
#line 448 "soapcpp2_yacc.y"
                        { (yyval.sym) = (yyvsp[0].sym); }
#line 2362 "soapcpp2_yacc.c"
    break;

  case 36: /* id: TYPE  */
#line 449 "soapcpp2_yacc.y"
                        { (yyval.sym) = (yyvsp[0].sym); }
#line 2368 "soapcpp2_yacc.c"
    break;

  case 37: /* name: ID  */
#line 451 "soapcpp2_yacc.y"
                        { (yyval.sym) = (yyvsp[0].sym); }
#line 2374 "soapcpp2_yacc.c"
    break;

  case 38: /* name: OPERATOR '!'  */
#line 452 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator!"); }
#line 2380 "soapcpp2_yacc.c"
    break;

  case 39: /* name: OPERATOR '~'  */
#line 453 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator~"); }
#line 2386 "soapcpp2_yacc.c"
    break;

  case 40: /* name: OPERATOR '='  */
#line 454 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator="); }
#line 2392 "soapcpp2_yacc.c"
    break;

  case 41: /* name: OPERATOR PA  */
#line 455 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator+="); }
#line 2398 "soapcpp2_yacc.c"
    break;

  case 42: /* name: OPERATOR NA  */
#line 456 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator-="); }
#line 2404 "soapcpp2_yacc.c"
    break;

  case 43: /* name: OPERATOR TA  */
#line 457 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator*="); }
#line 2410 "soapcpp2_yacc.c"
    break;

  case 44: /* name: OPERATOR DA  */
#line 458 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator/="); }
#line 2416 "soapcpp2_yacc.c"
    break;

  case 45: /* name: OPERATOR MA  */
#line 459 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator%="); }
#line 2422 "soapcpp2_yacc.c"
    break;

  case 46: /* name: OPERATOR AA  */
#line 460 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator&="); }
#line 2428 "soapcpp2_yacc.c"
    break;

  case 47: /* name: OPERATOR XA  */
#line 461 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator^="); }
#line 2434 "soapcpp2_yacc.c"
    break;

  case 48: /* name: OPERATOR OA  */
#line 462 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator|="); }
#line 2440 "soapcpp2_yacc.c"
    break;

  case 49: /* name: OPERATOR LA  */
#line 463 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator<<="); }
#line 2446 "soapcpp2_yacc.c"
    break;

  case 50: /* name: OPERATOR RA  */
#line 464 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator>>="); }
#line 2452 "soapcpp2_yacc.c"
    break;

  case 51: /* name: OPERATOR OR  */
#line 465 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator||"); }
#line 2458 "soapcpp2_yacc.c"
    break;

  case 52: /* name: OPERATOR AN  */
#line 466 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator&&"); }
#line 2464 "soapcpp2_yacc.c"
    break;

  case 53: /* name: OPERATOR '|'  */
#line 467 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator|"); }
#line 2470 "soapcpp2_yacc.c"
    break;

  case 54: /* name: OPERATOR '^'  */
#line 468 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator^"); }
#line 2476 "soapcpp2_yacc.c"
    break;

  case 55: /* name: OPERATOR '&'  */
#line 469 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator&"); }
#line 2482 "soapcpp2_yacc.c"
    break;

  case 56: /* name: OPERATOR EQ  */
#line 470 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator=="); }
#line 2488 "soapcpp2_yacc.c"
    break;

  case 57: /* name: OPERATOR NE  */
#line 471 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator!="); }
#line 2494 "soapcpp2_yacc.c"
    break;

  case 58: /* name: OPERATOR '<'  */
#line 472 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator<"); }
#line 2500 "soapcpp2_yacc.c"
    break;

  case 59: /* name: OPERATOR LE  */
#line 473 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator<="); }
#line 2506 "soapcpp2_yacc.c"
    break;

  case 60: /* name: OPERATOR '>'  */
#line 474 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator>"); }
#line 2512 "soapcpp2_yacc.c"
    break;

  case 61: /* name: OPERATOR GE  */
#line 475 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator>="); }
#line 2518 "soapcpp2_yacc.c"
    break;

  case 62: /* name: OPERATOR LS  */
#line 476 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator<<"); }
#line 2524 "soapcpp2_yacc.c"
    break;

  case 63: /* name: OPERATOR RS  */
#line 477 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator>>"); }
#line 2530 "soapcpp2_yacc.c"
    break;

  case 64: /* name: OPERATOR '+'  */
#line 478 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator+"); }
#line 2536 "soapcpp2_yacc.c"
    break;

  case 65: /* name: OPERATOR '-'  */
#line 479 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator-"); }
#line 2542 "soapcpp2_yacc.c"
    break;

  case 66: /* name: OPERATOR '*'  */
#line 480 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator*"); }
#line 2548 "soapcpp2_yacc.c"
    break;

  case 67: /* name: OPERATOR '/'  */
#line 481 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator/"); }
#line 2554 "soapcpp2_yacc.c"
    break;

  case 68: /* name: OPERATOR '%'  */
#line 482 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator%"); }
#line 2560 "soapcpp2_yacc.c"
    break;

  case 69: /* name: OPERATOR PP  */
#line 483 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator++"); }
#line 2566 "soapcpp2_yacc.c"
    break;

  case 70: /* name: OPERATOR NN  */
#line 484 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator--"); }
#line 2572 "soapcpp2_yacc.c"
    break;

  case 71: /* name: OPERATOR AR  */
#line 485 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator->"); }
#line 2578 "soapcpp2_yacc.c"
    break;

  case 72: /* name: OPERATOR '[' ']'  */
#line 486 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator[]"); }
#line 2584 "soapcpp2_yacc.c"
    break;

  case 73: /* name: OPERATOR '(' ')'  */
#line 487 "soapcpp2_yacc.y"
                        { (yyval.sym) = lookup("operator()"); }
#line 2590 "soapcpp2_yacc.c"
    break;

  case 74: /* name: OPERATOR texp  */
#line 488 "soapcpp2_yacc.y"
                        { s1 = c_storage((yyvsp[0].rec).sto);
			  s2 = c_type((yyvsp[0].rec).typ);
			  s = (char*)emalloc(strlen(s1) + strlen(s2) + 10);
			  strcpy(s, "operator ");
			  strcat(s, s1);
			  strcat(s, s2);
			  (yyval.sym) = lookup(s);
			  if (!(yyval.sym))
				(yyval.sym) = install(s, ID);
			}
#line 2605 "soapcpp2_yacc.c"
    break;

  case 75: /* constr: TYPE  */
#line 499 "soapcpp2_yacc.y"
                        { if (!(p = entry(classtable, (yyvsp[0].sym))))
			  	semerror("invalid constructor");
			  sp->entry = enter(sp->table, (yyvsp[0].sym));
			  sp->entry->info.typ = mknone();
			  sp->entry->info.sto = Snone;
			  sp->entry->info.offset = sp->offset;
			  sp->node.typ = mkvoid();
			  sp->node.sto = Snone;
			}
#line 2619 "soapcpp2_yacc.c"
    break;

  case 76: /* destr: virtual '~' TYPE  */
#line 510 "soapcpp2_yacc.y"
                        { if (!(p = entry(classtable, (yyvsp[0].sym))))
			  	semerror("invalid destructor");
			  s = (char*)emalloc(strlen((yyvsp[0].sym)->name) + 2);
			  strcpy(s, "~");
			  strcat(s, (yyvsp[0].sym)->name);
			  sym = lookup(s);
			  if (!sym)
				sym = install(s, ID);
			  sp->entry = enter(sp->table, sym);
			  sp->entry->info.typ = mknone();
			  sp->entry->info.sto = (yyvsp[-2].sto);
			  sp->entry->info.offset = sp->offset;
			  sp->node.typ = mkvoid();
			  sp->node.sto = Snone;
			}
#line 2639 "soapcpp2_yacc.c"
    break;

  case 77: /* func: fname '(' s6 fargso ')' constobj abstract  */
#line 527 "soapcpp2_yacc.y"
                        { if ((yyvsp[-6].e)->level == GLOBAL)
			  {	if (!((yyvsp[-6].e)->info.sto & Sextern) && sp->entry && sp->entry->info.typ->type == Tpointer && ((Tnode*)sp->entry->info.typ->ref)->type == Tchar)
			  	{	sprintf(errbuf, "last output parameter of remote method function prototype '%s' is a pointer to a char which will only return one byte: use char** instead to return a string", (yyvsp[-6].e)->sym->name);
					semwarn(errbuf);
				}
				if ((yyvsp[-6].e)->info.sto & Sextern)
				 	(yyvsp[-6].e)->info.typ = mkmethod((yyvsp[-6].e)->info.typ, sp->table);
			  	else if (sp->entry && (sp->entry->info.typ->type == Tpointer || sp->entry->info.typ->type == Treference || sp->entry->info.typ->type == Tarray || is_transient(sp->entry->info.typ)))
				{	if ((yyvsp[-6].e)->info.typ->type == Tint)
					{	sp->entry->info.sto = (Storage)((int)sp->entry->info.sto | (int)Sreturn);
						(yyvsp[-6].e)->info.typ = mkfun(sp->entry);
						(yyvsp[-6].e)->info.typ->id = (yyvsp[-6].e)->sym;
						if (!is_transient(sp->entry->info.typ))
						{	if (!is_response(sp->entry->info.typ))
							{	if (!is_XML(sp->entry->info.typ))
									add_response((yyvsp[-6].e), sp->entry);
							}
							else
								add_result(sp->entry->info.typ);
						}
					}
					else
					{	sprintf(errbuf, "return type of remote method function prototype '%s' must be integer", (yyvsp[-6].e)->sym->name);
						semerror(errbuf);
					}
				}
			  	else
			  	{	sprintf(errbuf, "last output parameter of remote method function prototype '%s' is a return parameter and must be a pointer or reference, or use %s(void) for no return parameter", (yyvsp[-6].e)->sym->name, (yyvsp[-6].e)->sym->name);
					semerror(errbuf);
			  	}
				if (!((yyvsp[-6].e)->info.sto & Sextern))
			  	{	unlinklast(sp->table);
			  		if ((p = entry(classtable, (yyvsp[-6].e)->sym)))
					{	if (p->info.typ->ref)
						{	sprintf(errbuf, "remote method name clash: struct/class '%s' already declared at line %d", (yyvsp[-6].e)->sym->name, p->lineno);
							semerror(errbuf);
						}
						else
						{	p->info.typ->ref = sp->table;
							p->info.typ->width = sp->offset;
						}
					}
			  		else
			  		{	p = enter(classtable, (yyvsp[-6].e)->sym);
						p->info.typ = mkstruct(sp->table, sp->offset);
						p->info.typ->id = (yyvsp[-6].e)->sym;
			  		}
			  	}
			  }
			  else if ((yyvsp[-6].e)->level == INTERNAL)
			  {	(yyvsp[-6].e)->info.typ = mkmethod((yyvsp[-6].e)->info.typ, sp->table);
				(yyvsp[-6].e)->info.sto = (Storage)((int)(yyvsp[-6].e)->info.sto | (int)(yyvsp[-1].sto) | (int)(yyvsp[0].sto));
			  	transient &= ~1;
			  }
			  exitscope();
			}
#line 2700 "soapcpp2_yacc.c"
    break;

  case 78: /* fname: %empty  */
#line 584 "soapcpp2_yacc.y"
                        { (yyval.e) = sp->entry; }
#line 2706 "soapcpp2_yacc.c"
    break;

  case 79: /* fargso: %empty  */
#line 586 "soapcpp2_yacc.y"
                        { }
#line 2712 "soapcpp2_yacc.c"
    break;

  case 80: /* fargso: fargs  */
#line 587 "soapcpp2_yacc.y"
                        { }
#line 2718 "soapcpp2_yacc.c"
    break;

  case 81: /* fargs: farg  */
#line 589 "soapcpp2_yacc.y"
                        { }
#line 2724 "soapcpp2_yacc.c"
    break;

  case 82: /* fargs: farg ',' fargs  */
#line 590 "soapcpp2_yacc.y"
                        { }
#line 2730 "soapcpp2_yacc.c"
    break;

  case 83: /* farg: tspec ptrs arg arrayck occurs init  */
#line 593 "soapcpp2_yacc.y"
                        { if ((yyvsp[-2].rec).sto & Stypedef)
			  	semwarn("typedef in function argument");
			  p = enter(sp->table, (yyvsp[-3].sym));
			  p->info.typ = (yyvsp[-2].rec).typ;
			  p->info.sto = (yyvsp[-2].rec).sto;
			  if ((yyvsp[-1].rec).minOccurs < 0)
			  {	if (((yyvsp[-2].rec).sto & Sattribute) || (yyvsp[-2].rec).typ->type == Tpointer)
			        	p->info.minOccurs = 0;
			       	else
			        	p->info.minOccurs = 1;
			  }
			  else
				p->info.minOccurs = (yyvsp[-1].rec).minOccurs;
			  p->info.maxOccurs = (yyvsp[-1].rec).maxOccurs;
			  if ((yyvsp[0].rec).hasval)
			  {	p->info.hasval = True;
				switch ((yyvsp[-2].rec).typ->type)
				{	case Tchar:
					case Tuchar:
					case Tshort:
					case Tushort:
					case Tint:
					case Tuint:
					case Tlong:
					case Tulong:
					case Tenum:
					case Ttime:
						if ((yyvsp[0].rec).typ->type == Tint || (yyvsp[0].rec).typ->type == Tchar || (yyvsp[0].rec).typ->type == Tenum)
							sp->val = p->info.val.i = (yyvsp[0].rec).val.i;
						else
						{	semerror("type error in initialization constant");
							p->info.hasval = False;
						}
						break;
					case Tfloat:
					case Tdouble:
					case Tldouble:
						if ((yyvsp[0].rec).typ->type == Tfloat || (yyvsp[0].rec).typ->type == Tdouble || (yyvsp[0].rec).typ->type == Tldouble)
							p->info.val.r = (yyvsp[0].rec).val.r;
						else if ((yyvsp[0].rec).typ->type == Tint)
							p->info.val.r = (double)(yyvsp[0].rec).val.i;
						else
						{	semerror("type error in initialization constant");
							p->info.hasval = False;
						}
						break;
					default:
						if ((yyvsp[-2].rec).typ->type == Tpointer
						 && ((Tnode*)(yyvsp[-2].rec).typ->ref)->type == Tchar
						 && (yyvsp[0].rec).typ->type == Tpointer
						 && ((Tnode*)(yyvsp[0].rec).typ->ref)->type == Tchar)
							p->info.val.s = (yyvsp[0].rec).val.s;
						else if ((yyvsp[-2].rec).typ->type == Tpointer
						      && ((Tnode*)(yyvsp[-2].rec).typ->ref)->id == lookup("std::string"))
						      	p->info.val.s = (yyvsp[0].rec).val.s;
						else if ((yyvsp[-2].rec).typ->id == lookup("std::string"))
						      	p->info.val.s = (yyvsp[0].rec).val.s;
						else if ((yyvsp[-2].rec).typ->type == Tpointer
						      && (yyvsp[0].rec).typ->type == Tint
						      && (yyvsp[0].rec).val.i == 0)
							p->info.val.i = 0;
						else
						{	semerror("type error in initialization constant");
							p->info.hasval = False;
						}
						break;
				}
			  }
			  p->info.offset = sp->offset;
			  if ((yyvsp[-2].rec).sto & Sextern)
				p->level = GLOBAL;
			  else if (sp->grow)
				sp->offset += p->info.typ->width;
			  else if (p->info.typ->width > sp->offset)
				sp->offset = p->info.typ->width;
			  sp->entry = p;
			}
#line 2812 "soapcpp2_yacc.c"
    break;

  case 84: /* arg: %empty  */
#line 671 "soapcpp2_yacc.y"
                        { if (sp->table->level != PARAM)
			    (yyval.sym) = gensymidx("param", (int)++sp->val);
			  else if (eflag)
				(yyval.sym) = gensymidx("_param", (int)++sp->val);
			  else
				(yyval.sym) = gensym("_param");
			}
#line 2824 "soapcpp2_yacc.c"
    break;

  case 85: /* arg: ID  */
#line 678 "soapcpp2_yacc.y"
                        { if (vflag != 1 && *(yyvsp[0].sym)->name == '_' && sp->table->level == GLOBAL)
			  { sprintf(errbuf, "SOAP 1.2 does not support anonymous parameters '%s'", (yyvsp[0].sym)->name);
			    semwarn(errbuf);
			  }
			  (yyval.sym) = (yyvsp[0].sym);
			}
#line 2835 "soapcpp2_yacc.c"
    break;

  case 86: /* texp: tspec ptrs array  */
#line 694 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 2841 "soapcpp2_yacc.c"
    break;

  case 87: /* texp: tspec ptrs ID array  */
#line 696 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 2847 "soapcpp2_yacc.c"
    break;

  case 88: /* spec: %empty  */
#line 698 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkint();
			  (yyval.rec).sto = Snone;
			  sp->node = (yyval.rec);
			}
#line 2856 "soapcpp2_yacc.c"
    break;

  case 89: /* spec: store spec  */
#line 702 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = (yyvsp[0].rec).typ;
			  (yyval.rec).sto = (Storage)((int)(yyvsp[-1].sto) | (int)(yyvsp[0].rec).sto);
			  if (((yyval.rec).sto & Sattribute) && !is_primitive_or_string((yyvsp[0].rec).typ) && !is_stdstr((yyvsp[0].rec).typ) && !is_binary((yyvsp[0].rec).typ) && !is_external((yyvsp[0].rec).typ))
			  {	semwarn("invalid attribute type");
			  	(yyval.rec).sto = (Storage)((int)(yyval.rec).sto & ~Sattribute);
			  }
			  sp->node = (yyval.rec);
			  if ((yyvsp[-1].sto) & Sextern)
				transient = 0;
			}
#line 2871 "soapcpp2_yacc.c"
    break;

  case 90: /* spec: type spec  */
#line 712 "soapcpp2_yacc.y"
                        { if ((yyvsp[-1].typ)->type == Tint)
				switch ((yyvsp[0].rec).typ->type)
				{ case Tchar:	(yyval.rec).typ = (yyvsp[0].rec).typ; break;
				  case Tshort:	(yyval.rec).typ = (yyvsp[0].rec).typ; break;
				  case Tint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tlong:	(yyval.rec).typ = (yyvsp[0].rec).typ; break;
				  case Tllong:	(yyval.rec).typ = (yyvsp[0].rec).typ; break;
				  default:	semwarn("illegal use of 'signed'");
						(yyval.rec).typ = (yyvsp[0].rec).typ;
				}
			  else if ((yyvsp[-1].typ)->type == Tuint)
				switch ((yyvsp[0].rec).typ->type)
				{ case Tchar:	(yyval.rec).typ = mkuchar(); break;
				  case Tshort:	(yyval.rec).typ = mkushort(); break;
				  case Tint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tlong:	(yyval.rec).typ = mkulong(); break;
				  case Tllong:	(yyval.rec).typ = mkullong(); break;
				  default:	semwarn("illegal use of 'unsigned'");
						(yyval.rec).typ = (yyvsp[0].rec).typ;
				}
			  else if ((yyvsp[-1].typ)->type == Tlong)
				switch ((yyvsp[0].rec).typ->type)
				{ case Tint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tlong:	(yyval.rec).typ = mkllong(); break;
				  case Tuint:	(yyval.rec).typ = mkulong(); break;
				  case Tulong:	(yyval.rec).typ = mkullong(); break;
				  case Tdouble:	(yyval.rec).typ = mkldouble(); break;
				  default:	semwarn("illegal use of 'long'");
						(yyval.rec).typ = (yyvsp[0].rec).typ;
				}
			  else if ((yyvsp[-1].typ)->type == Tulong)
				switch ((yyvsp[0].rec).typ->type)
				{ case Tint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tlong:	(yyval.rec).typ = mkullong(); break;
				  case Tuint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tulong:	(yyval.rec).typ = mkullong(); break;
				  default:	semwarn("illegal use of 'long'");
						(yyval.rec).typ = (yyvsp[0].rec).typ;
				}
			  else if ((yyvsp[0].rec).typ->type == Tint)
				(yyval.rec).typ = (yyvsp[-1].typ);
			  else
			  	semwarn("invalid type (missing ';' or type name used as non-type identifier?)");
			  (yyval.rec).sto = (yyvsp[0].rec).sto;
			  sp->node = (yyval.rec);
			}
#line 2922 "soapcpp2_yacc.c"
    break;

  case 91: /* tspec: store  */
#line 759 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkint();
			  (yyval.rec).sto = (yyvsp[0].sto);
			  sp->node = (yyval.rec);
			  if ((yyvsp[0].sto) & Sextern)
				transient = 0;
			}
#line 2933 "soapcpp2_yacc.c"
    break;

  case 92: /* tspec: type  */
#line 765 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = (yyvsp[0].typ);
			  (yyval.rec).sto = Snone;
			  sp->node = (yyval.rec);
			}
#line 2942 "soapcpp2_yacc.c"
    break;

  case 93: /* tspec: store tspec  */
#line 769 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = (yyvsp[0].rec).typ;
			  (yyval.rec).sto = (Storage)((int)(yyvsp[-1].sto) | (int)(yyvsp[0].rec).sto);
			  if (((yyval.rec).sto & Sattribute) && !is_primitive_or_string((yyvsp[0].rec).typ) && !is_stdstr((yyvsp[0].rec).typ) && !is_binary((yyvsp[0].rec).typ) && !is_external((yyvsp[0].rec).typ))
			  {	semwarn("invalid attribute type");
			  	(yyval.rec).sto = (Storage)((int)(yyval.rec).sto & ~Sattribute);
			  }
			  sp->node = (yyval.rec);
			  if ((yyvsp[-1].sto) & Sextern)
				transient = 0;
			}
#line 2957 "soapcpp2_yacc.c"
    break;

  case 94: /* tspec: type tspec  */
#line 779 "soapcpp2_yacc.y"
                        { if ((yyvsp[-1].typ)->type == Tint)
				switch ((yyvsp[0].rec).typ->type)
				{ case Tchar:	(yyval.rec).typ = (yyvsp[0].rec).typ; break;
				  case Tshort:	(yyval.rec).typ = (yyvsp[0].rec).typ; break;
				  case Tint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tlong:	(yyval.rec).typ = (yyvsp[0].rec).typ; break;
				  case Tllong:	(yyval.rec).typ = (yyvsp[0].rec).typ; break;
				  default:	semwarn("illegal use of 'signed'");
						(yyval.rec).typ = (yyvsp[0].rec).typ;
				}
			  else if ((yyvsp[-1].typ)->type == Tuint)
				switch ((yyvsp[0].rec).typ->type)
				{ case Tchar:	(yyval.rec).typ = mkuchar(); break;
				  case Tshort:	(yyval.rec).typ = mkushort(); break;
				  case Tint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tlong:	(yyval.rec).typ = mkulong(); break;
				  case Tllong:	(yyval.rec).typ = mkullong(); break;
				  default:	semwarn("illegal use of 'unsigned'");
						(yyval.rec).typ = (yyvsp[0].rec).typ;
				}
			  else if ((yyvsp[-1].typ)->type == Tlong)
				switch ((yyvsp[0].rec).typ->type)
				{ case Tint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tlong:	(yyval.rec).typ = mkllong(); break;
				  case Tuint:	(yyval.rec).typ = mkulong(); break;
				  case Tulong:	(yyval.rec).typ = mkullong(); break;
				  case Tdouble:	(yyval.rec).typ = mkldouble(); break;
				  default:	semwarn("illegal use of 'long'");
						(yyval.rec).typ = (yyvsp[0].rec).typ;
				}
			  else if ((yyvsp[-1].typ)->type == Tulong)
				switch ((yyvsp[0].rec).typ->type)
				{ case Tint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tlong:	(yyval.rec).typ = mkullong(); break;
				  case Tuint:	(yyval.rec).typ = (yyvsp[-1].typ); break;
				  case Tulong:	(yyval.rec).typ = mkullong(); break;
				  default:	semwarn("illegal use of 'long'");
						(yyval.rec).typ = (yyvsp[0].rec).typ;
				}
			  else if ((yyvsp[0].rec).typ->type == Tint)
				(yyval.rec).typ = (yyvsp[-1].typ);
			  else
			  	semwarn("invalid type");
			  (yyval.rec).sto = (yyvsp[0].rec).sto;
			  sp->node = (yyval.rec);
			}
#line 3008 "soapcpp2_yacc.c"
    break;

  case 95: /* type: VOID  */
#line 826 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkvoid(); }
#line 3014 "soapcpp2_yacc.c"
    break;

  case 96: /* type: BOOL  */
#line 827 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkbool(); }
#line 3020 "soapcpp2_yacc.c"
    break;

  case 97: /* type: CHAR  */
#line 828 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkchar(); }
#line 3026 "soapcpp2_yacc.c"
    break;

  case 98: /* type: WCHAR  */
#line 829 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkwchart(); }
#line 3032 "soapcpp2_yacc.c"
    break;

  case 99: /* type: SHORT  */
#line 830 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkshort(); }
#line 3038 "soapcpp2_yacc.c"
    break;

  case 100: /* type: INT  */
#line 831 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkint(); }
#line 3044 "soapcpp2_yacc.c"
    break;

  case 101: /* type: LONG  */
#line 832 "soapcpp2_yacc.y"
                        { (yyval.typ) = mklong(); }
#line 3050 "soapcpp2_yacc.c"
    break;

  case 102: /* type: LLONG  */
#line 833 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkllong(); }
#line 3056 "soapcpp2_yacc.c"
    break;

  case 103: /* type: ULLONG  */
#line 834 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkullong(); }
#line 3062 "soapcpp2_yacc.c"
    break;

  case 104: /* type: SIZE  */
#line 835 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkulong(); }
#line 3068 "soapcpp2_yacc.c"
    break;

  case 105: /* type: FLOAT  */
#line 836 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkfloat(); }
#line 3074 "soapcpp2_yacc.c"
    break;

  case 106: /* type: DOUBLE  */
#line 837 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkdouble(); }
#line 3080 "soapcpp2_yacc.c"
    break;

  case 107: /* type: SIGNED  */
#line 838 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkint(); }
#line 3086 "soapcpp2_yacc.c"
    break;

  case 108: /* type: UNSIGNED  */
#line 839 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkuint(); }
#line 3092 "soapcpp2_yacc.c"
    break;

  case 109: /* type: UCHAR  */
#line 840 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkuchar(); }
#line 3098 "soapcpp2_yacc.c"
    break;

  case 110: /* type: USHORT  */
#line 841 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkushort(); }
#line 3104 "soapcpp2_yacc.c"
    break;

  case 111: /* type: UINT  */
#line 842 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkuint(); }
#line 3110 "soapcpp2_yacc.c"
    break;

  case 112: /* type: ULONG  */
#line 843 "soapcpp2_yacc.y"
                        { (yyval.typ) = mkulong(); }
#line 3116 "soapcpp2_yacc.c"
    break;

  case 113: /* type: TIME  */
#line 844 "soapcpp2_yacc.y"
                        { (yyval.typ) = mktimet(); }
#line 3122 "soapcpp2_yacc.c"
    break;

  case 114: /* type: TEMPLATE '<' tname id '>' CLASS id  */
#line 846 "soapcpp2_yacc.y"
                        { if (!(p = entry(templatetable, (yyvsp[0].sym))))
			  {	p = enter(templatetable, (yyvsp[0].sym));
			  	p->info.typ = mktemplate(NULL, (yyvsp[0].sym));
			  	(yyvsp[0].sym)->token = TYPE;
			  }
			  (yyval.typ) = p->info.typ;
			}
#line 3134 "soapcpp2_yacc.c"
    break;

  case 115: /* type: CLASS '{' s2 decls '}'  */
#line 854 "soapcpp2_yacc.y"
                        { sym = gensym("_Struct");
			  sprintf(errbuf, "anonymous class will be named '%s'", sym->name);
			  semwarn(errbuf);
			  if ((p = entry(classtable, sym)))
			  {	if (p->info.typ->ref || p->info.typ->type != Tclass)
				{	sprintf(errbuf, "class '%s' already declared at line %d", sym->name, p->lineno);
					semerror(errbuf);
				}
			  }
			  else
			  {	p = enter(classtable, sym);
				p->info.typ = mkclass((Table*)0, 0);
			  }
			  sym->token = TYPE;
			  sp->table->sym = sym;
			  p->info.typ->ref = sp->table;
			  p->info.typ->width = sp->offset;
			  p->info.typ->id = sym;
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3160 "soapcpp2_yacc.c"
    break;

  case 116: /* type: class '{' s2 decls '}'  */
#line 876 "soapcpp2_yacc.y"
                        { p = reenter(classtable, (yyvsp[-4].e)->sym);
			  sp->table->sym = p->sym;
			  p->info.typ->ref = sp->table;
			  p->info.typ->width = sp->offset;
			  p->info.typ->id = p->sym;
			  if (p->info.typ->base)
			  	sp->table->prev = (Table*)entry(classtable, p->info.typ->base)->info.typ->ref;
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3175 "soapcpp2_yacc.c"
    break;

  case 117: /* type: class ':' base '{' s2 decls '}'  */
#line 887 "soapcpp2_yacc.y"
                        { p = reenter(classtable, (yyvsp[-6].e)->sym);
			  sp->table->sym = p->sym;
			  if (!(yyvsp[-4].e))
				semerror("invalid base class");
			  else
			  {	sp->table->prev = (Table*)(yyvsp[-4].e)->info.typ->ref;
				if (!sp->table->prev && !(yyvsp[-4].e)->info.typ->transient)
				{	sprintf(errbuf, "class '%s' has incomplete type", (yyvsp[-4].e)->sym->name);
					semerror(errbuf);
				}
			  	p->info.typ->base = (yyvsp[-4].e)->info.typ->id;
			  }
			  p->info.typ->ref = sp->table;
			  p->info.typ->width = sp->offset;
			  p->info.typ->id = p->sym;
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3198 "soapcpp2_yacc.c"
    break;

  case 118: /* type: class  */
#line 905 "soapcpp2_yacc.y"
                        { (yyvsp[0].e)->info.typ->id = (yyvsp[0].e)->sym;
			  (yyval.typ) = (yyvsp[0].e)->info.typ;
			}
#line 3206 "soapcpp2_yacc.c"
    break;

  case 119: /* type: class ':' base  */
#line 909 "soapcpp2_yacc.y"
                        { if (!(yyvsp[0].e))
				semerror("invalid base class");
			  else
			  {	if (!(yyvsp[0].e)->info.typ->ref && !(yyvsp[0].e)->info.typ->transient)
				{	sprintf(errbuf, "class '%s' has incomplete type", (yyvsp[0].e)->sym->name);
					semerror(errbuf);
				}
			  	(yyvsp[-2].e)->info.typ->base = (yyvsp[0].e)->info.typ->id;
			  }
			  (yyvsp[-2].e)->info.typ->id = (yyvsp[-2].e)->sym;
			  (yyval.typ) = (yyvsp[-2].e)->info.typ;
			}
#line 3223 "soapcpp2_yacc.c"
    break;

  case 120: /* type: STRUCT '{' s2 decls '}'  */
#line 922 "soapcpp2_yacc.y"
                        { sym = gensym("_Struct");
			  sprintf(errbuf, "anonymous struct will be named '%s'", sym->name);
			  semwarn(errbuf);
			  if ((p = entry(classtable, sym)))
			  {	if (p->info.typ->ref || p->info.typ->type != Tstruct)
				{	sprintf(errbuf, "struct '%s' already declared at line %d", sym->name, p->lineno);
					semerror(errbuf);
				}
				else
				{	p->info.typ->ref = sp->table;
					p->info.typ->width = sp->offset;
				}
			  }
			  else
			  {	p = enter(classtable, sym);
				p->info.typ = mkstruct(sp->table, sp->offset);
			  }
			  p->info.typ->id = sym;
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3249 "soapcpp2_yacc.c"
    break;

  case 121: /* type: struct '{' s2 decls '}'  */
#line 944 "soapcpp2_yacc.y"
                        { if ((p = entry(classtable, (yyvsp[-4].e)->sym)) && p->info.typ->ref)
			  {	if (is_mutable(p->info.typ))
			  	{	if (merge((Table*)p->info.typ->ref, sp->table))
					{	sprintf(errbuf, "member name clash in struct '%s' declared at line %d", (yyvsp[-4].e)->sym->name, p->lineno);
						semerror(errbuf);
					}
			  		p->info.typ->width += sp->offset;
				}
			  }
			  else
			  {	p = reenter(classtable, (yyvsp[-4].e)->sym);
			  	p->info.typ->ref = sp->table;
			  	p->info.typ->width = sp->offset;
			  	p->info.typ->id = p->sym;
			  }
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3272 "soapcpp2_yacc.c"
    break;

  case 122: /* type: STRUCT ID  */
#line 962 "soapcpp2_yacc.y"
                        { if ((p = entry(classtable, (yyvsp[0].sym))))
			  {	if (p->info.typ->type == Tstruct)
			  		(yyval.typ) = p->info.typ;
			  	else
				{	sprintf(errbuf, "'struct %s' redeclaration (line %d)", (yyvsp[0].sym)->name, p->lineno);
			  		semerror(errbuf);
			  		(yyval.typ) = mkint();
				}
			  }
			  else
			  {	p = enter(classtable, (yyvsp[0].sym));
			  	(yyval.typ) = p->info.typ = mkstruct((Table*)0, 0);
				p->info.typ->id = (yyvsp[0].sym);
			  }
			}
#line 3292 "soapcpp2_yacc.c"
    break;

  case 123: /* type: STRUCT TYPE  */
#line 977 "soapcpp2_yacc.y"
                        { if ((p = entry(classtable, (yyvsp[0].sym))))
			  {	if (p->info.typ->type == Tstruct)
					(yyval.typ) = p->info.typ;
			  	else
				{	sprintf(errbuf, "'struct %s' redeclaration (line %d)", (yyvsp[0].sym)->name, p->lineno);
			  		semerror(errbuf);
			  		(yyval.typ) = mkint();
				}
			  }
			  else
			  {	p = enter(classtable, (yyvsp[0].sym));
			  	(yyval.typ) = p->info.typ = mkstruct((Table*)0, 0);
				p->info.typ->id = (yyvsp[0].sym);
			  }
			}
#line 3312 "soapcpp2_yacc.c"
    break;

  case 124: /* type: UNION '{' s3 decls '}'  */
#line 993 "soapcpp2_yacc.y"
                        { sym = gensym("_Union");
			  sprintf(errbuf, "anonymous union will be named '%s'", sym->name);
			  semwarn(errbuf);
			  (yyval.typ) = mkunion(sp->table, sp->offset);
			  if ((p = entry(classtable, sym)))
			  {	if (p->info.typ->ref)
				{	sprintf(errbuf, "union or struct '%s' already declared at line %d", sym->name, p->lineno);
					semerror(errbuf);
				}
				else
				{	p->info.typ->ref = sp->table;
					p->info.typ->width = sp->offset;
				}
			  }
			  else
			  {	p = enter(classtable, sym);
				p->info.typ = mkunion(sp->table, sp->offset);
			  }
			  p->info.typ->id = sym;
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3339 "soapcpp2_yacc.c"
    break;

  case 125: /* type: UNION id '{' s3 decls '}'  */
#line 1016 "soapcpp2_yacc.y"
                        { if ((p = entry(classtable, (yyvsp[-4].sym))))
			  {	if (p->info.typ->ref || p->info.typ->type != Tunion)
			  	{	sprintf(errbuf, "union '%s' already declared at line %d", (yyvsp[-4].sym)->name, p->lineno);
					semerror(errbuf);
				}
				else
				{	p = reenter(classtable, (yyvsp[-4].sym));
					p->info.typ->ref = sp->table;
					p->info.typ->width = sp->offset;
				}
			  }
			  else
			  {	p = enter(classtable, (yyvsp[-4].sym));
				p->info.typ = mkunion(sp->table, sp->offset);
			  }
			  p->info.typ->id = (yyvsp[-4].sym);
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3363 "soapcpp2_yacc.c"
    break;

  case 126: /* type: UNION ID  */
#line 1035 "soapcpp2_yacc.y"
                        { if ((p = entry(classtable, (yyvsp[0].sym))))
			  {	if (p->info.typ->type == Tunion)
					(yyval.typ) = p->info.typ;
			  	else
				{	sprintf(errbuf, "'union %s' redeclaration (line %d)", (yyvsp[0].sym)->name, p->lineno);
			  		semerror(errbuf);
			  		(yyval.typ) = mkint();
				}
			  }
			  else
			  {	p = enter(classtable, (yyvsp[0].sym));
			  	(yyval.typ) = p->info.typ = mkunion((Table*) 0, 0);
				p->info.typ->id = (yyvsp[0].sym);
			  }
			}
#line 3383 "soapcpp2_yacc.c"
    break;

  case 127: /* type: UNION TYPE  */
#line 1050 "soapcpp2_yacc.y"
                        { if ((p = entry(classtable, (yyvsp[0].sym))))
			  {	if (p->info.typ->type == Tunion)
					(yyval.typ) = p->info.typ;
			  	else
				{	sprintf(errbuf, "'union %s' redeclaration (line %d)", (yyvsp[0].sym)->name, p->lineno);
			  		semerror(errbuf);
			  		(yyval.typ) = mkint();
				}
			  }
			  else
			  {	p = enter(classtable, (yyvsp[0].sym));
			  	(yyval.typ) = p->info.typ = mkunion((Table*) 0, 0);
				p->info.typ->id = (yyvsp[0].sym);
			  }
			}
#line 3403 "soapcpp2_yacc.c"
    break;

  case 128: /* type: ENUM '{' s2 dclrs s5 '}'  */
#line 1066 "soapcpp2_yacc.y"
                        { sym = gensym("_Enum");
			  sprintf(errbuf, "anonymous enum will be named '%s'", sym->name);
			  semwarn(errbuf);
			  if ((p = entry(enumtable, sym)))
			  {	if (p->info.typ->ref)
				{	sprintf(errbuf, "enum '%s' already declared at line %d", sym->name, p->lineno);
					semerror(errbuf);
				}
				else
				{	p->info.typ->ref = sp->table;
					p->info.typ->width = 4; /* 4 = enum */
				}
			  }
			  else
			  {	p = enter(enumtable, sym);
				p->info.typ = mkenum(sp->table);
			  }
			  p->info.typ->id = sym;
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3429 "soapcpp2_yacc.c"
    break;

  case 129: /* type: enum '{' s2 dclrs s5 '}'  */
#line 1088 "soapcpp2_yacc.y"
                        { if ((p = entry(enumtable, (yyvsp[-5].e)->sym)))
			  {	if (p->info.typ->ref)
				{	sprintf(errbuf, "enum '%s' already declared at line %d", (yyvsp[-5].e)->sym->name, p->lineno);
					semerror(errbuf);
				}
				else
				{	p->info.typ->ref = sp->table;
					p->info.typ->width = 4; /* 4 = enum */
				}
			  }
			  else
			  {	p = enter(enumtable, (yyvsp[-5].e)->sym);
				p->info.typ = mkenum(sp->table);
			  }
			  p->info.typ->id = (yyvsp[-5].e)->sym;
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3452 "soapcpp2_yacc.c"
    break;

  case 130: /* type: ENUM '*' id '{' s4 dclrs s5 '}'  */
#line 1107 "soapcpp2_yacc.y"
                        { if ((p = entry(enumtable, (yyvsp[-5].sym))))
			  {	if (p->info.typ->ref)
				{	sprintf(errbuf, "enum '%s' already declared at line %d", (yyvsp[-5].sym)->name, p->lineno);
					semerror(errbuf);
				}
				else
				{	p->info.typ->ref = sp->table;
					p->info.typ->width = 8; /* 8 = mask */
				}
			  }
			  else
			  {	p = enter(enumtable, (yyvsp[-5].sym));
				p->info.typ = mkmask(sp->table);
			  }
			  p->info.typ->id = (yyvsp[-5].sym);
			  (yyval.typ) = p->info.typ;
			  exitscope();
			}
#line 3475 "soapcpp2_yacc.c"
    break;

  case 131: /* type: ENUM ID  */
#line 1125 "soapcpp2_yacc.y"
                        { if ((p = entry(enumtable, (yyvsp[0].sym))))
			  	(yyval.typ) = p->info.typ;
			  else
			  {	p = enter(enumtable, (yyvsp[0].sym));
			  	(yyval.typ) = p->info.typ = mkenum((Table*)0);
				p->info.typ->id = (yyvsp[0].sym);
			  }
			}
#line 3488 "soapcpp2_yacc.c"
    break;

  case 132: /* type: ENUM TYPE  */
#line 1133 "soapcpp2_yacc.y"
                        { if ((p = entry(enumtable, (yyvsp[0].sym))))
				(yyval.typ) = p->info.typ;
			  else
			  {	p = enter(enumtable, (yyvsp[0].sym));
			  	(yyval.typ) = p->info.typ = mkenum((Table*)0);
				p->info.typ->id = (yyvsp[0].sym);
			  }
			}
#line 3501 "soapcpp2_yacc.c"
    break;

  case 133: /* type: TYPE  */
#line 1141 "soapcpp2_yacc.y"
                        { if ((p = entry(typetable, (yyvsp[0].sym))))
				(yyval.typ) = p->info.typ;
			  else if ((p = entry(classtable, (yyvsp[0].sym))))
			  	(yyval.typ) = p->info.typ;
			  else if ((p = entry(enumtable, (yyvsp[0].sym))))
			  	(yyval.typ) = p->info.typ;
			  else if ((yyvsp[0].sym) == lookup("std::string") || (yyvsp[0].sym) == lookup("std::wstring"))
			  {	p = enter(classtable, (yyvsp[0].sym));
				(yyval.typ) = p->info.typ = mkclass((Table*)0, 0);
			  	p->info.typ->id = (yyvsp[0].sym);
			  	p->info.typ->transient = -2;
			  }
			  else
			  {	sprintf(errbuf, "unknown type '%s'", (yyvsp[0].sym)->name);
				semerror(errbuf);
				(yyval.typ) = mkint();
			  }
			}
#line 3524 "soapcpp2_yacc.c"
    break;

  case 134: /* type: TYPE '<' texp '>'  */
#line 1160 "soapcpp2_yacc.y"
                        { if ((p = entry(templatetable, (yyvsp[-3].sym))))
				(yyval.typ) = mktemplate((yyvsp[-1].rec).typ, (yyvsp[-3].sym));
			  else
			  {	sprintf(errbuf, "invalid template '%s'", (yyvsp[-3].sym)->name);
				semerror(errbuf);
				(yyval.typ) = mkint();
			  }
			}
#line 3537 "soapcpp2_yacc.c"
    break;

  case 135: /* type: CLASS error '}'  */
#line 1169 "soapcpp2_yacc.y"
                        { synerror("malformed class definition (use spacing around ':' to separate derived : base)");
			  yyerrok;
			  (yyval.typ) = mkint();
			}
#line 3546 "soapcpp2_yacc.c"
    break;

  case 136: /* type: STRUCT error '}'  */
#line 1174 "soapcpp2_yacc.y"
                        { synerror("malformed struct definition");
			  yyerrok;
			  (yyval.typ) = mkint();
			}
#line 3555 "soapcpp2_yacc.c"
    break;

  case 137: /* type: UNION error '}'  */
#line 1179 "soapcpp2_yacc.y"
                        { synerror("malformed union definition");
			  yyerrok;
			  (yyval.typ) = mkint();
			}
#line 3564 "soapcpp2_yacc.c"
    break;

  case 138: /* type: ENUM error '}'  */
#line 1184 "soapcpp2_yacc.y"
                        { synerror("malformed enum definition");
			  yyerrok;
			  (yyval.typ) = mkint();
			}
#line 3573 "soapcpp2_yacc.c"
    break;

  case 139: /* struct: STRUCT id  */
#line 1189 "soapcpp2_yacc.y"
                        { if ((p = entry(classtable, (yyvsp[0].sym))))
			  {	if (p->info.typ->ref)
			   	{	if (!is_mutable(p->info.typ))
					{	sprintf(errbuf, "struct '%s' already declared at line %d", (yyvsp[0].sym)->name, p->lineno);
						semerror(errbuf);
					}
				}
				else
					p = reenter(classtable, (yyvsp[0].sym));
			  }
			  else
			  {	p = enter(classtable, (yyvsp[0].sym));
				p->info.typ = mkstruct((Table*)0, 0);
			  }
			  (yyval.e) = p;
			}
#line 3594 "soapcpp2_yacc.c"
    break;

  case 140: /* class: CLASS id  */
#line 1206 "soapcpp2_yacc.y"
                        { if ((p = entry(classtable, (yyvsp[0].sym))))
			  {	if (p->info.typ->ref)
			   	{	if (!is_mutable(p->info.typ))
					{	sprintf(errbuf, "class '%s' already declared at line %d", (yyvsp[0].sym)->name, p->lineno);
						semerror(errbuf);
					}
				}
				else
					p = reenter(classtable, (yyvsp[0].sym));
			  }
			  else
			  {	p = enter(classtable, (yyvsp[0].sym));
				p->info.typ = mkclass((Table*)0, 0);
				p->info.typ->id = p->sym;
			  }
			  (yyvsp[0].sym)->token = TYPE;
			  (yyval.e) = p;
			}
#line 3617 "soapcpp2_yacc.c"
    break;

  case 141: /* enum: ENUM id  */
#line 1225 "soapcpp2_yacc.y"
                        { if ((p = entry(enumtable, (yyvsp[0].sym))))
			  {	if (p->info.typ->ref)
				{	sprintf(errbuf, "enum '%s' already declared at line %d", (yyvsp[0].sym)->name, p->lineno);
					semerror(errbuf);
				}
				/*
				else
					p = reenter(classtable, $2);
			  	*/
			  }
			  else
			  {	p = enter(enumtable, (yyvsp[0].sym));
				p->info.typ = mkenum(0);
			  }
			  (yyval.e) = p;
			}
#line 3638 "soapcpp2_yacc.c"
    break;

  case 142: /* tname: CLASS  */
#line 1242 "soapcpp2_yacc.y"
                        { }
#line 3644 "soapcpp2_yacc.c"
    break;

  case 143: /* tname: TYPENAME  */
#line 1243 "soapcpp2_yacc.y"
                        { }
#line 3650 "soapcpp2_yacc.c"
    break;

  case 144: /* base: PROTECTED base  */
#line 1245 "soapcpp2_yacc.y"
                        { (yyval.e) = (yyvsp[0].e); }
#line 3656 "soapcpp2_yacc.c"
    break;

  case 145: /* base: PRIVATE base  */
#line 1246 "soapcpp2_yacc.y"
                        { (yyval.e) = (yyvsp[0].e); }
#line 3662 "soapcpp2_yacc.c"
    break;

  case 146: /* base: PUBLIC base  */
#line 1247 "soapcpp2_yacc.y"
                        { (yyval.e) = (yyvsp[0].e); }
#line 3668 "soapcpp2_yacc.c"
    break;

  case 147: /* base: TYPE  */
#line 1248 "soapcpp2_yacc.y"
                        { (yyval.e) = entry(classtable, (yyvsp[0].sym));
			  if (!(yyval.e))
			  {	p = entry(typetable, (yyvsp[0].sym));
			  	if (p && (p->info.typ->type == Tclass || p->info.typ->type == Tstruct))
					(yyval.e) = p;
			  }
			}
#line 3680 "soapcpp2_yacc.c"
    break;

  case 148: /* base: STRUCT ID  */
#line 1255 "soapcpp2_yacc.y"
                        { (yyval.e) = entry(classtable, (yyvsp[0].sym)); }
#line 3686 "soapcpp2_yacc.c"
    break;

  case 149: /* s2: %empty  */
#line 1257 "soapcpp2_yacc.y"
                        { if (transient == -2)
			  	transient = 0;
			  permission = 0;
			  enterscope(mktable(NULL), 0);
			  sp->entry = NULL;
			}
#line 3697 "soapcpp2_yacc.c"
    break;

  case 150: /* s3: %empty  */
#line 1264 "soapcpp2_yacc.y"
                        { if (transient == -2)
			  	transient = 0;
			  permission = 0;
			  enterscope(mktable(NULL), 0);
			  sp->entry = NULL;
			  sp->grow = False;
			}
#line 3709 "soapcpp2_yacc.c"
    break;

  case 151: /* s4: %empty  */
#line 1272 "soapcpp2_yacc.y"
                        { enterscope(mktable(NULL), 0);
			  sp->entry = NULL;
			  sp->mask = True;
			  sp->val = 1;
			}
#line 3719 "soapcpp2_yacc.c"
    break;

  case 152: /* s5: %empty  */
#line 1278 "soapcpp2_yacc.y"
                        { }
#line 3725 "soapcpp2_yacc.c"
    break;

  case 153: /* s5: ','  */
#line 1279 "soapcpp2_yacc.y"
                        { }
#line 3731 "soapcpp2_yacc.c"
    break;

  case 154: /* s6: %empty  */
#line 1281 "soapcpp2_yacc.y"
                        { if (sp->table->level == INTERNAL)
			  	transient |= 1;
			  permission = 0;
			  enterscope(mktable(NULL), 0);
			  sp->entry = NULL;
			  sp->table->level = PARAM;
			}
#line 3743 "soapcpp2_yacc.c"
    break;

  case 155: /* store: AUTO  */
#line 1289 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sauto; }
#line 3749 "soapcpp2_yacc.c"
    break;

  case 156: /* store: REGISTER  */
#line 1290 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sregister; }
#line 3755 "soapcpp2_yacc.c"
    break;

  case 157: /* store: STATIC  */
#line 1291 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sstatic; }
#line 3761 "soapcpp2_yacc.c"
    break;

  case 158: /* store: EXPLICIT  */
#line 1292 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sexplicit; }
#line 3767 "soapcpp2_yacc.c"
    break;

  case 159: /* store: EXTERN  */
#line 1293 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sextern; transient = 1; }
#line 3773 "soapcpp2_yacc.c"
    break;

  case 160: /* store: TYPEDEF  */
#line 1294 "soapcpp2_yacc.y"
                        { (yyval.sto) = Stypedef; }
#line 3779 "soapcpp2_yacc.c"
    break;

  case 161: /* store: VIRTUAL  */
#line 1295 "soapcpp2_yacc.y"
                        { (yyval.sto) = Svirtual; }
#line 3785 "soapcpp2_yacc.c"
    break;

  case 162: /* store: CONST  */
#line 1296 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sconst; }
#line 3791 "soapcpp2_yacc.c"
    break;

  case 163: /* store: FRIEND  */
#line 1297 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sfriend; }
#line 3797 "soapcpp2_yacc.c"
    break;

  case 164: /* store: INLINE  */
#line 1298 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sinline; }
#line 3803 "soapcpp2_yacc.c"
    break;

  case 165: /* store: MUSTUNDERSTAND  */
#line 1299 "soapcpp2_yacc.y"
                        { (yyval.sto) = SmustUnderstand; }
#line 3809 "soapcpp2_yacc.c"
    break;

  case 166: /* store: RETURN  */
#line 1300 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sreturn; }
#line 3815 "soapcpp2_yacc.c"
    break;

  case 167: /* store: '@'  */
#line 1301 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sattribute;
			  if (eflag)
			   	semwarn("SOAP RPC encoding does not support XML attributes");
			}
#line 3824 "soapcpp2_yacc.c"
    break;

  case 168: /* store: '$'  */
#line 1305 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sspecial; }
#line 3830 "soapcpp2_yacc.c"
    break;

  case 169: /* store: VOLATILE  */
#line 1306 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sextern; transient = -2; }
#line 3836 "soapcpp2_yacc.c"
    break;

  case 170: /* constobj: %empty  */
#line 1308 "soapcpp2_yacc.y"
                        { (yyval.sto) = Snone; }
#line 3842 "soapcpp2_yacc.c"
    break;

  case 171: /* constobj: CONST  */
#line 1309 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sconstobj; }
#line 3848 "soapcpp2_yacc.c"
    break;

  case 172: /* abstract: %empty  */
#line 1311 "soapcpp2_yacc.y"
                        { (yyval.sto) = Snone; }
#line 3854 "soapcpp2_yacc.c"
    break;

  case 173: /* abstract: '=' LNG  */
#line 1312 "soapcpp2_yacc.y"
                        { (yyval.sto) = Sabstract; }
#line 3860 "soapcpp2_yacc.c"
    break;

  case 174: /* virtual: %empty  */
#line 1314 "soapcpp2_yacc.y"
                        { (yyval.sto) = Snone; }
#line 3866 "soapcpp2_yacc.c"
    break;

  case 175: /* virtual: VIRTUAL  */
#line 1315 "soapcpp2_yacc.y"
                        { (yyval.sto) = Svirtual; }
#line 3872 "soapcpp2_yacc.c"
    break;

  case 176: /* ptrs: %empty  */
#line 1317 "soapcpp2_yacc.y"
                        { (yyval.rec) = tmp = sp->node; }
#line 3878 "soapcpp2_yacc.c"
    break;

  case 177: /* ptrs: ptrs '*'  */
#line 1318 "soapcpp2_yacc.y"
                        { /* handle const pointers, such as const char* */
			  if (/*tmp.typ->type == Tchar &&*/ (tmp.sto & Sconst))
			  	tmp.sto = (Storage)(((int)tmp.sto & ~Sconst) | Sconstptr);
			  tmp.typ = mkpointer(tmp.typ);
			  tmp.typ->transient = transient;
			  (yyval.rec) = tmp;
			}
#line 3890 "soapcpp2_yacc.c"
    break;

  case 178: /* ptrs: ptrs '&'  */
#line 1325 "soapcpp2_yacc.y"
                        { tmp.typ = mkreference(tmp.typ);
			  tmp.typ->transient = transient;
			  (yyval.rec) = tmp;
			}
#line 3899 "soapcpp2_yacc.c"
    break;

  case 179: /* array: %empty  */
#line 1330 "soapcpp2_yacc.y"
                        { (yyval.rec) = tmp;	/* tmp is inherited */
			}
#line 3906 "soapcpp2_yacc.c"
    break;

  case 180: /* array: '[' cexp ']' array  */
#line 1333 "soapcpp2_yacc.y"
                        { if (!bflag && (yyvsp[0].rec).typ->type == Tchar)
			  {	sprintf(errbuf, "char["SOAP_LONG_FORMAT"] will be serialized as an array of "SOAP_LONG_FORMAT" bytes: use soapcpp2 option -b to enable char[] string serialization or use char* for strings", (yyvsp[-2].rec).val.i, (yyvsp[-2].rec).val.i);
			  	semwarn(errbuf);
			  }
			  if ((yyvsp[-2].rec).hasval && (yyvsp[-2].rec).typ->type == Tint && (yyvsp[-2].rec).val.i > 0 && (yyvsp[0].rec).typ->width > 0)
				(yyval.rec).typ = mkarray((yyvsp[0].rec).typ, (int) (yyvsp[-2].rec).val.i * (yyvsp[0].rec).typ->width);
			  else
			  {	(yyval.rec).typ = mkarray((yyvsp[0].rec).typ, 0);
			  	semerror("undetermined array size");
			  }
			  (yyval.rec).sto = (yyvsp[0].rec).sto;
			}
#line 3923 "soapcpp2_yacc.c"
    break;

  case 181: /* array: '[' ']' array  */
#line 1345 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkpointer((yyvsp[0].rec).typ); /* zero size array = pointer */
			  (yyval.rec).sto = (yyvsp[0].rec).sto;
			}
#line 3931 "soapcpp2_yacc.c"
    break;

  case 182: /* arrayck: array  */
#line 1349 "soapcpp2_yacc.y"
                        { if ((yyvsp[0].rec).typ->type == Tstruct || (yyvsp[0].rec).typ->type == Tclass)
				if (!(yyvsp[0].rec).typ->ref && !(yyvsp[0].rec).typ->transient && !((yyvsp[0].rec).sto & Stypedef))
			   	{	sprintf(errbuf, "struct/class '%s' has incomplete type", (yyvsp[0].rec).typ->id->name);
					semerror(errbuf);
				}
			  (yyval.rec) = (yyvsp[0].rec);
			}
#line 3943 "soapcpp2_yacc.c"
    break;

  case 183: /* init: %empty  */
#line 1357 "soapcpp2_yacc.y"
                        { (yyval.rec).hasval = False; }
#line 3949 "soapcpp2_yacc.c"
    break;

  case 184: /* init: '=' cexp  */
#line 1358 "soapcpp2_yacc.y"
                        { if ((yyvsp[0].rec).hasval)
			  {	(yyval.rec).typ = (yyvsp[0].rec).typ;
				(yyval.rec).hasval = True;
				(yyval.rec).val = (yyvsp[0].rec).val;
			  }
			  else
			  {	(yyval.rec).hasval = False;
				semerror("initialization expression not constant");
			  }
			}
#line 3964 "soapcpp2_yacc.c"
    break;

  case 185: /* tag: %empty  */
#line 1369 "soapcpp2_yacc.y"
                        { (yyval.sym) = NULL; }
#line 3970 "soapcpp2_yacc.c"
    break;

  case 186: /* tag: TAG  */
#line 1370 "soapcpp2_yacc.y"
                        { (yyval.sym) = (yyvsp[0].sym); }
#line 3976 "soapcpp2_yacc.c"
    break;

  case 187: /* occurs: patt  */
#line 1373 "soapcpp2_yacc.y"
                        { (yyval.rec).minOccurs = -1;
			  (yyval.rec).maxOccurs = 1;
			  (yyval.rec).minLength = MINLONG64;
			  (yyval.rec).maxLength = MAXLONG64;
			  (yyval.rec).pattern = (yyvsp[0].s);
			}
#line 3987 "soapcpp2_yacc.c"
    break;

  case 188: /* occurs: patt cint  */
#line 1380 "soapcpp2_yacc.y"
                        { (yyval.rec).minOccurs = (LONG64)(yyvsp[0].i);
			  (yyval.rec).maxOccurs = 1;
			  (yyval.rec).minLength = (LONG64)(yyvsp[0].i);
			  (yyval.rec).maxLength = MAXLONG64;
			  (yyval.rec).pattern = (yyvsp[-1].s);
			}
#line 3998 "soapcpp2_yacc.c"
    break;

  case 189: /* occurs: patt cint ':'  */
#line 1387 "soapcpp2_yacc.y"
                        { (yyval.rec).minOccurs = (LONG64)(yyvsp[-1].i);
			  (yyval.rec).maxOccurs = 1;
			  (yyval.rec).minLength = (LONG64)(yyvsp[-1].i);
			  (yyval.rec).maxLength = MAXLONG64;
			  (yyval.rec).pattern = (yyvsp[-2].s);
			}
#line 4009 "soapcpp2_yacc.c"
    break;

  case 190: /* occurs: patt cint ':' cint  */
#line 1394 "soapcpp2_yacc.y"
                        { (yyval.rec).minOccurs = (LONG64)(yyvsp[-2].i);
			  (yyval.rec).maxOccurs = (LONG64)(yyvsp[0].i);
			  (yyval.rec).minLength = (LONG64)(yyvsp[-2].i);
			  (yyval.rec).maxLength = (LONG64)(yyvsp[0].i);
			  (yyval.rec).pattern = (yyvsp[-3].s);
			}
#line 4020 "soapcpp2_yacc.c"
    break;

  case 191: /* occurs: patt ':' cint  */
#line 1401 "soapcpp2_yacc.y"
                        { (yyval.rec).minOccurs = -1;
			  (yyval.rec).maxOccurs = (LONG64)(yyvsp[0].i);
			  (yyval.rec).minLength = MINLONG64;
			  (yyval.rec).maxLength = (LONG64)(yyvsp[0].i);
			  (yyval.rec).pattern = (yyvsp[-2].s);
			}
#line 4031 "soapcpp2_yacc.c"
    break;

  case 192: /* patt: %empty  */
#line 1408 "soapcpp2_yacc.y"
                        { (yyval.s) = NULL; }
#line 4037 "soapcpp2_yacc.c"
    break;

  case 193: /* patt: STR  */
#line 1409 "soapcpp2_yacc.y"
                        { (yyval.s) = (yyvsp[0].s); }
#line 4043 "soapcpp2_yacc.c"
    break;

  case 194: /* cint: LNG  */
#line 1411 "soapcpp2_yacc.y"
                        { (yyval.i) = (yyvsp[0].i); }
#line 4049 "soapcpp2_yacc.c"
    break;

  case 195: /* cint: '+' LNG  */
#line 1412 "soapcpp2_yacc.y"
                        { (yyval.i) = (yyvsp[0].i); }
#line 4055 "soapcpp2_yacc.c"
    break;

  case 196: /* cint: '-' LNG  */
#line 1413 "soapcpp2_yacc.y"
                        { (yyval.i) = -(yyvsp[0].i); }
#line 4061 "soapcpp2_yacc.c"
    break;

  case 197: /* expr: expr ',' expr  */
#line 1422 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4067 "soapcpp2_yacc.c"
    break;

  case 198: /* expr: cexp  */
#line 1423 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4073 "soapcpp2_yacc.c"
    break;

  case 199: /* cexp: obex '?' qexp ':' cexp  */
#line 1427 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = (yyvsp[-2].rec).typ;
			  (yyval.rec).sto = Snone;
			  (yyval.rec).hasval = False;
			}
#line 4082 "soapcpp2_yacc.c"
    break;

  case 201: /* qexp: expr  */
#line 1434 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4088 "soapcpp2_yacc.c"
    break;

  case 202: /* oexp: obex OR aexp  */
#line 1437 "soapcpp2_yacc.y"
                        { (yyval.rec).hasval = False;
			  (yyval.rec).typ = mkint();
			}
#line 4096 "soapcpp2_yacc.c"
    break;

  case 203: /* oexp: aexp  */
#line 1440 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4102 "soapcpp2_yacc.c"
    break;

  case 204: /* obex: oexp  */
#line 1442 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4108 "soapcpp2_yacc.c"
    break;

  case 205: /* aexp: abex AN rexp  */
#line 1445 "soapcpp2_yacc.y"
                        { (yyval.rec).hasval = False;
			  (yyval.rec).typ = mkint();
			}
#line 4116 "soapcpp2_yacc.c"
    break;

  case 206: /* aexp: rexp  */
#line 1448 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4122 "soapcpp2_yacc.c"
    break;

  case 207: /* abex: aexp  */
#line 1450 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4128 "soapcpp2_yacc.c"
    break;

  case 208: /* rexp: rexp '|' rexp  */
#line 1453 "soapcpp2_yacc.y"
                        { (yyval.rec) = iop("|", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4134 "soapcpp2_yacc.c"
    break;

  case 209: /* rexp: rexp '^' rexp  */
#line 1454 "soapcpp2_yacc.y"
                        { (yyval.rec) = iop("^", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4140 "soapcpp2_yacc.c"
    break;

  case 210: /* rexp: rexp '&' rexp  */
#line 1455 "soapcpp2_yacc.y"
                        { (yyval.rec) = iop("&", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4146 "soapcpp2_yacc.c"
    break;

  case 211: /* rexp: rexp EQ rexp  */
#line 1456 "soapcpp2_yacc.y"
                        { (yyval.rec) = relop("==", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4152 "soapcpp2_yacc.c"
    break;

  case 212: /* rexp: rexp NE rexp  */
#line 1457 "soapcpp2_yacc.y"
                        { (yyval.rec) = relop("!=", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4158 "soapcpp2_yacc.c"
    break;

  case 213: /* rexp: rexp '<' rexp  */
#line 1458 "soapcpp2_yacc.y"
                        { (yyval.rec) = relop("<", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4164 "soapcpp2_yacc.c"
    break;

  case 214: /* rexp: rexp LE rexp  */
#line 1459 "soapcpp2_yacc.y"
                        { (yyval.rec) = relop("<=", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4170 "soapcpp2_yacc.c"
    break;

  case 215: /* rexp: rexp '>' rexp  */
#line 1460 "soapcpp2_yacc.y"
                        { (yyval.rec) = relop(">", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4176 "soapcpp2_yacc.c"
    break;

  case 216: /* rexp: rexp GE rexp  */
#line 1461 "soapcpp2_yacc.y"
                        { (yyval.rec) = relop(">=", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4182 "soapcpp2_yacc.c"
    break;

  case 217: /* rexp: rexp LS rexp  */
#line 1462 "soapcpp2_yacc.y"
                        { (yyval.rec) = iop("<<", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4188 "soapcpp2_yacc.c"
    break;

  case 218: /* rexp: rexp RS rexp  */
#line 1463 "soapcpp2_yacc.y"
                        { (yyval.rec) = iop(">>", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4194 "soapcpp2_yacc.c"
    break;

  case 219: /* rexp: rexp '+' rexp  */
#line 1464 "soapcpp2_yacc.y"
                        { (yyval.rec) = op("+", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4200 "soapcpp2_yacc.c"
    break;

  case 220: /* rexp: rexp '-' rexp  */
#line 1465 "soapcpp2_yacc.y"
                        { (yyval.rec) = op("-", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4206 "soapcpp2_yacc.c"
    break;

  case 221: /* rexp: rexp '*' rexp  */
#line 1466 "soapcpp2_yacc.y"
                        { (yyval.rec) = op("*", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4212 "soapcpp2_yacc.c"
    break;

  case 222: /* rexp: rexp '/' rexp  */
#line 1467 "soapcpp2_yacc.y"
                        { (yyval.rec) = op("/", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4218 "soapcpp2_yacc.c"
    break;

  case 223: /* rexp: rexp '%' rexp  */
#line 1468 "soapcpp2_yacc.y"
                        { (yyval.rec) = iop("%", (yyvsp[-2].rec), (yyvsp[0].rec)); }
#line 4224 "soapcpp2_yacc.c"
    break;

  case 224: /* rexp: lexp  */
#line 1469 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4230 "soapcpp2_yacc.c"
    break;

  case 225: /* lexp: '!' lexp  */
#line 1472 "soapcpp2_yacc.y"
                        { if ((yyvsp[0].rec).hasval)
				(yyval.rec).val.i = !(yyvsp[0].rec).val.i;
			  (yyval.rec).typ = (yyvsp[0].rec).typ;
			  (yyval.rec).hasval = (yyvsp[0].rec).hasval;
			}
#line 4240 "soapcpp2_yacc.c"
    break;

  case 226: /* lexp: '~' lexp  */
#line 1477 "soapcpp2_yacc.y"
                        { if ((yyvsp[0].rec).hasval)
				(yyval.rec).val.i = ~(yyvsp[0].rec).val.i;
			  (yyval.rec).typ = (yyvsp[0].rec).typ;
			  (yyval.rec).hasval = (yyvsp[0].rec).hasval;
			}
#line 4250 "soapcpp2_yacc.c"
    break;

  case 227: /* lexp: '-' lexp  */
#line 1482 "soapcpp2_yacc.y"
                        { if ((yyvsp[0].rec).hasval) {
				if (integer((yyvsp[0].rec).typ))
					(yyval.rec).val.i = -(yyvsp[0].rec).val.i;
				else if (real((yyvsp[0].rec).typ))
					(yyval.rec).val.r = -(yyvsp[0].rec).val.r;
				else	typerror("string?");
			  }
			  (yyval.rec).typ = (yyvsp[0].rec).typ;
			  (yyval.rec).hasval = (yyvsp[0].rec).hasval;
			}
#line 4265 "soapcpp2_yacc.c"
    break;

  case 228: /* lexp: '+' lexp  */
#line 1492 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4271 "soapcpp2_yacc.c"
    break;

  case 229: /* lexp: '*' lexp  */
#line 1493 "soapcpp2_yacc.y"
                        { if ((yyvsp[0].rec).typ->type == Tpointer) {
			  	(yyval.rec).typ = (Tnode*)(yyvsp[0].rec).typ->ref;
			  } else
			  	typerror("dereference of non-pointer type");
			  (yyval.rec).sto = Snone;
			  (yyval.rec).hasval = False;
			}
#line 4283 "soapcpp2_yacc.c"
    break;

  case 230: /* lexp: '&' lexp  */
#line 1500 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkpointer((yyvsp[0].rec).typ);
			  (yyval.rec).sto = Snone;
			  (yyval.rec).hasval = False;
			}
#line 4292 "soapcpp2_yacc.c"
    break;

  case 231: /* lexp: SIZEOF '(' texp ')'  */
#line 1505 "soapcpp2_yacc.y"
                        { (yyval.rec).hasval = True;
			  (yyval.rec).typ = mkint();
			  (yyval.rec).val.i = (yyvsp[-1].rec).typ->width;
			}
#line 4301 "soapcpp2_yacc.c"
    break;

  case 232: /* lexp: pexp  */
#line 1509 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[0].rec); }
#line 4307 "soapcpp2_yacc.c"
    break;

  case 233: /* pexp: '(' expr ')'  */
#line 1512 "soapcpp2_yacc.y"
                        { (yyval.rec) = (yyvsp[-1].rec); }
#line 4313 "soapcpp2_yacc.c"
    break;

  case 234: /* pexp: ID  */
#line 1513 "soapcpp2_yacc.y"
                        { if ((p = enumentry((yyvsp[0].sym))) == (Entry*) 0)
				p = undefined((yyvsp[0].sym));
			  else
			  	(yyval.rec).hasval = True;
			  (yyval.rec).typ = p->info.typ;
			  (yyval.rec).val = p->info.val;
			}
#line 4325 "soapcpp2_yacc.c"
    break;

  case 235: /* pexp: LNG  */
#line 1520 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkint();
			  (yyval.rec).hasval = True;
			  (yyval.rec).val.i = (yyvsp[0].i);
			}
#line 4334 "soapcpp2_yacc.c"
    break;

  case 236: /* pexp: null  */
#line 1524 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkint();
			  (yyval.rec).hasval = True;
			  (yyval.rec).val.i = 0;
			}
#line 4343 "soapcpp2_yacc.c"
    break;

  case 237: /* pexp: DBL  */
#line 1528 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkfloat();
			  (yyval.rec).hasval = True;
			  (yyval.rec).val.r = (yyvsp[0].r);
			}
#line 4352 "soapcpp2_yacc.c"
    break;

  case 238: /* pexp: CHR  */
#line 1532 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkchar();
			  (yyval.rec).hasval = True;
			  (yyval.rec).val.i = (yyvsp[0].c);
			}
#line 4361 "soapcpp2_yacc.c"
    break;

  case 239: /* pexp: STR  */
#line 1536 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkstring();
			  (yyval.rec).hasval = True;
			  (yyval.rec).val.s = (yyvsp[0].s);
			}
#line 4370 "soapcpp2_yacc.c"
    break;

  case 240: /* pexp: CFALSE  */
#line 1540 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkbool();
			  (yyval.rec).hasval = True;
			  (yyval.rec).val.i = 0;
			}
#line 4379 "soapcpp2_yacc.c"
    break;

  case 241: /* pexp: CTRUE  */
#line 1544 "soapcpp2_yacc.y"
                        { (yyval.rec).typ = mkbool();
			  (yyval.rec).hasval = True;
			  (yyval.rec).val.i = 1;
			}
#line 4388 "soapcpp2_yacc.c"
    break;


#line 4392 "soapcpp2_yacc.c"

      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
     that yytoken be updated with the new translation.  We take the
     approach of translating immediately before every use of yytoken.
     One alternative is translating here after every semantic action,
     but that translation would be missed if the semantic action invokes
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
     incorrect destructor might then be invoked immediately.  In the
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
     to an incorrect destructor call or verbose syntax error message
     before the lookahead is translated.  */
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;

  *++yyvsp = yyval;

  /* 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.  */
  {
    const int yylhs = yyr1[yyn] - YYNTOKENS;
    const int yyi = yypgoto[yylhs] + *yyssp;
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
               ? yytable[yyi]
               : yydefgoto[yylhs]);
  }

  goto yynewstate;


/*--------------------------------------.
| yyerrlab -- here on detecting error.  |
`--------------------------------------*/
yyerrlab:
  /* Make sure we have latest lookahead translation.  See comments at
     user semantic actions for why this is necessary.  */
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
      yyerror (YY_("syntax error"));
    }

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

      if (yychar <= YYEOF)
        {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
        }
      else
        {
          yydestruct ("Error: discarding",
                      yytoken, &yylval);
          yychar = YYEMPTY;
        }
    }

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


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:
  /* Pacify compilers when the user code never invokes YYERROR and the
     label yyerrorlab therefore never appears in user code.  */
  if (0)
    YYERROR;
  ++yynerrs;

  /* Do not reclaim the symbols of the rule whose action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */

  /* Pop stack until we find a state that shifts the error token.  */
  for (;;)
    {
      yyn = yypact[yystate];
      if (!yypact_value_is_default (yyn))
        {
          yyn += YYSYMBOL_YYerror;
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
            {
              yyn = yytable[yyn];
              if (0 < yyn)
                break;
            }
        }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
        YYABORT;


      yydestruct ("Error: popping",
                  YY_ACCESSING_SYMBOL (yystate), yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END


  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturnlab;


/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturnlab;


/*-----------------------------------------------------------.
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
`-----------------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  goto yyreturnlab;


/*----------------------------------------------------------.
| yyreturnlab -- parsing is finished, clean up and return.  |
`----------------------------------------------------------*/
yyreturnlab:
  if (yychar != YYEMPTY)
    {
      /* Make sure we have latest lookahead translation.  See comments at
         user semantic actions for why this is necessary.  */
      yytoken = YYTRANSLATE (yychar);
      yydestruct ("Cleanup: discarding lookahead",
                  yytoken, &yylval);
    }
  /* Do not reclaim the symbols of the rule whose action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif

  return yyresult;
}

#line 1550 "soapcpp2_yacc.y"


/*
 * ???
 */
int
yywrap(void)
{	return 1;
}

/******************************************************************************\

	Support routines

\******************************************************************************/

static Node
op(const char *op, Node p, Node q)
{	Node	r;
	Tnode	*typ;
	r.typ = p.typ;
	r.sto = Snone;
	if (p.hasval && q.hasval) {
		if (integer(p.typ) && integer(q.typ))
			switch (op[0]) {
			case '|':	r.val.i = p.val.i |  q.val.i; break;
			case '^':	r.val.i = p.val.i ^  q.val.i; break;
			case '&':	r.val.i = p.val.i &  q.val.i; break;
			case '<':	r.val.i = p.val.i << q.val.i; break;
			case '>':	r.val.i = p.val.i >> q.val.i; break;
			case '+':	r.val.i = p.val.i +  q.val.i; break;
			case '-':	r.val.i = p.val.i -  q.val.i; break;
			case '*':	r.val.i = p.val.i *  q.val.i; break;
			case '/':	r.val.i = p.val.i /  q.val.i; break;
			case '%':	r.val.i = p.val.i %  q.val.i; break;
			default:	typerror(op);
			}
		else if (real(p.typ) && real(q.typ))
			switch (op[0]) {
			case '+':	r.val.r = p.val.r + q.val.r; break;
			case '-':	r.val.r = p.val.r - q.val.r; break;
			case '*':	r.val.r = p.val.r * q.val.r; break;
			case '/':	r.val.r = p.val.r / q.val.r; break;
			default:	typerror(op);
			}
		else	semerror("illegal constant operation");
		r.hasval = True;
	} else {
		typ = mgtype(p.typ, q.typ);
		r.hasval = False;
	}
	return r;
}

static Node
iop(const char *iop, Node p, Node q)
{	if (integer(p.typ) && integer(q.typ))
		return op(iop, p, q);
	typerror("integer operands only");
	return p;
}

static Node
relop(const char *op, Node p, Node q)
{	Node	r;
	Tnode	*typ;
	r.typ = mkint();
	r.sto = Snone;
	r.hasval = False;
	if (p.typ->type != Tpointer || p.typ != q.typ)
		typ = mgtype(p.typ, q.typ);
	return r;
}

/******************************************************************************\

	Scope management

\******************************************************************************/

/*
mkscope - initialize scope stack with a new table and offset
*/
static void
mkscope(Table *table, int offset)
{	sp = stack-1;
	enterscope(table, offset);
}

/*
enterscope - enter a new scope by pushing a new table and offset on the stack
*/
static void
enterscope(Table *table, int offset)
{	if (++sp == stack+MAXNEST)
		execerror("maximum scope depth exceeded");
	sp->table = table;
	sp->val = 0;
	sp->offset = offset;
	sp->grow = True;	/* by default, offset grows */
	sp->mask = False;
}

/*
exitscope - exit a scope by popping the table and offset from the stack
*/
static void
exitscope(void)
{	check(sp-- != stack, "exitscope() has no matching enterscope()");
}

/******************************************************************************\

	Undefined symbol

\******************************************************************************/

static Entry*
undefined(Symbol *sym)
{	Entry	*p;
	sprintf(errbuf, "undefined identifier '%s'", sym->name);
	semwarn(errbuf);
	p = enter(sp->table, sym);
	p->level = GLOBAL;
	p->info.typ = mkint();
	p->info.sto = Sextern;
	p->info.hasval = False;
	return p;
}

/*
mgtype - return most general type among two numerical types
*/
Tnode*
mgtype(Tnode *typ1, Tnode *typ2)
{	if (numeric(typ1) && numeric(typ2)) {
		if (typ1->type < typ2->type)
			return typ2;
	} else	typerror("non-numeric type");
	return typ1;
}

/******************************************************************************\

	Type checks

\******************************************************************************/

static int
integer(Tnode *typ)
{	switch (typ->type) {
	case Tchar:
	case Tshort:
	case Tint:
	case Tlong:	return True;
	default:	break;
	}
	return False;
}

static int
real(Tnode *typ)
{	switch (typ->type) {
	case Tfloat:
	case Tdouble:
	case Tldouble:	return True;
	default:	break;
	}
	return False;
}

static int
numeric(Tnode *typ)
{	return integer(typ) || real(typ);
}

static void
add_fault(Table *gt)
{ Table *t;
  Entry *p1, *p2, *p3, *p4;
  Symbol *s1, *s2, *s3, *s4;
  imported = NULL;
  s1 = lookup("SOAP_ENV__Code");
  p1 = entry(classtable, s1);
  if (!p1 || !p1->info.typ->ref)
  { t = mktable((Table*)0);
    if (!p1)
    { p1 = enter(classtable, s1);
      p1->info.typ = mkstruct(t, 3*4);
      p1->info.typ->id = s1;
    }
    else
      p1->info.typ->ref = t;
    p2 = enter(t, lookup("SOAP_ENV__Value"));
    p2->info.typ = qname;
    p2->info.minOccurs = 0;
    p2 = enter(t, lookup("SOAP_ENV__Subcode"));
    p2->info.typ = mkpointer(p1->info.typ);
    p2->info.minOccurs = 0;
  }
  s2 = lookup("SOAP_ENV__Detail");
  p2 = entry(classtable, s2);
  if (!p2 || !p2->info.typ->ref)
  { t = mktable((Table*)0);
    if (!p2)
    { p2 = enter(classtable, s2);
      p2->info.typ = mkstruct(t, 3*4);
      p2->info.typ->id = s2;
    }
    else
      p2->info.typ->ref = t;
    p3 = enter(t, lookup("__any"));
    p3->info.typ = xml;
    p3->info.minOccurs = 0;
    p3 = enter(t, lookup("__type"));
    p3->info.typ = mkint();
    p3->info.minOccurs = 0;
    p3 = enter(t, lookup("fault"));
    p3->info.typ = mkpointer(mkvoid());
    p3->info.minOccurs = 0;
    custom_fault = 0;
  }
  s4 = lookup("SOAP_ENV__Reason");
  p4 = entry(classtable, s4);
  if (!p4 || !p4->info.typ->ref)
  { t = mktable((Table*)0);
    if (!p4)
    { p4 = enter(classtable, s4);
      p4->info.typ = mkstruct(t, 4);
      p4->info.typ->id = s4;
    }
    else
      p4->info.typ->ref = t;
    p3 = enter(t, lookup("SOAP_ENV__Text"));
    p3->info.typ = mkstring();
    p3->info.minOccurs = 0;
  }
  s3 = lookup("SOAP_ENV__Fault");
  p3 = entry(classtable, s3);
  if (!p3 || !p3->info.typ->ref)
  { t = mktable(NULL);
    if (!p3)
    { p3 = enter(classtable, s3);
      p3->info.typ = mkstruct(t, 9*4);
      p3->info.typ->id = s3;
    }
    else
      p3->info.typ->ref = t;
    p3 = enter(t, lookup("faultcode"));
    p3->info.typ = qname;
    p3->info.minOccurs = 0;
    p3 = enter(t, lookup("faultstring"));
    p3->info.typ = mkstring();
    p3->info.minOccurs = 0;
    p3 = enter(t, lookup("faultactor"));
    p3->info.typ = mkstring();
    p3->info.minOccurs = 0;
    p3 = enter(t, lookup("detail"));
    p3->info.typ = mkpointer(p2->info.typ);
    p3->info.minOccurs = 0;
    p3 = enter(t, s1);
    p3->info.typ = mkpointer(p1->info.typ);
    p3->info.minOccurs = 0;
    p3 = enter(t, s4);
    p3->info.typ = mkpointer(p4->info.typ);
    p3->info.minOccurs = 0;
    p3 = enter(t, lookup("SOAP_ENV__Node"));
    p3->info.typ = mkstring();
    p3->info.minOccurs = 0;
    p3 = enter(t, lookup("SOAP_ENV__Role"));
    p3->info.typ = mkstring();
    p3->info.minOccurs = 0;
    p3 = enter(t, lookup("SOAP_ENV__Detail"));
    p3->info.typ = mkpointer(p2->info.typ);
    p3->info.minOccurs = 0;
  }
}

static void
add_soap(void)
{ Symbol *s = lookup("soap");
  p = enter(classtable, s);
  p->info.typ = mkstruct(NULL, 0);
  p->info.typ->transient = -2;
  p->info.typ->id = s;
}

static void
add_XML(void)
{ Symbol *s = lookup("_XML");
  s->token = TYPE;
  p = enter(typetable, s);
  xml = p->info.typ = mksymtype(mkstring(), s);
  p->info.sto = Stypedef;
}

static void
add_qname(void)
{ Symbol *s = lookup("_QName");
  s->token = TYPE;
  p = enter(typetable, s);
  qname = p->info.typ = mksymtype(mkstring(), s);
  p->info.sto = Stypedef;
}

static void
add_header(Table *gt)
{ Table *t;
  Entry *p;
  Symbol *s = lookup("SOAP_ENV__Header");
  imported = NULL;
  p = entry(classtable, s);
  if (!p || !p->info.typ->ref)
  { t = mktable((Table*)0);
    if (!p)
      p = enter(classtable, s);
    p->info.typ = mkstruct(t, 0);
    p->info.typ->id = s;
    custom_header = 0;
  }
}

static void
add_response(Entry *fun, Entry *ret)
{ Table *t;
  Entry *p, *q;
  Symbol *s;
  size_t n = strlen(fun->sym->name);
  char *r = (char*)emalloc(n+9);
  strcpy(r, fun->sym->name);
  strcat(r, "Response");
  if (!(s = lookup(r)))
    s = install(r, ID);
  free(r);
  t = mktable((Table*)0);
  q = enter(t, ret->sym);
  q->info = ret->info;
  if (q->info.typ->type == Treference)
    q->info.typ = (Tnode*)q->info.typ->ref;
  p = enter(classtable, s);
  p->info.typ = mkstruct(t, 4);
  p->info.typ->id = s;
  fun->info.typ->response = p;
}

static void
add_result(Tnode *typ)
{ Entry *p;
  if (!typ->ref || !((Tnode*)typ->ref)->ref)
  { semwarn("response struct/class must be declared before used in function prototype");
    return;
  }
  for (p = ((Table*)((Tnode*)typ->ref)->ref)->list; p; p = p->next)
    if (p->info.sto & Sreturn)
      return;
  for (p = ((Table*)((Tnode*)typ->ref)->ref)->list; p; p = p->next)
  { if (p->info.typ->type != Tfun && !(p->info.sto & Sattribute) && !is_transient(p->info.typ) && !(p->info.sto & (Sprivate|Sprotected)))
      p->info.sto = (Storage)((int)p->info.sto | (int)Sreturn);
      return;
  }
}
