/* Automatically generated at Trolltech by mkdists, Qt 2.2.0 */
#ifndef lint
static char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
#endif
#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define yyclearin (yychar=(-1))
#define yyerrok (yyerrflag=0)
#define YYRECOVERING (yyerrflag!=0)
#define YYPREFIX "yy"
#line 55 "moc.y"
void yyerror( const char *msg );

#include "qlist.h"
#include "qasciidict.h"
#include "qdict.h"
#include "qstrlist.h"
#include "qdatetime.h"
#include "qfile.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>



static QCString rmWS( const char * );

enum Access { Private, Protected, Public };


struct Argument					/* single arg meta data*/
{
    Argument( char *left, char *right )
	{ leftType  = rmWS( left );
	  rightType = rmWS( right );
	  if ( leftType == "void" && rightType.isEmpty() )
	      leftType = "";
	}
    QCString leftType;
    QCString rightType;
};

class ArgList : public QList<Argument> {	/* member function arg list*/
public:
    ArgList() { setAutoDelete( TRUE ); }
   ~ArgList() { clear(); }
};


struct Function					/* member function meta data*/
{						/*   used for signals and slots*/
    Access access;
    QCString    qualifier;			/* const or volatile*/
    QCString    name;
    QCString    type;
    int	       lineNo;
    ArgList   *args;
    Function() { args=0; }
   ~Function() { delete args; }
    const char* accessAsString() {
	switch ( access ) {
	case Private: return "Private";
	case Protected: return "Protected";
	default: return "Public";
	}
    }
};

class FuncList : public QList<Function> {	/* list of member functions*/
public:
    FuncList( bool autoDelete = FALSE ) { setAutoDelete( autoDelete ); }

    FuncList find( const char* name )
    {
	FuncList result;
	for ( QListIterator<Function> it( *this); it.current(); ++it ) {
	    if ( it.current()->name == name )
		result.append( it.current() );
	}
	return result;
    }
};

class Enum : public QStrList
{
public:
    QCString name;
    bool set;
};

class EnumList : public QList<Enum> {		/* list of property enums*/
public:
    EnumList() { setAutoDelete(TRUE); }
};


struct Property
{
    Property( int l, const char* t, const char* n, const char* s, const char* g, const char* r,
	      const QCString& st, int d, bool ov )
	: lineNo(l), type(t), name(n), set(s), get(g), reset(r), setfunc(0), getfunc(0), resetfunc(0),
	  sspec(Unspecified), gspec(Unspecified), stored( st ),
	  designable( d ), override( ov ), oredEnum( -1 )
    {}

    int lineNo;
    QCString type;
    QCString name;
    QCString set;
    QCString get;
    QCString reset;
    QCString stored;
    int designable; /* Allowed values are 1 (True), 0 (False), and -1 (Unset)*/
    bool override;
    int oredEnum; /* If the enums item may be ored. That means the data type is int.*/
		  /* Allowed values are 1 (True), 0 (False), and -1 (Unset)*/

    Function* setfunc;
    Function* getfunc;
    Function* resetfunc;

    enum Specification  { Unspecified, Class, Reference, Pointer, ConstCharStar };
    Specification sspec;
    Specification gspec;

    bool stdSet () {
	QCString s = "set";
	s += toupper( name[0] );
	s +=name.mid(1);
	return s ==set;
    }

    static const char* specToString( Specification s )
    {
	switch ( s ) {
	case Class:
	    return "Class";
	case Reference:
	    return "Reference";
	case Pointer:
	    return "Pointer";
	case ConstCharStar:
	    return "ConstCharStar";
	default:
	    return "Unspecified";
	}
    }
};

class PropList : public QList<Property> {	/* list of properties*/
public:
    PropList() { setAutoDelete( TRUE ); }
};


struct ClassInfo
{
    ClassInfo( const char* n, const char* v )
	: name(n), value(v)
    {}
    QCString name;
    QCString value;
};

class ClassInfoList : public QList<ClassInfo> {	/* list of class infos*/
public:
    ClassInfoList() { setAutoDelete( TRUE ); }
};


/*
  Attention!
  This table is copied from qvariant.cpp. If you change
  one, change both.
*/
static const int ntypes = 26;
static const char* const type_map[ntypes] =
{
    0,
    "QMap<QString,QVariant>",
    "QValueList<QVariant>",
    "QString",
    "QStringList",
    "QFont",
    "QPixmap",
    "QBrush",
    "QRect",
    "QSize",
    "QColor",
    "QPalette",
    "QColorGroup",
    "QIconSet",
    "QPoint",
    "QImage",
    "int",
    "uint",
    "bool",
    "double",
    "QCString",
    "QPointArray",
    "QRegion",
    "QBitmap",
    "QCursor",
    "QSizePolicy"
};

int qvariant_nameToType( const char* name )
{
    for ( int i = 0; i < ntypes; i++ ) {
	if ( !qstrcmp( type_map[i], name ) )
	    return i;
    }
    return 0;
}


ArgList *addArg( Argument * );			/* add arg to tmpArgList*/

enum Member { SignalMember,
	      SlotMember,
	      PropertyCandidateMember
	    };

void	 addMember( Member );			/* add tmpFunc to current class*/
void     addEnum();				/* add tmpEnum to current class*/

char	*strnew( const char * );		/* returns a new string (copy)*/
char	*stradd( const char *, const char * );	/* add two strings*/
char	*stradd( const char *, const char *,	/* add three strings*/
			       const char * );
char	*straddSpc( const char *, const char * );
char	*straddSpc( const char *, const char *,
			       const char * );
char	*straddSpc( const char *, const char *,
		    const char *, const char * );

extern int yydebug;
bool	   lexDebug	   = FALSE;
int	   lineNo;				/* current line number*/
bool	   errorControl	   = FALSE;		/* controlled errors*/
bool	   displayWarnings = TRUE;
bool	   skipClass;				/* don't generate for class*/
bool	   skipFunc;				/* don't generate for func*/
bool	   templateClass;			/* class is a template*/
bool	   templateClassOld;			/* previous class is a template*/

ArgList	  *tmpArgList;				/* current argument list*/
Function  *tmpFunc;				/* current member function*/
Enum      *tmpEnum;				/* current enum*/
Access tmpAccess;			/* current access permission*/
Access subClassPerm;			/* current access permission*/

bool	   Q_OBJECTdetected;			/* TRUE if current class*/
						/* contains the Q_OBJECT macro*/
bool	   Q_PROPERTYdetected;			/* TRUE if current class*/
						/* contains at least one Q_PROPERTY,*/
						/* Q_OVERRIDE, Q_SETS or Q_ENUMS macro*/
bool	   tmpPropOverride;			/* current property override setting*/

/* some temporary values*/
QCString   tmpExpression;			/* Used to store the characters the lexer*/
						/* is currently skipping (see addExpressionChar and friends)*/
int	   tmpYYStart;				/* Used to store the lexers current mode*/
int	   tmpYYStart2;				/* Used to store the lexers current mode*/
						/* (if tmpYYStart is already used)*/

const int  formatRevision = 9;			/* moc output format revision*/

