#ifndef lint

#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 31 "moc.y"
void yyerror( char *msg );

#include "qlist.h"
#include "qstring.h"
#include "qdatetm.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>

RCSTAG("$Id: moc.y,v 2.0 1996/09/24 10:16:07 agulbra Exp $");

QString rmWS( const char * );

enum AccessPerm { _PRIVATE, _PROTECTED, _PUBLIC };


struct Argument					/* single arg meta data*/
{
    Argument( char *left, char *right )
	{ leftType  = rmWS( left );
	  rightType = rmWS( right ); }
    QString leftType;
    QString rightType;
};

declare(QListM,Argument);

class ArgList : public QListM(Argument) {	/* member function arg list*/
public:
    ArgList() { setAutoDelete(TRUE); }
};


struct Function					/* member function meta data*/
{						/*   used for signals and slots*/
    AccessPerm accessPerm;
    QString    qualifier;			/* const or volatile*/
    QString    name;
    QString    type;
    int	       lineNo;
    ArgList   *args;
    Function() { args=0; }
   ~Function() { delete args; }
};

declare(QListM,Function);

class FuncList : public QListM(Function) {	/* list of member functions*/
public:
    FuncList() { setAutoDelete(TRUE); }
};


ArgList *addArg( Argument * );			/* add arg to tmpArgList*/
void	 addMember( char );			/* add tmpFunc 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 * );

extern int yydebug;
bool	   lexDebug	   = FALSE;
bool	   grammarDebug	   = 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*/

ArgList	  *tmpArgList;				/* current argument list*/
Function  *tmpFunc;				/* current member function*/
AccessPerm tmpAccessPerm;			/* current access permission*/
AccessPerm subClassPerm;			/* current access permission*/
bool	   Q_OBJECTdetected;			/* TRUE if current class*/
						/* contains the Q_OBJECT macro*/
QString	   tmpExpression;