#line 315 "moc.y"
typedef union {
    char	char_val;
    int		int_val;
    double	double_val;
    char       *string;
    Access	access;
    Function   *function;
    ArgList    *arg_list;
    Argument   *arg;
} YYSTYPE;
#line 281 "y.tab.c"
#define CHAR_VAL 257
#define INT_VAL 258
#define DOUBLE_VAL 259
#define STRING 260
#define IDENTIFIER 261
#define FRIEND 262
#define TYPEDEF 263
#define AUTO 264
#define REGISTER 265
#define STATIC 266
#define EXTERN 267
#define INLINE 268
#define VIRTUAL 269
#define CONST 270
#define VOLATILE 271
#define CHAR 272
#define SHORT 273
#define INT 274
#define LONG 275
#define SIGNED 276
#define UNSIGNED 277
#define FLOAT 278
#define DOUBLE 279
#define VOID 280
#define ENUM 281
#define CLASS 282
#define STRUCT 283
#define UNION 284
#define ASM 285
#define PRIVATE 286
#define PROTECTED 287
#define PUBLIC 288
#define OPERATOR 289
#define DBL_COLON 290
#define TRIPLE_DOT 291
#define TEMPLATE 292
#define NAMESPACE 293
#define USING 294
#define MUTABLE 295
#define SIGNALS 296
#define SLOTS 297
#define Q_OBJECT 298
#define Q_PROPERTY 299
#define Q_OVERRIDE 300
#define Q_CLASSINFO 301
#define Q_ENUMS 302
#define Q_SETS 303
#define READ 304
#define WRITE 305
#define STORED 306
#define DESIGNABLE 307
#define RESET 308
#define YYERRCODE 256
short yylhs[] = {                                        -1,
    0,    0,   36,   36,   36,   36,   36,   38,   38,   44,
   46,   42,   47,   48,   43,   45,   39,   41,   40,   40,
   50,   37,    1,    1,    2,   51,   52,   53,   28,   28,
   28,   28,   28,   27,   29,   29,   30,   30,   54,   54,
   54,   54,   55,   55,   31,   31,   11,   11,   11,   12,
   12,   13,   13,   13,   13,   13,   13,   13,   13,   13,
    3,   56,   56,   14,   14,   15,   15,   16,   16,   17,
   17,   17,   18,   18,   20,   20,   57,   57,   19,   19,
   23,   58,   23,   23,   60,   23,   21,   21,   22,   61,
   22,   62,   22,   22,   22,   32,   32,   63,   32,   32,
   59,   64,   10,   10,   68,   10,   69,   10,   70,   67,
   71,   67,   35,   35,   34,   34,   33,   33,   24,   24,
   25,   25,   26,   26,   66,   66,   66,   73,   72,   76,
   49,   49,   49,   49,   78,   78,   78,   78,   78,   77,
   77,   74,   79,   65,   65,   80,   81,   81,   83,   82,
    4,    4,   75,   75,   84,   84,   86,   86,   88,   85,
   89,   85,   85,   91,   94,   85,   95,   96,   85,   97,
   98,   85,   99,  101,   85,  102,  104,   85,   87,   87,
  106,   87,   87,   93,   93,  107,  107,  108,   90,   90,
  110,  110,  111,  105,  105,  112,  112,  113,  114,  114,
    5,    6,    6,    7,    7,    8,    8,    8,    8,    8,
    8,    8,    8,    8,    8,    9,    9,    9,  115,  115,
  115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
  115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
  115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
  115,  115,  115,  115,  115,  115,  115,  115,  115,  116,
  116,  117,  117,  117,  117,  117,  117,  117,  117,  117,
  117,  117,  117,  109,  109,  109,  109,  109,  109,  109,
  109,  122,  123,  109,  119,  119,  124,  125,  124,  126,
  124,  118,  127,  118,  120,  129,  129,  128,  128,  121,
  121,  130,  130,  130,  131,  132,  131,  134,   92,  133,
  133,  133,  133,  133,  135,  133,  100,  100,  103,  103,
};
short yylen[] = {                                         2,
    0,    2,    1,    1,    1,    1,    1,    1,    1,    0,
    0,    7,    0,    0,    6,    1,    5,    2,    2,    2,
    0,    3,    1,    1,    4,    0,    0,    0,    1,    1,
    1,    1,    1,    3,    0,    1,    1,    2,    1,    1,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    4,    0,    1,    2,    2,    1,    2,    3,    1,    2,
    2,    2,    2,    3,    0,    1,    0,    1,    3,    1,
    2,    0,    5,    4,    0,    7,    0,    1,    2,    0,
    4,    0,    5,    1,    3,    1,    2,    0,    5,    3,
    1,    6,    1,    2,    0,    4,    0,    5,    0,    4,
    0,    5,    0,    1,    1,    2,    2,    2,    0,    1,
    1,    2,    1,    1,    1,    1,    3,    0,    3,    0,
    5,    1,    4,    2,    1,    1,    1,    1,    1,    2,
    3,    2,    3,    0,    1,    2,    1,    3,    0,    5,
    0,    1,    0,    1,    2,    1,    1,    1,    0,    3,
    0,    4,    1,    0,    0,    7,    0,    0,    7,    0,
    0,    9,    0,    0,    7,    0,    0,    7,    2,    3,
    0,    3,    1,    0,    1,    2,    1,    1,    0,    1,
    2,    1,    1,    0,    1,    2,    1,    1,    0,    2,
    2,    3,    1,    4,    4,    1,    3,    2,    3,    2,
    1,    3,    2,    3,    2,    1,    1,    1,    3,    3,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    1,    1,    1,    2,    2,    2,    2,    2,    2,    2,
    2,    2,    2,    2,    2,    2,    2,    2,    3,    3,
    2,    2,    2,    2,    1,    3,    2,    2,    2,    0,
    1,    2,    1,    3,    5,    2,    3,    4,    3,    2,
    6,    4,    5,    3,    4,    6,    4,    4,    5,    3,
    3,    0,    0,    7,    1,    3,    1,    0,    4,    0,
    3,    0,    0,    3,    2,    0,    1,    5,    4,    0,
    1,    0,    1,    3,    1,    0,    4,    0,    4,    0,
    3,    3,    3,    3,    0,    4,    0,    2,    0,    2,
};
short yydefred[] = {                                      1,
    0,    0,    0,    2,    3,    4,    5,    6,    7,    8,
    9,    0,    0,    0,   19,   20,   18,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   14,   26,  135,   39,
   40,   41,   42,   43,   44,   45,   46,   52,   53,   54,
   55,   56,   57,   58,   59,   60,  136,  137,  138,  139,
  134,    0,   69,   24,    0,   22,   64,   65,  130,    0,
    0,  142,  152,    0,    0,    0,    0,   11,    1,    0,
   26,  141,    0,    0,    0,    0,    0,  216,  217,  218,
    0,  211,  203,    0,  206,    0,   17,    1,    0,    0,
   61,    0,   68,  161,  158,  163,  164,  167,  170,  173,
  176,  157,    0,    0,  156,  159,  133,    0,  213,    0,
  208,    0,    0,  215,  210,    0,   15,   25,    0,    0,
    0,    0,    0,    0,  131,  155,    0,    0,    0,  212,
  207,  202,  214,  209,   12,    0,    0,    0,    0,    0,
    0,  183,    0,    0,  181,  160,  204,  205,    0,   32,
   33,    0,    0,    0,    0,    0,    0,   63,  263,    0,
    0,   51,    0,   48,   47,   37,    0,   30,   29,   31,
    0,  162,  193,    0,  192,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,  179,    0,    0,  105,
  109,    0,    0,    0,  295,   72,    0,    0,    0,  255,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  270,    0,    0,    0,    0,    0,
    0,    0,  262,    0,  115,    0,   50,    0,    0,    0,
    0,    0,   38,  282,  199,  191,    0,    0,  293,  199,
    0,  301,    0,  308,  165,  168,    0,  318,  174,  320,
  177,  180,  198,    0,  197,  182,    0,  187,  188,   27,
   27,  107,  111,    0,    0,    0,  303,  244,  245,    0,
  246,    0,  259,  258,  236,  240,  251,  234,  253,  235,
    0,  254,  237,  238,  239,  241,  252,  242,  243,    0,
    0,  280,    0,  199,  269,  123,  124,  117,    0,  121,
  118,    0,    0,    0,  267,  116,  143,   71,    0,   70,
    0,    0,  264,    0,    0,    0,   80,    0,    0,   27,
    0,  199,    0,  199,    0,    0,    0,    0,    0,    0,
  196,  186,  106,    0,   27,   27,    0,  306,    0,    0,
  249,  250,  256,  219,  220,  199,    0,  122,    0,  268,
  272,    0,  283,  200,    0,    0,   78,   73,   90,    0,
    0,    0,   94,    0,  294,    0,    0,    0,  290,    0,
   96,    0,  285,    0,    0,    0,    0,    0,    0,  309,
  166,  169,  171,  175,  178,  110,  108,    0,    0,   28,
  304,  299,    0,  273,    0,  265,    0,    0,   74,   79,
   27,    0,  101,   82,    0,   92,   89,   34,  288,    0,
   27,   98,   97,  199,    0,    0,    0,    0,  315,    0,
    0,  112,  298,  307,  271,  199,    0,    0,  145,    0,
   95,   27,    0,   27,   27,  100,  291,   27,    0,  286,
  311,  312,  314,    0,  313,  172,    0,    0,  146,    0,
  128,    0,  125,  102,  126,   91,   83,   85,    0,  289,
    0,  316,  149,    0,    0,    0,   27,   93,   99,   27,
  148,  129,  127,   86,    0,  150,
};
short yydgoto[] = {                                      89,
   53,   54,  158,   62,   63,   81,   82,   83,   84,  159,
  160,  161,  162,  163,  164,   67,  165,  314,  315,  316,
  361,  362,  317,  298,  299,  300,  318,  166,  213,  167,
  168,  370,  225,  302,  303,    4,    5,    6,    7,    8,
    9,   10,   11,   26,   90,   88,   14,   69,   21,   12,
   70,  333,  424,  169,  170,   22,  358,  432,  371,  467,
  401,  434,  438,  240,  428,  454,  192,  260,  335,  261,
  336,  455,  465,   23,  103,   74,   24,   51,  171,  429,
  449,  450,  470,  104,  105,  106,  146,  127,  119,  172,
  120,  180,  256,  326,  121,  327,  122,  421,  123,  184,
  329,  124,  186,  330,  252,  189,  257,  258,  259,  174,
  175,  254,  255,  312,  215,  176,  177,  241,  372,  178,
  243,  311,  397,  373,  435,  411,  320,  195,  340,  266,
  267,  390,  380,  325,  444,
};
short yysindex[] = {                                      0,
   71, -237,  102,    0,    0,    0,    0,    0,    0,    0,
    0, -203,  121,  -29,    0,    0,    0,  136,  943,  -35,
  162,  183,  127,  368,  -56,  153,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,  -47,    0,    0,   30,    0,    0,    0,    0,   54,
  574,    0,    0,  292,   65,  299,   30,    0,    0,  294,
    0,    0,   65,  386,  320,  172,  579,    0,    0,    0,
  322,    0,    0, -213,    0,   30,    0,    0,   71,  275,
    0,  341,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,  281,  386,    0,    0,    0,  679,    0,   61,
    0,  574,   61,    0,    0,  286,    0,    0,  365,  387,
  393,  442,  453,  477,    0,    0,   22,  389,  395,    0,
    0,    0,    0,    0,    0,  615,  268,  268,  283,  290,
  300,    0,  505,  519,    0,    0,    0,    0,  125,    0,
    0,    0, -106,  327,  430,  329,  106,    0,    0,  233,
  990,    0,  331,    0,    0,    0,  658,    0,    0,    0,
  -40,    0,    0,  615,    0,  455,  480,  334,  337,  564,
  566,  568,  290,  567,  300,  572,    0,  615,  615,    0,
    0,   39,  515,  369,    0,    0,  581,  465,  479,    0,
  550,  607,  586,  249,  266,  507,  614,  617,  618,  -28,
  619,  620,  869, 1203,    0,  603,  -56,  631,   52,  430,
  278,  278,    0,  109,    0,  -31,    0,  292,  -55,  471,
 1203,  475,    0,    0,    0,    0,  508, 1203,    0,    0,
  -21,    0,  716,    0,    0,    0,  552,    0,    0,    0,
    0,    0,    0,  615,    0,    0,  615,    0,    0,    0,
    0,    0,    0,  369,  718,  774,    0,    0,    0,  761,
    0,  775,    0,    0,    0,    0,    0,    0,    0,    0,
  799,    0,    0,    0,    0,    0,    0,    0,    0,  279,
  279,    0,  783,    0,    0,    0,    0,    0,  278,    0,
    0,  279,  -71,  430,    0,    0,    0,    0,  279,    0,
  719,  786,    0,  805,  811,  565,    0,  182,  895,    0,
  786,    0,   33,    0,  606,  615,  615,  816,  615,  615,
    0,    0,    0,  765,    0,    0,  774,    0,  369,  734,
    0,    0,    0,    0,    0,    0,  786,    0,  430,    0,
    0,  -60,    0,    0,  278,  400,    0,    0,    0,  182,
  -46,  390,    0, 1203,    0,  786,  810,  -30,    0,  396,
    0,   90,    0,  786,  602,  609,  610,  611,  612,    0,
    0,    0,    0,    0,    0,    0,    0,  807,  773,    0,
    0,    0,  786,    0,  430,    0,  843,  845,    0,    0,
    0,  166,    0,    0,  182,    0,    0,    0,    0,  494,
    0,    0,    0,    0,   33,  606,  606,  606,    0,  606,
  615,    0,    0,    0,    0,    0,  -56,   74,    0,  813,
    0,    0,  880,    0,    0,    0,    0,    0,  786,    0,
    0,    0,    0,  606,    0,    0,  786,  903,    0,  900,
    0,  688,    0,    0,    0,    0,    0,    0,  854,    0,
  872,    0,    0,  -56,  837,  907,    0,    0,    0,    0,
    0,    0,    0,    0,  950,    0,
};
short yyrindex[] = {                                      0,
  236,  874,    0,    0,    0,    0,    0,    0,    0,    0,
    0,  301,  878,    0,    0,    0,    0,    0,  321,    0,
    0,    0,    0,   38,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,   -5,    0,    0,  129,    0,    0,    0,    0,    0,
    0,    0,    0,   -1,    0,    0,   34,    0,    0,    0,
    0,    0,    0,  909,    0,   72,    0,    0,    0,    0,
   77,    0,    0,    0,    0,   68,    0,    0, -111,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  915,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,  358,    0,    0,    0, 1003,
 1042,    0,    0,    0,    0,    0,    0,    0,  120,    0,
    0, 1145,    0,    0,  916,    0,    0,    0,    0,    0,
   79,    0,    0,    0,    0,    0,  301,    0,    0,    0,
    0,    0,    0,  551,    0,    0,  158, 1018,    0,    0,
    0,    0, 1003,    0, 1042,    0,    0, 1036, 1058,    0,
    0,  506,  244,  -26,    0,    0,  513,  557,  592,    0,
    0,    0,  857,  905, 1142, 1185, 1190, 1192, 1195, 1197,
 1202, 1390,    0,  -36,    0,    0,    0,    0, 1392,  916,
   23,   23,    0,   17,    0,    0,    0,  151,   80,    0,
  108,    0,    0,    0,    0,    0,    0,  170,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0, 1080,    0,    0, 1102,    0,    0,    0,
    0,    0,    0,  -26,  -23,  962,    0,    0,    0, 1398,
    0, 1400,    0,    0,    0,    0,    0,    0,    0,    0,
 1403,    0,    0,    0,    0,    0,    0,    0,    0, 1420,
 1420,    0,    0,    0,    0,    0,    0,    0,  -12,    0,
    0,  140,    0,  916,    0,    0,    0,    0,   17,    0,
    0,  441,    0,    0,  -19, 1079,    0,  -10,  301,    0,
  484,    0,    0,    0, 1085, 1058, 1058,    0, 1058, 1058,
    0,    0,    0,    0,    0,    0,  962,    0, 1025,    0,
    0,    0,    0,    0,    0,    0,  527,    0,  916,    0,
    0,    0,    0,    0,   83,  345,    0,    0,    0,    0,
  -32,  133,    0,   63,    0,  706,  269,    0,    0,  412,
    0,    0,    0,  749,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,  792,    0,  916,    0,    0,  104,    0,    0,
    0,    0,    0,    0,    1,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0, 1085, 1085, 1085,    0, 1085,
 1058,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,   25,    0,    0,    0,    0,    0,  835,    0,
    0,    0,    0, 1085,    0,    0, 1014,    0,    0,  232,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,
};
short yygindex[] = {                                   1151,
  352,    0, 1140,  924,    0,    0,  460, 1043,   -6,  297,
 -151,    0,   67,  -11,  -25,   50,    0,    0,    0,    0,
  752,  794,  802, -172,    0,  860,    0,    9, -211,  238,
 1141,  795,  229, 1004,  284,    0,    0,    0,    0,    0,
    0,    0,    0,    0, 1077,    0,    0,    0,    0,    0,
 1095,  144,    0, 1159, 1161,    0,    0,    0,  820,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  733,    0,    0,    0, 1094,    0,    0,    0,    0,    0,
    0, 1061,  159,    0,    0,    0,    0,    0,    0, 1019,
    0,    0, 1039,    0,    0,    0,    0,  946,  342,    0,
 1052,    0,  977,  113, -176,    0,    0,    0,    0,    0,
    0,    0,    0,  818,    0,    0,    0,    0,  901,  976,
  906,    0,  142,    0,    0,
};
#define YYTABLESIZE 1479
short yytable[] = {                                      66,
   20,   36,   61,   36,   36,   36,  222,   36,   81,  368,
  221,   81,   71,   16,  404,  231,  194,  302,  235,  309,
  305,   76,  323,   13,   36,  120,  319,  120,  120,  120,
   87,  120,  286,   87,   23,   85,   23,  322,   23,   23,
   23,   87,   23,  295,   87,  120,  120,   76,  120,  301,
   87,  111,   23,   23,   36,  113,   23,   23,  115,   23,
  119,   87,  119,  119,  119,   84,  119,  102,   84,   55,
  110,   66,  368,   66,   66,   66,   65,   66,  120,  145,
  119,  119,  234,  119,  131,   47,   85,  134,   18,   23,
  369,   66,   66,   27,   66,  287,  132,  102,  302,  262,
   35,  305,   35,   35,   35,   67,   35,   67,   67,   67,
  120,   67,  190,  119,   86,   23,   49,   23,   49,   49,
   49,   23,   49,   35,   66,   67,   67,  351,   67,  263,
   23,  218,  453,  415,  452,  201,   49,   49,  151,   49,
  119,  119,  191,  119,  319,   35,  222,  266,  414,   35,
  221,  266,  408,   35,  193,  232,   66,   23,   67,  103,
  151,   23,  144,  103,  144,  266,  266,  364,  140,   49,
   21,   21,  394,   88,  129,  233,   88,  103,  103,  114,
   21,   25,  398,  114,   71,  190,  140,  140,   70,  219,
   67,  293,   70,   88,   23,   28,  451,  114,  114,  201,
  219,  292,  151,  222,   64,  119,  431,  221,   23,   23,
   75,  108,  229,   64,  403,  191,  292,  349,  425,  222,
   56,  360,  233,  221,   36,   52,  144,  227,  395,  219,
  403,   71,  233,   65,   73,   36,   36,   36,   36,   36,
   36,   36,   36,   36,   36,   36,   36,   36,  120,   59,
   87,  140,   36,   36,   36,   36,  406,  304,   81,   23,
   23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
  222,   76,  359,   23,  221,   68,  120,  113,  120,  291,
   87,   71,  142,  119,   23,   71,  277,   23,   23,   23,
  147,   87,  147,  367,   66,   66,   66,   66,   66,   66,
   66,   66,   66,   66,   66,  113,  101,  232,  279,  276,
  101,  119,  101,  119,   75,   84,  222,  143,  144,   73,
  221,   76,   66,   35,   66,   64,  278,  101,   67,   67,
   67,   67,   67,   67,   67,   67,   67,   67,   67,   49,
   49,   49,   49,   49,   49,   49,   49,   49,   49,   49,
   65,   71,  321,   35,  147,   91,   67,   87,   67,  101,
  107,   23,   15,    2,    3,  112,   64,   49,   35,   49,
  150,  151,   30,   31,   32,   33,   34,   35,   36,   37,
   23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
   23,   16,  214,   88,   17,   65,   35,  224,  217,  117,
  114,  448,  118,   72,  334,  125,  347,   60,   23,   23,
  135,   70,   70,   70,   70,   70,   70,   70,   70,   70,
   70,   70,  136,   88,   93,   61,  137,  222,  114,  147,
   35,  221,  138,  222,  366,  148,  374,  221,  448,   70,
   23,   35,   35,   35,   35,   35,   35,   35,   35,   35,
   35,   35,   35,   35,  306,  287,  223,  214,  393,   35,
   75,   35,  212,  365,   57,   58,  208,  204,  214,  202,
  287,  203,  205,  200,  206,  214,  207,  173,  387,  388,
  406,  139,  189,  260,  381,  382,  412,  384,  385,  198,
  197,  199,  140,  219,  150,  151,   30,   31,   32,   33,
   34,   35,   36,   37,   71,   71,   71,   71,   71,   71,
   71,   71,   71,   71,   71,  173,  141,   21,   21,  238,
  201,  220,  305,  209,  270,  269,  439,   21,  179,  253,
  306,  222,   71,  313,  436,  221,  109,  239,  447,  271,
  272,  214,  182,  114,  430,  104,  363,  296,  297,  104,
  183,  282,  231,  210,  437,  211,  231,  441,  442,  443,
  185,  445,  187,  104,  104,  281,  281,  280,  281,  130,
  231,  231,  133,  344,  345,  457,  188,  459,  460,  446,
  237,  461,   62,   62,  412,  462,  214,  196,  363,  216,
  407,  228,  352,  214,  242,  253,  232,  244,  413,  350,
  232,  214,   63,   63,  245,   35,  246,  249,  274,  274,
  474,  247,  251,  475,  232,  232,   35,   35,   35,   35,
   35,   35,   35,   35,   35,   35,   35,   35,   35,  265,
  407,  233,  214,  363,   35,  233,   35,  264,  413,   62,
   62,  268,  273,  189,  189,  189,  275,  274,  396,  233,
  233,  278,  278,  189,  189,  189,  189,  189,  189,  189,
  189,  150,  151,   30,   31,   32,   33,   34,   35,   36,
   37,   78,   79,   80,  283,  190,  260,  284,  285,  288,
  289,   94,   95,   96,   97,   98,   99,  100,  101,  294,
  399,  150,  151,   30,   31,   32,   33,   34,   35,   36,
   37,  281,  281,  281,  281,  281,  281,  281,  281,  281,
  281,  281,  281,  281,  281,  281,  281,  281,  281,  281,
  281,  281,  281,  281,  281,  292,  281,  281,  281,  281,
  281,  308,  281,  281,  281,  310,  281,  281,  281,  281,
  281,  281,  281,  281,  274,  274,  274,  274,  274,  274,
  274,  274,  274,  274,  274,  274,  274,  274,  274,  274,
  274,  274,  274,  274,  274,  274,  274,  274,  219,  274,
  274,  274,  274,  274,  324,  274,  274,  274,  338,  274,
  274,  274,  274,  274,  274,  274,  274,  278,  278,  278,
  278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
  278,  278,  278,  278,  278,  278,  278,  278,  278,  278,
  278,  328,  278,  278,  278,  278,  278,  339,  278,  278,
  278,  341,  278,  278,  278,  278,  278,  278,  278,  278,
  275,  275,   62,   62,   76,  342,  190,  190,  190,   76,
  343,  346,   77,  353,  354,  355,  190,  190,  190,  190,
  190,  190,  190,  190,  356,  357,  383,  386,  392,   78,
   79,   80,  416,   65,   78,   79,   80,  409,   65,  417,
  418,  419,  420,  277,  277,  149,  150,  151,   30,   31,
   32,   33,   34,  152,   36,   37,   38,   39,   40,   41,
   42,   43,   44,   45,   46,  153,  223,  423,  154,  422,
  223,  426,  427,  155,   65,  456,   18,  156,  157,  375,
  376,  377,  378,  379,  223,  223,  279,  279,   64,  150,
  151,   30,   31,   32,   33,   34,   35,   36,   37,   38,
   39,   40,   41,   42,   43,   44,   45,   46,  230,  128,
  458,  154,  463,  464,  227,  466,  468,   65,  227,   18,
   38,   39,   40,   41,   42,   43,   44,   45,   46,  276,
  276,  472,  227,  227,  469,  473,  275,  275,  275,  275,
  275,  275,  275,  275,  275,  275,  275,  275,  275,  275,
  275,  275,  275,  275,  275,  275,  275,  275,  275,  275,
  476,  275,  275,  275,  275,  275,   13,  275,  275,  275,
   10,  275,  275,  275,  275,  275,  275,  275,  275,  277,
  277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
  277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
  277,  277,  277,  153,  277,  277,  277,  277,  277,  154,
  277,  277,  277,  317,  277,  277,  277,  277,  277,  277,
  277,  277,  279,  279,  279,  279,  279,  279,  279,  279,
  279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
  279,  279,  279,  279,  279,  279,  300,  279,  279,  279,
  279,  279,  319,  279,  279,  279,  296,  279,  279,  279,
  279,  279,  279,  279,  279,  276,  276,  276,  276,  276,
  276,  276,  276,  276,  276,  276,  276,  276,  276,  276,
  276,  276,  276,  276,  276,  276,  276,  276,  276,   77,
  276,  276,  276,  276,  276,  310,  276,  276,  276,  290,
  276,  276,  276,  276,  276,  276,  276,  276,  284,  284,
   38,   39,   40,   41,   42,   43,   44,   45,   46,  297,
    1,   19,  307,  402,  132,   64,  433,  400,  348,   48,
  194,  260,  410,  226,  116,   92,   38,   39,   40,   41,
   42,   43,   44,   45,   46,  230,   35,   49,  154,   50,
  405,  221,  184,  260,   65,  221,   18,   35,   35,   35,
   35,   35,   35,   35,   35,   35,  471,  126,  181,  221,
  221,  248,  332,   29,  195,  260,   30,   31,   32,   33,
   34,   35,   36,   37,   38,   39,   40,   41,   42,   43,
   44,   45,   46,  250,  222,  236,  185,  260,  222,  224,
  331,  225,  440,  224,  226,  225,  228,  389,  226,  337,
  228,  229,  222,  222,  391,  229,    0,  224,  224,  225,
  225,    0,  226,  226,  228,  228,    0,    0,    0,  229,
  229,   38,   39,   40,   41,   42,   43,   44,   45,   46,
  261,    0,    0,    0,  284,  284,  284,  284,  284,  284,
  284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
  284,  284,  284,  284,  284,  284,  284,  284,    0,  284,
  284,  284,  284,  284,    0,  284,  284,  284,    0,  284,
  284,  284,  284,  284,  284,  284,  284,   62,   62,    0,
    0,  194,  194,  194,    0,    0,    0,    0,    0,    0,
    0,  194,  194,  194,  194,  194,  194,  194,  194,   62,
   62,    0,    0,  184,  184,  184,    0,    0,    0,    0,
    0,    0,    0,  184,  184,  184,  184,  184,  184,  184,
  184,   62,   62,    0,    0,  195,  195,  195,    0,    0,
    0,    0,    0,    0,    0,  195,  195,  195,  195,  195,
  195,  195,  195,   62,   62,    0,    0,  185,  185,  185,
    0,    0,    0,    0,    0,    0,    0,  185,  185,  185,
  185,  185,  185,  185,  185,   44,   44,   44,   44,   44,
   44,   44,   44,   44,   44,   44,   44,   44,   44,   44,
   44,   44,   44,   44,   44,   44,   44,   44,   44,  230,
    0,  103,    0,  230,   44,  103,   44,  247,    0,  248,
    0,  247,  257,  248,    0,    0,  257,  230,  230,  103,
  103,    0,    0,    0,    0,  247,  247,  248,  248,  113,
  257,  257,    0,  113,  150,  151,   30,   31,   32,   33,
   34,   35,   36,   37,    0,    0,    0,  113,  113,
};
short yycheck[] = {                                      25,
   12,   38,   58,   40,   41,   42,   38,   44,   41,   40,
   42,   44,   60,  125,   61,  167,  123,   44,   59,  231,
   44,   41,   44,  261,   61,   38,  238,   40,   41,   42,
   41,   44,   61,   44,   40,   61,   38,   59,   40,   41,
   42,   41,   44,  220,   44,   58,   59,  261,   61,  222,
   61,   77,   58,   59,   91,  269,   58,   59,   84,   61,
   38,   61,   40,   41,   42,   41,   44,   74,   44,   20,
   77,   38,   40,   40,   41,   42,  290,   44,   91,   58,
   58,   59,  123,   61,  110,   19,  112,  113,  292,   91,
   58,   58,   59,  123,   61,  124,   59,  104,  125,   61,
   38,  125,   40,   41,   42,   38,   44,   40,   41,   42,
  123,   44,   61,   91,   65,   44,   38,  123,   40,   41,
   42,  123,   44,   61,   91,   58,   59,  304,   61,   91,
   59,  157,   59,   44,   61,   59,   58,   59,   59,   61,
   58,   59,   91,   61,  356,   38,   38,   40,   59,   42,
   42,   44,  364,   91,  261,  167,  123,   38,   91,   40,
  123,   42,   59,   44,   61,   58,   59,  319,   40,   91,
  282,  283,  349,   41,  108,  167,   44,   58,   59,   40,
  292,   61,  355,   44,   60,   61,   58,   59,   38,  261,
  123,  217,   42,   61,  123,   60,  123,   58,   59,  123,
  261,   44,  123,   38,  261,  123,   41,   42,   58,   59,
   41,   40,  163,  261,  261,   91,   59,  289,  395,   38,
   59,   40,  214,   42,  261,  261,  123,  161,  289,  261,
  261,   60,  224,  290,  290,  272,  273,  274,  275,  276,
  277,  278,  279,  280,  281,  282,  283,  284,  261,  123,
  261,  123,  289,  290,  291,  292,   91,  289,  291,  261,
  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,
   38,  291,   91,  123,   42,  123,  289,  261,  291,  213,
  291,   38,  261,  261,  290,   42,   38,  289,  290,  291,
   59,  291,   61,  261,  261,  262,  263,  264,  265,  266,
  267,  268,  269,  270,  271,  289,   38,  319,   43,   61,
   42,  289,   44,  291,  261,  291,   38,  296,  297,  290,
   42,  261,  289,  261,  291,  261,   61,   59,  261,  262,
  263,  264,  265,  266,  267,  268,  269,  270,  271,  261,
  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,
  290,   60,  240,  291,  123,   62,  289,   59,  291,   91,
   41,  290,  261,  293,  294,   44,  261,  289,  261,  291,
  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,
  261,  262,  263,  264,  265,  266,  267,  268,  269,  270,
  271,  290,  155,  261,  293,  290,  289,  160,  293,  125,
  261,  427,   62,   52,  261,  125,  294,   40,  289,  290,
  125,  261,  262,  263,  264,  265,  266,  267,  268,  269,
  270,  271,   58,  291,   73,   58,   40,   38,  289,   41,
  261,   42,   40,   38,  322,   41,  324,   42,  464,  289,
  290,  272,  273,  274,  275,  276,  277,  278,  279,  280,
  281,  282,  283,  284,  226,   44,  160,  220,  346,  290,
  291,  292,   33,  320,  282,  283,   37,   38,  231,   40,
   59,   42,   43,   44,   45,  238,   47,  136,  335,  336,
   91,   40,  125,  126,  326,  327,   91,  329,  330,   60,
   61,   62,   40,  261,  262,  263,  264,  265,  266,  267,
  268,  269,  270,  271,  261,  262,  263,  264,  265,  266,
  267,  268,  269,  270,  271,  174,   40,  282,  283,   40,
   91,  289,  226,   94,   60,   61,  414,  292,  261,  188,
  302,   38,  289,  237,   41,   42,   77,   58,  426,   61,
   62,  304,  260,   84,  401,   40,  318,  270,  271,   44,
  261,   45,   40,  124,  411,  126,   44,  416,  417,  418,
  261,  420,   58,   58,   59,  125,  126,   61,   62,  110,
   58,   59,  113,  290,  291,  432,   58,  434,  435,  421,
  126,  438,  282,  283,   91,  444,  349,  261,  360,  261,
  362,  261,  309,  356,  261,  254,   40,  261,  370,  303,
   44,  364,  282,  283,   41,  261,   41,   41,  125,  126,
  467,   44,   41,  470,   58,   59,  272,  273,  274,  275,
  276,  277,  278,  279,  280,  281,  282,  283,  284,  261,
  402,   40,  395,  405,  290,   44,  292,  123,  410,  282,
  283,   61,   93,  286,  287,  288,   61,   41,  352,   58,
   59,  125,  126,  296,  297,  298,  299,  300,  301,  302,
  303,  262,  263,  264,  265,  266,  267,  268,  269,  270,
  271,  286,  287,  288,   61,  125,  126,   61,   61,   61,
   61,  296,  297,  298,  299,  300,  301,  302,  303,   59,
  291,  262,  263,  264,  265,  266,  267,  268,  269,  270,
  271,  261,  262,  263,  264,  265,  266,  267,  268,  269,
  270,  271,  272,  273,  274,  275,  276,  277,  278,  279,
  280,  281,  282,  283,  284,  123,  286,  287,  288,  289,
  290,  261,  292,  293,  294,  261,  296,  297,  298,  299,
  300,  301,  302,  303,  261,  262,  263,  264,  265,  266,
  267,  268,  269,  270,  271,  272,  273,  274,  275,  276,
  277,  278,  279,  280,  281,  282,  283,  284,  261,  286,
  287,  288,  289,  290,   59,  292,  293,  294,   61,  296,
  297,  298,  299,  300,  301,  302,  303,  261,  262,  263,
  264,  265,  266,  267,  268,  269,  270,  271,  272,  273,
  274,  275,  276,  277,  278,  279,  280,  281,  282,  283,
  284,  260,  286,  287,  288,  289,  290,   44,  292,  293,
  294,   61,  296,  297,  298,  299,  300,  301,  302,  303,
  125,  126,  282,  283,  261,   61,  286,  287,  288,  261,
   42,   59,  269,  125,   59,   41,  296,  297,  298,  299,
  300,  301,  302,  303,   44,  291,   41,   93,  125,  286,
  287,  288,  261,  290,  286,  287,  288,   58,  290,  261,
  261,  261,  261,  125,  126,  261,  262,  263,  264,  265,
  266,  267,  268,  269,  270,  271,  272,  273,  274,  275,
  276,  277,  278,  279,  280,  281,   40,  125,  284,   93,
   44,   59,   58,  289,  290,   93,  292,  293,  294,  304,
  305,  306,  307,  308,   58,   59,  125,  126,  261,  262,
  263,  264,  265,  266,  267,  268,  269,  270,  271,  272,
  273,  274,  275,  276,  277,  278,  279,  280,  281,  261,
   61,  284,   40,   44,   40,  258,   93,  290,   44,  292,
  272,  273,  274,  275,  276,  277,  278,  279,  280,  125,
  126,  125,   58,   59,   93,   59,  261,  262,  263,  264,
  265,  266,  267,  268,  269,  270,  271,  272,  273,  274,
  275,  276,  277,  278,  279,  280,  281,  282,  283,  284,
   41,  286,  287,  288,  289,  290,  123,  292,  293,  294,
  123,  296,  297,  298,  299,  300,  301,  302,  303,  261,
  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,
  272,  273,  274,  275,  276,  277,  278,  279,  280,  281,
  282,  283,  284,  125,  286,  287,  288,  289,  290,  125,
  292,  293,  294,   41,  296,  297,  298,  299,  300,  301,
  302,  303,  261,  262,  263,  264,  265,  266,  267,  268,
  269,  270,  271,  272,  273,  274,  275,  276,  277,  278,
  279,  280,  281,  282,  283,  284,   59,  286,  287,  288,
  289,  290,   41,  292,  293,  294,  125,  296,  297,  298,
  299,  300,  301,  302,  303,  261,  262,  263,  264,  265,
  266,  267,  268,  269,  270,  271,  272,  273,  274,  275,
  276,  277,  278,  279,  280,  281,  282,  283,  284,   41,
  286,  287,  288,  289,  290,   41,  292,  293,  294,  261,
  296,  297,  298,  299,  300,  301,  302,  303,  125,  126,
  272,  273,  274,  275,  276,  277,  278,  279,  280,  125,
    0,   12,  229,  360,  112,  261,  405,  356,  299,   19,
  125,  126,  368,  160,   88,   71,  272,  273,  274,  275,
  276,  277,  278,  279,  280,  281,  261,   19,  284,   19,
  361,   40,  125,  126,  290,   44,  292,  272,  273,  274,
  275,  276,  277,  278,  279,  280,  464,  104,  138,   58,
   59,  183,  257,  261,  125,  126,  264,  265,  266,  267,
  268,  269,  270,  271,  272,  273,  274,  275,  276,  277,
  278,  279,  280,  185,   40,  174,  125,  126,   44,   40,
  254,   40,  415,   44,   40,   44,   40,  337,   44,  264,
   44,   40,   58,   59,  339,   44,   -1,   58,   59,   58,
   59,   -1,   58,   59,   58,   59,   -1,   -1,   -1,   58,
   59,  272,  273,  274,  275,  276,  277,  278,  279,  280,
  126,   -1,   -1,   -1,  261,  262,  263,  264,  265,  266,
  267,  268,  269,  270,  271,  272,  273,  274,  275,  276,
  277,  278,  279,  280,  281,  282,  283,  284,   -1,  286,
  287,  288,  289,  290,   -1,  292,  293,  294,   -1,  296,
  297,  298,  299,  300,  301,  302,  303,  282,  283,   -1,
   -1,  286,  287,  288,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,  296,  297,  298,  299,  300,  301,  302,  303,  282,
  283,   -1,   -1,  286,  287,  288,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,  296,  297,  298,  299,  300,  301,  302,
  303,  282,  283,   -1,   -1,  286,  287,  288,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,  296,  297,  298,  299,  300,
  301,  302,  303,  282,  283,   -1,   -1,  286,  287,  288,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,  296,  297,  298,
  299,  300,  301,  302,  303,  261,  262,  263,  264,  265,
  266,  267,  268,  269,  270,  271,  272,  273,  274,  275,
  276,  277,  278,  279,  280,  281,  282,  283,  284,   40,
   -1,   40,   -1,   44,  290,   44,  292,   40,   -1,   40,
   -1,   44,   40,   44,   -1,   -1,   44,   58,   59,   58,
   59,   -1,   -1,   -1,   -1,   58,   59,   58,   59,   40,
   58,   59,   -1,   44,  262,  263,  264,  265,  266,  267,
  268,  269,  270,  271,   -1,   -1,   -1,   58,   59,
};
#define YYFINAL 1
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 308
#if YYDEBUG
char *yyname[] = {
"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
"'!'",0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,
0,0,0,0,0,"':'","';'","'<'","'='","'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,"'['",0,"']'","'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,"'{'","'|'","'}'","'~'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"CHAR_VAL","INT_VAL",
"DOUBLE_VAL","STRING","IDENTIFIER","FRIEND","TYPEDEF","AUTO","REGISTER",
"STATIC","EXTERN","INLINE","VIRTUAL","CONST","VOLATILE","CHAR","SHORT","INT",
"LONG","SIGNED","UNSIGNED","FLOAT","DOUBLE","VOID","ENUM","CLASS","STRUCT",
"UNION","ASM","PRIVATE","PROTECTED","PUBLIC","OPERATOR","DBL_COLON",
"TRIPLE_DOT","TEMPLATE","NAMESPACE","USING","MUTABLE","SIGNALS","SLOTS",
"Q_OBJECT","Q_PROPERTY","Q_OVERRIDE","Q_CLASSINFO","Q_ENUMS","Q_SETS","READ",
"WRITE","STORED","DESIGNABLE","RESET",
};
char *yyrule[] = {
"$accept : declaration_seq",
"declaration_seq :",
"declaration_seq : declaration_seq declaration",
"declaration : class_def",
"declaration : namespace_def",
"declaration : namespace_alias_def",
"declaration : using_declaration",
"declaration : using_directive",
"namespace_def : named_namespace_def",
"namespace_def : unnamed_namespace_def",
"$$1 :",
"$$2 :",
"named_namespace_def : NAMESPACE IDENTIFIER $$1 '{' $$2 namespace_body '}'",
"$$3 :",
"$$4 :",
"unnamed_namespace_def : NAMESPACE $$3 '{' $$4 namespace_body '}'",
"namespace_body : declaration_seq",
"namespace_alias_def : NAMESPACE IDENTIFIER '=' complete_class_name ';'",
"using_directive : USING NAMESPACE",
"using_declaration : USING IDENTIFIER",
"using_declaration : USING DBL_COLON",
"$$5 :",
"class_def : $$5 class_specifier ';'",
"class_name : IDENTIFIER",
"class_name : template_class_name",
"template_class_name : IDENTIFIER '<' template_args '>'",
"template_args :",
"const_expression :",
"enumerator_expression :",
"decl_specifier : storage_class_specifier",
"decl_specifier : type_specifier",
"decl_specifier : fct_specifier",
"decl_specifier : FRIEND",
"decl_specifier : TYPEDEF",
"decl_specifiers : decl_specs_opt type_name decl_specs_opt",
"decl_specs_opt :",
"decl_specs_opt : decl_specs",
"decl_specs : decl_specifier",
"decl_specs : decl_specs decl_specifier",
"storage_class_specifier : AUTO",
"storage_class_specifier : REGISTER",
"storage_class_specifier : STATIC",
"storage_class_specifier : EXTERN",
"fct_specifier : INLINE",
"fct_specifier : VIRTUAL",
"type_specifier : CONST",
"type_specifier : VOLATILE",
"type_name : elaborated_type_specifier",
"type_name : complete_class_name",
"type_name : simple_type_names",
"simple_type_names : simple_type_names simple_type_name",
"simple_type_names : simple_type_name",
"simple_type_name : CHAR",
"simple_type_name : SHORT",
"simple_type_name : INT",
"simple_type_name : LONG",
"simple_type_name : SIGNED",
"simple_type_name : UNSIGNED",
"simple_type_name : FLOAT",
"simple_type_name : DOUBLE",
"simple_type_name : VOID",
"template_spec : TEMPLATE '<' template_args '>'",
"opt_template_spec :",
"opt_template_spec : template_spec",
"class_key : opt_template_spec CLASS",
"class_key : opt_template_spec STRUCT",
"complete_class_name : qualified_class_name",
"complete_class_name : DBL_COLON qualified_class_name",
"qualified_class_name : qualified_class_name DBL_COLON class_name",
"qualified_class_name : class_name",
"elaborated_type_specifier : class_key IDENTIFIER",
"elaborated_type_specifier : ENUM IDENTIFIER",
"elaborated_type_specifier : UNION IDENTIFIER",
"argument_declaration_list : arg_declaration_list_opt triple_dot_opt",
"argument_declaration_list : arg_declaration_list ',' TRIPLE_DOT",
"arg_declaration_list_opt :",
"arg_declaration_list_opt : arg_declaration_list",
"triple_dot_opt :",
"triple_dot_opt : TRIPLE_DOT",
"arg_declaration_list : arg_declaration_list ',' argument_declaration",
"arg_declaration_list : argument_declaration",
"argument_declaration : decl_specifiers abstract_decl_opt",
"$$6 :",
"argument_declaration : decl_specifiers abstract_decl_opt '=' $$6 const_expression",
"argument_declaration : decl_specifiers abstract_decl_opt dname abstract_decl_opt",
"$$7 :",
"argument_declaration : decl_specifiers abstract_decl_opt dname abstract_decl_opt '=' $$7 const_expression",
"abstract_decl_opt :",
"abstract_decl_opt : abstract_decl",
"abstract_decl : abstract_decl ptr_operator",
"$$8 :",
"abstract_decl : '[' $$8 const_expression ']'",
"$$9 :",
"abstract_decl : abstract_decl '[' $$9 const_expression ']'",
"abstract_decl : ptr_operator",
"abstract_decl : '(' abstract_decl ')'",
"declarator : dname",
"declarator : declarator ptr_operator",
"$$10 :",
"declarator : declarator '[' $$10 const_expression ']'",
"declarator : '(' declarator ')'",
"dname : IDENTIFIER",
"fct_decl : '(' argument_declaration_list ')' cv_qualifier_list_opt ctor_initializer_opt fct_body_or_semicolon",
"fct_name : IDENTIFIER",
"fct_name : IDENTIFIER array_decls",
"$$11 :",
"fct_name : IDENTIFIER '=' $$11 const_expression",
"$$12 :",
"fct_name : IDENTIFIER array_decls '=' $$12 const_expression",
"$$13 :",
"array_decls : '[' $$13 const_expression ']'",
"$$14 :",
"array_decls : array_decls '[' $$14 const_expression ']'",
"ptr_operators_opt :",
"ptr_operators_opt : ptr_operators",
"ptr_operators : ptr_operator",
"ptr_operators : ptr_operators ptr_operator",
"ptr_operator : '*' cv_qualifier_list_opt",
"ptr_operator : '&' cv_qualifier_list_opt",
"cv_qualifier_list_opt :",
"cv_qualifier_list_opt : cv_qualifier_list",
"cv_qualifier_list : cv_qualifier",
"cv_qualifier_list : cv_qualifier_list cv_qualifier",
"cv_qualifier : CONST",
"cv_qualifier : VOLATILE",
"fct_body_or_semicolon : ';'",
"fct_body_or_semicolon : fct_body",
"fct_body_or_semicolon : '=' INT_VAL ';'",
"$$15 :",
"fct_body : '{' $$15 '}'",
"$$16 :",
"class_specifier : full_class_head '{' $$16 opt_obj_member_list '}'",
"class_specifier : class_head",
"class_specifier : class_head '(' IDENTIFIER ')'",
"class_specifier : template_spec whatever",
"whatever : IDENTIFIER",
"whatever : simple_type_name",
"whatever : type_specifier",
"whatever : storage_class_specifier",
"whatever : fct_specifier",
"class_head : class_key qualified_class_name",
"class_head : class_key IDENTIFIER class_name",
"full_class_head : class_head opt_base_spec",
"nested_class_head : class_key qualified_class_name opt_base_spec",
"ctor_initializer_opt :",
"ctor_initializer_opt : ctor_initializer",
"ctor_initializer : ':' mem_initializer_list",
"mem_initializer_list : mem_initializer",
"mem_initializer_list : mem_initializer ',' mem_initializer_list",
"$$17 :",
"mem_initializer : complete_class_name '(' $$17 const_expression ')'",
"opt_base_spec :",
"opt_base_spec : base_spec",
"opt_obj_member_list :",
"opt_obj_member_list : obj_member_list",
"obj_member_list : obj_member_list obj_member_area",
"obj_member_list : obj_member_area",
"qt_access_specifier : access_specifier",
"qt_access_specifier : SLOTS",
"$$18 :",
"obj_member_area : qt_access_specifier $$18 slot_area",
"$$19 :",
"obj_member_area : SIGNALS $$19 ':' opt_signal_declarations",
"obj_member_area : Q_OBJECT",
"$$20 :",
"$$21 :",
"obj_member_area : Q_PROPERTY $$20 '(' property ')' $$21 opt_property_candidates",
"$$22 :",
"$$23 :",
"obj_member_area : Q_OVERRIDE $$22 '(' property ')' $$23 opt_property_candidates",
"$$24 :",
"$$25 :",
"obj_member_area : Q_CLASSINFO $$24 '(' STRING ',' STRING ')' $$25 opt_property_candidates",
"$$26 :",
"$$27 :",
"obj_member_area : Q_ENUMS $$26 '(' qt_enums ')' $$27 opt_property_candidates",
"$$28 :",
"$$29 :",
"obj_member_area : Q_SETS $$28 '(' qt_sets ')' $$29 opt_property_candidates",
"slot_area : SIGNALS ':'",
"slot_area : SLOTS ':' opt_slot_declarations",
"$$30 :",
"slot_area : ':' $$30 opt_property_candidates",
"slot_area : IDENTIFIER",
"opt_property_candidates :",
"opt_property_candidates : property_candidate_declarations",
"property_candidate_declarations : property_candidate_declarations property_candidate_declaration",
"property_candidate_declarations : property_candidate_declaration",
"property_candidate_declaration : signal_or_slot",
"opt_signal_declarations :",
"opt_signal_declarations : signal_declarations",
"signal_declarations : signal_declarations signal_declaration",
"signal_declarations : signal_declaration",
"signal_declaration : signal_or_slot",
"opt_slot_declarations :",
"opt_slot_declarations : slot_declarations",
"slot_declarations : slot_declarations slot_declaration",
"slot_declarations : slot_declaration",
"slot_declaration : signal_or_slot",
"opt_semicolons :",
"opt_semicolons : opt_semicolons ';'",
"base_spec : ':' base_list",
"base_list : base_list ',' base_specifier",
"base_list : base_specifier",
"qt_macro_name : IDENTIFIER '(' IDENTIFIER ')'",
"qt_macro_name : IDENTIFIER '(' simple_type_name ')'",
"base_specifier : complete_class_name",
"base_specifier : VIRTUAL access_specifier complete_class_name",
"base_specifier : VIRTUAL complete_class_name",
"base_specifier : access_specifier VIRTUAL complete_class_name",
"base_specifier : access_specifier complete_class_name",
"base_specifier : qt_macro_name",
"base_specifier : VIRTUAL access_specifier qt_macro_name",
"base_specifier : VIRTUAL qt_macro_name",
"base_specifier : access_specifier VIRTUAL qt_macro_name",
"base_specifier : access_specifier qt_macro_name",
"access_specifier : PRIVATE",
"access_specifier : PROTECTED",
"access_specifier : PUBLIC",
"operator_name : decl_specs_opt IDENTIFIER ptr_operators_opt",
"operator_name : decl_specs_opt simple_type_name ptr_operators_opt",
"operator_name : '+'",
"operator_name : '-'",
"operator_name : '*'",
"operator_name : '/'",
"operator_name : '%'",
"operator_name : '^'",
"operator_name : '&'",
"operator_name : '|'",
"operator_name : '~'",
"operator_name : '!'",
"operator_name : '='",
"operator_name : '<'",
"operator_name : '>'",
"operator_name : '+' '='",
"operator_name : '-' '='",
"operator_name : '*' '='",
"operator_name : '/' '='",
"operator_name : '%' '='",
"operator_name : '^' '='",
"operator_name : '&' '='",
"operator_name : '|' '='",
"operator_name : '~' '='",
"operator_name : '!' '='",
"operator_name : '=' '='",
"operator_name : '<' '='",
"operator_name : '>' '='",
"operator_name : '<' '<'",
"operator_name : '>' '>'",
"operator_name : '<' '<' '='",
"operator_name : '>' '>' '='",
"operator_name : '&' '&'",
"operator_name : '|' '|'",
"operator_name : '+' '+'",
"operator_name : '-' '-'",
"operator_name : ','",
"operator_name : '-' '>' '*'",
"operator_name : '-' '>'",
"operator_name : '(' ')'",
"operator_name : '[' ']'",
"opt_virtual :",
"opt_virtual : VIRTUAL",
"type_and_name : type_name fct_name",
"type_and_name : fct_name",
"type_and_name : opt_virtual '~' fct_name",
"type_and_name : decl_specs type_name decl_specs_opt ptr_operators_opt fct_name",
"type_and_name : decl_specs type_name",
"type_and_name : type_name ptr_operators fct_name",
"type_and_name : type_name decl_specs ptr_operators_opt fct_name",
"type_and_name : type_name OPERATOR operator_name",
"type_and_name : OPERATOR operator_name",
"type_and_name : decl_specs type_name decl_specs_opt ptr_operators_opt OPERATOR operator_name",
"type_and_name : type_name ptr_operators OPERATOR operator_name",
"type_and_name : type_name decl_specs ptr_operators_opt OPERATOR operator_name",
"signal_or_slot : type_and_name fct_decl opt_semicolons",
"signal_or_slot : type_and_name opt_bitfield ';' opt_semicolons",
"signal_or_slot : type_and_name opt_bitfield ',' member_declarator_list ';' opt_semicolons",
"signal_or_slot : enum_specifier opt_identifier ';' opt_semicolons",
"signal_or_slot : USING complete_class_name ';' opt_semicolons",
"signal_or_slot : USING NAMESPACE complete_class_name ';' opt_semicolons",
"signal_or_slot : NAMESPACE IDENTIFIER '{'",
"signal_or_slot : nested_class_head ';' opt_semicolons",
"$$31 :",
"$$32 :",
"signal_or_slot : nested_class_head '{' $$31 '}' $$32 ';' opt_semicolons",
"member_declarator_list : member_declarator",
"member_declarator_list : member_declarator_list ',' member_declarator",
"member_declarator : declarator",
"$$33 :",
"member_declarator : IDENTIFIER ':' $$33 const_expression",
"$$34 :",
"member_declarator : ':' $$34 const_expression",
"opt_bitfield :",
"$$35 :",
"opt_bitfield : ':' $$35 const_expression",
"enum_specifier : ENUM enum_tail",
"opt_komma :",
"opt_komma : ','",
"enum_tail : IDENTIFIER '{' enum_list opt_komma '}'",
"enum_tail : '{' enum_list opt_komma '}'",
"opt_identifier :",
"opt_identifier : IDENTIFIER",
"enum_list :",
"enum_list : enumerator",
"enum_list : enum_list ',' enumerator",
"enumerator : IDENTIFIER",
"$$36 :",
"enumerator : IDENTIFIER '=' $$36 enumerator_expression",
"$$37 :",
"property : IDENTIFIER IDENTIFIER $$37 prop_statements",
"prop_statements :",
"prop_statements : READ IDENTIFIER prop_statements",
"prop_statements : WRITE IDENTIFIER prop_statements",
"prop_statements : RESET IDENTIFIER prop_statements",
"prop_statements : STORED IDENTIFIER prop_statements",
"$$38 :",
"prop_statements : DESIGNABLE IDENTIFIER $$38 prop_statements",
"qt_enums :",
"qt_enums : IDENTIFIER qt_enums",
"qt_sets :",
"qt_sets : IDENTIFIER qt_sets",
};
#endif
#ifdef YYSTACKSIZE
#undef YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE
#else
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
#else
#define YYSTACKSIZE 500
#define YYMAXDEPTH 500
#endif
#endif
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
short *yyssp;
YYSTYPE *yyvsp;
YYSTYPE yyval;
YYSTYPE yylval;
short yyss[YYSTACKSIZE];
YYSTYPE yyvs[YYSTACKSIZE];
#define yystacksize YYSTACKSIZE
#line 1201 "moc.y"

#if defined(_OS_WIN32_)
#include <io.h>
#undef isatty
extern "C" int hack_isatty( int )
{
    return 0;
}
#define isatty hack_isatty
#else
#include <unistd.h>
#endif

#include "lex.yy.c"

void 	  init();				// initialize
void 	  initClass();				// prepare for new class
void 	  generateClass();			// generate C++ code for class
void 	  initExpression();			// prepare for new expression
QCString  combinePath( const char *, const char * );

QCString  fileName;				// file name
QCString  outputFile;				// output file name
QCString  includeFile;				// name of #include file
QCString  includePath;				// #include file path
QCString  qtPath;				// #include qt file path
bool	  noInclude     = FALSE;		// no #include <filename>
bool	  generatedCode = FALSE;		// no code generated
bool	  mocError = FALSE;			// moc parsing error occurred
QCString  className;				// name of parsed class
QCString  superclassName;			// name of super class
FuncList  signals;				// signal interface
FuncList  slots;				// slots interface
FuncList  propfuncs;				// all possible property access functions
FuncList  funcs( TRUE );			// all parsed functions, including signals
EnumList  enums;				// enums used in properties
PropList  props;				// list of all properties
ClassInfoList	infos;				// list of all class infos

// Used to store the values in the Q_PROPERTY macro
QCString propWrite;				// set function
QCString propRead;				// get function
QCString propReset;				// reset function
QCString propStored;				// "true", "false" or function or empty if not specified
bool propOverride;				// Wether OVERRIDE was detected
int propDesignable;				// Wether DESIGNABLE was TRUE (1) or FALSE (0) or not specified (-1)