#line 113 "moc.y"
typedef union {
    char	char_val;
    int		int_val;
    double	double_val;
    char       *string;
    AccessPerm	access;
    Function   *function;
    ArgList    *arg_list;
    Argument   *arg;
} YYSTYPE;
#line 103 "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 SIGNALS 293
#define SLOTS 294
#define Q_OBJECT 295
#define YYERRCODE 256
short yylhs[] = {                                        -1,
    0,    0,   38,   36,    1,    1,    2,   39,   40,   28,
   28,   28,   28,   28,   27,   29,   29,   30,   30,   41,
   41,   41,   41,   42,   42,   31,   31,   11,   11,   11,
   12,   12,   13,   13,   13,   13,   13,   13,   13,   13,
   13,    3,   43,   43,   14,   14,   15,   15,   16,   16,
   17,   17,   17,   18,   18,   20,   20,   44,   44,   19,
   19,   23,   45,   23,   23,   47,   23,   21,   21,   22,
   48,   22,   49,   22,   22,   22,   32,   32,   50,   32,
   32,   46,   51,   10,   10,   54,   10,   55,   10,   56,
   53,   57,   53,   35,   35,   34,   34,   33,   33,   24,
   24,   25,   25,   26,   26,   52,   52,   52,   59,   58,
   62,   37,   37,   37,   37,   63,   63,   63,   63,   63,
   64,   60,    4,    4,   61,   61,   65,   65,   67,   67,
   69,   66,   70,   66,   66,   68,   68,   73,   68,   71,
   71,   74,   74,   75,   72,   72,   77,   77,   78,   79,
   79,    5,    6,    6,    7,    7,    8,    8,    8,    8,
    8,    8,    8,    8,    8,    8,    9,    9,    9,   80,
   80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
   80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
   80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
   80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
   81,   81,   82,   82,   82,   82,   82,   82,   82,   82,
   82,   82,   82,   82,   76,   76,   76,   76,   84,   84,
   86,   87,   86,   88,   86,   83,   89,   83,   91,   85,
   90,   90,
};
short yylen[] = {                                         2,
    0,    2,    0,    3,    1,    1,    4,    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,    5,    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,    2,    5,    2,    1,    1,    1,    1,    1,
    0,    4,    0,    1,    0,    1,    2,    1,    1,    1,
    0,    3,    0,    4,    1,    2,    3,    0,    3,    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,    3,    1,    3,
    1,    0,    4,    0,    3,    0,    0,    3,    0,    5,
    0,    1,
};
short yydefred[] = {                                      1,
    3,    2,    0,    0,    0,    0,    0,    0,    0,    8,
  116,   20,   21,   22,   23,   24,   25,   26,   27,   33,
   34,   35,   36,   37,   38,   39,   40,   41,  117,  118,
  119,  120,  115,    0,    0,    6,    4,   45,   46,  111,
    0,    8,    0,    0,    0,   42,    0,    0,    0,  122,
  124,  167,  168,  169,  133,  130,  135,  129,    0,    0,
  128,  131,    7,  114,    0,    0,    0,   50,    0,  162,
  154,    0,  157,    0,    0,  112,  127,    0,    0,  164,
    0,  159,    0,    0,    0,  166,  161,    0,    0,    0,
    0,  138,  132,    0,    0,  163,  158,  153,  165,  160,
   49,    0,   13,   14,    0,    0,    0,    0,   44,  214,
    0,    0,   32,    0,   29,   28,   18,    0,   11,   10,
   12,  134,    0,  143,  144,    0,    0,    0,  136,    0,
    0,  155,  156,   86,   90,    0,    0,    0,   53,    0,
    0,  206,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,  221,    0,    0,
    0,    0,  213,    0,   96,    0,   31,   51,    0,    0,
   19,  142,    0,    0,  237,  150,    0,  150,  137,  149,
    0,  148,  139,    9,    9,   88,   92,  239,    0,  196,
    0,  197,  195,  210,  209,  187,  191,  202,  185,  204,
    0,  186,  205,  188,  189,  190,  192,  203,  193,  194,
    0,    0,  220,  104,  105,   98,    0,  102,   99,    0,
    0,    0,  218,   97,   52,    0,  215,    0,    0,    0,
   61,    0,    0,    9,    0,  150,    0,    0,  147,   87,
    0,    9,    9,    0,  200,  201,  207,  170,  171,  103,
    0,  219,  223,    0,    0,    0,   59,   54,   71,    0,
    0,    0,   75,    0,  238,  151,    0,    0,    0,  234,
    0,   77,    0,  229,   91,   89,    0,  240,  224,    0,
  216,    0,   55,   60,    9,    0,   82,   63,    0,   73,
   70,   15,  232,    0,    9,   79,   78,  150,    0,   93,
  222,  106,    0,  109,   83,  107,    0,   76,    9,    0,
    9,    9,   81,  235,    9,    0,  230,    0,    0,   72,
   64,   66,    0,  233,    0,  108,  110,    9,   74,   80,
   67,
};
short yydgoto[] = {                                       1,
   68,   36,  109,   50,   51,   69,   70,   71,   58,  110,
  111,  112,  113,  114,  115,   74,  116,  228,  229,  230,
  261,  262,  231,  216,  217,  218,  232,  117,  156,  157,
  119,  271,  165,  220,  221,    2,    7,    3,   41,  240,
  120,  121,    8,  258,  309,  272,  328,  285,  311,  315,
  176,  305,  136,  184,  242,  185,  243,  306,  319,    9,
   59,   45,   33,   44,   60,   61,   62,   93,   78,   75,
  122,  179,  131,  123,  124,  180,  181,  182,  235,  158,
  126,  127,  177,  273,  128,  274,  312,  295,  234,  138,
  244,
};
short yysindex[] = {                                      0,
    0,    0, -279,  -45,  710,  -91,  100, -262,   20,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  159,  190,    0,    0,    0,    0,    0,
  226,    0,   30,  235,  211,    0,  233,  256,  534,    0,
    0,    0,    0,    0,    0,    0,    0,    0,  199,  211,
    0,    0,    0,    0,  114,  113,  -91,    0,  284,    0,
    0,  -69,    0,   42,  275,    0,    0,  -46,  730,    0,
  -74,    0,   42,  534,  -74,    0,    0,  -91,  627,  278,
  299,    0,    0,  325,  330,    0,    0,    0,    0,    0,
    0,   90,    0,    0,    0,  112,  117,  419,    0,    0,
  180,  824,    0,  129,    0,    0,    0,  659,    0,    0,
    0,    0,  627,    0,    0,  269,  154,  343,    0,  627,
  627,    0,    0,    0,    0,  -17,    0,  281,    0,  223,
  165,    0,  363,  332,  385,  392,    8,  309,  110,  393,
  394,  399,   79,  404,  409,  739,  819,    0,  102,  419,
  122,  122,    0,  252,    0,   21,    0,    0,  213,  819,
    0,    0,  215,  819,    0,    0,   14,    0,    0,    0,
  627,    0,    0,    0,    0,    0,    0,    0,  411,    0,
  417,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  442,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  182,  182,    0,    0,    0,    0,  122,    0,    0,  182,
 -194,  419,    0,    0,    0,  182,    0,  444,  452,  209,
    0,  164,  535,    0,  448,    0,  -30,  448,    0,    0,
  408,    0,    0,  383,    0,    0,    0,    0,    0,    0,
  419,    0,    0,  -75,  122,  466,    0,    0,    0,  164,
  -60,   22,    0,  819,    0,    0,  448,  451,  -32,    0,
   51,    0,  166,    0,    0,    0,  418,    0,    0,  419,
    0,  -37,    0,    0,    0,  142,    0,    0,  164,    0,
    0,    0,    0,  305,    0,    0,    0,    0,  -30,    0,
    0,    0,  254,    0,    0,    0,  438,    0,    0,  465,
    0,    0,    0,    0,    0,  448,    0,  473,  414,    0,
    0,    0,  447,    0,  454,    0,    0,    0,    0,    0,
    0,
};
short yyrindex[] = {                                      0,
    0,    0,   78,    0,  123,    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,   -4,  -40,    0,    0,    0,    0,    0,
    0,    0,    0,  421,  416,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,  423,
    0,    0,    0,    0,   66,    0,    0,    0,  426,    0,
    0,    0,    0,    7,    0,    0,    0,    0,    0,    0,
    0,    0,   38,    0,    0,    0,    0,    0,  200,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,  118,    0,    0,  507,  427,    0,  759,    0,    0,
    0,   50,    0,    0,    0,    0,    0,   78,    0,    0,
    0,    0,  242,    0,    0,    0,  173,    0,    0,  468,
  468,    0,    0,    0,    0,  290,  169,    0,    0,  318,
  431,    0,  433,    0,    0,  494,  701,  793,  805,  818,
  825,  982,  984, 1004, 1006,    0,  -38,    0, 1009,  759,
   74,   74,    0,   61,    0,    0,    0,    0,    0,  -33,
    0,    0,    0,  137,    0,    0,    0,    0,    0,    0,
  548,    0,    0,    0,    0,    0,    0,    0, 1011,    0,
 1014,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 1016,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 1036, 1036,    0,    0,    0,    0,   62,    0,    0,  108,
    0,  759,    0,    0,    0,   61,    0,    0,  -10,  510,
    0,  -11,   78,    0,  297,    0,    0,  342,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  759,    0,    0,    0,  -18,  680,    0,    0,    0,    0,
  -12,  103,    0,   84,    0,    0,  377,  300,    0,    0,
  296,    0,    0,    0,    0,    0,    0,    0,    0,  759,
    0,    0,    0,    0,    0,    0,    0,    0,   40,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,   -2,
    0,    0,    0,    0,    0,  430,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,
};
short yygindex[] = {                                      0,
   29,    0,  551,    0,    0,    0,  461,  498,  288,  -39,
 -102,    0,   57,  554,  124,  521,    0,    0,    0,    0,
  306,  336,  341, -148,    0,  381,    0,   31, -118,   68,
  594,  331,  586,  490, -141,    0,    0,    0,  560,  559,
  622,  657,    0,    0,    0,  407,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,  615,    0,    0,    0,    0,
    0,  545,    0,    0,  555,  -62,    0,  496, -161,  -83,
    0,    0,    0,    0,    0,  380,    0,    0,    0,    0,
    0,
};
#define YYTABLESIZE 1104
short yytable[] = {                                      17,
  288,   17,   17,   17,   16,   17,  217,  269,   16,  269,
  217,   92,    4,  219,   10,  170,  238,  121,  113,   38,
   39,  302,   17,  303,  217,  217,  125,  270,   62,   68,
   57,   62,   68,    5,   35,    5,    5,    5,   65,    5,
  100,   65,  100,  186,   47,  198,   47,   47,   47,   68,
   47,  226,   17,    5,    5,  233,    5,  237,  162,  162,
  125,   29,  161,  161,   47,   47,  159,   47,  197,  248,
  249,  163,  236,  187,  267,   48,  213,   48,   48,   48,
   68,   48,  121,   68,  254,  304,    5,   30,  162,   30,
   30,   30,  161,   30,  251,   48,   48,   47,   48,  101,
   68,  101,  101,  101,  100,  101,  282,   30,   30,    5,
   30,  100,  290,  100,  100,  100,  101,  100,    5,  101,
  101,   16,  101,   16,   16,   16,  223,   16,   48,   47,
  264,  100,  100,  227,  100,   95,  316,  233,  253,  207,
   30,  296,   40,   69,   16,  292,   69,   95,  171,   42,
  134,   95,  101,   79,  203,    5,  118,   84,   37,    5,
   48,   84,  134,   69,  100,   95,   95,  279,  167,   34,
  202,  201,   73,   42,   16,   84,   84,   56,  164,  162,
  135,  252,  308,  161,  101,  159,   65,  171,    5,   82,
  118,   65,  135,  174,  171,   87,  301,  118,  118,   85,
  287,  162,  208,  260,   97,  161,   52,   73,  100,  299,
   52,  175,  212,  280,  281,   67,  236,  162,   42,  162,
   67,  161,   17,  161,  298,  192,  191,   16,  287,   43,
  268,  236,  290,   17,   17,   17,   17,   17,   17,   17,
   17,   17,   17,   17,   17,   17,   90,   91,  118,   68,
   17,   17,   17,   17,  259,   16,    5,    5,    5,    5,
    5,    5,    5,    5,    5,    5,    5,   47,   47,   47,
   47,   47,   47,   47,   47,   47,   47,   47,   62,   68,
   57,  159,  189,  190,    5,    5,    5,   46,   65,  162,
   48,  242,   49,  161,   63,   47,   64,   47,   48,   48,
   48,   48,   48,   48,   48,   48,   48,   48,   48,  222,
   30,   30,   30,   30,   30,   30,   30,   30,   30,   30,
   30,   94,  101,   76,  140,  211,   48,   84,   48,   85,
   68,   88,   89,   85,  100,  129,   72,   82,   30,  231,
   30,   82,  162,   82,   16,  313,  161,   85,   85,   94,
  101,  200,  101,   81,  231,    5,  130,  183,   82,   43,
   43,  183,  100,   69,  100,  132,  141,  211,   95,  199,
  133,   72,  137,   65,   16,  183,  183,  139,    5,    5,
    5,    5,    5,    5,    5,    5,    5,    5,    5,  168,
   82,  214,  215,   69,  173,  296,   95,   16,   52,   53,
   54,  178,   67,  188,   44,   44,    5,    5,   16,   16,
   16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
   16,  225,  225,  193,  194,  195,   16,   56,   16,   52,
   52,   52,   52,   52,   52,   52,   52,   52,   52,   52,
  159,  103,  104,   12,   13,   14,   15,   16,   17,   18,
   19,  155,  196,  204,  205,  151,  147,   52,  145,  206,
  146,  148,  142,  149,  209,  150,  228,  228,  160,  210,
  184,  245,  182,  225,  184,  159,  182,  246,  140,  143,
  141,   43,   43,  247,  255,  140,  140,  140,  184,  184,
  182,  182,  140,  140,  140,  256,   52,   53,   54,  257,
  275,  226,  226,   55,   56,   57,  266,  278,  293,  144,
  300,  318,  152,  103,  104,   12,   13,   14,   15,   16,
   17,   18,   19,   43,   43,  322,   80,  141,  141,  141,
  320,  326,   86,  174,  141,  141,  141,  174,  327,  329,
  125,   96,  153,  123,  154,   99,  330,  126,  152,  241,
   58,  174,  174,    5,  227,  227,    6,  225,  225,  225,
  225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
  225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
  225,   98,  225,  225,  225,  225,  225,   83,  225,  225,
  225,  225,  145,  211,  310,  286,  284,  250,   30,  294,
  166,   47,  228,  228,  228,  228,  228,  228,  228,  228,
  228,  228,  228,  228,  228,  228,  228,  228,  228,  228,
  228,  228,  228,  228,  228,  228,   31,  228,  228,  228,
  228,  228,  212,  228,  228,  228,  228,  226,  226,  226,
  226,  226,  226,  226,  226,  226,  226,  226,  226,  226,
  226,  226,  226,  226,  226,  226,  226,  226,  226,  226,
  226,   32,  226,  226,  226,  226,  226,  289,  226,  226,
  226,  226,  146,  211,   77,  183,  239,  172,  317,    0,
  103,  104,   12,   13,   14,   15,   16,   17,   18,   19,
  227,  227,  227,  227,  227,  227,  227,  227,  227,  227,
  227,  227,  227,  227,  227,  227,  227,  227,  227,  227,
  227,  227,  227,  227,    0,  227,  227,  227,  227,  227,
    0,  227,  227,  227,  227,    0,    0,  103,  104,   12,
   13,   14,   15,   16,   17,   18,   19,    0,    0,    0,
  178,    0,    0,  241,  178,    0,    0,    0,    0,   43,
   43,  224,    0,  145,  145,  145,  283,    0,  178,  178,
  145,  145,  145,    0,    0,    0,    0,   25,   25,   25,
   25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
   25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
   25,    0,  265,    0,   65,   34,   25,    0,   25,    0,
  276,  277,   66,    0,    0,  224,   20,   21,   22,   23,
   24,   25,   26,   27,   28,  169,    0,  263,  107,   52,
   53,   54,    0,   67,   67,    0,    4,    0,    0,   43,
   43,    0,  172,  146,  146,  146,  172,    0,    0,    0,
  146,  146,  146,  307,  173,  263,    0,  291,  173,    0,
  172,  172,    0,  314,    0,    0,  297,  175,    0,    0,
    0,  175,  173,  173,  176,    0,    0,  321,  176,  323,
  324,  291,    0,  325,  263,  175,  175,    0,    0,  297,
    0,    0,  176,  176,    0,    0,  331,  102,  103,  104,
   12,   13,   14,   15,   16,  105,   18,   19,   20,   21,
   22,   23,   24,   25,   26,   27,   28,  106,    0,    0,
  107,    0,    0,    0,    0,  108,   67,    0,    4,   34,
  103,  104,   12,   13,   14,   15,   16,   17,   18,   19,
   20,   21,   22,   23,   24,   25,   26,   27,   28,  169,
   16,    0,  107,    0,    0,    0,    0,    0,   67,    0,
    4,   16,   16,   16,   16,   16,   16,   16,   16,   16,
   16,   16,   16,   16,    0,    0,    0,    0,    0,   16,
   11,   16,    0,   12,   13,   14,   15,   16,   17,   18,
   19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
   94,    0,    0,    0,    0,    0,    0,    0,    0,  211,
    0,   20,   21,   22,   23,   24,   25,   26,   27,   28,
   20,   21,   22,   23,   24,   25,   26,   27,   28,   16,
    0,  177,    0,  179,    0,  177,    0,  179,    0,    0,
   16,   16,   16,   16,   16,   16,   16,   16,   16,  177,
  177,  179,  179,  180,    0,  181,    0,  180,   84,  181,
  198,    0,   84,  199,  198,  208,    0,  199,    0,  208,
    0,  180,  180,  181,  181,    0,   84,   84,  198,  198,
    0,  199,  199,  208,  208,   94,    0,    0,    0,   94,
  103,  104,   12,   13,   14,   15,   16,   17,   18,   19,
    0,    0,    0,   94,   94,   20,   21,   22,   23,   24,
   25,   26,   27,   28,
};
short yycheck[] = {                                      38,
   61,   40,   41,   42,   38,   44,   40,   40,   42,   40,
   44,   58,  292,  162,   60,  118,  178,   58,   59,  282,
  283,   59,   61,   61,   58,   59,   89,   58,   41,   41,
   41,   44,   44,   38,    6,   40,   41,   42,   41,   44,
   59,   44,   61,   61,   38,   38,   40,   41,   42,   61,
   44,  170,   91,   58,   59,  174,   61,   44,   38,   38,
  123,    5,   42,   42,   58,   59,  261,   61,   61,  211,
  212,  111,   59,   91,  236,   38,  160,   40,   41,   42,
   41,   44,  123,   44,  226,  123,   91,   38,   38,   40,
   41,   42,   42,   44,  289,   58,   59,   91,   61,   38,
   61,   40,   41,   42,  123,   44,  255,   58,   59,   44,
   61,   38,   91,   40,   41,   42,   88,   44,  123,   58,
   59,   38,   61,   40,   41,   42,  166,   44,   91,  123,
  233,   58,   59,  173,   61,   79,  298,  256,  222,   61,
   91,   91,  123,   41,   61,  264,   44,   40,  118,   60,
   61,   44,   91,   40,   45,   38,   89,   40,   59,   42,
  123,   44,   61,   61,   91,   58,   59,  251,  112,  261,
   61,   62,   49,   60,   91,   58,   59,   41,  111,   38,
   91,  221,   41,   42,  123,  261,  261,  157,  123,   66,
  123,  261,   91,   40,  164,   72,  280,  130,  131,  269,
  261,   38,  124,   40,   81,   42,   38,   84,   85,   44,
   42,   58,  156,  289,  254,  290,   44,   38,   60,   38,
  290,   42,  261,   42,   59,   61,   62,  261,  261,   40,
  261,   59,   91,  272,  273,  274,  275,  276,  277,  278,
  279,  280,  281,  282,  283,  284,  293,  294,  181,  261,
  289,  290,  291,  292,   91,  289,  261,  262,  263,  264,
  265,  266,  267,  268,  269,  270,  271,  261,  262,  263,
  264,  265,  266,  267,  268,  269,  270,  271,  291,  291,
  291,  261,   60,   61,  289,  290,  291,   62,  291,   38,
  261,  123,   58,   42,   62,  289,   41,  291,  261,  262,
  263,  264,  265,  266,  267,  268,  269,  270,  271,  289,
  261,  262,  263,  264,  265,  266,  267,  268,  269,  270,
  271,  261,  261,  125,  125,  126,  289,   44,  291,   40,
  291,  290,   58,   44,  261,   58,   49,   38,  289,   44,
  291,   42,   38,   44,  261,   41,   42,   58,   59,  289,
  289,   43,  291,   66,   59,  290,   58,   40,   59,  282,
  283,   44,  289,  261,  291,   41,  125,  126,  261,   61,
   41,   84,  261,  261,  291,   58,   59,  261,  261,  262,
  263,  264,  265,  266,  267,  268,  269,  270,  271,  261,
   91,  270,  271,  291,  126,   91,  289,  261,  286,  287,
  288,   59,  290,  123,  282,  283,  289,  290,  272,  273,
  274,  275,  276,  277,  278,  279,  280,  281,  282,  283,
  284,  125,  126,   61,   93,   41,  290,  291,  292,  261,
  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,
  261,  262,  263,  264,  265,  266,  267,  268,  269,  270,
  271,   33,   61,   61,   61,   37,   38,  289,   40,   61,
   42,   43,   44,   45,   61,   47,  125,  126,  289,   61,
   40,   61,   40,  261,   44,  261,   44,   61,   60,   61,
   62,  282,  283,   42,   41,  286,  287,  288,   58,   59,
   58,   59,  293,  294,  295,   44,  286,  287,  288,  291,
   93,  125,  126,  293,  294,  295,   59,  125,   58,   91,
   93,  258,   94,  262,  263,  264,  265,  266,  267,  268,
  269,  270,  271,  282,  283,   61,   66,  286,  287,  288,
   93,   59,   72,   40,  293,  294,  295,   44,  125,   93,
  125,   81,  124,  123,  126,   85,   93,  125,  123,  123,
   41,   58,   59,    3,  125,  126,    3,  261,  262,  263,
  264,  265,  266,  267,  268,  269,  270,  271,  272,  273,
  274,  275,  276,  277,  278,  279,  280,  281,  282,  283,
  284,   84,  286,  287,  288,  289,  290,   67,  292,  293,
  294,  295,  125,  126,  289,  260,  256,  217,    5,  269,
  111,   42,  261,  262,  263,  264,  265,  266,  267,  268,
  269,  270,  271,  272,  273,  274,  275,  276,  277,  278,
  279,  280,  281,  282,  283,  284,    5,  286,  287,  288,
  289,  290,  126,  292,  293,  294,  295,  261,  262,  263,
  264,  265,  266,  267,  268,  269,  270,  271,  272,  273,
  274,  275,  276,  277,  278,  279,  280,  281,  282,  283,
  284,    5,  286,  287,  288,  289,  290,  261,  292,  293,
  294,  295,  125,  126,   60,  131,  181,  123,  299,   -1,
  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,   -1,  286,  287,  288,  289,  290,
   -1,  292,  293,  294,  295,   -1,   -1,  262,  263,  264,
  265,  266,  267,  268,  269,  270,  271,   -1,   -1,   -1,
   40,   -1,   -1,  185,   44,   -1,   -1,   -1,   -1,  282,
  283,  166,   -1,  286,  287,  288,  291,   -1,   58,   59,
  293,  294,  295,   -1,   -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,  234,   -1,  261,  261,  290,   -1,  292,   -1,
  242,  243,  269,   -1,   -1,  220,  272,  273,  274,  275,
  276,  277,  278,  279,  280,  281,   -1,  232,  284,  286,
  287,  288,   -1,  290,  290,   -1,  292,   -1,   -1,  282,
  283,   -1,   40,  286,  287,  288,   44,   -1,   -1,   -1,
  293,  294,  295,  285,   40,  260,   -1,  262,   44,   -1,
   58,   59,   -1,  295,   -1,   -1,  271,   40,   -1,   -1,
   -1,   44,   58,   59,   40,   -1,   -1,  309,   44,  311,
  312,  286,   -1,  315,  289,   58,   59,   -1,   -1,  294,
   -1,   -1,   58,   59,   -1,   -1,  328,  261,  262,  263,
  264,  265,  266,  267,  268,  269,  270,  271,  272,  273,
  274,  275,  276,  277,  278,  279,  280,  281,   -1,   -1,
  284,   -1,   -1,   -1,   -1,  289,  290,   -1,  292,  261,
  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,
  272,  273,  274,  275,  276,  277,  278,  279,  280,  281,
  261,   -1,  284,   -1,   -1,   -1,   -1,   -1,  290,   -1,
  292,  272,  273,  274,  275,  276,  277,  278,  279,  280,
  281,  282,  283,  284,   -1,   -1,   -1,   -1,   -1,  290,
  261,  292,   -1,  264,  265,  266,  267,  268,  269,  270,
  271,  272,  273,  274,  275,  276,  277,  278,  279,  280,
  261,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  261,
   -1,  272,  273,  274,  275,  276,  277,  278,  279,  280,
  272,  273,  274,  275,  276,  277,  278,  279,  280,  261,
   -1,   40,   -1,   40,   -1,   44,   -1,   44,   -1,   -1,
  272,  273,  274,  275,  276,  277,  278,  279,  280,   58,
   59,   58,   59,   40,   -1,   40,   -1,   44,   40,   44,
   40,   -1,   44,   40,   44,   40,   -1,   44,   -1,   44,
   -1,   58,   59,   58,   59,   -1,   58,   59,   58,   59,
   -1,   58,   59,   58,   59,   40,   -1,   -1,   -1,   44,
  262,  263,  264,  265,  266,  267,  268,  269,  270,  271,
   -1,   -1,   -1,   58,   59,  272,  273,  274,  275,  276,
  277,  278,  279,  280,
};
#define YYFINAL 1
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 295
#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","SIGNALS","SLOTS","Q_OBJECT",
};
char *yyrule[] = {
"$accept : class_defs",
"class_defs :",
"class_defs : class_defs class_def",
"$$1 :",
"class_def : $$1 class_specifier ';'",
"class_name : IDENTIFIER",
"class_name : template_class_name",
"template_class_name : IDENTIFIER '<' template_args '>'",
"template_args :",
"const_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",
"$$2 :",
"argument_declaration : decl_specifiers abstract_decl_opt '=' $$2 const_expression",
"argument_declaration : decl_specifiers abstract_decl_opt dname abstract_decl_opt",
"$$3 :",
"argument_declaration : decl_specifiers abstract_decl_opt dname abstract_decl_opt '=' $$3 const_expression",
"abstract_decl_opt :",
"abstract_decl_opt : abstract_decl",
"abstract_decl : abstract_decl ptr_operator",
"$$4 :",
"abstract_decl : '[' $$4 const_expression ']'",
"$$5 :",
"abstract_decl : abstract_decl '[' $$5 const_expression ']'",
"abstract_decl : ptr_operator",
"abstract_decl : '(' abstract_decl ')'",
"declarator : dname",
"declarator : declarator ptr_operator",
"$$6 :",
"declarator : declarator '[' $$6 const_expression ']'",
"declarator : '(' declarator ')'",
"dname : IDENTIFIER",
"fct_decl : '(' argument_declaration_list ')' cv_qualifier_list_opt fct_body_or_semicolon",
"fct_name : IDENTIFIER",
"fct_name : IDENTIFIER array_decls",
"$$7 :",
"fct_name : IDENTIFIER '=' $$7 const_expression",
"$$8 :",
"fct_name : IDENTIFIER array_decls '=' $$8 const_expression",
"$$9 :",
"array_decls : '[' $$9 const_expression ']'",
"$$10 :",
"array_decls : array_decls '[' $$10 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 ';'",
"$$11 :",
"fct_body : '{' $$11 '}'",
"$$12 :",
"class_specifier : class_head '{' $$12 opt_obj_member_list '}'",
"class_specifier : class_key class_name",
"class_specifier : class_key class_name '(' IDENTIFIER ')'",
"class_specifier : template_spec whatever",
"whatever : IDENTIFIER",
"whatever : simple_type_name",
"whatever : type_specifier",
"whatever : storage_class_specifier",
"whatever : fct_specifier",
"$$13 :",
"class_head : class_key class_name $$13 opt_base_spec",
"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",
"$$14 :",
"obj_member_area : qt_access_specifier $$14 slot_area",
"$$15 :",
"obj_member_area : SIGNALS $$15 ':' opt_signal_declarations",
"obj_member_area : Q_OBJECT",
"slot_area : SIGNALS ':'",
"slot_area : SLOTS ':' opt_slot_declarations",
"$$16 :",
"slot_area : ':' $$16 opt_slot_declarations",
"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_semicolons",
"member_declarator_list : member_declarator",
"member_declarator_list : member_declarator_list ',' member_declarator",
"member_declarator : declarator",
"$$17 :",
"member_declarator : IDENTIFIER ':' $$17 const_expression",
"$$18 :",
"member_declarator : ':' $$18 const_expression",
"opt_bitfield :",
"$$19 :",
"opt_bitfield : ':' $$19 const_expression",
"$$20 :",
"enum_specifier : ENUM opt_identifier '{' $$20 '}'",
"opt_identifier :",
"opt_identifier : IDENTIFIER",
};
#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 754 "moc.y"

#if defined(_OS_WIN32_)
#if defined(_CC_MSVC_)
extern "C" int _isatty( int );
#define isatty _isatty
#endif
#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
QString	  combinePath( const char *, const char * );

QString	  fileName;				// file name
QString	  outputFile;				// output file name
QString   includeFile;				// name of #include file
QString	  includePath;				// #include file path
bool	  noInclude     = FALSE;		// no #include <filename>
bool	  generatedCode = FALSE;		// no code generated
QString	  className;				// name of parsed class
QString	  superclassName;			// name of super class
FuncList  signals;				// signal interface
FuncList  slots;				// slots interface

FILE  *out;					// output file

int yyparse();


int main( int argc, char **argv )
{
    bool autoInclude = TRUE;
    char *error	     = 0;
    for ( int n=1; n<argc && error==0; n++ ) {
	QString arg = argv[n];
	if ( arg[0] == '-' ) {			// option
	    QString 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";
			break;
		    }
		    includePath = argv[++n];
		} else
		    includePath = &opt[1];
	    } 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 if ( opt == "dbg" ) {	// non-signal members are slots
		grammarDebug = 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"
#if 0
		 "\t-ldbg    lex debug output\n"
		 "\t-ydbg    yacc debug output\n"
		 "\t-dbg     test parser, all non-signal members are slots\n"
#endif
		 );
	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 ) {
        fprintf( stderr, "%s:%d: Warning: %s\n", fileName.data(), 0, 
		 "No relevant classes found. No output generated." );
    }

    slots.clear();
    signals.clear();
    return 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
 */