QStrList qtEnums;				// Used to store the contents of Q_ENUMS
QStrList qtSets;				// Used to store the contents of Q_SETS

FILE  *out;					// output file

int yyparse();

void replace( char *s, char c1, char c2 );

int main( int argc, char **argv )
{
    bool autoInclude = TRUE;
    char *error	     = 0;
    qtPath = "";
    for ( int n=1; n<argc && error==0; n++ ) {
	QCString arg = argv[n];
	if ( arg[0] == '-' ) {			// option
	    QCString opt = &arg[1];
	    if ( opt[0] == 'o' ) {		// output redirection
		if ( opt[1] == '\0' ) {
		    if ( !(n < argc-1) ) {
			error = "Missing output-file name";
			break;
		    }
		    outputFile = argv[++n];
		} else
		    outputFile = &opt[1];
	    } else if ( opt == "i" ) {		// no #include statement
		noInclude   = TRUE;
		autoInclude = FALSE;
	    } else if ( opt[0] == 'f' ) {	// produce #include statement
		noInclude   = FALSE;
		autoInclude = FALSE;
		if ( opt[1] ) {			// -fsomething.h
		    includeFile = &opt[1];
		}
	    } else if ( opt[0] == 'p' ) {	// include file path
		if ( opt[1] == '\0' ) {
		    if ( !(n < argc-1) ) {
			error = "Missing path name for the -p option.";
			break;
		    }
		    includePath = argv[++n];
		} else {
		    includePath = &opt[1];
		}
	    } else if ( opt[0] == 'q' ) {	// qt include file path
		if ( opt[1] == '\0' ) {
		    if ( !(n < argc-1) ) {
			error = "Missing path name for the -q option.";
			break;
		    }
		    qtPath = argv[++n];
		} else {
		    qtPath = &opt[1];
		}
		replace(qtPath.data(),'\\','/');
		if ( qtPath.right(1) != "/" )
		    qtPath += '/';
	    } else if ( opt == "k" ) {		// don't stop on errors
		errorControl = TRUE;
	    } else if ( opt == "nw" ) {		// don't display warnings
		displayWarnings = FALSE;
	    } else if ( opt == "ldbg" ) {	// lex debug output
		lexDebug = TRUE;
	    } else if ( opt == "ydbg" ) {	// yacc debug output
		yydebug = TRUE;
	    } else {
		error = "Invalid argument";
	    }
	} else {
	    if ( !fileName.isNull() )		// can handle only one file
		error	 = "Too many input files specified";
	    else
		fileName = arg.copy();
	}
    }

    if ( autoInclude ) {
	int ppos = fileName.findRev('.');
	if ( ppos != -1 && tolower( fileName[ppos + 1] ) == 'h' )
	    noInclude = FALSE;
	else
	    noInclude = TRUE;
    }
    if ( !fileName.isEmpty() && !outputFile.isEmpty() &&
	 includeFile.isEmpty() && includePath.isEmpty() ) {
	includeFile = combinePath(fileName,outputFile);
    }
    if ( includeFile.isEmpty() )
	includeFile = fileName.copy();
    if ( !includePath.isEmpty() ) {
	if ( includePath.right(1) != "/" )
	    includePath += '/';
	includeFile = includePath + includeFile;
    }
    if ( fileName.isNull() && !error ) {
	fileName = "standard input";
	yyin	 = stdin;
    } else if ( argc < 2 || error ) {		// incomplete/wrong args
	fprintf( stderr, "Qt meta object compiler\n" );
	if ( error )
	    fprintf( stderr, "moc: %s\n", error );
	fprintf( stderr, "Usage:  moc [options] <header-file>\n"
		 "\t-o file  Write output to file rather than stdout\n"
		 "\t-i       Do not generate an #include statement\n"
		 "\t-f[file] Force #include, optional file name\n"
		 "\t-p path  Path prefix for included file\n"
		 "\t-k       Do not stop on errors\n"
		 "\t-nw      Do not display warnings\n"
		 );
	return 1;
    } else {
	yyin = fopen( (const char *)fileName, "r" );
	if ( !yyin ) {
	    fprintf( stderr, "moc: %s: No such file\n", (const char*)fileName);
	    return 1;
	}
    }
    if ( !outputFile.isEmpty() ) {		// output file specified
	out = fopen( (const char *)outputFile, "w" );	// create output file
	if ( !out ) {
	    fprintf( stderr, "moc: Cannot create %s\n",
		     (const char*)outputFile );
	    return 1;
	}
    } else {					// use stdout
	out = stdout;
    }
    init();
    yyparse();
    fclose( yyin );
    if ( !outputFile.isNull() )
	fclose( out );

    if ( !generatedCode && displayWarnings && !mocError ) {
        fprintf( stderr, "%s:%d: Warning: %s\n", fileName.data(), 0,
		 "No relevant classes found. No output generated." );
    }

    slots.clear();
    signals.clear();
    propfuncs.clear();
    funcs.clear();
    infos.clear();
    props.clear();
    infos.clear();

    return mocError ? 1 : 0;
}

void replace( char *s, char c1, char c2 )
{
    if ( !s )
	return;
    while ( *s ) {
	if ( *s == c1 )
	    *s = c2;
	s++;
    }
}

/*
  This function looks at two file names and returns the name of the
  infile, with a path relative to outfile. Examples:
    /tmp/abc	/tmp/bcd	->	abc
    xyz/a/bc	xyz/b/ac	->	../a/bc
    /tmp/abc	xyz/klm		-)	/tmp/abc
 */

QCString combinePath( const char *infile, const char *outfile )
{
    QCString a = infile;  replace(a.data(),'\\','/');
    QCString b = outfile; replace(b.data(),'\\','/');
    a = a.stripWhiteSpace();
    b = b.stripWhiteSpace();
    QCString r;
    int i = 0;
    int ncommondirs = 0;
    while ( a[i] && a[i] == b[i] ) {
	if ( a[i] == '/' && i > 0 )
	    ncommondirs++;
	i++;
    }
    if ( ncommondirs > 0 ) {			// common base directory
	while ( i>=0 ) {
	    if ( a[i] == '/' && b[i] == '/' )
		break;
	    --i;
	}
	++i;
	a = &a[i];
	b = &b[i];
    } else {
	if ( (a[0] == '/') || (isalpha(a[0]) && a[1] == ':') )
	    return a;
	b = &b[i];
    }
    i = b.contains('/');
    while ( i-- > 0 )
	r += "../";
    r += a;
    return r;
}


#define getenv hack_getenv			// workaround for byacc
char *getenv()		     { return 0; }
char *getenv( const char * ) { return 0; }

void init()					// initialize
{
    BEGIN OUTSIDE;
    lineNo	 = 1;
    skipClass	 = FALSE;
    skipFunc	 = FALSE;
    tmpArgList	 = new ArgList;
    tmpFunc	 = new Function;
    tmpEnum	 = new Enum;
}

void initClass()				 // prepare for new class
{
    tmpAccess      = Private;
    subClassPerm       = Private;
    Q_OBJECTdetected   = FALSE;
    Q_PROPERTYdetected = FALSE;
    skipClass	       = FALSE;
    templateClass      = FALSE;
    slots.clear();
    signals.clear();
    propfuncs.clear();
    enums.clear();
    funcs.clear();
    props.clear();
    infos.clear();
    qtSets.clear();
    qtEnums.clear();
}

struct NamespaceInfo
{
    QCString name;
    int pLevelOnEntering; // Parenthesis level on entering the namespace
    QDict<char> definedClasses; // Classes defined in the namespace
};

QList<NamespaceInfo> namespaces;

void enterNameSpace( const char *name = 0 )   	 // prepare for new class
{
    static bool first = TRUE;
    if ( first ) {
	namespaces.setAutoDelete( TRUE );
	first = FALSE;
    }

    NamespaceInfo *tmp = new NamespaceInfo;
    if ( name )
	tmp->name = name;
    tmp->pLevelOnEntering = namespacePLevel;
    namespaces.append( tmp );
}