QString combinePath( const char *infile, const char *outfile )
{
    QString a = infile;  replace(a.data(),'\\','/');
    QString b = outfile; replace(b.data(),'\\','/');
    a = a.stripWhiteSpace();
    b = b.stripWhiteSpace();
    QString 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] == '/' )
	    return a;
	b = &b[i];
    }
    i = b.contains('/');
    while ( i-- > 0 )
	r += "../";
    r += a;
    return r;
}


extern char *getenv();
extern char *getenv( const char * );

char *getenv() { return 0; }
char *getenv( const char * ) { return 0; }


void init()					// initialize
{
    BEGIN OUTSIDE;
    lineNo	 = 1;
    skipClass	 = FALSE;
    skipFunc	 = FALSE;
    signals.setAutoDelete( TRUE );
    slots.setAutoDelete( TRUE );

    tmpArgList	 = new ArgList;
    CHECK_PTR( tmpArgList );
    tmpFunc	 = new Function;
    CHECK_PTR( tmpFunc );
}

void initClass()				 // prepare for new class
{
    tmpAccessPerm    = _PRIVATE;
    subClassPerm     = _PRIVATE;
    Q_OBJECTdetected = FALSE;
    skipClass	     = FALSE;
    templateClass    = FALSE;
    slots.clear();
    signals.clear();
}

/* Remove white space from SIGNAL and SLOT names */

QString rmWS( const char *src )
{
    QString tmp( strlen( src ) + 1 );
    register char *d = tmp.data();
    register char *s = (char *)src;
    while( *s && isspace(*s) )
	s++;
    while ( *s ) {
	while( *s && !isspace(*s) )
	    *d++ = *s++;
	while( *s && isspace(*s) )
	    s++;
	if ( *s && ( isalpha(*s) || *s == '_' ) )
	    *d++ = ' ';
    }
    tmp.truncate( d - tmp.data() );
    return tmp;
}

void initExpression()
{
    tmpExpression = "";
}

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

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

void yyerror( char *msg )			// print yacc error message
{

    fprintf( stderr, "%s:%d: Error: %s\n", fileName.data(), lineNo, msg);
/*
    if ( errorControl )
	fprintf( stderr, "%s:%d: Warning: %s\n", fileName.data(), lineNo, msg);
    else
	fprintf( stderr, "%s:%d: Error: %s\n", fileName.data(), lineNo, msg );
*/
}

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

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

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

void func_warn( char *msg )
{
    moc_warn( msg );
    skipFunc = TRUE;
}

void operatorError()
{
    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[strlen(s1)+strlen(s2)+1];
    CHECK_PTR( n );
    strcpy( 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[strlen(s1)+strlen(s2)+strlen(s3)+1];
    CHECK_PTR( n );
    strcpy( 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[strlen(s1)+strlen(s2)+strlen(s3)+strlen(s4)+1];
    CHECK_PTR( n );
    strcpy( n, s1 );
    strcat( n, s2 );
    strcat( n, s3 );
    strcat( n, s4 );
    return n;
}


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

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

void generateFuncs( FuncList *list, char *functype, int num )
{
    Function *f;
    for ( f=list->first(); f; f=list->next() ) {
	QString typstr = "";
	int count = 0;
	Argument *a = f->args->first();
	while ( a ) {
	    if ( count++ )
		typstr += ",";
	    typstr += a->leftType;
	    typstr += a->rightType;
	    a = f->args->next();
	}
	fprintf( out, "    typedef %s(%s::*m%d_t%d)(%s);\n",
		 (const char*)f->type,
		 (const char*)className, num, list->at(),(const char*)typstr );
	f->type = f->name.copy();
	f->type += "(";
	f->type += typstr;
	f->type += ")";
    }
    for ( f=list->first(); f; f=list->next() )
	fprintf( out, "    m%d_t%d v%d_%d = &%s::%s;\n", num, list->at(),
		 num, list->at(), (const char*)className,(const char*)f->name);
    if ( list->count() )
	fprintf( out, "    QMetaData *%s_tbl = new QMetaData[%d];\n",
		 functype, list->count() );
    for ( f=list->first(); f; f=list->next() )
	fprintf( out, "    %s_tbl[%d].name = \"%s\";\n",
		 functype, list->at(), (const char*)f->type );
    for ( f=list->first(); f; f=list->next() )
	fprintf( out, "    %s_tbl[%d].ptr = *((QMember*)&v%d_%d);\n",
		 functype, list->at(), num, list->at() );
}

void generateClass()		      // generate C++ source code for a class
{
    char *hdr1 = "/****************************************************************************\n"
		 "** %s meta object code from reading C++ file '%s'\n**\n";
    char *hdr2 = "** Created: %s\n"
		 "**      by: The Qt Meta Object Compiler (moc)\n**\n";
    char *hdr3 = "** WARNING! All changes made in this file will be lost!\n";
    char *hdr4 = "*****************************************************************************/\n\n";
    static int gen_count = 0;
    if ( skipClass )				// don't generate for class
	return;
    if ( !Q_OBJECTdetected ) {
	if ( signals.count() == 0 && slots.count() == 0 )
	    return;
	generatedCode = TRUE;
	if ( displayWarnings )
	    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();
	QString dstr = dt.toString();
	QString fn = fileName;
	int 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*)className, (const char*)fn );
	fprintf( out, hdr2, (const char*)dstr );
	fprintf( out, hdr3 );
	fprintf( out, hdr4 );
	fprintf( out, "#include <qmetaobj.h>\n" );
	if ( !noInclude )
	    fprintf( out, "#include \"%s\"\n", (const char*)includeFile );
	fprintf( out, "\n\n" );
    }
    else
	fprintf( out, "\n\n" );

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

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

//
// Generate initMetaObject member function
//
    fprintf( out, "void %s::initMetaObject()\n{\n", (const char*)className );
    fprintf( out, "    if ( metaObj )\n\treturn;\n" );
    fprintf( out, "    if ( !%s::metaObject() )\n\t%s::initMetaObject();\n",
	     (const char*)superclassName, (const char*)superclassName );
//
// Build slots array in initMetaObject()
//
    generateFuncs( &slots, "slot", Slot_Num );

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

//
// Finally code to create meta object
//
    fprintf( out, "    metaObj = new QMetaObject( \"%s\", \"%s\",\n",
	     (const char*)className, (const char*)superclassName );
    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, "}\n" );