void leaveNameSpace()				 // prepare for new class
{
    NamespaceInfo *tmp = namespaces.last();
    namespacePLevel = tmp->pLevelOnEntering;
    namespaces.remove();
}

QCString nameQualifier()
{
    QListIterator<NamespaceInfo> iter( namespaces );
    NamespaceInfo *tmp;
    QCString qualifier = "";
    for( ; (tmp = iter.current()) ; ++iter ) {
	if ( !tmp->name.isNull() ) {  // If not unnamed namespace
	    qualifier += tmp->name;
	    qualifier += "::";
	}
    }
    return qualifier;
}

int openNameSpaceForMetaObject( FILE *out )
{
    int levels = 0;
    QListIterator<NamespaceInfo> iter( namespaces );
    NamespaceInfo *tmp;
    QCString indent = "";
    for( ; (tmp = iter.current()) ; ++iter ) {
	if ( !tmp->name.isNull() ) {  // If not unnamed namespace
	    fprintf( out, "%snamespace %s {\n", (const char *)indent,
		     (const char *) tmp->name );
	    indent += "    ";
	    levels++;
	}
    }
    QCString nm = className;
    int pos;
    while( (pos = nm.find( "::" )) != -1 ) {
	QCString spaceName = nm.left( pos );
	nm = nm.right( nm.length() - pos - 2 );
	if ( !spaceName.isEmpty() ) {
	    fprintf( out, "%snamespace %s {\n", (const char *)indent,
		     (const char *) spaceName );
	    indent += "    ";
	    levels++;
	}
    }
    return levels;
}

void closeNameSpaceForMetaObject( FILE *out, int levels )
{
    int i;
    for( i = 0 ; i < levels ; i++ )
	    fprintf( out, "}" );
    if ( levels )
	fprintf( out, "\n" );

}

void selectOutsideClassState()
{
    if ( namespaces.count() == 0 )
	BEGIN OUTSIDE;
    else
	BEGIN IN_NAMESPACE;
}

void registerClassInNamespace()
{
    if ( namespaces.count() == 0 )
	return;
    namespaces.last()->definedClasses.insert((const char *)className,(char*)1);
}

//
// Remove white space from SIGNAL and SLOT names.
// This function has been copied from qobject.cpp.
//