//
// End of function initMetaObject()
//

//
// Generate internal signal functions
//'
    Function *f;
    f = signals.first();			// make internal signal methods
    static bool included_list_stuff = FALSE;
    while ( f ) {
	QString typstr = "";			// type string
	QString valstr = "";			// value string
	QString argstr = "";			// argument string (type+value)
	int  count     = 0;
	char buf[12];
						// method header
	Argument *a = f->args->first();
	while ( a ) {				// argument list
	    if ( count++ ) {
		typstr += ",";
		valstr += ", ";
		argstr += ", ";
	    }
	    typstr += a->leftType;
	    typstr += a->rightType;
	    argstr += a->leftType;
	    argstr += " ";
	    sprintf( buf, "t%d", count );
	    valstr += buf;
	    argstr += buf;
	    argstr += a->rightType;
	    a = f->args->next();
	}

	bool predef_call = FALSE;
	if ( typstr.isEmpty() || typstr == "short" || typstr == "int" ||
	     typstr == "long" || typstr == "char*" || typstr == "const char*"){
	    predef_call = TRUE;
	}
	if ( !predef_call && !included_list_stuff ) {
	    fprintf( out, "\n#if !defined(MOC_CONNECTIONLIST_DECLARED)\n" );
	    fprintf( out, "#define MOC_CONNECTIONLIST_DECLARED\n" );
	    fprintf( out, "#include <qlist.h>\n" );
	    fprintf( out, "declare(QListM,QConnection);\n" );
	    fprintf( out, "declare(QListIteratorM,QConnection);\n" );
	    fprintf( out, "#endif\n" );
	    included_list_stuff = TRUE;
	}

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

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

	if ( predef_call ) {
	    fprintf( out, "    activate_signal( \"%s(%s)\"",
		     (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, "    QConnectionList *clist = receivers(\"%s(%s)\");\n",
		 (const char*)f->name, (const char*)typstr );
	fprintf( out, "    if ( !clist || signalsBlocked() )\n\treturn;\n" );
	fprintf( out, "    typedef void (QObject::*RT)(%s);\n",
		 (const char*)typstr);
	fprintf( out, "    typedef RT *PRT;\n" );
	fprintf( out, "    QConnectionListIt it(*clist);\n" );
	fprintf( out, "    register QConnection *c;\n" );
	fprintf( out, "    RT r;\n" );
	fprintf( out, "    QSenderObject *object;\n" );
	fprintf( out, "    while ( (c=it.current()) ) {\n" );
	fprintf( out, "\t++it;\n" );
	fprintf( out, "\tr = *((PRT)(c->member()));\n" );
	fprintf( out, "\tobject = (QSenderObject*)c->object();\n" );
	fprintf( out, "\tobject->setSender( this );\n" );
	fprintf( out, "\t(object->*r)(%s);\n", (const char*)valstr );
	fprintf( out, "    }\n}\n" );
	f = signals.next();
    }

}


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

void addMember( char m )
{
    if ( skipFunc ) {
	tmpArgList  = new ArgList;   // ugly but works!
	CHECK_PTR( tmpArgList );
	tmpFunc	    = new Function;
	CHECK_PTR( tmpFunc );
	skipFunc    = FALSE;
	return;
    }
    if ( m == 's' && tmpFunc->type != "void" ) {
	moc_err( "Signals must have \"void\" as their return type" );
	return;
    }
    tmpFunc->accessPerm = tmpAccessPerm;
    tmpFunc->args	= tmpArgList;
    tmpFunc->lineNo	= lineNo;
    tmpArgList		= new ArgList;
    CHECK_PTR( tmpArgList );
    switch( m ) {
	case 's': signals.append( tmpFunc ); break;
	case 't': slots.  append( tmpFunc ); break;
    }
    skipFunc = FALSE;
    tmpFunc  = new Function;
    CHECK_PTR( tmpFunc );
}
#line 1478 "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 3:
#line 211 "moc.y"
{ initClass(); }
break;
case 4:
#line 212 "moc.y"
{ generateClass();
						BEGIN OUTSIDE; }
break;
case 5:
#line 219 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 6:
#line 220 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 7:
#line 224 "moc.y"
{ yyval.string = stradd( yyvsp[-3].string, "<",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(), ">" ); }
break;
case 8:
#line 235 "moc.y"
{ initExpression();
						    templLevel = 1;
						    BEGIN IN_TEMPL_ARGS; }
break;
case 9:
#line 248 "moc.y"
{ initExpression();
						    BEGIN IN_EXPR; }
break;
case 10:
#line 254 "moc.y"
{ yyval.string = ""; }
break;
case 11:
#line 255 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 12:
#line 256 "moc.y"
{ yyval.string = ""; }
break;
case 13:
#line 257 "moc.y"
{ skipFunc = TRUE; yyval.string = ""; }
break;
case 14:
#line 258 "moc.y"
{ skipFunc = TRUE; yyval.string = ""; }
break;
case 15:
#line 262 "moc.y"
{ char *tmp = new char[
						    strlen(yyvsp[-2].string) +
						    strlen(yyvsp[-1].string) +
						    strlen(yyvsp[0].string) + 3 ];
						    strcpy(tmp,yyvsp[-2].string);
						    strcat(tmp," ");
						    strcat(tmp,yyvsp[-1].string);
						    strcat(tmp," ");
						    strcat(tmp,yyvsp[0].string);
						    yyval.string = tmp; }
break;
case 16:
#line 274 "moc.y"
{ yyval.string = ""; }
break;
case 17:
#line 275 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 18:
#line 278 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 19:
#line 279 "moc.y"
{ yyval.string = stradd(yyvsp[-1].string," ",yyvsp[0].string); }
break;
case 22:
#line 284 "moc.y"
{ skipFunc = TRUE; }
break;
case 26:
#line 292 "moc.y"
{ yyval.string = "const"; }
break;
case 27:
#line 293 "moc.y"
{ yyval.string = "volatile"; }
break;
case 28:
#line 296 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 29:
#line 297 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 30:
#line 298 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 31:
#line 302 "moc.y"
{ yyval.string = stradd(yyvsp[-1].string," ",yyvsp[0].string); }
break;
case 32:
#line 303 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 33:
#line 305 "moc.y"
{ yyval.string = "char"; }
break;
case 34:
#line 306 "moc.y"
{ yyval.string = "short"; }
break;
case 35:
#line 307 "moc.y"
{ yyval.string = "int"; }
break;
case 36:
#line 308 "moc.y"
{ yyval.string = "long"; }
break;
case 37:
#line 309 "moc.y"
{ yyval.string = "signed"; }
break;
case 38:
#line 310 "moc.y"
{ yyval.string = "unsigned"; }
break;
case 39:
#line 311 "moc.y"
{ yyval.string = "float"; }
break;
case 40:
#line 312 "moc.y"
{ yyval.string = "double"; }
break;
case 41:
#line 313 "moc.y"
{ yyval.string = "void"; }
break;
case 42:
#line 317 "moc.y"
{ yyval.string = stradd( "template<",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(), ">" ); }
break;
case 44:
#line 323 "moc.y"
{ templateClass = TRUE; }
break;
case 45:
#line 327 "moc.y"
{ yyval.string = "class"; }
break;
case 46:
#line 328 "moc.y"
{ yyval.string = "struct"; }
break;
case 47:
#line 331 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 48:
#line 333 "moc.y"
{ yyval.string = stradd( "::", yyvsp[0].string ); }
break;
case 49:
#line 337 "moc.y"
{ yyval.string = stradd( yyvsp[-2].string, "::", yyvsp[0].string );}
break;
case 50:
#line 338 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 51:
#line 342 "moc.y"
{ yyval.string = stradd(yyvsp[-1].string," ",yyvsp[0].string); }
break;
case 52:
#line 343 "moc.y"
{ yyval.string = stradd("enum ",yyvsp[0].string); }
break;
case 53:
#line 344 "moc.y"
{ yyval.string = stradd("union ",yyvsp[0].string); }
break;
case 54:
#line 349 "moc.y"
{ yyval.arg_list = yyvsp[-1].arg_list;}
break;
case 55:
#line 350 "moc.y"
{ yyval.arg_list = yyvsp[-2].arg_list;
				       moc_warn("Ellipsis not supported"
					       " in signals and slots.\n"
					       "Ellipsis argument ignored."); }
break;
case 56:
#line 356 "moc.y"
{ yyval.arg_list = tmpArgList; }
break;
case 57:
#line 357 "moc.y"
{ yyval.arg_list = yyvsp[0].arg_list; }
break;
case 59:
#line 361 "moc.y"
{ moc_warn("Ellipsis not supported"
					       " in signals and slots.\n"
					       "Ellipsis argument ignored."); }
break;
case 60:
#line 369 "moc.y"
{ yyval.arg_list = addArg(yyvsp[0].arg); }
break;
case 61:
#line 370 "moc.y"
{ yyval.arg_list = addArg(yyvsp[0].arg); }
break;
case 62:
#line 373 "moc.y"
{ yyval.arg = new Argument(stradd(yyvsp[-1].string,yyvsp[0].string),"");
				  CHECK_PTR(yyval.arg); }
break;
case 63:
#line 376 "moc.y"
{ expLevel = 1; }
break;
case 64:
#line 378 "moc.y"
{ yyval.arg = new Argument(stradd(yyvsp[-4].string,yyvsp[-3].string),"");
				  CHECK_PTR(yyval.arg); }
break;
case 65:
#line 382 "moc.y"
{ yyval.arg = new Argument(stradd(yyvsp[-3].string,yyvsp[-2].string),yyvsp[0].string);
				  CHECK_PTR(yyval.arg); }
break;
case 66:
#line 386 "moc.y"
{ expLevel = 1; }
break;
case 67:
#line 388 "moc.y"
{ yyval.arg = new Argument(stradd(yyvsp[-6].string,yyvsp[-5].string),yyvsp[-3].string);
				  CHECK_PTR(yyval.arg); }
break;
case 68:
#line 393 "moc.y"
{ yyval.string = ""; }
break;
case 69:
#line 394 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 70:
#line 398 "moc.y"
{ yyval.string = stradd(yyvsp[-1].string,yyvsp[0].string); }
break;
case 71:
#line 399 "moc.y"
{ expLevel = 1; }
break;
case 72:
#line 401 "moc.y"
{ yyval.string = stradd( "[",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(), "]" ); }
break;
case 73:
#line 404 "moc.y"
{ expLevel = 1; }
break;
case 74:
#line 406 "moc.y"
{ yyval.string = stradd( yyvsp[-4].string,"[",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(),"]" ); }
break;
case 75:
#line 409 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 76:
#line 410 "moc.y"
{ yyval.string = yyvsp[-1].string; }
break;
case 77:
#line 413 "moc.y"
{ yyval.string = ""; }
break;
case 78:
#line 415 "moc.y"
{ yyval.string = stradd(yyvsp[-1].string,yyvsp[0].string);}
break;
case 79:
#line 416 "moc.y"
{ expLevel = 1; }
break;
case 80:
#line 418 "moc.y"
{ yyval.string = stradd( yyvsp[-4].string,"[",
				     tmpExpression =
				     tmpExpression.stripWhiteSpace(),"]" ); }
break;
case 81:
#line 421 "moc.y"
{ yyval.string = yyvsp[-1].string; }
break;
case 83:
#line 432 "moc.y"
{ tmpFunc->args	     = yyvsp[-3].arg_list;
						  tmpFunc->qualifier = yyvsp[-1].string; }
break;
case 85:
#line 438 "moc.y"
{ func_warn("Variable as signal or slot."); }
break;
case 86:
#line 439 "moc.y"
{ expLevel=0; }
break;
case 87:
#line 441 "moc.y"
{ skipFunc = TRUE; }
break;
case 88:
#line 442 "moc.y"
{ expLevel=0; }
break;
case 89:
#line 444 "moc.y"
{ skipFunc = TRUE; }
break;
case 90:
#line 448 "moc.y"
{ expLevel = 1; }
break;
case 92:
#line 450 "moc.y"
{ expLevel = 1; }
break;
case 94:
#line 455 "moc.y"
{ yyval.string = ""; }
break;
case 95:
#line 456 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 96:
#line 459 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 97:
#line 460 "moc.y"
{ yyval.string = stradd(yyvsp[-1].string," ",yyvsp[0].string);}
break;
case 98:
#line 463 "moc.y"
{ yyval.string = stradd("*"," ",yyvsp[0].string);}
break;
case 99:
#line 464 "moc.y"
{ yyval.string = stradd("&"," ",yyvsp[0].string);}
break;
case 100:
#line 471 "moc.y"
{ yyval.string = ""; }
break;
case 101:
#line 472 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 102:
#line 475 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 103:
#line 477 "moc.y"
{ yyval.string = stradd(yyvsp[-1].string,yyvsp[0].string); }
break;
case 104:
#line 480 "moc.y"
{ yyval.string = "const"; }
break;
case 105:
#line 481 "moc.y"
{ yyval.string = "volatile"; }
break;
case 109:
#line 489 "moc.y"
{BEGIN IN_FCT; fctLevel = 1;}
break;
case 110:
#line 490 "moc.y"
{BEGIN QT_DEF; }
break;
case 111:
#line 497 "moc.y"
{ BEGIN IN_CLASS; level = 1; }
break;
case 112:
#line 499 "moc.y"
{ BEGIN QT_DEF; }
break;
case 113:
#line 500 "moc.y"
{ BEGIN QT_DEF;	  /* -- " -- */
						  skipClass = TRUE; }
break;
case 114:
#line 504 "moc.y"
{ BEGIN QT_DEF; /* catch ';' */
						  skipClass = TRUE; }
break;
case 115:
#line 506 "moc.y"
{ skipClass = TRUE;
						  BEGIN GIMME_SEMICOLON; }
break;
case 121:
#line 518 "moc.y"
{ className = yyvsp[0].string; }
break;
case 122:
#line 519 "moc.y"
{ superclassName = yyvsp[0].string; }
break;
case 123:
#line 522 "moc.y"
{ yyval.string = NULL; }
break;
case 124:
#line 523 "moc.y"
{ yyval.string = yyvsp[0].string; }
break;
case 129:
#line 535 "moc.y"
{ tmpAccessPerm = yyvsp[0].access; }
break;
case 130:
#line 536 "moc.y"
{ moc_err( "Missing access specifier"
						   " before \"slots:\"." ); }
break;
case 131:
#line 540 "moc.y"
{ BEGIN QT_DEF; }
break;
case 133:
#line 542 "moc.y"
{ BEGIN QT_DEF; }
break;
case 135:
#line 544 "moc.y"
{ if ( tmpAccessPerm )
				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 136:
#line 552 "moc.y"
{ moc_err( "Signals cannot "
						 "have access specifiers" ); }
break;
case 138:
#line 555 "moc.y"
{ if ( grammarDebug )
						  BEGIN QT_DEF;
					      else
						  BEGIN IN_CLASS;
					   if ( level != 1 )
					       moc_warn( "unexpected ':'" );
					 }
break;
case 144:
#line 575 "moc.y"
{ addMember('s'); }
break;
case 149:
#line 586 "moc.y"
{ addMember('t'); }
break;
case 152:
#line 593 "moc.y"
{ yyval.string=yyvsp[0].string; }
break;
case 155:
#line 601 "moc.y"
{ yyval.string = stradd( yyvsp[-3].string, "(", yyvsp[-1].string, ")" ); }
break;
case 156:
#line 603 "moc.y"
{ yyval.string = stradd( yyvsp[-3].string, "(", yyvsp[-1].string, ")" ); }
break;
case 157:
#line 606 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 158:
#line 607 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 159:
#line 608 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 160:
#line 609 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 161:
#line 610 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 162:
#line 611 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 163:
#line 612 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 164:
#line 613 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 165:
#line 614 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 166:
#line 615 "moc.y"
{yyval.string=yyvsp[0].string;}
break;
case 167:
#line 618 "moc.y"
{ yyval.access=_PRIVATE; }
break;
case 168:
#line 619 "moc.y"
{ yyval.access=_PROTECTED; }
break;
case 169:
#line 620 "moc.y"
{ yyval.access=_PUBLIC; }
break;
case 213:
#line 672 "moc.y"
{ tmpFunc->type = yyvsp[-1].string;
						  tmpFunc->name = yyvsp[0].string; }
break;
case 214:
#line 675 "moc.y"
{ tmpFunc->type = "int";
						  tmpFunc->name = yyvsp[0].string;
				  if ( tmpFunc->name == className )
				      func_warn( "Constructors cannot be"
						 " signals or slots.");
						}
break;
case 215:
#line 682 "moc.y"
{
				       func_warn( "Destructors cannot be"
						  " signals or slots.");
						}
break;
case 216:
#line 688 "moc.y"
{ tmpFunc->type =
						      stradd(yyvsp[-4].string,yyvsp[-3].string,yyvsp[-2].string,yyvsp[-1].string);
						  tmpFunc->name = yyvsp[0].string; }
break;
case 217:
#line 692 "moc.y"
{ skipFunc = TRUE; }
break;
case 218:
#line 694 "moc.y"
{ tmpFunc->type =
						      stradd(yyvsp[-2].string,yyvsp[-1].string);
						  tmpFunc->name = yyvsp[0].string; }
break;
case 219:
#line 699 "moc.y"
{ tmpFunc->type =
						      stradd(yyvsp[-3].string,yyvsp[-2].string,yyvsp[-1].string);
						  tmpFunc->name = yyvsp[0].string; }
break;
case 220:
#line 703 "moc.y"
{ operatorError();    }
break;
case 221:
#line 705 "moc.y"
{ operatorError();    }
break;
case 222:
#line 708 "moc.y"
{ operatorError();    }
break;
case 223:
#line 710 "moc.y"
{ operatorError();    }
break;
case 224:
#line 713 "moc.y"
{ operatorError();    }
break;
case 226:
#line 718 "moc.y"
{ func_warn("Variable as signal or slot."); }
break;
case 227:
#line 721 "moc.y"
{ func_warn("Variable as signal or slot."); }
break;
case 228:
#line 723 "moc.y"
{ func_warn("Enum declaration as signal or"
					  " slot."); }
break;
case 232:
#line 733 "moc.y"
{ expLevel = 0; }
break;
case 234:
#line 735 "moc.y"
{ expLevel = 0; }
break;
case 237:
#line 740 "moc.y"
{ expLevel = 0; }
break;
case 239:
#line 745 "moc.y"
{BEGIN IN_FCT; fctLevel=1;}
break;
case 240:
#line 746 "moc.y"
{BEGIN QT_DEF; }
break;
#line 2276 "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);
}