inline bool isIdentChar( char x )
{						// Avoid bug in isalnum
    return x == '_' || (x >= '0' && x <= '9') ||
	 (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z');
}

inline bool isSpace( char x )
{
#if defined(_CC_BOR_)
  /*
    Borland C++ 4.5 has a weird isspace() bug.
    isspace() usually works, but not here.
    This implementation is sufficient for our internal use: rmWS()
  */
    return (uchar)x <= 32;
#else
    return isspace( x );
#endif
}

static QCString rmWS( const char *src )
{
    QCString result( qstrlen(src)+1 );
    char *d = result.data();
    char *s = (char *)src;
    char last = 0;
    while( *s && isSpace(*s) )			// skip leading space
	s++;
    while ( *s ) {
	while ( *s && !isSpace(*s) )
	    last = *d++ = *s++;
	while ( *s && isSpace(*s) )
	    s++;
	if ( *s && isIdentChar(*s) && isIdentChar(last) )
	    last = *d++ = ' ';
    }
    result.truncate( (int)(d - result.data()) );
    return result;
}


void initExpression()
{
    tmpExpression = "";
}

void addExpressionString( const char *s )
{
    tmpExpression += s;
}

void addExpressionChar( const char c )
{
    tmpExpression += c;
}

void yyerror( const char *msg )			// print yacc error message
{
    mocError = TRUE;
    fprintf( stderr, "%s:%d: Error: %s\n", fileName.data(), lineNo, msg );
}

void moc_err( const char *s )
{
    yyerror( s );
    if ( errorControl ) {
	exit( -1 );
    }
}

void moc_err( const char *s1, const char *s2 )
{
    static char tmp[1024];
    sprintf( tmp, s1, s2 );
    yyerror( tmp );
    if ( errorControl ) {
	exit( -1 );
    }
}

void moc_warn( const char *msg )
{
    if ( displayWarnings )
	fprintf( stderr, "%s:%d: Warning: %s\n", fileName.data(), lineNo, msg);
}

void moc_warn( char *s1, char *s2 )
{
    static char tmp[1024];
    sprintf( tmp, s1, s2 );
    if ( displayWarnings )
	fprintf( stderr, "%s:%d: Warning: %s\n", fileName.data(), lineNo, tmp);
}

static bool suppress_func_warn = FALSE;
void func_warn( const char *msg )
{
    if ( !suppress_func_warn )
	moc_warn( msg );
    skipFunc = TRUE;
}

void operatorError()
{
    if ( !suppress_func_warn )
	moc_warn("Operator functions cannot be signals or slots.");
    skipFunc = TRUE;
}

#ifndef yywrap
int yywrap()					// more files?
{
    return 1;					// end of file
}
#endif

char *stradd( const char *s1, const char *s2 )	// adds two strings
{
    char *n = new char[qstrlen(s1)+qstrlen(s2)+1];
    qstrcpy( n, s1 );
    strcat( n, s2 );
    return n;
}

char *stradd( const char *s1, const char *s2, const char *s3 )// adds 3 strings
{
    char *n = new char[qstrlen(s1)+qstrlen(s2)+qstrlen(s3)+1];
    qstrcpy( n, s1 );
    strcat( n, s2 );
    strcat( n, s3 );
    return n;
}

char *stradd( const char *s1, const char *s2,
	      const char *s3, const char *s4 )// adds 4 strings
{
    char *n = new char[qstrlen(s1)+qstrlen(s2)+qstrlen(s3)+qstrlen(s4)+1];
    qstrcpy( n, s1 );
    strcat( n, s2 );
    strcat( n, s3 );
    strcat( n, s4 );
    return n;
}


char *straddSpc( const char *s1, const char *s2 )
{
    char *n = new char[qstrlen(s1)+qstrlen(s2)+2];
    qstrcpy( n, s1 );
    strcat( n, " " );
    strcat( n, s2 );
    return n;
}

char *straddSpc( const char *s1, const char *s2, const char *s3 )
{
    char *n = new char[qstrlen(s1)+qstrlen(s2)+qstrlen(s3)+3];
    qstrcpy( n, s1 );
    strcat( n, " " );
    strcat( n, s2 );
    strcat( n, " " );
    strcat( n, s3 );
    return n;
}

char *straddSpc( const char *s1, const char *s2,
	      const char *s3, const char *s4 )
{
    char *n = new char[qstrlen(s1)+qstrlen(s2)+qstrlen(s3)+qstrlen(s4)+4];
    qstrcpy( n, s1 );
    strcat( n, " " );
    strcat( n, s2 );
    strcat( n, " " );
    strcat( n, s3 );
    strcat( n, " " );
    strcat( n, s4 );
    return n;
}

// Generate C++ code for building member function table

QCString pureClassName()
{
    QCString result;
    int pos = className.findRev( "::");
    if ( pos != -1 )
        result = className.right( className.length() - pos - 2 );
    else
	result = className;
    return result;
}

QCString qualifiedClassName()
{
    QCString tmp = nameQualifier();
    tmp += className;
    return tmp;
}

QCString qualifiedSuperclassName()
{
    if ( namespaces.count() == 0 )
	return superclassName;
    if ( namespaces.last()->definedClasses.find((const char *)superclassName)){
	QCString tmp = nameQualifier();
	tmp += superclassName;
	return tmp;
    } else {
	return superclassName;
    }
}

const int Slot_Num   = 1;
const int Signal_Num = 2;
const int Prop_Num = 3;

void generateFuncs( FuncList *list, char *functype, int num )
{
    Function *f;
    for ( f=list->first(); f; f=list->next() ) {
	QCString typstr = "";
	int count = 0;
	Argument *a = f->args->first();
	while ( a ) {
	    if ( !a->leftType.isEmpty() || ! a->rightType.isEmpty() ) {
		if ( count++ )
		    typstr += ",";
		typstr += a->leftType;
		typstr += a->rightType;
	    }
	    a = f->args->next();
	}
	fprintf( out, "    typedef %s(%s::*m%d_t%d)(%s)%s;\n",
		 (const char*)f->type, (const char*)qualifiedClassName(),
		 num, list->at(),
		 (const char*)typstr,  (const char*)f->qualifier );
	f->type = f->name;
	f->type += "(";
	f->type += typstr;
	f->type += ")";
    }
    for ( f=list->first(); f; f=list->next() )
	fprintf( out, "    m%d_t%d v%d_%d = Q_AMPERSAND %s::%s;\n",
		 num, list->at(), num, list->at(),
		 (const char*)qualifiedClassName(), (const char*)f->name);
    if ( list->count() ) {
	fprintf(out,"    QMetaData *%s_tbl = QMetaObject::new_metadata(%d);\n",
		functype, list->count() );

    }

    //### remove 3.0
    if ( qstrcmp( functype, "slot" )  == 0 ) {
	if ( list->count() )
	    fprintf(out,"    QMetaData::Access *%s_tbl_access = QMetaObject::new_metaaccess(%d);\n",
		    functype, list->count() );
	else
	    fprintf(out,"    QMetaData::Access *%s_tbl_access = 0;\n",
		    functype );
    }


    for ( f=list->first(); f; f=list->next() ) {
	fprintf( out, "    %s_tbl[%d].name = \"%s\";\n",
		 functype, list->at(), (const char*)f->type );
	fprintf( out, "    %s_tbl[%d].ptr = (QMember)v%d_%d;\n",
		 functype, list->at(), num, list->at() );

/* ### do this in 3.0:
	fprintf( out, "    %s_tbl[%d].access = QMetaData::%s;\n",
		 functype, list->at(), f->accessAsString() );

### for now:
*/
	if ( qstrcmp( functype, "slot" ) == 0 )
	    fprintf( out, "    %s_tbl_access[%d] = QMetaData::%s;\n",
		     functype, list->at(), f->accessAsString() );
    }
}


void generateTypedef( Function* f, int num )
{
  QCString typstr = "";
  int count = 0;
  Argument *a = f->args->first();
  while ( a ) {
    if ( !a->leftType.isEmpty() || ! a->rightType.isEmpty() ) {
      if ( count++ )
	typstr += ",";
      typstr += a->leftType;
      typstr += a->rightType;
    }
    a = f->args->next();
  }


  fprintf( out, "    typedef %s(%s::*m%d_t%d)(%s)%s;\n",
	   (const char*)f->type, (const char*)className, Prop_Num, num,
	   (const char*)typstr,  (const char*)f->qualifier );
}


bool isPropertyType( const char* type )
{
    if ( qvariant_nameToType( type ) != 0 )
	return TRUE;

    for( QListIterator<Enum> lit( enums ); lit.current(); ++lit ) {
	if ( lit.current()->name == type )
	    return TRUE;
    }
    return FALSE;
}

/*!
  Returns TRUE if the type is not one of a QVariant types.
  So it is either a enum/set or an error.
*/
bool isEnumType( const char* type )
{
    if ( qvariant_nameToType( type ) != 0 )
	return FALSE;

    return TRUE;
}

void finishProps()
{
    int entry = 0;
    fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
    for( QListIterator<Property> it( props ); it.current(); ++it ) {
	if ( !isPropertyType( it.current()->type ) ||
	     it.current()->override )
	    fprintf( out, "    metaObj->resolveProperty( &props_tbl[%d] );\n", entry );
	++entry;
    }
    fprintf( out, "#endif // QT_NO_PROPERTIES\n" );
}

int generateEnums()
{
    if ( enums.count() == 0 )
	return 0;

    fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
    fprintf( out, "    QMetaEnum* enum_tbl = QMetaObject::new_metaenum( %i );\n", enums.count() );

    int i = 0;
    for ( QListIterator<Enum> it( enums ); it.current(); ++it, ++i ) {
	fprintf( out, "    enum_tbl[%i].name = \"%s\";\n", i, (const char*)it.current()->name );
	fprintf( out, "    enum_tbl[%i].count = %i;\n", i, (const char*)it.current()->count() );
	fprintf( out, "    enum_tbl[%i].items = QMetaObject::new_metaenum_item( %i );\n",
		 i,(const char*)it.current()->count() );

	if ( it.current()->set )
		fprintf( out, "    enum_tbl[%i].set = TRUE;\n", i );
	else
		fprintf( out, "    enum_tbl[%i].set = FALSE;\n", i );

	int k = 0;
	for( QStrListIterator eit( *it.current() ); eit.current(); ++eit, ++k ) {
	    fprintf( out, "    enum_tbl[%i].items[%i].key = \"%s\";\n", i, k, eit.current() );
	    fprintf( out, "    enum_tbl[%i].items[%i].value = (int) %s::%s;\n",
		     i, k, (const char*)className, eit.current() );
	}
    }
    fprintf( out, "#endif // QT_NO_PROPERTIES\n" );

    return enums.count();
}


int generateProps()
{
    if ( displayWarnings && !Q_OBJECTdetected )
	moc_err("The declaration of the class \"%s\" contains properties"
		" but no Q_OBJECT macro!", className.data());

    fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
    //
    // Resolve and verify property access functions
    //
    for( QListIterator<Property> it( props ); it.current(); ) {
	Property* p = it.current();
	++it;

	// verify get function
	if ( !p->get.isEmpty() ) {
	    FuncList candidates = propfuncs.find( p->get );
	    for ( Function* f = candidates.first(); f; f = candidates.next() ) {
		if ( f->qualifier != "const" ) // get functions must be const
		    continue;
		if ( f->args && !f->args->isEmpty() ) // and must not take any arguments
		    continue;
		QCString tmp = f->type;
		tmp = tmp.simplifyWhiteSpace();
		Property::Specification spec = Property::Unspecified;
		if ( p->type == "QCString" && (tmp == "const char*" || tmp == "const char *" ) ) {
		    tmp = "QCString";
		    spec = Property::ConstCharStar;
		} else if ( tmp.right(1) == "&" ) {
		    tmp = tmp.left( tmp.length() - 1 );
		    spec = Property::Reference;
		} else if ( tmp.right(1) == "*" ) {
		    tmp = tmp.left( tmp.length() - 1 );
		    spec = Property::Pointer;
		} else {
		    spec = Property::Class;
		}
		if ( tmp.left(6) == "const " )
		    tmp = tmp.mid( 6, tmp.length() - 6 );
		tmp = tmp.simplifyWhiteSpace();
		if ( p->type == tmp ) {
		    // If it is an enum then it may not be a set
		    bool ok = TRUE;
		    for( QListIterator<Enum> lit( enums ); lit.current(); ++lit )
			if ( lit.current()->name == p->type && lit.current()->set )
			    ok = FALSE;
		    if ( !ok ) continue;
		    p->gspec = spec;
		    p->getfunc = f;
		    p->oredEnum = 0;
		    break;
		}
		else if ( isEnumType( p->type ) ) {
		    if ( tmp == "int" || tmp == "uint" || tmp == "unsigned int" ) {
			// Test wether the enum is really a set (unfortunately we don't know enums of super classes)
			bool ok = TRUE;
			for( QListIterator<Enum> lit( enums ); lit.current(); ++lit )
			    if ( lit.current()->name == p->type && !lit.current()->set )
				ok = FALSE;
			if ( !ok ) continue;
		        p->gspec = spec;
		        p->getfunc = f;
			p->oredEnum = 1;
		    }
		}
	    }
	    if ( p->getfunc == 0 ) {
		if ( displayWarnings ) {

		    // Is the type a set, that means, mentioned in Q_SETS ?
		    bool set = FALSE;
		    for( QListIterator<Enum> lit( enums ); lit.current(); ++lit )
			if ( lit.current()->name == p->type && lit.current()->set )
			    set = TRUE;

		    fprintf( stderr, "%s:%d: Warning: Property '%s' not available.\n",
			     fileName.data(), p->lineNo, (const char*) p->name );
		    fprintf( stderr, "   Have been looking for public get functions \n");
		    if ( !set ) {
			fprintf( stderr,
			     "      %s %s() const\n"
			     "      %s& %s() const\n"
			     "      const %s& %s() const\n"
			     "      %s* %s() const\n",
			     (const char*) p->type, (const char*) p->get,
			     (const char*) p->type, (const char*) p->get,
			     (const char*) p->type, (const char*) p->get,
			     (const char*) p->type, (const char*) p->get );
		    }
		    if ( set || !isPropertyType( p->type ) ) {
			fprintf( stderr,
			     "      int %s() const\n"
			     "      uint %s() const\n"
			     "      unsigned int %s() const\n",
			     (const char*) p->get,
			     (const char*) p->get,
			     (const char*) p->get );
		    }
		    if ( p->type == "QCString" )
			fprintf( stderr, "      const char* %s() const\n",
				 (const char*)p->get );

		    if ( candidates.isEmpty() ) {
			fprintf( stderr, "   but found nothing.\n");
		    } else {
			fprintf( stderr, "   but only found the missmatching candidate(s)\n");
			for ( Function* f = candidates.first(); f; f = candidates.next() ) {
			    QCString typstr = "";
			    Argument *a = f->args->first();
			    int count = 0;
			    while ( a ) {
				if ( !a->leftType.isEmpty() || ! a->rightType.isEmpty() ) {
				    if ( count++ )
					typstr += ",";
				    typstr += a->leftType;
				    typstr += a->rightType;
				}
				a = f->args->next();
			    }
			    fprintf( stderr, "      %s:%d: %s %s(%s) %s\n", fileName.data(), f->lineNo,
				     (const char*) f->type,(const char*) f->name, (const char*) typstr,
				     f->qualifier.isNull()?"":(const char*) f->qualifier );
			}
		    }
		}
	    }
	}

	// verify set function
	if ( !p->set.isEmpty() ) {
	    FuncList candidates = propfuncs.find( p->set );
	    for ( Function* f = candidates.first(); f; f = candidates.next() ) {
		if ( !f->args || f->args->isEmpty() )
		    continue;
		QCString tmp = f->args->first()->leftType;
		tmp = tmp.simplifyWhiteSpace();
		Property::Specification spec = Property::Unspecified;
		if ( tmp.right(1) == "&" ) {
		    tmp = tmp.left( tmp.length() - 1 );
		    spec = Property::Reference;
		}
		else {
		    spec = Property::Class;
		}
		if ( p->type == "QCString" && (tmp == "const char*" || tmp == "const char *" ) ) {
		    tmp = "QCString";
		    spec = Property::ConstCharStar;
		}
		if ( tmp.left(6) == "const " )
		    tmp = tmp.mid( 6, tmp.length() - 6 );
		tmp = tmp.simplifyWhiteSpace();

		if ( p->type == tmp && f->args->count() == 1 ) {
		    // If it is an enum then it may not be a set
		    if ( p->oredEnum == 1 )
			continue;
		    bool ok = TRUE;
		    for( QListIterator<Enum> lit( enums ); lit.current(); ++lit )
			if ( lit.current()->name == p->type && lit.current()->set )
			    ok = FALSE;
		    if ( !ok ) continue;
		    p->sspec = spec;
		    p->setfunc = f;
		    p->oredEnum = 0;
		    break;
		}
		else if ( isEnumType( p->type ) && f->args->count() == 1 ) {
		    if ( tmp == "int" || tmp == "uint" || tmp == "unsigned int" ) {
		        if ( p->oredEnum == 0 )
			    continue;
			// Test wether the enum is really a set (unfortunately we don't know enums of super classes)
			bool ok = TRUE;
			for( QListIterator<Enum> lit( enums ); lit.current(); ++lit )
			    if ( lit.current()->name == p->type && !lit.current()->set )
				ok = FALSE;
			if ( !ok ) continue;
		        p->sspec = spec;
		        p->setfunc = f;
			p->oredEnum = 1;
		    }
		}
	    }
	    if ( p->setfunc == 0 ) {
		if ( displayWarnings ) {

		    // Is the type a set, that means, mentioned in Q_SETS ?
		    bool set = FALSE;
		    for( QListIterator<Enum> lit( enums ); lit.current(); ++lit )
			if ( lit.current()->name == p->type && lit.current()->set )
			    set = TRUE;

		    fprintf( stderr, "%s:%d: Warning: Property '%s' not writable.\n",
			     fileName.data(), p->lineNo, (const char*) p->name );
		    fprintf( stderr, "   Have been looking for public set functions \n");
		    if ( !set && p->oredEnum != 1 ) {
			fprintf( stderr,
			     "      void %s( %s )\n"
			     "      void %s( %s& )\n"
			     "      void %s( const %s& )\n",
			     (const char*) p->set, (const char*) p->type,
			     (const char*) p->set, (const char*) p->type,
			     (const char*) p->set, (const char*) p->type );
		    }
		    if ( set || ( !isPropertyType( p->type ) && p->oredEnum != 0 ) ) {
			fprintf( stderr,
			     "      void %s( int )\n"
			     "      void %s( uint )\n"
			     "      void %s( unsigned int )\n",
			     (const char*) p->set,
			     (const char*) p->set,
			     (const char*) p->set );
		    }

		    if ( p->type == "QCString" )
			fprintf( stderr, "      void %s( const char* ) const\n",
				 (const char*) p->set );

		    if ( !candidates.isEmpty() ) {
			fprintf( stderr, "   but only found the missmatching candidate(s)\n");
			for ( Function* f = candidates.first(); f; f = candidates.next() ) {
			    QCString typstr = "";
			    Argument *a = f->args->first();
			    int count = 0;
			    while ( a ) {
				if ( !a->leftType.isEmpty() || ! a->rightType.isEmpty() ) {
				    if ( count++ )
					typstr += ",";
				    typstr += a->leftType;
				    typstr += a->rightType;
				}
				a = f->args->next();
			    }
			    fprintf( stderr, "      %s:%d: %s %s(%s)\n", fileName.data(), f->lineNo,
				     (const char*) f->type,(const char*) f->name, (const char*) typstr );
			}
		    }
		}
	    }
	}

	// verify reset function
	if ( !p->reset.isEmpty() ) {
	    FuncList candidates = propfuncs.find( p->reset );
	    for ( Function* f = candidates.first(); f; f = candidates.next() ) {
		if ( f->qualifier == "const" ) // reset functions must not be const
		    continue;
		if ( f->args && !f->args->isEmpty() ) // and must not take any arguments
		    continue;
		QCString tmp = f->type;
		tmp = tmp.simplifyWhiteSpace();
		if ( tmp != "void" ) // Reset function must return void
		    continue;
		p->resetfunc = f;
	    }
	    if ( p->resetfunc == 0 ) {
		if ( displayWarnings ) {

		    fprintf( stderr, "%s:%d: Warning: Property '%s' not resetable.\n",
			     fileName.data(), p->lineNo, (const char*) p->name );
		    fprintf( stderr, "   Have been looking for public reset functions \n");
		    fprintf( stderr, "      void %s()\n", (const char*) p->reset );

		    if ( candidates.isEmpty() ) {
			fprintf( stderr, "   but found nothing.\n");
		    } else {
			fprintf( stderr, "   but only found the missmatching candidate(s)\n");
			for ( Function* f = candidates.first(); f; f = candidates.next() ) {
			    QCString typstr = "";
			    Argument *a = f->args->first();
			    int count = 0;
			    while ( a ) {
				if ( !a->leftType.isEmpty() || ! a->rightType.isEmpty() ) {
				    if ( count++ )
					typstr += ",";
				    typstr += a->leftType;
				    typstr += a->rightType;
				}
				a = f->args->next();
			    }
			    fprintf( stderr, "      %s:%d: %s %s(%s) %s\n", fileName.data(), f->lineNo,
				     (const char*) f->type,(const char*) f->name, (const char*) typstr,
				     f->qualifier.isNull()?"":(const char*) f->qualifier );
			}
		    }
		}
	    }
	}

	// Resolve and verify the STORED function (if any)
	if ( !p->stored.isEmpty() &&  p->stored != "true" && p->stored != "false" ) {
	    bool found = FALSE;
	    FuncList candidates = propfuncs.find( p->stored );
	    for ( Function* f = candidates.first(); f; f = candidates.next() ) {
		if ( f->qualifier != "const" ) // stored functions must be const
		    continue;
		if ( f->args && !f->args->isEmpty() ) // and must not take any arguments
		    continue;

		if ( f->type == "bool" )
		    found = TRUE;
	    }
	    if ( !found ) {
		if ( displayWarnings ) {
		    fprintf( stderr, "%s:%d: Warning: Property '%s' not stored.\n",
			     fileName.data(), p->lineNo, (const char*) p->name );
		    fprintf( stderr, "   Have been looking for public function \n"
			     "      bool %s() const\n",
			     (const char*) p->stored );

		    if ( candidates.isEmpty() ) {
			fprintf( stderr, "   but found nothing.\n");
		    } else {
			fprintf( stderr, "   but only found the missmatching candidate(s)\n");
			for ( Function* f = candidates.first(); f; f = candidates.next() ) {
			    QCString typstr = "";
			    Argument *a = f->args->first();
			    int count = 0;
			    while ( a ) {
				if ( !a->leftType.isEmpty() || ! a->rightType.isEmpty() ) {
				    if ( count++ )
					typstr += ",";
				    typstr += a->leftType;
				    typstr += a->rightType;
				}
				a = f->args->next();
			    }
			    fprintf( stderr, "      %s:%d: %s %s(%s) %s\n", fileName.data(), f->lineNo,
				     (const char*) f->type,(const char*) f->name, (const char*) typstr,
				     f->qualifier.isNull()?"":(const char*) f->qualifier );
			}
		    }
		}
	    }
	}

    }

    //
    // Generate all typedefs
    //
    {
	int count = 0;
	for( QListIterator<Property> it( props ); it.current(); ++it ) {
	    if ( it.current()->getfunc )
		generateTypedef( it.current()->getfunc, count );
	    if ( it.current()->setfunc )
		generateTypedef( it.current()->setfunc, count + 1 );
	    if ( it.current()->resetfunc )
		generateTypedef( it.current()->resetfunc, count + 2 );
	    count += 3;
	}
    }

    //
    // Crazy stuff for crazy compilers
    //
    {
	int count = 0;
	for( QListIterator<Property> it( props ); it.current(); ++it ) {
	    if ( it.current()->getfunc )
		fprintf( out, "    m%d_t%d v%d_%d = &%s::%s;\n", Prop_Num, count,
			 Prop_Num, count, (const char*)className,(const char*)it.current()->getfunc->name);
	    if ( it.current()->setfunc )
		fprintf( out, "    m%d_t%d v%d_%d = &%s::%s;\n", Prop_Num, count + 1,
			 Prop_Num, count + 1, (const char*)className,(const char*)it.current()->setfunc->name);
	    if ( it.current()->resetfunc )
		fprintf( out, "    m%d_t%d v%d_%d = &%s::%s;\n", Prop_Num, count + 2,
			 Prop_Num, count + 2, (const char*)className,(const char*)it.current()->resetfunc->name);
	    count += 3;
	}
    }

    //
    // Create meta data
    //
    if ( props.count() )
    {
	fprintf( out, "    QMetaProperty *props_tbl = QMetaObject::new_metaproperty( %d );\n", props.count() );
	int count = 0;
	int entry = 0;
	for( QListIterator<Property> it( props ); it.current(); ++it ){

	    fprintf( out, "    props_tbl[%d].t = \"%s\";\n", entry,
		     (const char*)it.current()->type );
	    fprintf( out, "    props_tbl[%d].n = \"%s\";\n",
		     entry, (const char*) it.current()->name );

	    if ( it.current()->getfunc )
		fprintf( out, "    props_tbl[%d].get = (QMember)v%d_%d;\n",
			 entry, Prop_Num, count );
	    else
		fprintf( out, "    props_tbl[%d].get = 0;\n", entry );

	    if ( it.current()->setfunc )
		fprintf( out, "    props_tbl[%d].set = (QMember)v%d_%d;\n",
			 entry, Prop_Num, count + 1 );
	    else
		fprintf( out, "    props_tbl[%d].set = 0;\n", entry );

	    if ( it.current()->resetfunc )
		fprintf( out, "    props_tbl[%d].reset = (QMember)v%d_%d;\n",
			 entry, Prop_Num, count + 2 );
	    else
		fprintf( out, "    props_tbl[%d].reset = 0;\n", entry );

	    fprintf( out, "    props_tbl[%d].gspec = QMetaProperty::%s;\n",
		     entry, Property::specToString(it.current()->gspec ));

	    fprintf( out, "    props_tbl[%d].sspec = QMetaProperty::%s;\n",
		     entry, Property::specToString(it.current()->sspec ));

	    int enumpos = -1;
	    int k = 0;
	    for( QListIterator<Enum> eit( enums ); eit.current(); ++eit, ++k ){
		if ( eit.current()->name == it.current()->type )
		    enumpos = k;
	    }

	    QCString flags;
	
	    // Is it an enum of this class ?
	    if ( enumpos != -1 )
		fprintf( out, "    props_tbl[%d].enumData = &enum_tbl[%i];\n", entry, enumpos );
	    // Is it an unknown enum that needs to be resolved ?
	    else if (!isPropertyType( it.current()->type ) ) {
		if ( it.current()->oredEnum == 1 )
		    flags += "QMetaProperty::UnresolvedSet|";
		else if ( it.current()->oredEnum == 0 )
		    flags += "QMetaProperty::UnresolvedEnum|";
		else
		    flags +="QMetaProperty::UnresolvedEnumOrSet|";
	    }

	    // Handle STORED
	    if ( it.current()->stored == "false" )
		flags +="QMetaProperty::NotStored|";
	    else if ( !it.current()->stored.isEmpty() && it.current()->stored != "true" )
	    {
		fprintf( out, "    typedef bool(%s::*s3_t%d)()const;\n", (const char*)className, count );
		fprintf( out, "    s3_t%d sv3_%d = &%s::%s;\n", count, count, (const char*)className,
			 (const char*)it.current()->stored );
		fprintf( out, "    props_tbl[%d].store = *((QMember*)&sv3_%d);\n", entry, count );
	    }
	    // else { Default is TRUE -> do nothing }

	    // OVERRIDE but no STORED ?
	    if ( it.current()->override && it.current()->stored.isEmpty() )
		flags += "QMetaProperty::UnresolvedStored|";

	    // Handle DESIGNABLE
	    if ( it.current()->designable == 0 )
		flags += "QMetaProperty::NotDesignable|";
	    // else { Default is TRUE -> do nothing }

	    // OVERRIDE but no DESIGNABLE ?
	    if ( it.current()->override && it.current()->designable == -1 )
		flags += "QMetaProperty::UnresolvedDesignable|";
	
	    if ( it.current()->stdSet() )
		flags += "QMetaProperty::StdSet|";
	
	    if (!flags.isEmpty() ) {
		if ( flags[ (int) flags.length() - 1] == '|' )
		    flags.remove( flags.length()-1, 1);
		fprintf( out, "    props_tbl[%d].setFlags(%s);\n", entry, flags.data() );
	    }
	
	    ++entry;
	    count += 3;
	}
    }
    fprintf( out, "#endif // QT_NO_PROPERTIES\n" );

    return props.count();
}


int generateClassInfos()
{
    if ( infos.isEmpty() )
	return 0;

    if ( displayWarnings && !Q_OBJECTdetected )
	moc_err("The declaration of the class \"%s\" contains class infos"
		" but no Q_OBJECT macro!", className.data());

    fprintf( out, "    QClassInfo* classinfo_tbl = QMetaObject::new_classinfo( %i );\n", infos.count() );

    int i = 0;
    for( QListIterator<ClassInfo> it( infos ); it.current(); ++it, ++i ) {
	fprintf( out, "    classinfo_tbl[%i].name = \"%s\";\n", i, it.current()->name.data() );
	fprintf( out, "    classinfo_tbl[%i].value = \"%s\";\n", i, it.current()->value.data() );
    }

    return i;
}

void generateClass()		      // generate C++ source code for a class
{
    static int gen_count = 0;
    char *hdr1 = "/****************************************************************************\n"
		 "** %s meta object code from reading C++ file '%s'\n**\n";
    char *hdr2 = "** Created: %s\n"
		 "**      by: The Qt MOC ($Id: qt/src/moc/moc.y   2.2.0   edited 2000-08-31 $)\n**\n";
    char *hdr3 = "** WARNING! All changes made in this file will be lost!\n";
    char *hdr4 = "*****************************************************************************/\n\n";
    int   i;

    if ( skipClass )				// don't generate for class
	return;
    if ( !Q_OBJECTdetected ) {
	if ( signals.count() == 0 && slots.count() == 0 && props.count() == 0 && infos.count() == 0 )
	    return;
	generatedCode = TRUE;
	if ( displayWarnings && (signals.count()+slots.count()) != 0 )
	    moc_err("The declaration of the class \"%s\" contains slots "
		    "and/or signals\n\t but no Q_OBJECT macro!", className.data());
    } else {
	if ( superclassName.isEmpty() )
	    moc_err("The declaration of the class \"%s\" contains the\n"
		    "\tQ_OBJECT macro but does not inherit from any class!\n"
		    "\tInherit from QObject or one of its descendants"
		    " or remove Q_OBJECT. ", className.data() );
    }
    if ( templateClass ) {			// don't generate for class
	moc_err( "Sorry, Qt does not support templates that contain\n"
		 "signals, slots or Q_OBJECT. This will be supported soon." );
	return;
    }
    generatedCode = TRUE;
    if ( gen_count++ == 0 ) {			// first class to be generated
	QDateTime dt = QDateTime::currentDateTime();
	QCString dstr = dt.toString().ascii();
	QCString fn = fileName;
	i = fileName.length()-1;
	while ( i>0 && fileName[i-1] != '/' && fileName[i-1] != '\\' )
	    i--;				// skip path
	if ( i >= 0 )
	    fn = &fileName[i];
	fprintf( out, hdr1, (const char*)qualifiedClassName(),(const char*)fn);
	fprintf( out, hdr2, (const char*)dstr );
	fprintf( out, hdr3 );
	fprintf( out, hdr4 );
	fprintf( out, "#define Q_MOC_%s\n", className.data() );
	fprintf( out, "#if !defined(Q_MOC_OUTPUT_REVISION)\n" );
	fprintf( out, "#define Q_MOC_OUTPUT_REVISION %d\n", formatRevision );
	fprintf( out, "#elif Q_MOC_OUTPUT_REVISION != %d\n", formatRevision );
	fprintf( out, "#error \"Moc format conflict - "
		 "please regenerate all moc files\"\n" );
	fprintf( out, "#endif\n\n" );
	if ( !noInclude )
	    fprintf( out, "#include \"%s\"\n", (const char*)includeFile );
	fprintf( out, "#include <%sqmetaobject.h>\n", (const char*)qtPath );
	fprintf( out, "#include <%sqapplication.h>\n", (const char*)qtPath );
	fprintf( out, "\n" );
	fprintf( out, "#if defined(Q_SPARCWORKS_FUNCP_BUG)\n" );
	fprintf( out, "#define Q_AMPERSAND\n" );
	fprintf( out, "#else\n" );
	fprintf( out, "#define Q_AMPERSAND &\n" );
	fprintf( out, "#endif\n" );
	fprintf( out, "\n\n" );
    } else {
	fprintf( out, "\n\n" );
    }


//
// Generate virtual function className()
//
    fprintf( out, "const char *%s::className() const\n{\n    ",
	     (const char*)qualifiedClassName() );
    fprintf( out, "return \"%s\";\n}\n\n", (const char*)qualifiedClassName() );

//
// Generate static metaObj variable
//
    fprintf( out, "QMetaObject *%s::metaObj = 0;\n\n", (const char*)qualifiedClassName());

//
// Generate initMetaObject member function
//
    fprintf( out, "void %s::initMetaObject()\n{\n", (const char*)qualifiedClassName() );
    fprintf( out, "    if ( metaObj )\n\treturn;\n" );
    fprintf( out, "    if ( qstrcmp(%s::className(), \"%s\") != 0 )\n"
	          "\tbadSuperclassWarning(\"%s\",\"%s\");\n",
             (const char*)qualifiedSuperclassName(), (const char*)qualifiedSuperclassName(),
             (const char*)qualifiedClassName(), (const char*)qualifiedSuperclassName() );
    fprintf( out, "    (void) staticMetaObject();\n");
    fprintf( out, "}\n\n");

//
// Generate tr member function ### 3.0 one function
//
    fprintf( out, "#ifndef QT_NO_TRANSLATION\n\n" );
    fprintf( out, "QString %s::tr(const char* s)\n{\n",
	     (const char*)qualifiedClassName() );
    fprintf( out, "    return qApp->translate"
	     "( \"%s\", s, 0 );\n}\n\n", (const char*)qualifiedClassName() );
    fprintf( out, "QString %s::tr(const char* s, const char * c)\n{\n",
	     (const char*)qualifiedClassName() );
    fprintf( out, "    return qApp->translate"
	     "( \"%s\", s, c );\n}\n\n", (const char*)qualifiedClassName() );
    fprintf( out, "#endif // QT_NO_TRANSLATION\n\n" );

//
// Generate staticMetaObject member function
//
    fprintf( out, "QMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() );
    fprintf( out, "    if ( metaObj )\n\treturn metaObj;\n" );
    fprintf( out, "    (void) %s::staticMetaObject();\n", (const char*)qualifiedSuperclassName() );

//
// Build the enums array in staticMetaObject()
// Enums HAVE to be generated BEFORE the properties
//
   int n_enums = generateEnums();

//
// Build property array in staticMetaObject()
//
   int n_props = generateProps();

//
// Build class info  array in staticMetaObject()
//
   int n_infos = generateClassInfos();

//
// Build slots array in staticMetaObject()
//
    generateFuncs( &slots, "slot", Slot_Num );

//
// Build signals array in staticMetaObject()
//
    generateFuncs( &signals, "signal", Signal_Num );

//
// Finally code to create and return meta object
//
    fprintf( out, "    metaObj = QMetaObject::new_metaobject(\n"
		  "\t\"%s\", \"%s\",\n",
	     (const char*)qualifiedClassName(), (const char*)qualifiedSuperclassName() );

    if ( slots.count() )
	fprintf( out, "\tslot_tbl, %d,\n", slots.count() );
    else
	fprintf( out, "\t0, 0,\n" );

    if ( signals.count() )
	fprintf( out, "\tsignal_tbl, %d,\n", signals.count());
    else
	fprintf( out, "\t0, 0,\n" );

    fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
    if ( n_props )
	fprintf( out, "\tprops_tbl, %d,\n", n_props );
    else
	fprintf( out, "\t0, 0,\n" );

    if ( n_enums )
	fprintf( out, "\tenum_tbl, %d,\n", n_enums );
    else
	fprintf( out, "\t0, 0,\n" );
    fprintf( out, "#endif // QT_NO_PROPERTIES\n" );

    if ( n_infos )
	fprintf( out, "\tclassinfo_tbl, %d );\n", n_infos );
    else
	fprintf( out, "\t0, 0 );\n" );


    //### remove 3.0
    fprintf( out, "    metaObj->set_slot_access( slot_tbl_access );\n" );

//
// Finish property array in staticMetaObject()
//
    finishProps();

    fprintf( out, "    return metaObj;\n}\n" );

//
// End of function staticMetaObject()
//

//
// Generate internal signal functions
//
    Function *f;
    f = signals.first();			// make internal signal methods
    static bool included_list_stuff = FALSE;
    while ( f ) {
	QCString typstr = "";			// type string
	QCString valstr = "";			// value string
	QCString argstr = "";			// argument string (type+value)
	char	buf[12];
	Argument *a = f->args->first();
	QCString typvec[32], valvec[32], argvec[32];
	typvec[0] = "";
	valvec[0] = "";
	argvec[0] = "";

	i = 0;
	while ( a ) {				// argument list
	    if ( !a->leftType.isEmpty() || !a->rightType.isEmpty() ) {
		if ( i ) {
		    typstr += ",";
		    valstr += ", ";
		    argstr += ", ";
		}
		typstr += a->leftType;
		typstr += a->rightType;
		argstr += a->leftType;
		argstr += " ";
		sprintf( buf, "t%d", i );
		valstr += buf;
		argstr += buf;
		argstr += a->rightType;
		++i;
		typvec[i] = typstr.copy();
		valvec[i] = valstr.copy();
		argvec[i] = argstr.copy();
	    }
	    a = f->args->next();
	}

	const char *predef_call_func;
	if ( typstr == "bool" ) {
	    predef_call_func = "activate_signal_bool";
	} else if ( typstr == "QString" ) {
	    predef_call_func = "activate_signal_string";
	} else if ( typstr == "const QString&" ) {
	    predef_call_func = "activate_signal_strref";
	} else if ( typstr.isEmpty() || typstr == "short" ||
		    typstr == "int" ||  typstr == "long" ||
		    typstr == "char*" || typstr == "const char*" ) {
	    predef_call_func = "activate_signal";
	} else {
	    predef_call_func = 0;
	}
	if ( !predef_call_func && !included_list_stuff ) {
	    // yes we need it, because otherwise QT_VERSION may not be defined
	    fprintf( out, "\n#include <%sqobjectdefs.h>\n", (const char*)qtPath );
	    fprintf( out, "#include <%sqsignalslotimp.h>\n", (const char*)qtPath );
	    included_list_stuff = TRUE;
	}

	fprintf( out, "\n/" /* c++ */ "/ SIGNAL %s\n", (const char*)f->name );
	fprintf( out, "void %s::%s(", (const char*)qualifiedClassName(),
		 (const char*)f->name );

	if ( argstr.isEmpty() )
	    fprintf( out, ")\n{\n" );
	else
	    fprintf( out, " %s )\n{\n", (const char*)argstr );

	if ( predef_call_func ) {
	    fprintf( out, "    %s( \"%s(%s)\"", predef_call_func,
		     (const char*)f->name, (const char*)typstr );
	    if ( !valstr.isEmpty() )
		fprintf( out, ", %s", (const char*)valstr );
	    fprintf( out, " );\n}\n" );
	    f = signals.next();
	    continue;
	}


	fprintf( out,"    // No builtin function for signal parameter type %s\n",
		 (const char*)typstr );
	int nargs = f->args->count();
	fprintf( out, "    QConnectionList *clist = receivers(\"%s(%s)\");\n",
		 (const char*)f->name, (const char*)typstr );
	fprintf( out, "    if ( !clist || signalsBlocked() )\n\treturn;\n" );
	if ( nargs ) {
	    for ( i=0; i<=nargs; i++ ) {
		fprintf( out, "    typedef void (QObject::*RT%d)(%s);\n",
			 i, (const char*)typvec[i] );
	    }
	} else {
	    fprintf( out, "    typedef void (QObject::*RT)(%s);\n",
		     (const char*)typstr);
	}
	if ( nargs ) {
	    for ( i=0; i<=nargs; i++ )
		fprintf( out, "    RT%d r%d;\n", i, i );
	} else {
	    fprintf( out, "    RT r;\n" );
	}
	fprintf( out, "    QConnectionListIt it(*clist);\n" );
	fprintf( out, "    QConnection   *c;\n" );
	fprintf( out, "    QSenderObject *object;\n" );
	fprintf( out, "    while ( (c=it.current()) ) {\n" );
	fprintf( out, "\t++it;\n" );
	fprintf( out, "\tobject = (QSenderObject*)c->object();\n" );
	fprintf( out, "\tobject->setSender( this );\n" );
	if ( nargs ) {
	    fprintf( out, "\tswitch ( c->numArgs() ) {\n" );
	    for ( i=0; i<=nargs; i++ ) {
		fprintf( out, "\t    case %d:\n", i );
		fprintf( out, "#ifdef Q_FP_CCAST_BROKEN\n" );
		fprintf( out, "\t\tr%d = reinterpret_cast<RT%d>(*(c->member()));\n", i, i );
		fprintf( out, "#else\n" );
		fprintf( out, "\t\tr%d = (RT%d)*(c->member());\n", i, i );
		fprintf( out, "#endif\n" );
		fprintf( out, "\t\t(object->*r%d)(%s);\n",
			 i, (const char*)valvec[i] );
		fprintf( out, "\t\tbreak;\n" );
	    }
	    fprintf( out, "\t}\n" );
	} else {
	    fprintf( out, "#ifdef Q_FP_CCAST_BROKEN\n" );
	    fprintf( out, "\tr = reinterpret_cast<RT>(*(c->member()));\n" );
	    fprintf( out, "#else\n" );
	    fprintf( out, "\tr = (RT)*(c->member());\n" );
	    fprintf( out, "\t(object->*r)(%s);\n", (const char*)valstr );
	    fprintf( out, "#endif\n" );
	}
	fprintf( out, "    }\n}\n" );
	f = signals.next();
    }
}

ArgList *addArg( Argument *a )			// add argument to list
{
    tmpArgList->append( a );
    return tmpArgList;
}

void addEnum()
{
    // Avoid duplicates
    for( QListIterator<Enum> lit( enums ); lit.current(); ++lit ) {
	if ( lit.current()->name == tmpEnum->name )
        {
	    if ( displayWarnings )
		moc_err( "Enum %s defined twice.", (const char*)tmpEnum->name );
	}
    }

    // Only look at stuff in Q_ENUMS and Q_SETS
    if ( qtEnums.contains( tmpEnum->name ) || qtSets.contains( tmpEnum->name ) )
    {
	enums.append( tmpEnum );
	if ( qtSets.contains( tmpEnum->name ) )
	    tmpEnum->set = TRUE;
	else
	    tmpEnum->set = FALSE;
    }
    else
	delete tmpEnum;
    tmpEnum = new Enum;
}

void addMember( Member m )
{
    if ( skipFunc ) {
	tmpFunc->args = tmpArgList; // just to be sure
  	delete tmpFunc;
	tmpArgList  = new ArgList;   // ugly but works!
	tmpFunc	    = new Function;
	skipFunc    = FALSE;
	return;
    }

    tmpFunc->access = tmpAccess;
    tmpFunc->args	= tmpArgList;
    tmpFunc->lineNo	= lineNo;

    funcs.append( tmpFunc );

    switch( m ) {
    case SignalMember:
	signals.append( tmpFunc );
	break;
    case SlotMember:
	slots.append( tmpFunc );
	// fall trough
    case PropertyCandidateMember:
	if ( !tmpFunc->name.isEmpty() && tmpFunc->access == Public )
	    propfuncs.append( tmpFunc );
    }

 Failed:
    skipFunc = FALSE;
    tmpFunc  = new Function;
    tmpArgList = new ArgList;
}

/* Used to check property names. They must match the pattern
 * [A-Za-z][A-Za-z0-9_]*
 */
void checkIdentifier( const char* ident )
{
    const char* p = ident;
    if ( p == 0 || *p == 0 )
    {
	moc_err( "A property name must not be of zero length");
	return;
    }
    if ( !( *p >= 'A' && *p <= 'Z' ) && !( *p >= 'a' && *p <= 'z' )  )
    {
	moc_err( "'%s' is not a valid property name. It must match the pattern [A-Za-z][A-Za-z0-9_]*", (char*) ident );
	return;
    }

    while( *p )
    {
    	if ( !( *p >= 'A' && *p <= 'Z' ) && !( *p >= 'a' && *p <= 'z' ) && !( *p >= '0' && *p <= '9' ) && *p != '_' )
        {
	    moc_err( "'%s' is not a valid property name. It must match the pattern [A-Za-z][A-Za-z0-9_]*", (char*) ident );
            return;
        }
	++p;
    }
}



#line 2939 "y.tab.c"
#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
int
yyparse()
{
    register int yym, yyn, yystate;
#if YYDEBUG
    register char *yys;
    extern char *getenv();

    if (yys = getenv("YYDEBUG"))
    {
        yyn = *yys;
        if (yyn >= '0' && yyn <= '9')
            yydebug = yyn - '0';
    }
#endif

    yynerrs = 0;
    yyerrflag = 0;
    yychar = (-1);

    yyssp = yyss;
    yyvsp = yyvs;
    *yyssp = yystate = 0;

yyloop:
    if (yyn = yydefred[yystate]) goto yyreduce;
    if (yychar < 0)
    {
        if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, reading %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
    }
    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: state %d, shifting to state %d\n",
                    YYPREFIX, yystate, yytable[yyn]);
#endif
        if (yyssp >= yyss + yystacksize - 1)
        {
            goto yyoverflow;
        }
        *++yyssp = yystate = yytable[yyn];
        *++yyvsp = yylval;
        yychar = (-1);
        if (yyerrflag > 0)  --yyerrflag;
        goto yyloop;
    }
    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
        yyn = yytable[yyn];
        goto yyreduce;
    }
    if (yyerrflag) goto yyinrecovery;
#ifdef lint
    goto yynewerror;
#endif
yynewerror:
    yyerror("syntax error");
#ifdef lint
    goto yyerrlab;
#endif
yyerrlab:
    ++yynerrs;
yyinrecovery:
    if (yyerrflag < 3)
    {
        yyerrflag = 3;
        for (;;)
        {
            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: state %d, error recovery shifting\
 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
#endif
                if (yyssp >= yyss + yystacksize - 1)
                {
                    goto yyoverflow;
                }
                *++yyssp = yystate = yytable[yyn];
                *++yyvsp = yylval;
                goto yyloop;
            }
            else
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: error recovery discarding state %d\n",
                            YYPREFIX, *yyssp);
#endif
                if (yyssp <= yyss) goto yyabort;
                --yyssp;
                --yyvsp;
            }
        }
    }
    else
    {
        if (yychar == 0) goto yyabort;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
        yychar = (-1);
        goto yyloop;
    }
yyreduce:
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
                YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif
    yym = yylen[yyn];
    yyval = yyvsp[1-yym];
    switch (yyn)
    {
case 10:
#line 440 "moc.y"
{ enterNameSpace(yyvsp[0].string); }
break;
case 11:
#line 441 "moc.y"
{ BEGIN IN_NAMESPACE; }
break;
case 12:
#line 443 "moc.y"
{ leaveNameSpace();
			                       selectOutsideClassState();
                                             }
break;
case 13:
#line 448 "moc.y"
{ enterNameSpace(); }
break;
case 14:
#line 449 "moc.y"
{ BEGIN IN_NAMESPACE; }
break;
case 15:
#line 451 "moc.y"
{ leaveNameSpace();
  			                       selectOutsideClassState();
			                     }
break;
case 17:
#line 460 "moc.y"
{ selectOutsideClassState(); }
break;
case 18:
#line 464 "moc.y"
{ selectOutsideClassState(); }
break;
case 19:
#line 467 "moc.y"
{ selectOutsideClassState(); }
break;
case 20:
#line 468 "moc.y"
{ selectOutsideClassState(); }
break;
case 21:
#line 471 "moc.y"
{ initClass(); }
break;
case 22:
#line 472 "moc.y"
{ generateClass();
			                        registerClassInNamespace();
						selectOutsideClassState(); }
break;
case 23:
#line 480 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 24:
#line 481 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 25:
#line 485 "moc.y"
{ yyval.string = stradd( yyvsp[-3].string, "<",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(), ">" ); }
break;
case 26:
#line 496 "moc.y"
{ initExpression();
						    templLevel = 1;
						    BEGIN IN_TEMPL_ARGS; }
break;
case 27:
#line 509 "moc.y"
{ initExpression();
						    BEGIN IN_EXPR; }
break;
case 28:
#line 513 "moc.y"
{ initExpression();
						    BEGIN IN_ENUM; }
break;
case 29:
#line 519 "moc.y"
{ yyval.string = ""; }
break;
case 30:
#line 520 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 31:
#line 521 "moc.y"
{ yyval.string = ""; }
break;
case 32:
#line 522 "moc.y"
{ skipFunc = TRUE; yyval.string = ""; }
break;
case 33:
#line 523 "moc.y"
{ skipFunc = TRUE; yyval.string = ""; }
break;
case 34:
#line 527 "moc.y"
{ yyval.string = straddSpc(yyvsp[-2].string,yyvsp[-1].string,yyvsp[0].string); }
break;
case 35:
#line 530 "moc.y"
{ yyval.string = ""; }
break;
case 36:
#line 531 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 37:
#line 534 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 38:
#line 535 "moc.y"
{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
break;
case 41:
#line 540 "moc.y"
{ skipFunc = TRUE; }
break;
case 45:
#line 548 "moc.y"
{ yyval.string = "const"; }
break;
case 46:
#line 549 "moc.y"
{ yyval.string = "volatile"; }
break;
case 47:
#line 552 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 48:
#line 553 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 49:
#line 554 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 50:
#line 558 "moc.y"
{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
break;
case 51:
#line 559 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 52:
#line 561 "moc.y"
{ yyval.string = "char"; }
break;
case 53:
#line 562 "moc.y"
{ yyval.string = "short"; }
break;
case 54:
#line 563 "moc.y"
{ yyval.string = "int"; }
break;
case 55:
#line 564 "moc.y"
{ yyval.string = "long"; }
break;
case 56:
#line 565 "moc.y"
{ yyval.string = "signed"; }
break;
case 57:
#line 566 "moc.y"
{ yyval.string = "unsigned"; }
break;
case 58:
#line 567 "moc.y"
{ yyval.string = "float"; }
break;
case 59:
#line 568 "moc.y"
{ yyval.string = "double"; }
break;
case 60:
#line 569 "moc.y"
{ yyval.string = "void"; }
break;
case 61:
#line 573 "moc.y"
{ yyval.string = stradd( "template<",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(), ">" ); }
break;
case 63:
#line 579 "moc.y"
{ templateClassOld = templateClass;
						  templateClass = TRUE;
						}
break;
case 64:
#line 585 "moc.y"
{ yyval.string = "class"; }
break;
case 65:
#line 586 "moc.y"
{ yyval.string = "struct"; }
break;
case 66:
#line 589 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 67:
#line 591 "moc.y"
{ yyval.string = stradd( "::", yyvsp[0].string ); }
break;
case 68:
#line 595 "moc.y"
{ yyval.string = stradd( yyvsp[-2].string, "::", yyvsp[0].string );}
break;
case 69:
#line 596 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 70:
#line 600 "moc.y"
{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
break;
case 71:
#line 601 "moc.y"
{ yyval.string = stradd("enum ",yyvsp[0].string); }
break;
case 72:
#line 602 "moc.y"
{ yyval.string = stradd("union ",yyvsp[0].string); }
break;
case 73:
#line 607 "moc.y"
{ yyval.arg_list = yyvsp[-1].arg_list;}
break;
case 74:
#line 608 "moc.y"
{ yyval.arg_list = yyvsp[-2].arg_list;
				       func_warn("Ellipsis not supported"
						 " in signals and slots.\n"
						 "Ellipsis argument ignored."); }
break;
case 75:
#line 614 "moc.y"
{ yyval.arg_list = tmpArgList; }
break;
case 76:
#line 615 "moc.y"
{ yyval.arg_list = yyvsp[0].arg_list; }
break;
case 78:
#line 619 "moc.y"
{ func_warn("Ellipsis not supported"
						 " in signals and slots.\n"
						 "Ellipsis argument ignored."); }
break;
case 79:
#line 627 "moc.y"
{ yyval.arg_list = addArg(yyvsp[0].arg); }
break;
case 80:
#line 628 "moc.y"
{ yyval.arg_list = addArg(yyvsp[0].arg); }
break;
case 81:
#line 631 "moc.y"
{ yyval.arg = new Argument(straddSpc(yyvsp[-1].string,yyvsp[0].string),""); }
break;
case 82:
#line 633 "moc.y"
{ expLevel = 1; }
break;
case 83:
#line 635 "moc.y"
{ yyval.arg = new Argument(straddSpc(yyvsp[-4].string,yyvsp[-3].string),""); }
break;
case 84:
#line 638 "moc.y"
{ yyval.arg = new Argument(straddSpc(yyvsp[-3].string,yyvsp[-2].string),yyvsp[0].string); }
break;
case 85:
#line 641 "moc.y"
{ expLevel = 1; }
break;
case 86:
#line 643 "moc.y"
{ yyval.arg = new Argument(straddSpc(yyvsp[-6].string,yyvsp[-5].string),yyvsp[-3].string); }
break;
case 87:
#line 647 "moc.y"
{ yyval.string = ""; }
break;
case 88:
#line 648 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 89:
#line 652 "moc.y"
{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
break;
case 90:
#line 653 "moc.y"
{ expLevel = 1; }
break;
case 91:
#line 655 "moc.y"
{ yyval.string = stradd( "[",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(), "]" ); }
break;
case 92:
#line 658 "moc.y"
{ expLevel = 1; }
break;
case 93:
#line 660 "moc.y"
{ yyval.string = stradd( yyvsp[-4].string,"[",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(),"]" ); }
break;
case 94:
#line 663 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 95:
#line 664 "moc.y"
{ yyval.string = yyvsp[-1].string; }
break;
case 96:
#line 667 "moc.y"
{ yyval.string = ""; }
break;
case 97:
#line 669 "moc.y"
{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string);}
break;
case 98:
#line 670 "moc.y"
{ expLevel = 1; }
break;
case 99:
#line 672 "moc.y"
{ yyval.string = stradd( yyvsp[-4].string,"[",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(),"]" ); }
break;
case 100:
#line 675 "moc.y"
{ yyval.string = yyvsp[-1].string; }
break;
case 102:
#line 687 "moc.y"
{ tmpFunc->args	     = yyvsp[-4].arg_list;
						  tmpFunc->qualifier = yyvsp[-2].string; }
break;
case 104:
#line 693 "moc.y"
{ func_warn("Variable as signal or slot."); }
break;
case 105:
#line 694 "moc.y"
{ expLevel=0; }
break;
case 106:
#line 696 "moc.y"
{ skipFunc = TRUE; }
break;
case 107:
#line 697 "moc.y"
{ expLevel=0; }
break;
case 108:
#line 699 "moc.y"
{ skipFunc = TRUE; }
break;
case 109:
#line 703 "moc.y"
{ expLevel = 1; }
break;
case 111:
#line 705 "moc.y"
{ expLevel = 1; }
break;
case 113:
#line 710 "moc.y"
{ yyval.string = ""; }
break;
case 114:
#line 711 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 115:
#line 714 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 116:
#line 715 "moc.y"
{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string);}
break;
case 117:
#line 718 "moc.y"
{ yyval.string = straddSpc("*",yyvsp[0].string);}
break;
case 118:
#line 719 "moc.y"
{ yyval.string = stradd("&",yyvsp[0].string);}
break;
case 119:
#line 726 "moc.y"
{ yyval.string = ""; }
break;
case 120:
#line 727 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 121:
#line 730 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 122:
#line 732 "moc.y"
{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
break;
case 123:
#line 735 "moc.y"
{ yyval.string = "const"; }
break;
case 124:
#line 736 "moc.y"
{ yyval.string = "volatile"; }
break;
case 128:
#line 744 "moc.y"
{ BEGIN IN_FCT; fctLevel = 1;}
break;
case 129:
#line 745 "moc.y"
{ BEGIN QT_DEF; }
break;
case 130:
#line 752 "moc.y"
{ BEGIN IN_CLASS;
                                                  classPLevel = 1;
						}
break;
case 131:
#line 756 "moc.y"
{ BEGIN QT_DEF; }
break;
case 132:
#line 757 "moc.y"
{ BEGIN QT_DEF;	  /* -- " -- */
						  skipClass = TRUE; }
break;
case 133:
#line 761 "moc.y"
{ BEGIN QT_DEF; /* catch ';' */
						  skipClass = TRUE; }
break;
case 134:
#line 763 "moc.y"
{ skipClass = TRUE;
						  BEGIN GIMME_SEMICOLON; }
break;
case 140:
#line 776 "moc.y"
{ className = yyvsp[0].string; }
break;
case 141:
#line 779 "moc.y"
{ className = yyvsp[0].string; }
break;
case 142:
#line 783 "moc.y"
{ superclassName = yyvsp[0].string; }
break;
case 143:
#line 788 "moc.y"
{ templateClass = templateClassOld; }
break;
case 149:
#line 802 "moc.y"
{ expLevel = 1; }
break;
case 151:
#line 807 "moc.y"
{ yyval.string = 0; }
break;
case 152:
#line 808 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 157:
#line 820 "moc.y"
{ tmpAccess = yyvsp[0].access; }
break;
case 158:
#line 821 "moc.y"
{ moc_err( "Missing access specifier"
						   " before \"slots:\"." ); }
break;
case 159:
#line 825 "moc.y"
{ BEGIN QT_DEF; }
break;
case 161:
#line 827 "moc.y"
{ BEGIN QT_DEF; }
break;
case 163:
#line 829 "moc.y"
{
			      if ( tmpAccess )
				  moc_warn("Q_OBJECT is not in the private"
					   " section of the class.\n"
					   "Q_OBJECT is a macro that resets"
					   " access permission to \"private\".");
			      Q_OBJECTdetected = TRUE;
			  }
break;
case 164:
#line 837 "moc.y"
{ tmpYYStart = YY_START;
				       tmpPropOverride = FALSE;
				       BEGIN IN_PROPERTY; }
break;
case 165:
#line 840 "moc.y"
{
						BEGIN tmpYYStart;
				   	   }
break;
case 167:
#line 844 "moc.y"
{ tmpYYStart = YY_START;
				       tmpPropOverride = TRUE;
				       BEGIN IN_PROPERTY; }
break;
case 168:
#line 847 "moc.y"
{
						BEGIN tmpYYStart;
				   	   }
break;
case 170:
#line 851 "moc.y"
{ tmpYYStart = YY_START; BEGIN IN_CLASSINFO; }
break;
case 171:
#line 853 "moc.y"
{
				      infos.append( new ClassInfo( yyvsp[-3].string, yyvsp[-1].string ) );
				      BEGIN tmpYYStart;
				  }
break;
case 173:
#line 858 "moc.y"
{ tmpYYStart = YY_START; BEGIN IN_PROPERTY; }
break;
case 174:
#line 859 "moc.y"
{
			  			Q_PROPERTYdetected = TRUE;
						BEGIN tmpYYStart;
				   	   }
break;
case 176:
#line 864 "moc.y"
{ tmpYYStart = YY_START; BEGIN IN_PROPERTY; }
break;
case 177:
#line 865 "moc.y"
{
			  			Q_PROPERTYdetected = TRUE;
						BEGIN tmpYYStart;
				   	   }
break;
case 179:
#line 872 "moc.y"
{ moc_err( "Signals cannot "
						 "have access specifiers" ); }
break;
case 181:
#line 875 "moc.y"
{ if ( tmpAccess == Public && Q_PROPERTYdetected )
                                                  BEGIN QT_DEF;
                                              else
                                                  BEGIN IN_CLASS;
					  suppress_func_warn = TRUE;
                                        }
break;
case 182:
#line 882 "moc.y"
{
					  suppress_func_warn = FALSE;
					}
break;
case 183:
#line 885 "moc.y"
{ BEGIN IN_CLASS;
					   if ( classPLevel != 1 )
					       moc_warn( "unexpected access"
							 "specifier" );
					}
break;
case 188:
#line 900 "moc.y"
{ addMember( PropertyCandidateMember ); }
break;
case 193:
#line 912 "moc.y"
{ addMember( SignalMember ); }
break;
case 198:
#line 923 "moc.y"
{ addMember( SlotMember ); }
break;
case 201:
#line 930 "moc.y"
{ yyval.string=yyvsp[0].string; }
break;
case 204:
#line 938 "moc.y"
{ yyval.string = stradd( yyvsp[-3].string, "(", yyvsp[-1].string, ")" ); }
break;
case 205:
#line 940 "moc.y"
{ yyval.string = stradd( yyvsp[-3].string, "(", yyvsp[-1].string, ")" ); }
break;
case 206:
#line 943 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 207:
#line 944 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 208:
#line 945 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 209:
#line 946 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 210:
#line 947 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 211:
#line 948 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 212:
#line 949 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 213:
#line 950 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 214:
#line 951 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 215:
#line 952 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 216:
#line 955 "moc.y"
{ yyval.access=Private; }
break;
case 217:
#line 956 "moc.y"
{ yyval.access=Protected; }
break;
case 218:
#line 957 "moc.y"
{ yyval.access=Public; }
break;
case 262:
#line 1009 "moc.y"
{ tmpFunc->type = yyvsp[-1].string;
						  tmpFunc->name = yyvsp[0].string; }
break;
case 263:
#line 1012 "moc.y"
{ tmpFunc->type = "int";
						  tmpFunc->name = yyvsp[0].string;
				  if ( tmpFunc->name == className )
				      func_warn( "Constructors cannot be"
						 " signals or slots.");
						}
break;
case 264:
#line 1019 "moc.y"
{ tmpFunc->type = "void";
						  tmpFunc->name = "~";
						  tmpFunc->name += yyvsp[0].string;
				       func_warn( "Destructors cannot be"
						  " signals or slots.");
						}
break;
case 265:
#line 1027 "moc.y"
{
						    char *tmp =
							straddSpc(yyvsp[-4].string,yyvsp[-3].string,yyvsp[-2].string,yyvsp[-1].string);
						    tmpFunc->type = rmWS(tmp);
						    delete tmp;
						    tmpFunc->name = yyvsp[0].string; }
break;
case 266:
#line 1034 "moc.y"
{ skipFunc = TRUE; }
break;
case 267:
#line 1036 "moc.y"
{ tmpFunc->type =
						      straddSpc(yyvsp[-2].string,yyvsp[-1].string);
						  tmpFunc->name = yyvsp[0].string; }
break;
case 268:
#line 1041 "moc.y"
{ tmpFunc->type =
						      straddSpc(yyvsp[-3].string,yyvsp[-2].string,yyvsp[-1].string);
						  tmpFunc->name = yyvsp[0].string; }
break;
case 269:
#line 1045 "moc.y"
{ operatorError();    }
break;
case 270:
#line 1047 "moc.y"
{ operatorError();    }
break;
case 271:
#line 1050 "moc.y"
{ operatorError();    }
break;
case 272:
#line 1052 "moc.y"
{ operatorError();    }
break;
case 273:
#line 1055 "moc.y"
{ operatorError();    }
break;
case 275:
#line 1061 "moc.y"
{ func_warn("Variable as signal or slot."); }
break;
case 276:
#line 1064 "moc.y"
{ func_warn("Variable as signal or slot."); }
break;
case 277:
#line 1066 "moc.y"
{ func_warn("Enum declaration as signal or"
					    " slot."); }
break;
case 278:
#line 1069 "moc.y"
{ func_warn("Using declaration as signal or"
					    " slot."); }
break;
case 279:
#line 1072 "moc.y"
{ func_warn("Using declaration as signal or"
					    " slot."); }
break;
case 280:
#line 1075 "moc.y"
{ classPLevel++;
				  moc_err("Namespace declaration as signal or"
					  " slot."); }
break;
case 281:
#line 1079 "moc.y"
{ func_warn("Class declaration as signal or slot.");}
break;
case 282:
#line 1081 "moc.y"
{ func_warn("Class declaration as signal or slot.");
				  BEGIN IN_FCT; fctLevel=1;
				}
break;
case 283:
#line 1084 "moc.y"
{ BEGIN QT_DEF; }
break;
case 288:
#line 1094 "moc.y"
{ expLevel = 0; }
break;
case 290:
#line 1096 "moc.y"
{ expLevel = 0; }
break;
case 293:
#line 1101 "moc.y"
{ expLevel = 0; }
break;
case 298:
#line 1116 "moc.y"
{ BEGIN QT_DEF;
				  if ( tmpAccess == Public) {
				      tmpEnum->name = yyvsp[-4].string;
				      addEnum();
				  }
				}
break;
case 299:
#line 1123 "moc.y"
{ tmpEnum->clear();}
break;
case 305:
#line 1135 "moc.y"
{ if ( tmpAccess == Public) tmpEnum->append( yyvsp[0].string ); }
break;
case 306:
#line 1136 "moc.y"
{ expLevel=0; }
break;
case 307:
#line 1137 "moc.y"
{  if ( tmpAccess == Public) tmpEnum->append( yyvsp[-3].string );  }
break;
case 308:
#line 1141 "moc.y"
{
				     propWrite = "";
				     propRead = "";
				     if ( tmpPropOverride )
				         propStored = "";
				     else
					 propStored = "true";
				     propReset = "";
				     propOverride = tmpPropOverride;
				     if ( tmpPropOverride )
				         propDesignable = -1;
				     else
				         propDesignable = 1;
				}
break;
case 309:
#line 1156 "moc.y"
{
				    if ( propRead.isEmpty() && !propOverride)
					moc_err( "A property must at least feature a read method." );
				    checkIdentifier( yyvsp[-2].string );
				    Q_PROPERTYdetected = TRUE;
				    /* Avoid duplicates*/
				    for( QListIterator<Property> lit( props ); lit.current(); ++lit ) {
					if ( lit.current()->name == yyvsp[-2].string ) {
					    if ( displayWarnings )
						moc_err( "Property '%s' defined twice.",
							 (const char*)lit.current()->name );
					}
				    }
				    props.append( new Property( lineNo, yyvsp[-3].string, yyvsp[-2].string,
								propWrite, propRead, propReset, propStored,
								propDesignable, propOverride ) );
				}
break;
case 311:
#line 1176 "moc.y"
{ propRead = yyvsp[-1].string; }
break;
case 312:
#line 1177 "moc.y"
{ propWrite = yyvsp[-1].string; }
break;
case 313:
#line 1178 "moc.y"
{ propReset = yyvsp[-1].string; }
break;
case 314:
#line 1179 "moc.y"
{ propStored = yyvsp[-1].string; }
break;
case 315:
#line 1181 "moc.y"
{
					if ( qstrcmp( yyvsp[0].string, "true" ) == 0 )
						propDesignable = 1;
					else if ( qstrcmp( yyvsp[0].string, "false" ) == 0 )
						propDesignable = 0;
					else
						moc_err( "DESIGNABLE may only be followed by 'true' or 'false'" );
				}
break;
case 317:
#line 1192 "moc.y"
{ }
break;
case 318:
#line 1193 "moc.y"
{ qtEnums.append( yyvsp[-1].string ); }
break;
case 319:
#line 1196 "moc.y"
{ }
break;
case 320:
#line 1197 "moc.y"
{ qtSets.append( yyvsp[-1].string ); }
break;
#line 3998 "y.tab.c"
    }
    yyssp -= yym;
    yystate = *yyssp;
    yyvsp -= yym;
    yym = yylhs[yyn];
    if (yystate == 0 && yym == 0)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: after reduction, shifting from state 0 to\
 state %d\n", YYPREFIX, YYFINAL);
#endif
        yystate = YYFINAL;
        *++yyssp = YYFINAL;
        *++yyvsp = yyval;
        if (yychar < 0)
        {
            if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
            if (yydebug)
            {
                yys = 0;
                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
                if (!yys) yys = "illegal-symbol";
                printf("%sdebug: state %d, reading %d (%s)\n",
                        YYPREFIX, YYFINAL, yychar, yys);
            }
#endif
        }
        if (yychar == 0) goto yyaccept;
        goto yyloop;
    }
    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
        yystate = yytable[yyn];
    else
        yystate = yydgoto[yym];
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: after reduction, shifting from state %d \
to state %d\n", YYPREFIX, *yyssp, yystate);
#endif
    if (yyssp >= yyss + yystacksize - 1)
    {
        goto yyoverflow;
    }
    *++yyssp = yystate;
    *++yyvsp = yyval;
    goto yyloop;
yyoverflow:
    yyerror("yacc stack overflow");
yyabort:
    return (1);
yyaccept:
    return (0);
}
