summaryrefslogtreecommitdiffstats
path: root/src/moc
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-11-08 12:31:36 -0600
committerTimothy Pearson <[email protected]>2011-11-08 12:31:36 -0600
commitd796c9dd933ab96ec83b9a634feedd5d32e1ba3f (patch)
tree6e3dcca4f77e20ec8966c666aac7c35bd4704053 /src/moc
downloadtqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.tar.gz
tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.zip
Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731
Diffstat (limited to 'src/moc')
-rw-r--r--src/moc/README12
-rw-r--r--src/moc/moc.l498
-rw-r--r--src/moc/moc.pro65
-rw-r--r--src/moc/moc.y3607
-rw-r--r--src/moc/moc_lex.cpp3230
-rw-r--r--src/moc/moc_yacc.cpp4814
-rw-r--r--src/moc/moc_yacc.h65
7 files changed, 12291 insertions, 0 deletions
diff --git a/src/moc/README b/src/moc/README
new file mode 100644
index 000000000..7eb8a54df
--- /dev/null
+++ b/src/moc/README
@@ -0,0 +1,12 @@
+This directory contains the source code for the Qt Meta Object
+Compiler (moc).
+
+The files moc_yacc.cpp, moc_yacc.h and moc_lex.cpp are generated by
+lex and yacc from moc.l and moc.y.
+
+To compile the moc program from scratch, you need lex and yacc. These
+tools are preinstalled on most Unix systems, often as symbolic links
+to flex and byacc or bison.
+
+If you run Windows, you can install the Cygwin32 package available at
+ftp://ftp.cygnus.com/pub/gnu-win32/win32.
diff --git a/src/moc/moc.l b/src/moc/moc.l
new file mode 100644
index 000000000..7249d7c19
--- /dev/null
+++ b/src/moc/moc.l
@@ -0,0 +1,498 @@
+/****************************************************************************
+**
+** Lexical analyzer for meta object compiler
+**
+** Created : 930417
+**
+** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt GUI Toolkit.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing retquirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at [email protected].
+**
+** This file may be used under the terms of the Q Public License as
+** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
+** included in the packaging of this file. Licensees holding valid TQt
+** Commercial licenses may use this file in accordance with the TQt
+** Commercial License Agreement provided with the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*****************************************************************************/
+
+%{
+#ifdef MOC_YACC_CODE
+
+#ifdef MOC_MWERKS_PLUGIN
+#ifdef Q_OS_MAC9
+# define isascii(c) ((int)( (unsigned int) (c) <= (unsigned char)0x7F ))
+#endif
+const char *buf_buffer = NULL;
+long buf_size_total = 0, buf_index = 0;
+#define YY_INPUT(buf, result, max_size) \
+ { \
+ if(buf_index < buf_size_total ) { \
+ while(!isascii(buf_buffer[buf_index])) buf_index++; \
+ int ms = ((max_size < buf_size_total) ? max_size : buf_size_total); \
+ for(result = 0; result < ms; result++) { \
+ char c = buf_buffer[buf_index + result]; \
+ if(!isascii(c)) { \
+ buf_index++; \
+ break; \
+ } \
+ buf[result] = c == '\r' ? '\n' : c; \
+ } \
+ buf_index += result; \
+ } else result = YY_NULL; \
+ }
+#endif
+
+#include "qstring.h"
+
+
+#define input yyinput // yyinput in C++
+
+#define X if(lexDebug){fprintf(stderr,"LEX (%i) : %s\n",lineNo,yytext);};
+#define Y if(lexDebug){fprintf(stderr,"LEX (%i) : %s\n",lineNo,yytext);};
+/*
+#define Y if(lexDebug){fprintf(stderr,"LEX (%i) : %s updates level to %i\n"\
+ ,lineNo,yytext,templLevel);};
+*/
+#define Z if(lexDebug){fprintf(stderr,"LEX (%i) : skipped the string %s\"\n"\
+ ,lineNo,yytext);};
+#define BEGIN_INSIDE
+
+
+#define linput() \
+ ( (c = input()) == '\n' ? (lineNo++, c) : (c == EOF) ? 0 : c )
+
+#include <string.h>
+#include <stdlib.h>
+
+int classPLevel = 1; /* Depth of nested curly braces in IN_CLASS */
+int namespacePLevel = 1; /* Depth of nested curly braces in IN_NAMESPACE */
+int expLevel = 1; /* Depth of nested parentheses in IN_EXPR */
+int enumLevel = 1; /* Depth of nested parentheses in IN_ENUM */
+int fctLevel = 1; /* Depth of nested parentheses in IN_FCT */
+int templLevel = 1; /* Depth of levels in IN_TEMPL_ARGS */
+
+int lastState = 0; /* Remembers the state when a
+ MOC_SKIP_BEGIN is encountered */
+int skipLevel = 0; /* Depth of MOC_SKIP_BEGINs */
+
+class TQString;
+
+extern void addExpressionChar( const char );
+extern void addExpressionString( const char * );
+extern void moc_warn( const char *msg );
+%}
+
+%start OUTSIDE QT_DEF IN_CLASS IN_NAMESPACE IN_ENUM IN_EXPR IN_DEF_ARG IN_FCT IN_TEMPL_ARGS GIMME_SEMICOLON SKIP IN_PROPERTY IN_CLASSINFO
+
+ALMOSTSTRING \"([^"\n\\]|\\(.|\n))*
+STRING {ALMOSTSTRING}\"
+
+%%
+
+<OUTSIDE>"class" { X;
+ BEGIN QT_DEF;
+ return CLASS; }
+<OUTSIDE>"namespace" { X;
+ BEGIN QT_DEF;
+ return NAMESPACE; }
+<OUTSIDE>"using" { X;
+ BEGIN QT_DEF;
+ return USING; }
+<OUTSIDE>"template" { X;
+ BEGIN QT_DEF;
+ return TEMPLATE; }
+<QT_DEF>"Q_OBJECT" { X; return Q_OBJECT; }
+<QT_DEF>"signals" { X; return SIGNALS; }
+<QT_DEF>"slots" { X; return SLOTS; }
+<QT_DEF>"Q_CLASSINFO" { X; return Q_CLASSINFO; }
+<QT_DEF>"Q_PROPERTY" { X; return Q_PROPERTY; }
+<QT_DEF>"Q_OVERRIDE" { X; return Q_OVERRIDE; }
+<QT_DEF>"Q_ENUMS" { X; return Q_ENUMS; }
+<QT_DEF>"Q_SETS" { X; return Q_SETS; }
+
+<IN_FCT>"{" { fctLevel++;Y; }
+<IN_FCT>"}" { fctLevel--;Y;if (fctLevel==0){X;return '}';}}
+<IN_CLASS>"{" { classPLevel++;Y; }
+<IN_CLASS>"}" { classPLevel--;Y;if (classPLevel == 0)
+ {X;return '}';} }
+<IN_CLASS>"public" { X;if( classPLevel == 1 ) return PUBLIC; }
+<IN_CLASS>"protected" { X;if( classPLevel == 1 ) return PROTECTED; }
+<IN_CLASS>"private" { X;if( classPLevel == 1 ) return PRIVATE; }
+<IN_CLASS>"signals" { X;if( classPLevel == 1 ) return SIGNALS; }
+<IN_CLASS>"slots" { X;if( classPLevel == 1 ) return SLOTS; }
+<IN_CLASS>"Q_CLASSINFO" { X;if( classPLevel == 1 ) return Q_CLASSINFO; }
+<IN_CLASS>"Q_OBJECT" { X;
+ if ( classPLevel == 1 )
+ return Q_OBJECT;
+ else if ( classPLevel > 1 )
+ moc_warn( "Cannot use Q_OBJECT in nested class." );
+ }
+<IN_CLASS>"Q_PROPERTY" { X;if( classPLevel == 1 ) return Q_PROPERTY; }
+<IN_CLASS>"Q_OVERRIDE" { X;if( classPLevel == 1 ) return Q_OVERRIDE; }
+<IN_CLASS>"Q_ENUMS" { X;if( classPLevel == 1 ) return Q_ENUMS; }
+<IN_CLASS>"Q_SETS" { X;if( classPLevel == 1 ) return Q_SETS; }
+
+<IN_NAMESPACE>"{" { namespacePLevel++;Y; }
+<IN_NAMESPACE>"}" { namespacePLevel--;Y;if (namespacePLevel == 0)
+ {X;return '}';}}
+<IN_NAMESPACE>"class" { X;
+ BEGIN QT_DEF;
+ return CLASS; }
+<IN_NAMESPACE>"template" { X;
+ BEGIN QT_DEF;
+ return TEMPLATE; }
+<IN_NAMESPACE>"namespace" { X;
+ BEGIN QT_DEF;
+ return NAMESPACE; }
+<IN_NAMESPACE>"using" { X;
+ BEGIN QT_DEF;
+ return USING; }
+
+<IN_PROPERTY>"(" { X; return '('; }
+<IN_PROPERTY>")" { X; return ')'; }
+<IN_PROPERTY>"READ" { X; return READ; }
+<IN_PROPERTY>"WRITE" { X; return WRITE; }
+<IN_PROPERTY>"STORED" { X; return STORED; }
+<IN_PROPERTY>"RESET" { X; return RESET; }
+<IN_PROPERTY>"DESIGNABLE" { X; return DESIGNABLE; }
+<IN_PROPERTY>"SCRIPTABLE" { X; return SCRIPTABLE; }
+
+
+<IN_EXPR>"(" { expLevel++;X; }
+<IN_EXPR>")" { expLevel--;Y;if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ')';} }
+<IN_EXPR>"[" { expLevel++;X; }
+<IN_EXPR>"]" { expLevel--;X;if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ']';} }
+<IN_EXPR>"," { if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ',' ;} }
+<IN_EXPR>";" { if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ';' ;} }
+<IN_DEF_ARG>"(" { expLevel++;X; }
+<IN_DEF_ARG>")" { expLevel--;Y;if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ')';} }
+<IN_DEF_ARG>"[" { expLevel++;X; }
+<IN_DEF_ARG>"]" { expLevel--;X;if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ']';} }
+<IN_DEF_ARG>"," { if (expLevel <= 1)
+ { X; BEGIN QT_DEF; return ',' ;} }
+<IN_DEF_ARG>";" { if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ';' ;} }
+<IN_ENUM>"(" { enumLevel++;X; }
+<IN_ENUM>")" { enumLevel--;X; }
+<IN_ENUM>"[" { enumLevel++;X; }
+<IN_ENUM>"]" { enumLevel--;X }
+<IN_ENUM>"," { if (enumLevel == 0)
+ { X; BEGIN QT_DEF; return ',' ;} }
+<IN_ENUM>";" { if (enumLevel == 0)
+ { X; BEGIN QT_DEF; return ';' ;} }
+<IN_ENUM>"}" { if (enumLevel == 0)
+ { X; BEGIN QT_DEF; return '}' ;} }
+<IN_TEMPL_ARGS>[[(<] { templLevel++;
+ Y;
+ addExpressionChar( yytext[0] );
+ }
+<IN_TEMPL_ARGS>[])>] { templLevel--;
+ Y;
+ if ( templLevel == 0 ) {
+ X;
+ BEGIN QT_DEF;
+ return yytext[0];
+ } else {
+ addExpressionChar( yytext[0] );
+ }
+ }
+<QT_DEF>"friend" { X;return FRIEND; }
+<QT_DEF>"typedef" { X;return TYPEDEF; }
+<QT_DEF>"auto" { X;return AUTO; }
+<QT_DEF>"register" { X;return REGISTER; }
+<QT_DEF>"static" { X;return STATIC; }
+<QT_DEF>"extern" { X;return EXTERN; }
+<QT_DEF>"inline" { X;return INLINE; }
+<QT_DEF>"__inline__" { X;return INLINE; }
+<QT_DEF>"virtual" { X;return VIRTUAL; }
+<QT_DEF>"const" { X;return CONST; }
+<QT_DEF>"volatile" { X;return VOLATILE; }
+<QT_DEF>"char" { X;return CHAR; }
+<QT_DEF>"short" { X;return SHORT; }
+<QT_DEF>"int" { X;return INT; }
+<QT_DEF>"long" { X;return LONG; }
+<QT_DEF>"signed" { X;return SIGNED; }
+<QT_DEF>"unsigned" { X;return UNSIGNED; }
+<QT_DEF>"float" { X;return FLOAT; }
+<QT_DEF>"double" { X;return DOUBLE; }
+<QT_DEF>"void" { X;return VOID; }
+<QT_DEF>"enum" { X;return ENUM; }
+<QT_DEF>"class" { X;return CLASS; }
+<QT_DEF>"struct" { X;return STRUCT; }
+<QT_DEF>"union" { X;return UNION; }
+<QT_DEF>"asm" { X;return ASM; }
+<QT_DEF>"private" { X;return PRIVATE; }
+<QT_DEF>"protected" { X;return PROTECTED; }
+<QT_DEF>"public" { X;return PUBLIC; }
+<QT_DEF>"operator" { X;return OPERATOR; }
+<QT_DEF>"::" { X;return DBL_COLON; }
+<QT_DEF>"..." { X;return TRIPLE_DOT; }
+<QT_DEF>"template" { X;return TEMPLATE; }
+<QT_DEF>"mutable" { X;return MUTABLE; }
+<QT_DEF>"throw" { X;return THROW; }
+<QT_DEF>"using" { X;return USING; }
+<QT_DEF>"namespace" { X;return NAMESPACE; }
+
+<QT_DEF>[_a-zA-Z][_a-zA-Z0-9]* {
+ X;
+ yylval.string = qstrdup(yytext);
+ return IDENTIFIER;
+ }
+
+<IN_PROPERTY>[_a-zA-Z][_a-zA-Z0-9]* {
+ X;
+ yylval.string = qstrdup(yytext);
+ return IDENTIFIER;
+ }
+
+<IN_CLASSINFO>"(" { X; return '('; }
+<IN_CLASSINFO>")" { X; return ')'; }
+<IN_CLASSINFO>"," { X; return ','; }
+
+<IN_CLASSINFO>{ALMOSTSTRING} {
+ X;
+ yylval.string = qstrdup( yytext + 1 );
+ input(); /* discard the '"' */
+ return STRING;
+ }
+
+<OUTSIDE>[_a-zA-Z][_a-zA-Z0-9]* ;
+<IN_CLASS>[_a-zA-Z][_a-zA-Z0-9]* ;
+<IN_NAMESPACE>[_a-zA-Z][_a-zA-Z0-9]* ;
+
+<OUTSIDE>{STRING} { /* discard strings */
+ Z;
+ }
+
+<IN_CLASS>{STRING} { /* discard strings */
+ Z;
+ }
+
+<IN_NAMESPACE>{STRING} { /* discard strings */
+ Z;
+ }
+
+<IN_FCT>{ALMOSTSTRING} { /* discard strings */
+ Z;
+ addExpressionString( yytext );
+ input(); /* discard the '"' */
+ }
+
+
+<IN_TEMPL_ARGS>{ALMOSTSTRING} {
+ X;
+ addExpressionString( yytext );
+ input(); /* discard the '"' */
+ return STRING;
+ }
+
+<QT_DEF>{ALMOSTSTRING} {
+ X;
+ yylval.string = qstrdup( yytext + 1 );
+ input(); /* discard the '"' */
+ return STRING;
+ }
+
+<QT_DEF>'.' { X;
+ yylval.char_val = yytext[1];
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\a' { X;
+ yylval.char_val = '\a';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\b' { X;
+ yylval.char_val = '\b';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\f' { X;
+ yylval.char_val = '\f';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\n' { X;
+ yylval.char_val = '\n';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\r' { X;
+ yylval.char_val = '\r';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\t' { X;
+ yylval.char_val = '\t';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\v' { X;
+ yylval.char_val = '\v';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\\\' { X;
+ yylval.char_val = '\\';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\?' { X;
+ yylval.char_val = '\?';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\'' { X;
+ yylval.char_val = '\'';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\\"' { X;
+ yylval.char_val = '\"'; /* " */
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\0' { X;
+ yylval.char_val = '\0';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\[0-7]+' { X;
+ yylval.char_val =
+ (char)strtol( &yytext[1], 0, 8 );
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\x[0-9a-fA-F]+' { X;
+ yylval.char_val =
+ (char)strtol( &yytext[2], 0, 16 );
+ return CHAR_VAL;
+ }
+
+<QT_DEF>'\\.' { X;
+ yylval.char_val = ' ';
+ return CHAR_VAL;
+ }
+
+<QT_DEF>[0-9]+ { X;
+ yylval.int_val = atoi(yytext);
+ return INT_VAL;
+ }
+
+<QT_DEF>[0-9]+\.[0-9]* { X;
+ yylval.double_val = atof(yytext);
+ return DOUBLE_VAL;
+ }
+
+<QT_DEF>\.[0-9]+ { X;
+ yylval.double_val = atof(yytext);
+ return DOUBLE_VAL;
+ }
+
+
+^#define.*\\$ { /* skip multi-line macro-definitions */
+ int c, c1;
+ input(); /* Discard the '\n'. */
+ do {
+ c1=' ';
+ while((c = linput()) != '\n' && c != 0) c1=c;
+ if (c == 0) break;
+ } while(c1=='\\');
+ unput(c); /* put back the '\n' or the EOF */
+ }
+
+^[ \t]*#.* { /* preprocessor commands are skipped */}
+"//"[^\n]* { /* C++ comment */
+ TQCString s = yytext;
+ if ( s.contains( "MOC_SKIP_BEGIN" ) ) {
+ skipLevel++;
+ if ( skipLevel == 1 ) {
+ lastState = YYSTATE;
+ BEGIN SKIP;
+ }
+ } else
+ if ( s.contains( "MOC_SKIP_END" ) ) {
+ if ( skipLevel == 0 ) {
+ moc_warn(" MOC_SKIP_END without MOC_SKIP_BEGIN");
+ } else {
+ skipLevel--;
+ if ( skipLevel == 0 ) {
+ BEGIN lastState;
+ }
+ }
+ }
+ }
+"/*" { /* C comment */
+ int c = ' ';
+ do {
+ if ( c!= '*' ) {
+ while((c = linput()) != '*' && c != 0)
+ ;
+ }
+ if (c == 0) break;
+ } while(((c = linput())) != '/' && c != 0);
+ if (c == 0)
+ unput(c);
+ }
+
+<IN_TEMPL_ARGS>. { addExpressionChar( yytext[0] ); }
+
+<IN_TEMPL_ARGS>[ \t\r\b\f]+ {
+ /* spaces are important in template args,
+ e.g. Foo<const int> */
+ addExpressionChar( yytext[0] ); }
+[ \t\r\b\f]+ ;
+<IN_CLASS>. ;
+<IN_NAMESPACE>. ;
+<IN_FCT>. ;
+<IN_EXPR>. { addExpressionChar( yytext[0] ); }
+<IN_DEF_ARG>. ;
+<IN_ENUM>. { addExpressionChar( yytext[0] ); }
+<OUTSIDE>. ;
+<SKIP>. ;
+<QT_DEF>. {
+ X;
+ return yytext[0];
+ }
+<GIMME_SEMICOLON>. {
+ X;
+ return ';';
+ }
+\n {
+ lineNo++;
+ }
+
+
+%%
+
+#endif // MOC_YACC_CODE
diff --git a/src/moc/moc.pro b/src/moc/moc.pro
new file mode 100644
index 000000000..da95b173c
--- /dev/null
+++ b/src/moc/moc.pro
@@ -0,0 +1,65 @@
+TEMPLATE = app
+TARGET = moc
+
+CONFIG = console release qtinc yacc lex_included yacc_no_name_mangle
+DEFINES += QT_MOC QT_NO_CODECS QT_LITE_UNICODE QT_NO_COMPONENT \
+ QT_NO_STL QT_NO_COMPRESS
+win32:DEFINES += QT_NODLL
+DESTDIR = ../../bin
+
+
+INCLUDEPATH += $$QT_SOURCE_TREE/include ../tools .
+DEPENDPATH += $$QT_SOURCE_TREE/include ../tools .
+LIBS =
+OBJECTS_DIR = .
+SOURCES = ../tools/qbuffer.cpp \
+ ../tools/qptrcollection.cpp \
+ ../tools/qcstring.cpp \
+ ../tools/qdatastream.cpp \
+ ../tools/qdatetime.cpp \
+ ../tools/qfile.cpp \
+ ../tools/qdir.cpp \
+ ../tools/qfileinfo.cpp \
+ ../tools/qgarray.cpp \
+ ../tools/qgdict.cpp \
+ ../tools/qglist.cpp \
+ ../tools/qglobal.cpp \
+ ../tools/qgvector.cpp \
+ ../tools/qiodevice.cpp \
+ ../tools/qregexp.cpp \
+ ../tools/qstring.cpp \
+ ../tools/qlocale.cpp \
+ ../tools/qunicodetables.cpp \
+ ../tools/qstringlist.cpp \
+ ../tools/qtextstream.cpp \
+ ../tools/qbitarray.cpp \
+ ../tools/qmap.cpp \
+ ../tools/qgcache.cpp \
+ ../codecs/qtextcodec.cpp \
+ ../codecs/qutfcodec.cpp
+
+isEmpty(QT_PRODUCT)|contains(QT_PRODUCT, qt-internal) {
+ LEXSOURCES = moc.l
+ YACCSOURCES = moc.y
+} else {
+ SOURCES += moc_yacc.cpp
+}
+
+unix:SOURCES += ../tools/qfile_unix.cpp ../tools/qdir_unix.cpp ../tools/qfileinfo_unix.cpp
+win32:SOURCES += ../tools/qfile_win.cpp ../tools/qdir_win.cpp ../tools/qfileinfo_win.cpp
+macx:LIBS += -framework Carbon
+
+target.path=$$bins.path
+INSTALLS += target
+
+*-mwerks {
+ TEMPLATE = lib
+ TARGET = McMoc
+ CONFIG -= static
+ CONFIG += shared plugin
+ DEFINES += MOC_MWERKS_PLUGIN
+ MWERKSDIR = $QT_SOURCE_TREE/util/mwerks_plugin
+ INCLUDEPATH += $$MWERKSDIR/Headers
+ LIBS += $$MWERKSDIR/Libraries/PluginLib4.shlb
+ SOURCES += mwerks_mac.cpp
+}
diff --git a/src/moc/moc.y b/src/moc/moc.y
new file mode 100644
index 000000000..08d1b95c8
--- /dev/null
+++ b/src/moc/moc.y
@@ -0,0 +1,3607 @@
+/****************************************************************************
+**
+** Parser and code generator for meta object compiler
+**
+** Created : 930417
+**
+** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt GUI Toolkit.
+**
+** This file may be used under the terms of the GNU General
+** Public License versions 2.0 or 3.0 as published by the Free
+** Software Foundation and appearing in the files LICENSE.GPL2
+** and LICENSE.GPL3 included in the packaging of this file.
+** Alternatively you may (at your option) use any later version
+** of the GNU General Public License if such license has been
+** publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing retquirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at [email protected].
+**
+** This file may be used under the terms of the Q Public License as
+** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
+** included in the packaging of this file. Licensees holding valid TQt
+** Commercial licenses may use this file in accordance with the TQt
+** Commercial License Agreement provided with the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+** --------------------------------------------------------------------------
+**
+** This compiler reads a C++ header file with class definitions and ouputs
+** C++ code to build a meta class. The meta data includes public methods
+** (not constructors, destructors or operator functions), signals and slot
+** definitions. The output file should be compiled and linked into the
+** target application.
+**
+** C++ header files are assumed to have correct syntax, and we are therefore
+** doing less strict checking than C++ compilers.
+**
+** The C++ grammar has been adopted from the "The Annotated C++ Reference
+** Manual" (ARM), by Ellis and Stroustrup (Addison Wesley, 1992).
+**
+** Notice that this code is not possible to compile with GNU bison, instead
+** use standard AT&T yacc or Berkeley yacc.
+*****************************************************************************/
+
+%{
+#define MOC_YACC_CODE
+void yyerror( const char *msg );
+
+#include "qplatformdefs.h"
+#include "qasciidict.h"
+#include "qdatetime.h"
+#include "qdict.h"
+#include "qfile.h"
+#include "qdir.h"
+#include "qptrlist.h"
+#include "qregexp.h"
+#include "qstrlist.h"
+#ifdef MOC_MWERKS_PLUGIN
+# ifdef Q_OS_MACX
+# undef OLD_DEBUG
+# ifdef DEBUG
+# define OLD_DEBUG DEBUG
+# undef DEBUG
+# endif
+# define DEBUG 0
+# ifndef __IMAGECAPTURE__
+# define __IMAGECAPTURE__
+# endif
+# include <Carbon/Carbon.h>
+# endif
+# include "mwerks_mac.h"
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#if defined CONST
+#undef CONST
+#endif
+#if defined VOID
+#undef VOID
+#endif
+
+bool isEnumType( const char* type );
+int enumIndex( const char* type );
+bool isVariantType( const char* type );
+int qvariant_nameToType( const char* name );
+static void init(); // initialize
+static void initClass(); // prepare for new class
+static void generateClass(); // generate C++ code for class
+static void initExpression(); // prepare for new expression
+static void enterNameSpace( const char *name = 0 );
+static void leaveNameSpace();
+static void selectOutsideClassState();
+static void registerClassInNamespace();
+static bool suppress_func_warn = FALSE;
+static void func_warn( const char *msg );
+static void moc_warn( const char *msg );
+static void moc_err( const char *s );
+static void moc_err( const char *s1, const char *s2 );
+static void operatorError();
+static void checkPropertyName( const char* ident );
+
+static const char* const utype_map[] =
+{
+ "bool",
+ "int",
+ "double",
+ "TQString",
+ "TQVariant",
+ 0
+};
+
+inline bool isIdentChar( char x )
+{ // Avoid bug in isalnum
+ return x == '_' || (x >= '0' && x <= '9') ||
+ (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z');
+}
+
+bool validUType( TQCString ctype )
+{
+ if ( ctype.left(6) == "const " )
+ ctype = ctype.mid( 6, ctype.length() - 6 );
+ if ( ctype.right(1) == "&" )
+ ctype = ctype.left( ctype.length() - 1 );
+ else if ( ctype.right(1) == "*" )
+ return TRUE;
+
+ int i = -1;
+ while ( utype_map[++i] )
+ if ( ctype == utype_map[i] )
+ return TRUE;
+
+ return isEnumType( ctype );
+}
+
+TQCString castToUType( TQCString ctype )
+{
+ if ( ctype.right(1) == "&" )
+ ctype = ctype.left( ctype.length() - 1 );
+ if( ctype.right(1) == "]") {
+ int lb = ctype.findRev('[');
+ if(lb != -1)
+ ctype = ctype.left(lb) + "*";
+ }
+ return ctype;
+}
+
+TQCString rawUType( TQCString ctype )
+{
+ ctype = castToUType( ctype );
+ if ( ctype.left(6) == "const " )
+ ctype = ctype.mid( 6, ctype.length() - 6 );
+ return ctype;
+}
+
+TQCString uType( TQCString ctype )
+{
+ if ( !validUType( ctype ) ) {
+ if ( isVariantType( rawUType(ctype) ) )
+ return "varptr";
+ else
+ return "ptr";
+ }
+ if ( ctype.left(6) == "const " )
+ ctype = ctype.mid( 6, ctype.length() - 6 );
+ if ( ctype.right(1) == "&" ) {
+ ctype = ctype.left( ctype.length() - 1 );
+ } else if ( ctype.right(1) == "*" ) {
+ TQCString raw = ctype.left( ctype.length() - 1 );
+ ctype = "ptr";
+ if ( raw == "char" )
+ ctype = "charstar";
+ else if ( raw == "TQUnknownInterface" )
+ ctype = "iface";
+ else if ( raw == "TQDispatchInterface" )
+ ctype = "idisp";
+ else if ( isVariantType( raw ) )
+ ctype = "varptr";
+ }
+ if ( isEnumType( ctype ) )
+ ctype = "enum";
+ return ctype;
+}
+
+bool isInOut( TQCString ctype )
+{
+ if ( ctype.left(6) == "const " )
+ return FALSE;
+ if ( ctype.right(1) == "&" )
+ return TRUE;
+ if ( ctype.right(2) == "**" )
+ return TRUE;
+ return FALSE;
+}
+
+TQCString uTypeExtra( TQCString ctype )
+{
+ TQCString typeExtra = "0";
+ if ( !validUType( ctype ) ) {
+ if ( isVariantType( rawUType(ctype) ) )
+ typeExtra.sprintf("\"\\x%02x\"", qvariant_nameToType( rawUType(ctype) ) );
+ else
+ typeExtra.sprintf( "\"%s\"", rawUType(ctype).data() );
+ return typeExtra;
+ }
+ if ( ctype.left(6) == "const " )
+ ctype = ctype.mid( 6, ctype.length() - 6 );
+ if ( ctype.right(1) == "&" )
+ ctype = ctype.left( ctype.length() - 1 );
+ if ( ctype.right(1) == "*" ) {
+ TQCString raw = ctype.left( ctype.length() - 1 );
+ ctype = "ptr";
+ if ( raw == "char" )
+ ;
+ else if ( isVariantType( raw ) )
+ typeExtra.sprintf("\"\\x%02x\"", qvariant_nameToType( raw ) );
+ else
+ typeExtra.sprintf( "\"%s\"", raw.stripWhiteSpace().data() );
+
+ } else if ( isEnumType( ctype ) ) {
+ int idx = enumIndex( ctype );
+ if ( idx >= 0 ) {
+ typeExtra.sprintf( "&enum_tbl[%d]", enumIndex( ctype ) );
+ } else {
+ typeExtra.sprintf( "parentObject->enumerator(\"%s\", TRUE )", ctype.data() );
+ }
+ typeExtra =
+ "\n#ifndef QT_NO_PROPERTIES\n\t " + typeExtra +
+ "\n#else"
+ "\n\t 0"
+ "\n#endif // QT_NO_PROPERTIES\n\t ";
+ }
+ return typeExtra;
+}
+
+/*
+ Attention!
+ This table is copied from qvariant.cpp. If you change
+ one, change both.
+*/
+static const int ntypes = 35;
+static const char* const type_map[ntypes] =
+{
+ 0,
+ "TQMap<TQString,TQVariant>",
+ "TQValueList<TQVariant>",
+ "TQString",
+ "TQStringList",
+ "TQFont",
+ "TQPixmap",
+ "TQBrush",
+ "TQRect",
+ "TQSize",
+ "TQColor",
+ "TQPalette",
+ "TQColorGroup",
+ "TQIconSet",
+ "TQPoint",
+ "TQImage",
+ "int",
+ "uint",
+ "bool",
+ "double",
+ "TQCString",
+ "TQPointArray",
+ "TQRegion",
+ "TQBitmap",
+ "TQCursor",
+ "TQSizePolicy",
+ "TQDate",
+ "TQTime",
+ "TQDateTime",
+ "TQByteArray",
+ "TQBitArray",
+ "TQKeySequence",
+ "TQPen",
+ "Q_LLONG",
+ "Q_ULLONG"
+};
+
+int qvariant_nameToType( const char* name )
+{
+ for ( int i = 0; i < ntypes; i++ ) {
+ if ( !qstrcmp( type_map[i], name ) )
+ return i;
+ }
+ return 0;
+}
+
+/*
+ Returns TRUE if the type is a TQVariant types.
+*/
+bool isVariantType( const char* type )
+{
+ return qvariant_nameToType( type ) != 0;
+}
+
+/*
+ Replaces '>>' with '> >' (as in 'TQValueList<TQValueList<double> >').
+ This function must be called to produce valid C++ code. However,
+ the string representation still uses '>>'.
+*/
+void fixRightAngles( TQCString *str )
+{
+ str->replace( TQRegExp(">>"), "> >" );
+}
+
+static TQCString rmWS( const char * );
+
+enum Access { Private, Protected, Public };
+
+
+class Argument // single arg meta data
+{
+public:
+ Argument( const char *left, const char *right, const char* argName = 0, bool isDefaultArgument = FALSE )
+ {
+ leftType = rmWS( left );
+ rightType = rmWS( right );
+ if ( leftType == "void" && rightType.isEmpty() )
+ leftType = "";
+
+ int len = leftType.length();
+
+ /*
+ Convert 'char const *' into 'const char *'. Start at index 1,
+ not 0, because 'const char *' is already OK.
+ */
+ for ( int i = 1; i < len; i++ ) {
+ if ( leftType[i] == 'c' &&
+ strncmp(leftType.data() + i + 1, "onst", 4) == 0
+ && (i + 5 >= len || !isIdentChar(leftType[i + 5]))
+ && !isIdentChar(i-1)
+ ) {
+ leftType.remove( i, 5 );
+ if ( leftType[i - 1] == ' ' )
+ leftType.remove( i - 1, 1 );
+ leftType.prepend( "const " );
+ break;
+ }
+
+ /*
+ We musn't convert 'char * const *' into 'const char **'
+ and we must beware of 'Bar<const Bla>'.
+ */
+ if ( leftType[i] == '&' || leftType[i] == '*' ||
+ leftType[i] == '<' )
+ break;
+ }
+
+ name = argName;
+ isDefault = isDefaultArgument;
+ }
+
+ TQCString leftType;
+ TQCString rightType;
+ TQCString name;
+ bool isDefault;
+};
+
+class ArgList : public TQPtrList<Argument> { // member function arg list
+public:
+ ArgList() { setAutoDelete( TRUE ); }
+ ~ArgList() { clear(); }
+
+ /* the clone has one default argument less, the orignal has all default arguments removed */
+ ArgList* magicClone() {
+ ArgList* l = new ArgList;
+ bool firstDefault = FALSE;
+ for ( first(); current(); next() ) {
+ bool isDefault = current()->isDefault;
+ if ( !firstDefault && isDefault ) {
+ isDefault = FALSE;
+ firstDefault = TRUE;
+ }
+ l->append( new Argument( current()->leftType, current()->rightType, current()->name, isDefault ) );
+ }
+ for ( first(); current(); ) {
+ if ( current()->isDefault )
+ remove();
+ else
+ next();
+ }
+ return l;
+ }
+
+ bool hasDefaultArguments() {
+ for ( Argument* a = first(); a; a = next() ) {
+ if ( a->isDefault )
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+};
+
+
+struct Function // member function meta data
+{
+ Access access;
+ TQCString qualifier; // const or volatile
+ TQCString name;
+ TQCString type;
+ TQCString signature;
+ 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 TQPtrList<Function> { // list of member functions
+public:
+ FuncList( bool autoDelete = FALSE ) { setAutoDelete( autoDelete ); }
+
+ FuncList find( const char* name )
+ {
+ FuncList result;
+ for ( TQPtrListIterator<Function> it(*this); it.current(); ++it ) {
+ if ( it.current()->name == name )
+ result.append( it.current() );
+ }
+ return result;
+ }
+};
+
+class Enum : public TQStrList
+{
+public:
+ TQCString name;
+ bool set;
+};
+
+class EnumList : public TQPtrList<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 TQCString& st, const TQCString& d, const TQCString& sc, bool ov )
+ : lineNo(l), type(t), name(n), set(s), get(g), reset(r), setfunc(0), getfunc(0),
+ sspec(Unspecified), gspec(Unspecified), stored( st ),
+ designable( d ), scriptable( sc ), override( ov ), oredEnum( -1 )
+ {
+ /*
+ The Q_PROPERTY construct cannot contain any commas, since
+ commas separate macro arguments. We therefore expect users
+ to type "TQMap" instead of "TQMap<TQString, TQVariant>". For
+ coherence, we also expect the same for
+ TQValueList<TQVariant>, the other template class supported by
+ TQVariant.
+ */
+ if ( type == "TQMap" ) {
+ type = "TQMap<TQString,TQVariant>";
+ } else if ( type == "TQValueList" ) {
+ type = "TQValueList<TQVariant>";
+ } else if ( type == "LongLong" ) {
+ type = "Q_LLONG";
+ } else if ( type == "ULongLong" ) {
+ type = "Q_ULLONG";
+ }
+ }
+
+ int lineNo;
+ TQCString type;
+ TQCString name;
+ TQCString set;
+ TQCString get;
+ TQCString reset;
+ TQCString stored;
+ TQCString designable;
+ TQCString scriptable;
+ bool override;
+
+ Function* setfunc;
+ Function* getfunc;
+
+ 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)
+ TQCString enumsettype; // contains the set function type in case of oredEnum
+ TQCString enumgettype; // contains the get function type in case of oredEnum
+
+ enum Specification { Unspecified, Class, Reference, Pointer, ConstCharStar };
+ Specification sspec;
+ Specification gspec;
+
+ bool stdSet() {
+ TQCString 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 TQPtrList<Property> { // list of properties
+public:
+ PropList() { setAutoDelete( TRUE ); }
+};
+
+
+struct ClassInfo
+{
+ ClassInfo( const char* n, const char* v )
+ : name(n), value(v)
+ {}
+ TQCString name;
+ TQCString value;
+};
+
+class ClassInfoList : public TQPtrList<ClassInfo> { // list of class infos
+public:
+ ClassInfoList() { setAutoDelete( TRUE ); }
+};
+
+class parser_reg {
+ public:
+ parser_reg();
+ ~parser_reg();
+
+ // some temporary values
+ TQCString tmpExpression; // Used to store the characters the lexer
+ // is currently skipping (see addExpressionChar and friends)
+ TQCString fileName; // file name
+ TQCString outputFile; // output file name
+ TQCString pchFile; // name of PCH file (used on Windows)
+ TQStrList includeFiles; // name of #include files
+ TQCString includePath; // #include file path
+ TQCString qtPath; // #include qt file path
+ int gen_count; //number of classes generated
+ bool noInclude; // no #include <filename>
+ bool generatedCode; // no code generated
+ bool mocError; // moc parsing error occurred
+ bool hasVariantIncluded; //whether or not qvariant.h was included yet
+ TQCString className; // name of parsed class
+ TQCString superClassName; // name of first super class
+ TQStrList multipleSuperClasses; // other superclasses
+ FuncList signals; // signal interface
+ FuncList slots; // slots interface
+ FuncList propfuncs; // all possible property access functions
+ FuncList funcs; // 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
+ TQCString propWrite; // set function
+ TQCString propRead; // get function
+ TQCString propReset; // reset function
+ TQCString propStored; //
+ TQCString propDesignable; // "true", "false" or function or empty if not specified
+ TQCString propScriptable; // "true", "false" or function or empty if not specified
+ bool propOverride; // Wether OVERRIDE was detected
+
+ TQStrList qtEnums; // Used to store the contents of Q_ENUMS
+ TQStrList qtSets; // Used to store the contents of Q_SETS
+
+};
+
+static parser_reg *g = 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 *stradd( const char *, const char * ); // add two strings
+char *stradd( const char *, const char *, // add three strings
+ const char * );
+char *stradd( const char *, const char *, // adds 4 strings
+ const char *, 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; // controled 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
+
+int tmpYYStart; // Used to store the lexers current mode
+int tmpYYStart2; // Used to store the lexers current mode
+ // (if tmpYYStart is already used)
+
+// if the format revision changes, you MUST change it in qmetaobject.h too
+const int formatRevision = 26; // moc output format revision
+
+// if the flags change, you HAVE to change it in qmetaobject.h too
+enum Flags {
+ Invalid = 0x00000000,
+ Readable = 0x00000001,
+ Writable = 0x00000002,
+ EnumOrSet = 0x00000004,
+ UnresolvedEnum = 0x00000008,
+ StdSet = 0x00000100,
+ Override = 0x00000200,
+ NotDesignable = 0x00001000,
+ DesignableOverride = 0x00002000,
+ NotScriptable = 0x00004000,
+ ScriptableOverride = 0x00008000,
+ NotStored = 0x00010000,
+ StoredOverride = 0x00020000
+};
+
+
+#ifdef YYBISON
+# if defined(Q_OS_WIN32)
+# include <io.h>
+# undef isatty
+extern "C" int hack_isatty( int )
+ {
+ return 0;
+ }
+# define isatty hack_isatty
+# else
+# include <unistd.h>
+# endif
+
+# define YYDEBUG 1
+# include "moc_yacc.h"
+# include "moc_lex.cpp"
+#endif //YYBISON
+%}
+
+
+
+
+%union {
+ char char_val;
+ int int_val;
+ double double_val;
+ char *string;
+ Access access;
+ Function *function;
+ ArgList *arg_list;
+ Argument *arg;
+}
+
+%start declaration_seq
+
+%token <char_val> CHAR_VAL /* value types */
+%token <int_val> INT_VAL
+%token <double_val> DOUBLE_VAL
+%token <string> STRING
+%token <string> IDENTIFIER /* identifier string */
+
+%token FRIEND /* declaration keywords */
+%token TYPEDEF
+%token AUTO
+%token REGISTER
+%token STATIC
+%token EXTERN
+%token INLINE
+%token VIRTUAL
+%token CONST
+%token VOLATILE
+%token CHAR
+%token SHORT
+%token INT
+%token LONG
+%token SIGNED
+%token UNSIGNED
+%token FLOAT
+%token DOUBLE
+%token VOID
+%token ENUM
+%token CLASS
+%token STRUCT
+%token UNION
+%token ASM
+%token PRIVATE
+%token PROTECTED
+%token PUBLIC
+%token OPERATOR
+%token DBL_COLON
+%token TRIPLE_DOT
+%token TEMPLATE
+%token NAMESPACE
+%token USING
+%token MUTABLE
+%token THROW
+
+%token SIGNALS
+%token SLOTS
+%token Q_OBJECT
+%token Q_PROPERTY
+%token Q_OVERRIDE
+%token Q_CLASSINFO
+%token Q_ENUMS
+%token Q_SETS
+
+%token READ
+%token WRITE
+%token STORED
+%token DESIGNABLE
+%token SCRIPTABLE
+%token RESET
+
+%type <string> class_name
+%type <string> template_class_name
+%type <string> template_spec
+%type <string> opt_base_spec
+
+%type <string> base_spec
+%type <string> base_list
+%type <string> qt_macro_name
+%type <string> base_specifier
+%type <access> access_specifier
+%type <string> fct_name
+%type <string> type_name
+%type <string> simple_type_names
+%type <string> simple_type_name
+%type <string> class_key
+%type <string> complete_class_name
+%type <string> qualified_class_name
+%type <string> elaborated_type_specifier
+%type <string> whatever
+
+%type <arg_list> argument_declaration_list
+%type <arg_list> arg_declaration_list
+%type <arg_list> arg_declaration_list_opt
+%type <string> abstract_decl_opt
+%type <string> abstract_decl
+%type <arg> argument_declaration
+%type <arg> opt_exception_argument
+%type <string> cv_qualifier_list_opt
+%type <string> cv_qualifier_list
+%type <string> cv_qualifier
+%type <string> decl_specifiers
+%type <string> decl_specifier
+%type <string> decl_specs_opt
+%type <string> decl_specs
+%type <string> type_specifier
+%type <string> fct_specifier
+%type <string> declarator
+%type <string> ptr_operator
+%type <string> ptr_operators
+%type <string> ptr_operators_opt
+
+%type <string> dname
+
+%%
+declaration_seq: /* empty */
+ | declaration_seq declaration
+ ;
+
+declaration: class_def
+/* | template_declaration */
+ | namespace_def
+ | namespace_alias_def
+ | using_declaration
+ | using_directive
+ ;
+
+namespace_def: named_namespace_def
+ | unnamed_namespace_def
+ ;
+
+named_namespace_def: NAMESPACE
+ IDENTIFIER { enterNameSpace($2); }
+ '{' { BEGIN IN_NAMESPACE; }
+ namespace_body
+ '}' { leaveNameSpace();
+ selectOutsideClassState();
+ }
+ ;
+
+unnamed_namespace_def: NAMESPACE { enterNameSpace(); }
+ '{' { BEGIN IN_NAMESPACE; }
+ namespace_body
+ '}' { leaveNameSpace();
+ selectOutsideClassState();
+ }
+ ;
+
+namespace_body: declaration_seq
+ ;
+
+namespace_alias_def: NAMESPACE IDENTIFIER '=' complete_class_name ';'
+ { selectOutsideClassState(); }
+ ;
+
+
+using_directive: USING NAMESPACE { selectOutsideClassState(); } /* Skip namespace */
+ ;
+
+using_declaration: USING IDENTIFIER { selectOutsideClassState(); }
+ | USING DBL_COLON { selectOutsideClassState(); }
+ ;
+
+class_def: { initClass(); }
+ class_specifier ';' { generateClass();
+ registerClassInNamespace();
+ selectOutsideClassState(); }
+ ;
+
+
+/***** r.17.1 (ARM p.387 ): Keywords *****/
+
+class_name: IDENTIFIER { $$ = $1; }
+ | template_class_name { $$ = $1; }
+ ;
+
+template_class_name: IDENTIFIER '<' template_args '>'
+ { g->tmpExpression = rmWS( g->tmpExpression );
+ $$ = stradd( $1, "<",
+ g->tmpExpression, ">" ); }
+ ;
+
+/*
+ template_args skips all characters until it encounters a ">" (it
+ handles and discards sublevels of parentheses). Since the rule is
+ empty it must be used with care!
+*/
+
+template_args: /* empty */ { initExpression();
+ templLevel = 1;
+ BEGIN IN_TEMPL_ARGS; }
+ ;
+
+/***** r.17.2 (ARM p.388): Expressions *****/
+
+
+/* const_expression skips all characters until it encounters either one
+ of "]", ")" or "," (it handles and discards sublevels of parentheses).
+ Since the rule is empty it must be used with care!
+*/
+
+const_expression: /* empty */ { initExpression();
+ BEGIN IN_EXPR; }
+ ;
+
+/* def_argument is just like const expression but handles the ","
+ slightly differently. It was added for 3.0 as tquick solution. TODO:
+ merge with const_expression.
+ */
+
+def_argument: /* empty */ { BEGIN IN_DEF_ARG; }
+ ;
+
+enumerator_expression: /* empty */ { initExpression();
+ BEGIN IN_ENUM; }
+ ;
+
+/***** r.17.3 (ARM p.391): Declarations *****/
+
+decl_specifier: storage_class_specifier { $$ = ""; }
+ | type_specifier { $$ = $1; }
+ | fct_specifier { $$ = ""; }
+ | FRIEND { skipFunc = TRUE; $$ = ""; }
+ | TYPEDEF { skipFunc = TRUE; $$ = ""; }
+ ;
+
+decl_specifiers: decl_specs_opt type_name decl_specs_opt
+ { $$ = straddSpc($1,$2,$3); }
+ ;
+decl_specs_opt: /* empty */ { $$ = ""; }
+ | decl_specs { $$ = $1; }
+ ;
+
+decl_specs: decl_specifier { $$ = $1; }
+ | decl_specs decl_specifier { $$ = straddSpc($1,$2); }
+ ;
+
+storage_class_specifier: AUTO
+ | REGISTER
+ | STATIC { skipFunc = TRUE; }
+ | EXTERN
+ ;
+
+fct_specifier: INLINE { }
+ | VIRTUAL { }
+ ;
+
+type_specifier: CONST { $$ = "const"; }
+ | VOLATILE { $$ = "volatile"; }
+ ;
+
+type_name: elaborated_type_specifier { $$ = $1; }
+ | complete_class_name { $$ = $1; }
+ | simple_type_names { $$ = $1; }
+ ;
+
+simple_type_names: simple_type_names simple_type_name
+ { $$ = straddSpc($1,$2); }
+ | simple_type_name { $$ = $1; }
+ ;
+
+simple_type_name: CHAR { $$ = "char"; }
+ | SHORT { $$ = "short"; }
+ | INT { $$ = "int"; }
+ | LONG { $$ = "long"; }
+ | SIGNED { $$ = "signed"; }
+ | UNSIGNED { $$ = "unsigned"; }
+ | FLOAT { $$ = "float"; }
+ | DOUBLE { $$ = "double"; }
+ | VOID { $$ = "void"; }
+ ;
+
+template_spec: TEMPLATE '<' template_args '>'
+ { g->tmpExpression = rmWS( g->tmpExpression );
+ $$ = stradd( "template<",
+ g->tmpExpression, ">" ); }
+ ;
+
+opt_template_spec: /* empty */
+ | template_spec { templateClassOld = templateClass;
+ templateClass = TRUE;
+ }
+ ;
+
+
+class_key: opt_template_spec CLASS { $$ = "class"; }
+ | opt_template_spec STRUCT { $$ = "struct"; }
+ ;
+
+complete_class_name: qualified_class_name { $$ = $1; }
+ | DBL_COLON qualified_class_name
+ { $$ = stradd( "::", $2 ); }
+ ;
+
+qualified_class_name: qualified_class_name DBL_COLON class_name
+ { $$ = stradd( $1, "::", $3 );}
+ | class_name { $$ = $1; }
+ ;
+
+elaborated_type_specifier:
+ class_key IDENTIFIER { $$ = straddSpc($1,$2); }
+ | ENUM IDENTIFIER { $$ = stradd("enum ",$2); }
+ | UNION IDENTIFIER { $$ = stradd("union ",$2); }
+ ;
+
+/***** r.17.4 (ARM p.393): Declarators *****/
+
+argument_declaration_list: arg_declaration_list_opt triple_dot_opt { $$ = $1;}
+ | arg_declaration_list ',' TRIPLE_DOT { $$ = $1;
+ func_warn("Ellipsis not supported"
+ " in signals and slots.\n"
+ "Ellipsis argument ignored."); }
+ ;
+
+arg_declaration_list_opt: /* empty */ { $$ = tmpArgList; }
+ | arg_declaration_list { $$ = $1; }
+ ;
+
+opt_exception_argument: /* empty */ { $$ = 0; }
+ | argument_declaration
+ ;
+
+triple_dot_opt: /* empty */
+ | TRIPLE_DOT { func_warn("Ellipsis not supported"
+ " in signals and slots.\n"
+ "Ellipsis argument ignored."); }
+
+ ;
+
+arg_declaration_list: arg_declaration_list
+ ','
+ argument_declaration { $$ = addArg($3); }
+ | argument_declaration { $$ = addArg($1); }
+ ;
+
+argument_declaration: decl_specifiers abstract_decl_opt
+ { $$ = new Argument(straddSpc($1,$2),""); }
+ | decl_specifiers abstract_decl_opt
+ '=' { expLevel = 1; }
+ def_argument
+ { $$ = new Argument(straddSpc($1,$2),"", 0, TRUE ); }
+ | decl_specifiers abstract_decl_opt dname
+ abstract_decl_opt
+ { $$ = new Argument(straddSpc($1,$2),$4, $3); }
+ | decl_specifiers abstract_decl_opt dname
+ abstract_decl_opt
+ '=' { expLevel = 1; }
+ def_argument
+ { $$ = new Argument(straddSpc($1,$2),$4, $3, TRUE); }
+ ;
+
+
+abstract_decl_opt: /* empty */ { $$ = ""; }
+ | abstract_decl { $$ = $1; }
+ ;
+
+abstract_decl: abstract_decl ptr_operator
+ { $$ = straddSpc($1,$2); }
+ | '[' { expLevel = 1; }
+ const_expression ']'
+ { $$ = stradd( "[",
+ g->tmpExpression =
+ g->tmpExpression.stripWhiteSpace(), "]" ); }
+ | abstract_decl '[' { expLevel = 1; }
+ const_expression ']'
+ { $$ = stradd( $1,"[",
+ g->tmpExpression =
+ g->tmpExpression.stripWhiteSpace(),"]" ); }
+ | ptr_operator { $$ = $1; }
+ | '(' abstract_decl ')' { $$ = $2; }
+ ;
+
+declarator: dname { $$ = ""; }
+ | declarator ptr_operator
+ { $$ = straddSpc($1,$2);}
+ | declarator '[' { expLevel = 1; }
+ const_expression ']'
+ { $$ = stradd( $1,"[",
+ g->tmpExpression =
+ g->tmpExpression.stripWhiteSpace(),"]" ); }
+ | '(' declarator ')' { $$ = $2; }
+ ;
+
+dname: IDENTIFIER
+ ;
+
+fct_decl: '('
+ argument_declaration_list
+ ')'
+ cv_qualifier_list_opt
+ ctor_initializer_opt
+ exception_spec_opt
+ opt_identifier
+ fct_body_or_semicolon
+ { tmpFunc->args = $2;
+ tmpFunc->qualifier = $4; }
+ ;
+
+fct_name: IDENTIFIER /* NOTE: simplified! */
+ | IDENTIFIER array_decls
+ { func_warn("Variable as signal or slot."); }
+ | IDENTIFIER '=' { expLevel=0; }
+ const_expression /* probably const member */
+ { skipFunc = TRUE; }
+ | IDENTIFIER array_decls '=' { expLevel=0; }
+ const_expression /* probably const member */
+ { skipFunc = TRUE; }
+ ;
+
+
+array_decls: '[' { expLevel = 1; }
+ const_expression ']'
+ | array_decls '[' { expLevel = 1; }
+ const_expression ']'
+
+ ;
+
+ptr_operators_opt: /* empty */ { $$ = ""; }
+ | ptr_operators { $$ = $1; }
+ ;
+
+ptr_operators: ptr_operator { $$ = $1; }
+ | ptr_operators ptr_operator { $$ = straddSpc($1,$2);}
+ ;
+
+ptr_operator: '*' cv_qualifier_list_opt { $$ = straddSpc("*",$2);}
+ | '&' cv_qualifier_list_opt { $$ = stradd("&",$2);}
+/*! | complete_class_name
+ DBL_COLON
+ '*'
+ cv_qualifier_list_opt { $$ = stradd($1,"::*",$4); }*/
+ ;
+
+cv_qualifier_list_opt: /* empty */ { $$ = ""; }
+ | cv_qualifier_list { $$ = $1; }
+ ;
+
+cv_qualifier_list: cv_qualifier { $$ = $1; }
+ | cv_qualifier_list cv_qualifier
+ { $$ = straddSpc($1,$2); }
+ ;
+
+cv_qualifier: CONST { $$ = "const"; }
+ | VOLATILE { $$ = "volatile"; }
+ ;
+
+fct_body_or_semicolon: ';'
+ | fct_body
+ | '=' INT_VAL ';' /* abstract func, INT_VAL = 0 */
+ ;
+
+fct_body: '{' { BEGIN IN_FCT; fctLevel = 1;}
+ '}' { BEGIN QT_DEF; }
+ ;
+
+
+/***** r.17.5 (ARM p.395): Class Declarations *****/
+
+class_specifier: full_class_head
+ '{' { BEGIN IN_CLASS;
+ classPLevel = 1;
+ }
+ opt_obj_member_list
+ '}' { BEGIN QT_DEF; } /*catch ';'*/
+ | class_head { BEGIN QT_DEF; /* -- " -- */
+ skipClass = TRUE; }
+ | class_head '*' IDENTIFIER { BEGIN QT_DEF; /* -- " -- */
+ skipClass = TRUE; }
+ | class_head '&' IDENTIFIER { BEGIN QT_DEF; /* -- " -- */
+ skipClass = TRUE; }
+ | class_head
+ '(' IDENTIFIER ')' /* TQt macro name */
+ { BEGIN QT_DEF; /* catch ';' */
+ skipClass = TRUE; }
+ | template_spec whatever { skipClass = TRUE;
+ BEGIN GIMME_SEMICOLON; }
+ ;
+
+whatever: IDENTIFIER
+ | simple_type_name
+ | type_specifier
+ | storage_class_specifier { $$ = ""; }
+ | fct_specifier
+ ;
+
+
+class_head: class_key
+ qualified_class_name { g->className = $2;
+ if ( g->className == "TQObject" )
+ Q_OBJECTdetected = TRUE;
+ }
+ | class_key
+ IDENTIFIER /* possible DLL EXPORT macro */
+ class_name { g->className = $3;
+ if ( g->className == "TQObject" )
+ Q_OBJECTdetected = TRUE;
+ }
+ ;
+
+full_class_head: class_head
+ opt_base_spec { g->superClassName = $2; }
+ ;
+
+nested_class_head: class_key
+ qualified_class_name
+ opt_base_spec { templateClass = templateClassOld; }
+ ;
+
+exception_spec_opt: /* empty */
+ | exception_spec
+ ;
+
+/* looser than the real thing */
+exception_spec: THROW '(' opt_exception_argument ')'
+ ;
+
+ctor_initializer_opt: /* empty */
+ | ctor_initializer
+ ;
+
+ctor_initializer: ':' mem_initializer_list
+ ;
+
+mem_initializer_list: mem_initializer
+ | mem_initializer ',' mem_initializer_list
+ ;
+
+/* complete_class_name also represents IDENTIFIER */
+mem_initializer: complete_class_name '(' { expLevel = 1; }
+ const_expression ')'
+ ;
+
+
+opt_base_spec: /* empty */ { $$ = 0; }
+ | base_spec { $$ = $1; }
+ ;
+
+opt_obj_member_list: /* empty */
+ | obj_member_list
+ ;
+
+obj_member_list: obj_member_list obj_member_area
+ | obj_member_area
+ ;
+
+
+qt_access_specifier: access_specifier { tmpAccess = $1; }
+ | SLOTS { moc_err( "Missing access specifier"
+ " before \"slots:\"." ); }
+ ;
+
+obj_member_area: qt_access_specifier { BEGIN QT_DEF; }
+ slot_area
+ | SIGNALS { BEGIN QT_DEF; }
+ ':' opt_signal_declarations
+ | Q_OBJECT {
+ 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;
+ }
+ | Q_PROPERTY { tmpYYStart = YY_START;
+ tmpPropOverride = FALSE;
+ BEGIN IN_PROPERTY; }
+ '(' property ')' {
+ BEGIN tmpYYStart;
+ }
+ opt_property_candidates
+ | Q_OVERRIDE { tmpYYStart = YY_START;
+ tmpPropOverride = TRUE;
+ BEGIN IN_PROPERTY; }
+ '(' property ')' {
+ BEGIN tmpYYStart;
+ }
+ opt_property_candidates
+ | Q_CLASSINFO { tmpYYStart = YY_START; BEGIN IN_CLASSINFO; }
+ '(' STRING ',' STRING ')'
+ {
+ g->infos.append( new ClassInfo( $4, $6 ) );
+ BEGIN tmpYYStart;
+ }
+ opt_property_candidates
+ | Q_ENUMS { tmpYYStart = YY_START; BEGIN IN_PROPERTY; }
+ '(' qt_enums ')' {
+ Q_PROPERTYdetected = TRUE;
+ BEGIN tmpYYStart;
+ }
+ opt_property_candidates
+ | Q_SETS { tmpYYStart = YY_START; BEGIN IN_PROPERTY; }
+ '(' qt_sets ')' {
+ Q_PROPERTYdetected = TRUE;
+ BEGIN tmpYYStart;
+ }
+ opt_property_candidates
+ ;
+
+slot_area: SIGNALS ':' { moc_err( "Signals cannot "
+ "have access specifiers" ); }
+ | SLOTS ':' opt_slot_declarations
+ | ':' { if ( tmpAccess == Public && Q_PROPERTYdetected )
+ BEGIN QT_DEF;
+ else
+ BEGIN IN_CLASS;
+ suppress_func_warn = TRUE;
+ }
+ opt_property_candidates
+ {
+ suppress_func_warn = FALSE;
+ }
+ | IDENTIFIER { BEGIN IN_CLASS;
+ if ( classPLevel != 1 )
+ moc_warn( "unexpected access"
+ "specifier" );
+ }
+ ;
+
+opt_property_candidates: /*empty*/
+ | property_candidate_declarations
+ ;
+
+property_candidate_declarations: property_candidate_declarations property_candidate_declaration
+ | property_candidate_declaration
+ ;
+
+property_candidate_declaration: signal_or_slot { addMember( PropertyCandidateMember ); }
+ ;
+
+opt_signal_declarations: /* empty */
+ | signal_declarations
+ ;
+
+signal_declarations: signal_declarations signal_declaration
+ | signal_declaration
+ ;
+
+
+signal_declaration: signal_or_slot { addMember( SignalMember ); }
+ ;
+
+opt_slot_declarations: /* empty */
+ | slot_declarations
+ ;
+
+slot_declarations: slot_declarations slot_declaration
+ | slot_declaration
+ ;
+
+slot_declaration: signal_or_slot { addMember( SlotMember ); }
+ ;
+
+opt_semicolons: /* empty */
+ | opt_semicolons ';'
+ ;
+
+base_spec: ':' base_list { $$=$2; }
+ ;
+
+base_list : base_list ',' base_specifier { g->multipleSuperClasses.append( $3 ); }
+ | base_specifier
+ ;
+
+qt_macro_name: IDENTIFIER '(' IDENTIFIER ')'
+ { $$ = stradd( $1, "(", $3, ")" ); }
+ | IDENTIFIER '(' simple_type_name ')'
+ { $$ = stradd( $1, "(", $3, ")" ); }
+ ;
+
+base_specifier: complete_class_name {$$=$1;}
+ | VIRTUAL access_specifier complete_class_name {$$=$3;}
+ | VIRTUAL complete_class_name {$$=$2;}
+ | access_specifier VIRTUAL complete_class_name {$$=$3;}
+ | access_specifier complete_class_name {$$=$2;}
+ | qt_macro_name {$$=$1;}
+ | VIRTUAL access_specifier qt_macro_name {$$=$3;}
+ | VIRTUAL qt_macro_name {$$=$2;}
+ | access_specifier VIRTUAL qt_macro_name {$$=$3;}
+ | access_specifier qt_macro_name {$$=$2;}
+ ;
+
+access_specifier: PRIVATE { $$=Private; }
+ | PROTECTED { $$=Protected; }
+ | PUBLIC { $$=Public; }
+ ;
+
+operator_name: decl_specs_opt IDENTIFIER ptr_operators_opt { }
+ | decl_specs_opt simple_type_name ptr_operators_opt { }
+ | '+'
+ | '-'
+ | '*'
+ | '/'
+ | '%'
+ | '^'
+ | '&'
+ | '|'
+ | '~'
+ | '!'
+ | '='
+ | '<'
+ | '>'
+ | '+' '='
+ | '-' '='
+ | '*' '='
+ | '/' '='
+ | '%' '='
+ | '^' '='
+ | '&' '='
+ | '|' '='
+ | '~' '='
+ | '!' '='
+ | '=' '='
+ | '<' '='
+ | '>' '='
+ | '<' '<'
+ | '>' '>'
+ | '<' '<' '='
+ | '>' '>' '='
+ | '&' '&'
+ | '|' '|'
+ | '+' '+'
+ | '-' '-'
+ | ','
+ | '-' '>' '*'
+ | '-' '>'
+ | '(' ')'
+ | '[' ']'
+ ;
+
+
+opt_virtual: /* empty */
+ | VIRTUAL
+ ;
+
+type_and_name: type_name fct_name
+ { tmpFunc->type = $1;
+ tmpFunc->name = $2; }
+ | fct_name
+ { tmpFunc->type = "int";
+ tmpFunc->name = $1;
+ if ( tmpFunc->name == g->className )
+ func_warn( "Constructors cannot be"
+ " signals or slots.");
+ }
+ | opt_virtual '~' fct_name
+ { tmpFunc->type = "void";
+ tmpFunc->name = "~";
+ tmpFunc->name += $3;
+ func_warn( "Destructors cannot be"
+ " signals or slots.");
+ }
+ | decl_specs type_name decl_specs_opt
+ ptr_operators_opt fct_name
+ {
+ char *tmp =
+ straddSpc($1,$2,$3,$4);
+ tmpFunc->type = rmWS(tmp);
+ delete [] tmp;
+ tmpFunc->name = $5; }
+ | decl_specs type_name /* probably friend decl */
+ { skipFunc = TRUE; }
+ | type_name ptr_operators fct_name
+ { tmpFunc->type =
+ straddSpc($1,$2);
+ tmpFunc->name = $3; }
+ | type_name decl_specs ptr_operators_opt
+ fct_name
+ { tmpFunc->type =
+ straddSpc($1,$2,$3);
+ tmpFunc->name = $4; }
+ | type_name OPERATOR operator_name
+ { operatorError(); }
+ | OPERATOR operator_name
+ { operatorError(); }
+ | decl_specs type_name decl_specs_opt
+ ptr_operators_opt OPERATOR operator_name
+ { operatorError(); }
+ | type_name ptr_operators OPERATOR operator_name
+ { operatorError(); }
+ | type_name decl_specs ptr_operators_opt
+ OPERATOR operator_name
+ { operatorError(); }
+ ;
+
+
+signal_or_slot: type_and_name fct_decl opt_semicolons
+ | type_and_name opt_bitfield ';' opt_semicolons
+ { func_warn("Unexpected variable declaration."); }
+ | type_and_name opt_bitfield ','member_declarator_list
+ ';' opt_semicolons
+ { func_warn("Unexpected variable declaration."); }
+ | enum_specifier opt_identifier ';' opt_semicolons
+ { func_warn("Unexpected enum declaration."); }
+ | USING complete_class_name ';' opt_semicolons
+ { func_warn("Unexpected using declaration."); }
+ | USING NAMESPACE complete_class_name ';' opt_semicolons
+ { func_warn("Unexpected using declaration."); }
+ | NAMESPACE IDENTIFIER '{'
+ { classPLevel++;
+ moc_err("Unexpected namespace declaration."); }
+ | nested_class_head ';' opt_semicolons
+ { func_warn("Unexpected class declaration.");}
+ | nested_class_head
+ '{' { func_warn("Unexpected class declaration.");
+ BEGIN IN_FCT; fctLevel=1;
+ }
+ '}' { BEGIN QT_DEF; }
+ ';' opt_semicolons
+ ;
+
+
+member_declarator_list: member_declarator
+ | member_declarator_list ',' member_declarator
+ ;
+
+member_declarator: declarator { }
+ | IDENTIFIER ':' { expLevel = 0; }
+ const_expression
+ | ':' { expLevel = 0; }
+ const_expression
+ ;
+
+opt_bitfield: /* empty */
+ | ':' { expLevel = 0; }
+ const_expression
+ ;
+
+
+enum_specifier: ENUM enum_tail
+ ;
+
+/* optional final comma at the end of an enum list. Not really C++ but
+some people still use it */
+opt_komma: /*empty*/
+ | ','
+ ;
+
+enum_tail: IDENTIFIER '{' enum_list opt_komma
+ '}' { BEGIN QT_DEF;
+ if ( tmpAccess == Public) {
+ tmpEnum->name = $1;
+ addEnum();
+ }
+ }
+ | '{' enum_list opt_komma
+ '}' { tmpEnum->clear();}
+ ;
+
+opt_identifier: /* empty */
+ | IDENTIFIER { }
+ ;
+
+enum_list: /* empty */
+ | enumerator
+ | enum_list ',' enumerator
+ ;
+
+enumerator: IDENTIFIER { if ( tmpAccess == Public) tmpEnum->append( $1 ); }
+ | IDENTIFIER '=' { enumLevel=0; }
+ enumerator_expression { if ( tmpAccess == Public) tmpEnum->append( $1 ); }
+ ;
+
+property: IDENTIFIER IDENTIFIER
+ {
+ g->propWrite = "";
+ g->propRead = "";
+ g->propOverride = tmpPropOverride;
+ g->propReset = "";
+ if ( g->propOverride ) {
+ g->propStored = "";
+ g->propDesignable = "";
+ g->propScriptable = "";
+ } else {
+ g->propStored = "true";
+ g->propDesignable = "true";
+ g->propScriptable = "true";
+ }
+ }
+ prop_statements
+ {
+ if ( g->propRead.isEmpty() && !g->propOverride )
+ moc_err( "A property must at least feature a read method." );
+ checkPropertyName( $2 );
+ Q_PROPERTYdetected = TRUE;
+ // Avoid duplicates
+ for( TQPtrListIterator<Property> lit( g->props ); lit.current(); ++lit ) {
+ if ( lit.current()->name == $2 ) {
+ if ( displayWarnings )
+ moc_err( "Property '%s' defined twice.",
+ (const char*)lit.current()->name );
+ }
+ }
+ g->props.append( new Property( lineNo, $1, $2,
+ g->propWrite, g->propRead, g->propReset,
+ g->propStored, g->propDesignable,
+ g->propScriptable, g->propOverride ) );
+ }
+ ;
+
+prop_statements: /* empty */
+ | READ IDENTIFIER prop_statements { g->propRead = $2; }
+ | WRITE IDENTIFIER prop_statements { g->propWrite = $2; }
+ | RESET IDENTIFIER prop_statements { g->propReset = $2; }
+ | STORED IDENTIFIER prop_statements { g->propStored = $2; }
+ | DESIGNABLE IDENTIFIER prop_statements { g->propDesignable = $2; }
+ | SCRIPTABLE IDENTIFIER prop_statements { g->propScriptable = $2; }
+ ;
+
+qt_enums: /* empty */ { }
+ | IDENTIFIER qt_enums { g->qtEnums.append( $1 ); }
+ ;
+
+qt_sets: /* empty */ { }
+ | IDENTIFIER qt_sets { g->qtSets.append( $1 ); }
+ ;
+
+%%
+
+#ifndef YYBISON
+# if defined(Q_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 "moc_lex.cpp"
+#endif //YYBISON
+
+void cleanup();
+TQCString combinePath( const char *, const char * );
+
+FILE *out; // output file
+
+parser_reg::parser_reg() : funcs(TRUE)
+{
+ gen_count = 0;
+ noInclude = FALSE; // no #include <filename>
+ generatedCode = FALSE; // no code generated
+ mocError = FALSE; // moc parsing error occurred
+ hasVariantIncluded = FALSE;
+}
+
+
+parser_reg::~parser_reg()
+{
+ slots.clear();
+ signals.clear();
+ propfuncs.clear();
+ funcs.clear();
+ infos.clear();
+ props.clear();
+ infos.clear();
+}
+
+int yyparse();
+
+void replace( char *s, char c1, char c2 );
+
+void setDefaultIncludeFile()
+{
+ if ( g->includeFiles.isEmpty() ) {
+ if ( g->includePath.isEmpty() ) {
+ if ( !g->fileName.isEmpty() && !g->outputFile.isEmpty() ) {
+ g->includeFiles.append( combinePath(g->fileName, g->outputFile) );
+ } else {
+ g->includeFiles.append( g->fileName );
+ }
+ } else {
+ g->includeFiles.append( combinePath(g->fileName, g->fileName) );
+ }
+ }
+}
+
+#ifdef Q_CC_MSVC
+#define ErrorFormatString "%s(%d):"
+#else
+#define ErrorFormatString "%s:%d:"
+#endif
+
+#ifndef MOC_MWERKS_PLUGIN
+int main( int argc, char **argv )
+{
+ init();
+
+ bool autoInclude = TRUE;
+ const char *error = 0;
+ g->qtPath = "";
+ for ( int n=1; n<argc && error==0; n++ ) {
+ TQCString arg = argv[n];
+ if ( arg[0] == '-' ) { // option
+ TQCString opt = &arg[1];
+ if ( opt[0] == 'o' ) { // output redirection
+ if ( opt[1] == '\0' ) {
+ if ( !(n < argc-1) ) {
+ error = "Missing output file name";
+ break;
+ }
+ g->outputFile = argv[++n];
+ } else
+ g->outputFile = &opt[1];
+ } else if ( opt == "i" ) { // no #include statement
+ g->noInclude = TRUE;
+ autoInclude = FALSE;
+ } else if ( opt[0] == 'f' ) { // produce #include statement
+ g->noInclude = FALSE;
+ autoInclude = FALSE;
+ if ( opt[1] ) // -fsomething.h
+ g->includeFiles.append( &opt[1] );
+ } else if ( opt == "pch" ) { // produce #include statement for PCH
+ if ( !(n < argc-1) ) {
+ error = "Missing name of PCH file";
+ break;
+ }
+ g->pchFile = argv[++n];
+ } 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;
+ }
+ g->includePath = argv[++n];
+ } else {
+ g->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;
+ }
+ g->qtPath = argv[++n];
+ } else {
+ g->qtPath = &opt[1];
+ }
+ replace(g->qtPath.data(),'\\','/');
+ if ( g->qtPath.right(1) != "/" )
+ g->qtPath += '/';
+ } else if ( opt == "v" ) { // version number
+ fprintf( stderr, "TQt Meta Object Compiler version %d"
+ " (TQt %s)\n", formatRevision,
+ QT_VERSION_STR );
+ cleanup();
+ return 1;
+ } else if ( opt == "k" ) { // 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 ( !g->fileName.isNull() ) // can handle only one file
+ error = "Too many input files specified";
+ else
+ g->fileName = arg.copy();
+ }
+ }
+
+ if ( autoInclude ) {
+ int ppos = g->fileName.findRev('.');
+ if ( ppos != -1 && tolower( g->fileName[ppos + 1] ) == 'h' )
+ g->noInclude = FALSE;
+ else
+ g->noInclude = TRUE;
+ }
+ setDefaultIncludeFile();
+
+ if ( g->fileName.isNull() && !error ) {
+ g->fileName = "standard input";
+ yyin = stdin;
+ } else if ( argc < 2 || error ) { // incomplete/wrong args
+ fprintf( stderr, "TQt 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-f[file] Force #include, optional file name\n"
+ "\t-p path Path prefix for included file\n"
+ "\t-i Do not generate an #include statement\n"
+ "\t-k Do not stop on errors\n"
+ "\t-nw Do not display warnings\n"
+ "\t-v Display version of moc\n" );
+ cleanup();
+ return 1;
+ } else {
+ yyin = fopen( (const char *)g->fileName, "r" );
+ if ( !yyin ) {
+ fprintf( stderr, "moc: %s: No such file\n", (const char*)g->fileName);
+ cleanup();
+ return 1;
+ }
+ }
+ if ( !g->outputFile.isEmpty() ) { // output file specified
+ out = fopen( (const char *)g->outputFile, "w" ); // create output file
+ if ( !out ) {
+ fprintf( stderr, "moc: Cannot create %s\n",
+ (const char*)g->outputFile );
+ cleanup();
+ return 1;
+ }
+ } else { // use stdout
+ out = stdout;
+ }
+ yyparse();
+ fclose( yyin );
+ if ( !g->outputFile.isNull() )
+ fclose( out );
+
+ if ( !g->generatedCode && displayWarnings && !g->mocError ) {
+ fprintf( stderr, ErrorFormatString" Warning: %s\n", g->fileName.data(), 0,
+ "No relevant classes found. No output generated." );
+ }
+
+ int ret = g->mocError ? 1 : 0;
+ cleanup();
+ return ret;
+}
+#else
+bool qt_is_gui_used = FALSE;
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef Q_OS_MAC9
+# include <Files.h>
+# include <Strings.h>
+# include <Errors.h>
+# include "Aliases.h"
+#endif
+#include "CWPluginErrors.h"
+#include <CWPlugins.h>
+#include "DropInCompilerLinker.h"
+#include <stat.h>
+
+const unsigned char *p_str(const char *, int =-1);
+
+CWPluginContext g_ctx;
+
+moc_status do_moc( CWPluginContext ctx, const TQCString &fin, const TQCString &fout, CWFileSpec *dspec, bool i)
+{
+ init();
+
+ g_ctx = ctx;
+ g->noInclude = i;
+ g->fileName = fin;
+ g->outputFile = fout;
+
+ setDefaultIncludeFile();
+
+ CWFileInfo fi;
+ memset(&fi, 0, sizeof(fi));
+ fi.fullsearch = TRUE;
+ fi.dependencyType = cwNormalDependency;
+ fi.isdependentoffile = kCurrentCompiledFile;
+ if(CWFindAndLoadFile( ctx, fin.data(), &fi) != cwNoErr) {
+ cleanup();
+ return moc_no_source;
+ }
+
+ if(dspec) {
+ memcpy(dspec, &fi.filespec, sizeof(fi.filespec));
+ const unsigned char *f = p_str(fout.data());
+ memcpy(dspec->name, f, f[0]+1);
+ free(f);
+ }
+ buf_size_total = fi.filedatalength;
+ buf_buffer = fi.filedata;
+
+ TQCString path("");
+ AliasHandle alias;
+ Str63 str;
+ AliasInfoType x = 1;
+ char tmp[sizeof(Str63)+2];
+ if(NewAlias( NULL, &fi.filespec, &alias) != noErr) {
+ cleanup();
+ return moc_general_error;
+ }
+ for(;;) {
+ GetAliasInfo(alias, x++, str);
+ if(!str[0])
+ break;
+ strncpy((char *)tmp, (const char *)str+1, str[0]);
+ tmp[str[0]] = '\0';
+ path.prepend(":");
+ path.prepend((char *)tmp);
+ }
+ path.prepend("MacOS 9:"); //FIXME
+
+ TQString inpath = path + fin, outpath = path + fout;
+ struct stat istat, ostat;
+ if(stat(inpath, &istat) == -1) {
+ cleanup();
+ return moc_no_source;
+ }
+ if(stat(outpath, &ostat) == 0 && istat.st_mtime < ostat.st_mtime) {
+ cleanup();
+ return moc_not_time;
+ }
+
+ unlink(outpath.data());
+ out = fopen(outpath.data(), "w+");
+ if(!out) {
+ cleanup();
+ return moc_general_error;
+ }
+
+ yyparse();
+ if(out != stdout)
+ fclose(out);
+
+ if(g->mocError || !g->generatedCode) {
+ unlink(outpath.data());
+ moc_status ret = !g->generatedCode ? moc_no_qobject : moc_parse_error;
+ cleanup();
+ return ret;
+ }
+
+ cleanup();
+ return moc_success;
+}
+#endif
+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
+ */
+
+TQCString combinePath( const char *infile, const char *outfile )
+{
+ TQFileInfo inFileInfo( TQDir::current(), TQFile::decodeName(infile) );
+ TQFileInfo outFileInfo( TQDir::current(), TQFile::decodeName(outfile) );
+ int numCommonComponents = 0;
+
+ TQStringList inSplitted =
+ TQStringList::split( '/', inFileInfo.dir().canonicalPath(), TRUE );
+ TQStringList outSplitted =
+ TQStringList::split( '/', outFileInfo.dir().canonicalPath(), TRUE );
+
+ while ( !inSplitted.isEmpty() && !outSplitted.isEmpty() &&
+ inSplitted.first() == outSplitted.first() ) {
+ inSplitted.remove( inSplitted.begin() );
+ outSplitted.remove( outSplitted.begin() );
+ numCommonComponents++;
+ }
+
+ if ( numCommonComponents < 2 ) {
+ /*
+ The paths don't have the same drive, or they don't have the
+ same root directory. Use an absolute path.
+ */
+ return TQFile::encodeName( inFileInfo.absFilePath() );
+ } else {
+ /*
+ The paths have something in common. Use a path relative to
+ the output file.
+ */
+ while ( !outSplitted.isEmpty() ) {
+ outSplitted.remove( outSplitted.begin() );
+ inSplitted.prepend( ".." );
+ }
+ inSplitted.append( inFileInfo.fileName() );
+ return TQFile::encodeName( inSplitted.join("/") );
+ }
+}
+
+
+#define getenv hack_getenv // workaround for byacc
+char *getenv() { return 0; }
+char *getenv( const char * ) { return 0; }
+
+void init() // initialize
+{
+ BEGIN OUTSIDE;
+ if(g)
+ delete g;
+ g = new parser_reg;
+ lineNo = 1;
+ skipClass = FALSE;
+ skipFunc = FALSE;
+ tmpArgList = new ArgList;
+ tmpFunc = new Function;
+ tmpEnum = new Enum;
+
+#ifdef MOC_MWERKS_PLUGIN
+ buf_buffer = NULL;
+ buf_index = 0;
+ buf_size_total = 0;
+#endif
+}
+
+void cleanup()
+{
+ delete g;
+ g = NULL;
+
+#ifdef MOC_MWERKS_PLUGIN
+ if(buf_buffer && g_ctx)
+ CWReleaseFileText(g_ctx, buf_buffer);
+#endif
+}
+
+void initClass() // prepare for new class
+{
+ tmpAccess = Private;
+ subClassPerm = Private;
+ Q_OBJECTdetected = FALSE;
+ Q_PROPERTYdetected = FALSE;
+ skipClass = FALSE;
+ templateClass = FALSE;
+ g->slots.clear();
+ g->signals.clear();
+ g->propfuncs.clear();
+ g->enums.clear();
+ g->funcs.clear();
+ g->props.clear();
+ g->infos.clear();
+ g->qtSets.clear();
+ g->qtEnums.clear();
+ g->multipleSuperClasses.clear();
+}
+
+struct NamespaceInfo
+{
+ TQCString name;
+ int pLevelOnEntering; // Parenthesis level on entering the namespace
+ TQDict<char> definedClasses; // Classes defined in the namespace
+};
+
+TQPtrList<NamespaceInfo> namespaces;
+
+void enterNameSpace( const char *name ) // 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();
+}
+
+TQCString nameQualifier()
+{
+ TQPtrListIterator<NamespaceInfo> iter( namespaces );
+ NamespaceInfo *tmp;
+ TQCString 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;
+ TQPtrListIterator<NamespaceInfo> iter( namespaces );
+ NamespaceInfo *tmp;
+ TQCString 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++;
+ }
+ }
+ TQCString nm = g->className;
+ int pos;
+ while( (pos = nm.find( "::" )) != -1 ) {
+ TQCString 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 *)g->className,(char*)1);
+}
+
+//
+// Remove white space from SIGNAL and SLOT names.
+// This function has been copied from qobject.cpp.
+//
+
+inline bool isSpace( char x )
+{
+#if defined(Q_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( (uchar) x );
+#endif
+}
+
+static TQCString rmWS( const char *src )
+{
+ TQCString 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()
+{
+ g->tmpExpression = "";
+}
+
+void addExpressionString( const char *s )
+{
+ g->tmpExpression += s;
+}
+
+void addExpressionChar( const char c )
+{
+ g->tmpExpression += c;
+}
+
+void yyerror( const char *msg ) // print yacc error message
+{
+ g->mocError = TRUE;
+#ifndef MOC_MWERKS_PLUGIN
+ fprintf( stderr, ErrorFormatString" Error: %s\n", g->fileName.data(), lineNo, msg );
+#else
+ char msg2[200];
+ sprintf(msg2, ErrorFormatString" Error: %s", g->fileName.data(), lineNo, msg);
+ CWReportMessage(g_ctx, NULL, msg2, NULL, messagetypeError, 0);
+#endif
+ if ( errorControl ) {
+ if ( !g->outputFile.isEmpty() && yyin && fclose(yyin) == 0 )
+ remove( g->outputFile );
+ exit( -1 );
+ }
+}
+
+void moc_err( const char *s )
+{
+ yyerror( s );
+}
+
+void moc_err( const char *s1, const char *s2 )
+{
+ static char tmp[1024];
+ sprintf( tmp, s1, s2 );
+ yyerror( tmp );
+}
+
+void moc_warn( const char *msg )
+{
+ if ( displayWarnings )
+ fprintf( stderr, ErrorFormatString" Warning: %s\n", g->fileName.data(), lineNo, msg);
+}
+
+void moc_warn( char *s1, char *s2 )
+{
+ static char tmp[1024];
+ sprintf( tmp, s1, s2 );
+ if ( displayWarnings )
+ fprintf( stderr, ErrorFormatString" Warning: %s\n", g->fileName.data(), lineNo, tmp);
+}
+
+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
+
+
+/*
+ We call B::qt_invoke() rather than A::B::qt_invoke() to
+ work around a bug in MSVC 6. The bug occurs if the
+ super-class is in a namespace and the sub-class isn't.
+
+ Exception: If the superclass has the same name as the subclass, we
+ want non-MSVC users to have a working generated files.
+*/
+TQCString purestSuperClassName()
+{
+ TQCString sc = g->superClassName;
+ TQCString c = g->className;
+ /*
+ Make sure qualified template arguments (e.g., foo<bar::baz>)
+ don't interfere.
+ */
+ int pos = sc.findRev( "::", sc.find( '<' ) );
+ if ( pos != -1 ) {
+ sc = sc.right( sc.length() - pos - 2 );
+ pos = c.findRev( "::" );
+ if ( pos != -1 )
+ c = c.right( c.length() - pos - 2 );
+ if ( sc == c )
+ sc = g->superClassName;
+ }
+ return sc;
+}
+
+TQCString qualifiedClassName()
+{
+ return nameQualifier() + g->className;
+}
+
+const int Slot_Num = 1;
+const int Signal_Num = 2;
+const int Prop_Num = 3;
+
+void generateFuncs( FuncList *list, const char *functype, int num )
+{
+ Function *f;
+ for ( f=list->first(); f; f=list->next() ) {
+ bool hasReturnValue = f->type != "void" && (validUType( f->type ) || isVariantType( f->type) );
+
+ if ( hasReturnValue || !f->args->isEmpty() ) {
+ fprintf( out, " static const TQUParameter param_%s_%d[] = {\n", functype, list->at() );
+ if ( hasReturnValue ) {
+ if ( validUType( f->type ) )
+ fprintf( out, "\t{ 0, &static_QUType_%s, %s, TQUParameter::Out }", uType(f->type).data(), uTypeExtra(f->type).data() );
+ else
+ fprintf( out, "\t{ 0, &static_QUType_TQVariant, %s, TQUParameter::Out }", uTypeExtra(f->type).data() );
+ if ( !f->args->isEmpty() )
+ fprintf( out, ",\n" );
+ }
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ if( a->name.isEmpty() )
+ fprintf( out, "\t{ 0, &static_QUType_%s, %s, TQUParameter::%s }",
+ uType( type ).data(), uTypeExtra( type ).data(),
+ isInOut( type ) ? "InOut" : "In" );
+ else
+ fprintf( out, "\t{ \"%s\", &static_QUType_%s, %s, TQUParameter::%s }",
+ a->name.data(), uType( type ).data(), uTypeExtra( type ).data(),
+ isInOut( type ) ? "InOut" : "In" );
+ a = f->args->next();
+ if ( a )
+ fprintf( out, ",\n" );
+ }
+ fprintf( out, "\n };\n");
+ }
+
+ fprintf( out, " static const TQUMethod %s_%d = {", functype, list->at() );
+ int n = f->args->count();
+ if ( hasReturnValue )
+ n++;
+ fprintf( out, "\"%s\", %d,", f->name.data(), n );
+ if ( n )
+ fprintf( out, " param_%s_%d };\n", functype, list->at() );
+ else
+ fprintf( out, " 0 };\n" );
+
+ TQCString 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();
+ }
+ f->signature = f->name;
+ f->signature += "(";
+ f->signature += typstr;
+ f->signature += ")";
+ }
+ if ( list->count() ) {
+ fprintf(out," static const TQMetaData %s_tbl[] = {\n", functype );
+ f = list->first();
+ while ( f ) {
+ fprintf( out, "\t{ \"%s\",", f->signature.data() );
+ fprintf( out, " &%s_%d,", functype, list->at() );
+ fprintf( out, " TQMetaData::%s }", f->accessAsString() );
+ f = list->next();
+ if ( f )
+ fprintf( out, ",\n");
+ }
+ fprintf( out, "\n };\n" );
+ }
+}
+
+
+int enumIndex( const char* type )
+{
+ int index = 0;
+ for( TQPtrListIterator<Enum> lit( g->enums ); lit.current(); ++lit ) {
+ if ( lit.current()->name == type )
+ return index;
+ index++;
+ }
+ return -1;
+}
+
+bool isEnumType( const char* type )
+{
+ return enumIndex( type ) >= 0 || ( g->qtEnums.contains( type ) || g->qtSets.contains( type ) );
+}
+
+bool isPropertyType( const char* type )
+{
+ if ( isVariantType( type ) )
+ return TRUE;
+
+ return isEnumType( type );
+}
+
+int generateEnums()
+{
+ if ( g->enums.count() == 0 )
+ return 0;
+
+ fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
+ int i = 0;
+ for ( TQPtrListIterator<Enum> it( g->enums ); it.current(); ++it, ++i ) {
+ fprintf( out, " static const TQMetaEnum::Item enum_%i[] = {\n", i );
+ int k = 0;
+ for( TQStrListIterator eit( *it.current() ); eit.current(); ++eit, ++k ) {
+ if ( k )
+ fprintf( out, ",\n" );
+ fprintf( out, "\t{ \"%s\", (int) %s::%s }", eit.current(), (const char*) g->className, eit.current() );
+ }
+ fprintf( out, "\n };\n" );
+ }
+ fprintf( out, " static const TQMetaEnum enum_tbl[] = {\n" );
+ i = 0;
+ for ( TQPtrListIterator<Enum> it2( g->enums ); it2.current(); ++it2, ++i ) {
+ if ( i )
+ fprintf( out, ",\n" );
+ fprintf( out, "\t{ \"%s\", %u, enum_%i, %s }",
+ (const char*)it2.current()->name,
+ it2.current()->count(),
+ i,
+ it2.current()->set ? "TRUE" : "FALSE" );
+ }
+ fprintf( out, "\n };\n" );
+ fprintf( out, "#endif // QT_NO_PROPERTIES\n" );
+
+ return g->enums.count();
+}
+
+int generateProps()
+{
+ //
+ // Resolve and verify property access functions
+ //
+ for( TQPtrListIterator<Property> it( g->props ); it.current(); ) {
+ Property* p = it.current();
+ ++it;
+
+ // verify get function
+ if ( !p->get.isEmpty() ) {
+ FuncList candidates = g->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;
+ TQCString tmp = f->type;
+ Property::Specification spec = Property::Unspecified;
+ if ( p->type == "TQCString" && (tmp == "const char*" || tmp == "const char *" ) ) {
+ tmp = "TQCString";
+ 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( TQPtrListIterator<Enum> lit( g->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 ( !isVariantType( p->type ) ) {
+ if ( tmp == "int" || tmp == "uint" || tmp == "unsigned int" ) {
+ // Test whether the enum is really a set (unfortunately we don't know enums of super classes)
+ bool ok = TRUE;
+ for( TQPtrListIterator<Enum> lit( g->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;
+ p->enumgettype = tmp;
+ }
+ }
+ }
+ if ( p->getfunc == 0 ) {
+ if ( displayWarnings ) {
+
+ // Is the type a set, that means, mentioned in Q_SETS?
+ bool set = FALSE;
+ for( TQPtrListIterator<Enum> lit( g->enums ); lit.current(); ++lit )
+ if ( lit.current()->name == p->type && lit.current()->set )
+ set = TRUE;
+
+ fprintf( stderr, ErrorFormatString" Warning: Property '%s' not available.\n",
+ g->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 == "TQCString" )
+ 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 mismatching candidate(s)\n");
+ for ( Function* f = candidates.first(); f; f = candidates.next() ) {
+ TQCString 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", g->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 = g->propfuncs.find( p->set );
+ for ( Function* f = candidates.first(); f; f = candidates.next() ) {
+ if ( !f->args || f->args->isEmpty() )
+ continue;
+ TQCString 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 == "TQCString" && (tmp == "const char*" || tmp == "const char *" ) ) {
+ tmp = "TQCString";
+ 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( TQPtrListIterator<Enum> lit( g->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 ( !isVariantType( 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( TQPtrListIterator<Enum> lit( g->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;
+ p->enumsettype = tmp;
+ }
+ }
+ }
+ if ( p->setfunc == 0 ) {
+ if ( displayWarnings ) {
+
+ // Is the type a set, that means, mentioned in Q_SETS ?
+ bool set = FALSE;
+ for( TQPtrListIterator<Enum> lit( g->enums ); lit.current(); ++lit )
+ if ( lit.current()->name == p->type && lit.current()->set )
+ set = TRUE;
+
+ fprintf( stderr, ErrorFormatString" Warning: Property '%s' not writable.\n",
+ g->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 == "TQCString" )
+ fprintf( stderr, " void %s( const char* ) const\n",
+ (const char*) p->set );
+
+ if ( !candidates.isEmpty() ) {
+ fprintf( stderr, " but only found the mismatching candidate(s)\n");
+ for ( Function* f = candidates.first(); f; f = candidates.next() ) {
+ TQCString 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", g->fileName.data(), f->lineNo,
+ (const char*) f->type,(const char*) f->name, (const char*) typstr );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //
+ // Create meta data
+ //
+ if ( g->props.count() ) {
+ if ( displayWarnings && !Q_OBJECTdetected )
+ moc_err("The declaration of the class \"%s\" contains properties"
+ " but no Q_OBJECT macro.", g->className.data());
+
+ fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
+
+ fprintf( out, " static const TQMetaProperty props_tbl[%d] = {\n ", g->props.count() );
+ for( TQPtrListIterator<Property> it( g->props ); it.current(); ++it ) {
+
+ fprintf( out, "\t{ \"%s\",\"%s\", ", it.current()->type.data(), it.current()->name.data() );
+ int flags = Invalid;
+ if ( !isVariantType( it.current()->type ) ) {
+ flags |= EnumOrSet;
+ if ( !isEnumType( it.current()->type ) )
+ flags |= UnresolvedEnum;
+ } else {
+ flags |= qvariant_nameToType( it.current()->type ) << 24;
+ }
+ if ( it.current()->getfunc )
+ flags |= Readable;
+ if ( it.current()->setfunc ) {
+ flags |= Writable;
+ if ( it.current()->stdSet() )
+ flags |= StdSet;
+ }
+ if ( it.current()->override )
+ flags |= Override;
+
+ if ( it.current()->designable.isEmpty() )
+ flags |= DesignableOverride;
+ else if ( it.current()->designable == "false" )
+ flags |= NotDesignable;
+
+ if ( it.current()->scriptable.isEmpty() )
+ flags |= ScriptableOverride;
+ else if ( it.current()->scriptable == "false" )
+ flags |= NotScriptable;
+
+ if ( it.current()->stored.isEmpty() )
+ flags |= StoredOverride;
+ else if ( it.current()->stored == "false" )
+ flags |= NotStored;
+
+
+ fprintf( out, "0x%.4x, ", flags );
+ fprintf( out, "&%s::metaObj, ", (const char*) qualifiedClassName() );
+ if ( !isVariantType( it.current()->type ) ) {
+ int enumpos = -1;
+ int k = 0;
+ for( TQPtrListIterator<Enum> eit( g->enums ); eit.current(); ++eit, ++k ) {
+ if ( eit.current()->name == it.current()->type )
+ enumpos = k;
+ }
+
+ // Is it an enum of this class ?
+ if ( enumpos != -1 )
+ fprintf( out, "&enum_tbl[%i], ", enumpos );
+ else
+ fprintf( out, "0, ");
+ } else {
+ fprintf( out, "0, ");
+ }
+ fprintf( out, "-1 }" );
+ if ( !it.atLast() )
+ fprintf( out, ",\n" );
+ else
+ fprintf( out, "\n" );
+ }
+ fprintf( out, " };\n" );
+ fprintf( out, "#endif // QT_NO_PROPERTIES\n" );
+ }
+
+ return g->props.count();
+}
+
+
+
+int generateClassInfos()
+{
+ if ( g->infos.isEmpty() )
+ return 0;
+
+ if ( displayWarnings && !Q_OBJECTdetected )
+ moc_err("The declaration of the class \"%s\" contains class infos"
+ " but no Q_OBJECT macro.", g->className.data());
+
+ fprintf( out, " static const TQClassInfo classinfo_tbl[] = {\n" );
+ int i = 0;
+ for( TQPtrListIterator<ClassInfo> it( g->infos ); it.current(); ++it, ++i ) {
+ if ( i )
+ fprintf( out, ",\n" );
+ fprintf( out, "\t{ \"%s\", \"%s\" }", it.current()->name.data(),it.current()->value.data() );
+ }
+ fprintf( out, "\n };\n" );
+ return i;
+}
+
+
+void generateClass() // generate C++ source code for a class
+{
+ const char *hdr1 = "/****************************************************************************\n"
+ "** %s meta object code from reading C++ file '%s'\n**\n";
+ const char *hdr2 = "** Created: %s\n"
+ const char *hdr3 = "** WARNING! All changes made in this file will be lost!\n";
+ const char *hdr4 = "*****************************************************************************/\n\n";
+ int i;
+
+ if ( skipClass ) // don't generate for class
+ return;
+
+ if ( !Q_OBJECTdetected ) {
+ if ( g->signals.count() == 0 && g->slots.count() == 0 && g->props.count() == 0 && g->infos.count() == 0 )
+ return;
+ if ( displayWarnings && (g->signals.count() + g->slots.count()) != 0 )
+ moc_err("The declaration of the class \"%s\" contains signals "
+ "or slots\n\t but no Q_OBJECT macro.", g->className.data());
+ } else {
+ if ( g->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 TQObject or one of its descendants"
+ " or remove Q_OBJECT.", g->className.data() );
+ }
+ if ( templateClass ) { // don't generate for class
+ moc_err( "Sorry, TQt does not support templates that contain\n"
+ "\tsignals, slots or Q_OBJECT." );
+ return;
+ }
+ g->generatedCode = TRUE;
+ g->gen_count++;
+
+ if ( g->gen_count == 1 ) { // first class to be generated
+ TQDateTime dt = TQDateTime::currentDateTime();
+ TQCString dstr = dt.toString().ascii();
+ TQCString fn = g->fileName;
+ i = g->fileName.length()-1;
+ while ( i>0 && g->fileName[i-1] != '/' && g->fileName[i-1] != '\\' )
+ i--; // skip path
+ if ( i >= 0 )
+ fn = &g->fileName[i];
+ fprintf( out, hdr1, (const char*)qualifiedClassName(),(const char*)fn);
+ fprintf( out, hdr2, (const char*)dstr );
+ fprintf( out, hdr3 );
+ fprintf( out, hdr4 );
+
+ if ( !g->noInclude ) {
+ /*
+ The header file might be a TQt header file with
+ QT_NO_COMPAT macros around signals, slots or
+ properties. Without the #undef, we cannot compile the
+ TQt library with QT_NO_COMPAT defined.
+
+ Header files of libraries build around TQt can also use
+ QT_NO_COMPAT, so this #undef might be beneficial to
+ users of TQt, and not only to developers of TQt.
+ */
+ fprintf( out, "#undef QT_NO_COMPAT\n" );
+
+ if ( !g->pchFile.isEmpty() )
+ fprintf( out, "#include \"%s\" // PCH include\n", (const char*)g->pchFile );
+ if ( !g->includePath.isEmpty() && g->includePath.right(1) != "/" )
+ g->includePath += "/";
+
+ g->includeFiles.first();
+ while ( g->includeFiles.current() ) {
+ TQCString inc = g->includeFiles.current();
+ if ( inc[0] != '<' && inc[0] != '"' ) {
+ if ( !g->includePath.isEmpty() && g->includePath != "./" )
+ inc.prepend( g->includePath );
+ inc = "\"" + inc + "\"";
+ }
+ fprintf( out, "#include %s\n", (const char *)inc );
+ g->includeFiles.next();
+ }
+ }
+ fprintf( out, "#include <%sqmetaobject.h>\n", (const char*)g->qtPath );
+ fprintf( out, "#include <%sqapplication.h>\n\n", (const char*)g->qtPath );
+ fprintf( out, "#include <%sprivate/qucomextra_p.h>\n", (const char*)g->qtPath );
+ fprintf( out, "#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != %d)\n", formatRevision );
+ fprintf( out, "#error \"This file was generated using the moc from %s."
+ " It\"\n#error \"cannot be used with the include files from"
+ " this version of TQt.\"\n#error \"(The moc has changed too"
+ " much.)\"\n", QT_VERSION_STR );
+ fprintf( out, "#endif\n\n" );
+ } else {
+ fprintf( out, "\n\n" );
+ }
+
+ if ( !g->hasVariantIncluded ) {
+ bool needToIncludeVariant = !g->props.isEmpty();
+ for ( Function* f =g->slots.first(); f && !needToIncludeVariant; f=g->slots.next() )
+ needToIncludeVariant = ( f->type != "void" && !validUType( f->type ) && isVariantType( f->type) );
+
+ if ( needToIncludeVariant ) {
+ fprintf( out, "#include <%sqvariant.h>\n", (const char*)g->qtPath );
+ g->hasVariantIncluded = TRUE;
+ }
+ }
+
+ bool isTQObject = g->className == "TQObject" ;
+
+
+//
+// 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, "TQMetaObject *%s::metaObj = 0;\n", (const char*)qualifiedClassName());
+
+//
+// Generate static cleanup object variable
+//
+ TQCString cleanup = qualifiedClassName().copy();
+ for ( int cnpos = 0; cnpos < cleanup.length(); cnpos++ ) {
+ if ( cleanup[cnpos] == ':' )
+ cleanup[cnpos] = '_';
+ }
+
+ fprintf( out, "static TQMetaObjectCleanUp cleanUp_%s( \"%s\", &%s::staticMetaObject );\n\n", (const char*)cleanup, (const char*)qualifiedClassName(), (const char*)qualifiedClassName() );
+
+//
+// Generate tr and trUtf8 member functions
+//
+ fprintf( out, "#ifndef QT_NO_TRANSLATION\n" );
+ fprintf( out, "TQString %s::tr( const char *s, const char *c )\n{\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " if ( qApp )\n" );
+ fprintf( out, "\treturn qApp->translate( \"%s\", s, c,"
+ " TQApplication::DefaultCodec );\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " else\n" );
+ fprintf( out, "\treturn TQString::fromLatin1( s );\n");
+ fprintf( out, "}\n" );
+ fprintf( out, "#ifndef QT_NO_TRANSLATION_UTF8\n" );
+ fprintf( out, "TQString %s::trUtf8( const char *s, const char *c )\n{\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " if ( qApp )\n" );
+ fprintf( out, "\treturn qApp->translate( \"%s\", s, c,"
+ " TQApplication::UnicodeUTF8 );\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " else\n" );
+ fprintf( out, "\treturn TQString::fromUtf8( s );\n" );
+ fprintf( out, "}\n" );
+ fprintf( out, "#endif // QT_NO_TRANSLATION_UTF8\n\n" );
+ fprintf( out, "#endif // QT_NO_TRANSLATION\n\n" );
+
+//
+// Generate staticMetaObject member function
+//
+ fprintf( out, "TQMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() );
+ fprintf( out, " if ( metaObj )\n\treturn metaObj;\n" );
+ if ( isTQObject )
+ fprintf( out, " TQMetaObject* parentObject = staticTQtMetaObject();\n" );
+ else if ( !g->superClassName.isEmpty() )
+ fprintf( out, " TQMetaObject* parentObject = %s::staticMetaObject();\n", (const char*)g->superClassName );
+ else
+ fprintf( out, " TQMetaObject* parentObject = 0;\n" );
+
+//
+// Build the classinfo array
+//
+ int n_infos = generateClassInfos();
+
+// Build the enums array
+// Enums HAVE to be generated BEFORE the properties and slots
+//
+ int n_enums = generateEnums();
+
+//
+// Build slots array in staticMetaObject()
+//
+ generateFuncs( &g->slots, "slot", Slot_Num );
+
+//
+// Build signals array in staticMetaObject()
+//
+ generateFuncs( &g->signals, "signal", Signal_Num );
+
+//
+// Build property array in staticMetaObject()
+//
+ int n_props = generateProps();
+
+//
+// Finally code to create and return meta object
+//
+ fprintf( out, " metaObj = TQMetaObject::new_metaobject(\n"
+ "\t\"%s\", parentObject,\n", (const char*)qualifiedClassName() );
+
+ if ( g->slots.count() )
+ fprintf( out, "\tslot_tbl, %d,\n", g->slots.count() );
+ else
+ fprintf( out, "\t0, 0,\n" );
+
+ if ( g->signals.count() )
+ fprintf( out, "\tsignal_tbl, %d,\n", g->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" );
+
+
+//
+// Setup cleanup handler and return meta object
+//
+ fprintf( out, " cleanUp_%s.setMetaObject( metaObj );\n", cleanup.data() );
+ fprintf( out, " return metaObj;\n}\n" );
+
+//
+// End of function staticMetaObject()
+//
+
+//
+// Generate smart cast function
+//
+ fprintf( out, "\nvoid* %s::qt_cast( const char* clname )\n{\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " if ( !qstrcmp( clname, \"%s\" ) )\n"
+ "\treturn this;\n",
+ (const char*)qualifiedClassName() );
+ for ( const char* cname = g->multipleSuperClasses.first(); cname; cname = g->multipleSuperClasses.next() ) {
+ fprintf( out, " if ( !qstrcmp( clname, \"%s\" ) )\n", cname);
+ TQCString fixed(cname);
+ while (fixed.find(">>") != -1)
+ fixed = fixed.replace(">>", "> >");
+ fprintf( out, "\treturn (%s*)this;\n", fixed.data());
+ }
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, " return %s::qt_cast( clname );\n",
+ (const char*)purestSuperClassName() );
+ else
+ fprintf( out, " return 0;\n" );
+ fprintf( out, "}\n" );
+
+//
+// Generate internal signal functions
+//
+ Function *f;
+ f = g->signals.first(); // make internal signal methods
+ static bool included_list_headers = FALSE;
+ int sigindex = 0;
+ while ( f ) {
+ TQCString argstr;
+ char buf[12];
+ Argument *a = f->args->first();
+ int offset = 0;
+ const char *predef_call_func = 0;
+ bool hasReturnValue = f->type != "void" && (validUType( f->type ) || isVariantType( f->type) );
+ if ( hasReturnValue ) {
+ ; // no predefined function available
+ } else if ( !a ) {
+ predef_call_func = "activate_signal";
+ } else if ( f->args->count() == 1 ) {
+ TQCString ctype = (a->leftType + ' ' + a->rightType).simplifyWhiteSpace();
+ if ( !isInOut( ctype ) ) {
+ TQCString utype = uType( ctype );
+ if ( utype == "bool" )
+ predef_call_func = "activate_signal_bool";
+ else if ( utype == "TQString" || utype == "int" || utype == "double" )
+ predef_call_func = "activate_signal";
+ }
+ }
+
+ if ( !predef_call_func && !included_list_headers ) {
+ // yes we need it, because otherwise QT_VERSION may not be defined
+ fprintf( out, "\n#include <%sqobjectdefs.h>\n", (const char*)g->qtPath );
+ fprintf( out, "#include <%sqsignalslotimp.h>\n", (const char*)g->qtPath );
+ included_list_headers = TRUE;
+ }
+
+ while ( a ) { // argument list
+ if ( !a->leftType.isEmpty() || !a->rightType.isEmpty() ) {
+ argstr += a->leftType;
+ argstr += " ";
+ sprintf( buf, "t%d", offset++ );
+ argstr += buf;
+ argstr += a->rightType;
+ a = f->args->next();
+ if ( a )
+ argstr += ", ";
+ } else {
+ a = f->args->next();
+ }
+ }
+
+ fixRightAngles( &argstr );
+
+ fprintf( out, "\n// SIGNAL %s\n", (const char*)f->name );
+ fprintf( out, "%s %s::%s(", (const char*) f->type,
+ (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( staticMetaObject()->signalOffset() + %d", predef_call_func, sigindex );
+ if ( !argstr.isEmpty() )
+ fprintf( out, ", t0" );
+ fprintf( out, " );\n}\n" );
+ } else {
+ if ( hasReturnValue )
+ fprintf( out, " %s something;\n", f->type.data() );
+ int nargs = f->args->count();
+ fprintf( out, " if ( signalsBlocked() )\n\treturn%s;\n", hasReturnValue ? " something" : "" );
+ fprintf( out, " TQConnectionList *clist = receivers( staticMetaObject()->signalOffset() + %d );\n",
+ sigindex );
+ fprintf( out, " if ( !clist )\n\treturn%s;\n", hasReturnValue ? " something" : "" );
+ fprintf( out, " TQUObject o[%d];\n", f->args->count() + 1 );
+
+ // initialize return value to something
+ if ( hasReturnValue ) {
+ if ( validUType( f->type ) ) {
+ TQCString utype = uType( f->type );
+ fprintf( out, " static_QUType_%s.set(o,something);\n", utype.data() );
+ } else if ( uType( f->type ) == "varptr" ) {
+ fprintf( out, " static_QUType_varptr.set(o,&something);\n" );
+ } else {
+ fprintf( out, " static_QUType_ptr.set(o,&something);\n" );
+ }
+ }
+
+ // initialize arguments
+ if ( !f->args->isEmpty() ) {
+ offset = 0;
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ if ( validUType( type ) ) {
+ TQCString utype = uType( type );
+ fprintf( out, " static_QUType_%s.set(o+%d,t%d);\n", utype.data(), offset+1, offset );
+ } else if ( uType( type ) == "varptr" ) {
+ fprintf( out, " static_QUType_varptr.set(o+%d,&t%d);\n", offset+1, offset );
+ } else {
+ fprintf( out, " static_QUType_ptr.set(o+%d,&t%d);\n", offset+1, offset );
+ }
+ a = f->args->next();
+ offset++;
+ }
+ }
+ fprintf( out, " activate_signal( clist, o );\n" );
+
+ // get return values from inOut parameters
+ if ( !f->args->isEmpty() ) {
+ offset = 0;
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ if ( validUType( type ) && isInOut( type ) ) {
+ TQCString utype = uType( type );
+ if ( utype == "enum" )
+ fprintf( out, " t%d = (%s)static_QUType_%s.get(o+%d);\n", offset, type.data(), utype.data(), offset+1 );
+ else if ( utype == "ptr" && type.right(2) == "**" )
+ fprintf( out, " if (t%d) *t%d = *(%s)static_QUType_ptr.get(o+%d);\n", offset, offset, type.data(), offset+1 );
+ else
+ fprintf( out, " t%d = static_QUType_%s.get(o+%d);\n", offset, utype.data(), offset+1 );
+ }
+ a = f->args->next();
+ offset++;
+ }
+ }
+
+ // get and return return value
+ if ( hasReturnValue ) {
+ TQCString utype = uType( f->type );
+ if ( utype == "enum" || utype == "ptr" || utype == "varptr" ) // need cast
+ fprintf( out, " return (%s)static_QUType_%s.get(o);\n", f->type.data(), utype.data() );
+ else
+ fprintf( out, " return static_QUType_%s.get(o);\n", utype.data() );
+ }
+
+ fprintf( out, "}\n" );
+ }
+
+ f = g->signals.next();
+ sigindex++;
+ }
+
+
+//
+// Generate internal qt_invoke() function
+//
+ fprintf( out, "\nbool %s::qt_invoke( int _id, TQUObject* _o )\n{\n", qualifiedClassName().data() );
+
+ if( !g->slots.isEmpty() ) {
+ fprintf( out, " switch ( _id - staticMetaObject()->slotOffset() ) {\n" );
+ int slotindex = -1;
+ for ( f = g->slots.first(); f; f = g->slots.next() ) {
+ slotindex ++;
+ if ( f->type == "void" && f->args->isEmpty() ) {
+ fprintf( out, " case %d: %s(); break;\n", slotindex, f->name.data() );
+ continue;
+ }
+
+ fprintf( out, " case %d: ", slotindex );
+ bool hasReturnValue = FALSE;
+ bool hasVariantReturn = FALSE;
+ if ( f->type != "void" ) {
+ if ( validUType( f->type )) {
+ hasReturnValue = TRUE;
+ fprintf( out, "static_QUType_%s.set(_o,", uType(f->type).data() );
+ } else if ( isVariantType( f->type ) ) {
+ hasReturnValue = hasVariantReturn = TRUE;
+ // do not need special handling for bool since this is handled as utype
+ fprintf( out, "static_QUType_TQVariant.set(_o,TQVariant(" );
+ }
+ }
+ int offset = 0;
+ fprintf( out, "%s(", f->name.data() );
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ fixRightAngles( &type );
+ if ( validUType( type ) ) {
+ TQCString utype = uType( type );
+ if ( utype == "ptr" || utype == "varptr" || utype == "enum" )
+ fprintf( out, "(%s)static_QUType_%s.get(_o+%d)", type.data(), utype.data(), offset+1 );
+ else
+ fprintf( out, "(%s)static_QUType_%s.get(_o+%d)", type.data(), utype.data(), offset+1 );
+ } else {
+ TQCString castType = castToUType( type );
+ if(castType == type)
+ fprintf( out, "(%s)(*((%s*)static_QUType_ptr.get(_o+%d)))", type.data(),
+ castType.data(), offset+1 );
+ else
+ fprintf( out, "(%s)*((%s*)static_QUType_ptr.get(_o+%d))", type.data(),
+ castType.data(), offset+1 );
+ }
+ a = f->args->next();
+ if ( a )
+ fprintf( out, "," );
+ offset++;
+ }
+ fprintf( out, ")" );
+ if ( hasReturnValue )
+ fprintf( out, ")" );
+ if ( hasVariantReturn )
+ fprintf( out, ")" );
+ fprintf( out, "; break;\n" );
+ }
+ fprintf( out, " default:\n" );
+
+ if ( !g->superClassName.isEmpty() && !isTQObject ) {
+ fprintf( out, "\treturn %s::qt_invoke( _id, _o );\n",
+ (const char *) purestSuperClassName() );
+ } else {
+ fprintf( out, "\treturn FALSE;\n" );
+ }
+ fprintf( out, " }\n" );
+ fprintf( out, " return TRUE;\n}\n" );
+ } else {
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, " return %s::qt_invoke(_id,_o);\n}\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, " return FALSE;\n}\n" );
+ }
+
+
+//
+// Generate internal qt_emit() function
+//
+ fprintf( out, "\nbool %s::qt_emit( int _id, TQUObject* _o )\n{\n", qualifiedClassName().data() );
+
+ if ( !g->signals.isEmpty() ) {
+ fprintf( out, " switch ( _id - staticMetaObject()->signalOffset() ) {\n" );
+ int signalindex = -1;
+ for ( f = g->signals.first(); f; f = g->signals.next() ) {
+ signalindex++;
+ if ( f->type == "void" && f->args->isEmpty() ) {
+ fprintf( out, " case %d: %s(); break;\n", signalindex, f->name.data() );
+ continue;
+ }
+
+ fprintf( out, " case %d: ", signalindex );
+ bool hasReturnValue = FALSE;
+ if ( f->type != "void" && validUType( f->type )) {
+ hasReturnValue = TRUE;
+ fprintf( out, "static_QUType_%s.set(_o,", uType(f->type).data() );
+ }
+ int offset = 0;
+ fprintf( out, "%s(", f->name.data() );
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ fixRightAngles( &type );
+ if ( validUType( type ) ) {
+ TQCString utype = uType( type );
+ if ( utype == "ptr" || utype == "varptr" || utype == "enum" )
+ fprintf( out, "(%s)static_QUType_%s.get(_o+%d)", type.data(), utype.data(), offset+1 );
+ else
+ fprintf( out, "(%s)static_QUType_%s.get(_o+%d)", type.data(), utype.data(), offset+1 );
+ } else {
+ TQCString castType = castToUType( type );
+ if(castType == type)
+ fprintf( out, "(%s)(*((%s*)static_QUType_ptr.get(_o+%d)))", type.data(),
+ castType.data(), offset+1 );
+ else
+ fprintf( out, "(%s)*((%s*)static_QUType_ptr.get(_o+%d))", type.data(),
+ castType.data(), offset+1 );
+ }
+ a = f->args->next();
+ if ( a )
+ fprintf( out, "," );
+ offset++;
+ }
+ fprintf( out, ")" );
+ if ( hasReturnValue )
+ fprintf( out, ")" );
+ fprintf( out, "; break;\n" );
+ }
+ fprintf( out, " default:\n" );
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, "\treturn %s::qt_emit(_id,_o);\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, "\treturn FALSE;\n" );
+ fprintf( out, " }\n" );
+ fprintf( out, " return TRUE;\n}\n" );
+ } else {
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, " return %s::qt_emit(_id,_o);\n}\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, " return FALSE;\n}\n" );
+ }
+
+
+ fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
+//
+// Generate internal qt_property() functions
+//
+
+ fprintf( out, "\nbool %s::qt_property( int id, int f, TQVariant* v)\n{\n", qualifiedClassName().data() );
+
+ if ( !g->props.isEmpty() ) {
+ fprintf( out, " switch ( id - staticMetaObject()->propertyOffset() ) {\n" );
+ int propindex = -1;
+ bool need_resolve = FALSE;
+
+ for( TQPtrListIterator<Property> it( g->props ); it.current(); ++it ){
+ propindex ++;
+ fprintf( out, " case %d: ", propindex );
+ fprintf( out, "switch( f ) {\n" );
+
+ uint flag_break = 0;
+ uint flag_propagate = 0;
+
+ if ( it.current()->setfunc ) {
+ fprintf( out, "\tcase 0: %s(", it.current()->setfunc->name.data() );
+ TQCString type = it.current()->type.copy(); // detach on purpose
+ if ( it.current()->oredEnum )
+ type = it.current()->enumsettype;
+ if ( type == "uint" )
+ fprintf( out, "v->asUInt()" );
+ else if ( type == "unsigned int" )
+ fprintf( out, "(uint)v->asUInt()" );
+ else if ( type == "TQMap<TQString,TQVariant>" )
+ fprintf( out, "v->asMap()" );
+ else if ( type == "TQValueList<TQVariant>" )
+ fprintf( out, "v->asList()" );
+ else if ( type == "Q_LLONG" )
+ fprintf( out, "v->asLongLong()" );
+ else if ( type == "Q_ULLONG" )
+ fprintf( out, "v->asULongLong()" );
+ else if ( isVariantType( type ) ) {
+ if (( type[0] == 'T' ) && ( type[1] == 'Q' ))
+ type = type.mid(2);
+ else
+ type[0] = toupper( type[0] );
+ fprintf( out, "v->as%s()", type.data() );
+ } else {
+ fprintf( out, "(%s&)v->asInt()", type.data() );
+ }
+ fprintf( out, "); break;\n" );
+
+ } else if ( it.current()->override ) {
+ flag_propagate |= 1 << (0+1);
+ }
+ if ( it.current()->getfunc ) {
+ if ( it.current()->gspec == Property::Pointer )
+ fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s()%s ); break;\n",
+ it.current()->getfunc->name.data(),
+ !isVariantType( it.current()->type ) ? "(int)" : "",
+ it.current()->getfunc->name.data(),
+ it.current()->type == "bool" ? ", 0" : "" );
+ else
+ fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s()%s ); break;\n",
+ !isVariantType( it.current()->type ) ? "(int)" : "",
+ it.current()->getfunc->name.data(),
+ it.current()->type == "bool" ? ", 0" : "" );
+ } else if ( it.current()->override ) {
+ flag_propagate |= 1<< (1+1);
+ }
+
+ if ( !it.current()->reset.isEmpty() )
+ fprintf( out, "\tcase 2: this->%s(); break;\n", it.current()->reset.data() );
+
+ if ( it.current()->designable.isEmpty() )
+ flag_propagate |= 1 << (3+1);
+ else if ( it.current()->designable == "true" )
+ flag_break |= 1 << (3+1);
+ else if ( it.current()->designable != "false" )
+ fprintf( out, "\tcase 3: return this->%s();\n", it.current()->designable.data() );
+
+ if ( it.current()->scriptable.isEmpty() )
+ flag_propagate |= 1 << (4+1);
+ else if ( it.current()->scriptable == "true" )
+ flag_break |= 1 << (4+1);
+ else if ( it.current()->scriptable != "false" )
+ fprintf( out, "\tcase 4: return this->%s();\n", it.current()->scriptable.data() );
+
+ if ( it.current()->stored.isEmpty() )
+ flag_propagate |= 1 << (5+1);
+ else if ( it.current()->stored == "true" )
+ flag_break |= 1 << (5+1);
+ else if ( it.current()->stored != "false" )
+ fprintf( out, "\tcase 5: return this->%s();\n", it.current()->stored.data() );
+
+ int i = 0;
+ if ( flag_propagate != 0 ) {
+ fprintf( out, "\t" );
+ for ( i = 0; i <= 5; i++ ) {
+ if ( flag_propagate & (1 << (i+1) ) )
+ fprintf( out, "case %d: ", i );
+ }
+ if (!g->superClassName.isEmpty() && !isTQObject ) {
+ fprintf( out, "goto resolve;\n" );
+ need_resolve = TRUE;
+ } else {
+ fprintf( out, " return FALSE;\n" );
+ }
+ }
+ if ( flag_break != 0 ) {
+ fprintf( out, "\t" );
+ for ( i = 0; i <= 5; i++ ) {
+ if ( flag_break & (1 << (i+1) ) )
+ fprintf( out, "case %d: ", i );
+ }
+ fprintf( out, "break;\n");
+ }
+
+ fprintf( out, "\tdefault: return FALSE;\n } break;\n" );
+ }
+ fprintf( out, " default:\n" );
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, "\treturn %s::qt_property( id, f, v );\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, "\treturn FALSE;\n" );
+ fprintf( out, " }\n" );
+ fprintf( out, " return TRUE;\n" );
+
+ if ( need_resolve )
+ fprintf( out, "resolve:\n return %s::qt_property( staticMetaObject()->resolveProperty(id), f, v );\n",
+ (const char *) purestSuperClassName() );
+ fprintf( out, "}\n" );
+ } else {
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, " return %s::qt_property( id, f, v);\n}\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, " return FALSE;\n}\n" );
+ }
+
+ fprintf( out, "\nbool %s::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; }\n", qualifiedClassName().data() );
+ fprintf( out, "#endif // QT_NO_PROPERTIES\n" );
+}
+
+
+ArgList *addArg( Argument *a ) // add argument to list
+{
+ if ( (!a->leftType.isEmpty() || !a->rightType.isEmpty() ) ) //filter out truely void arguments
+ tmpArgList->append( a );
+ return tmpArgList;
+}
+
+void addEnum()
+{
+ // Avoid duplicates
+ for( TQPtrListIterator<Enum> lit( g->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 types mentioned in Q_ENUMS and Q_SETS
+ if ( g->qtEnums.contains( tmpEnum->name ) || g->qtSets.contains( tmpEnum->name ) )
+ {
+ g->enums.append( tmpEnum );
+ if ( g->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->type = tmpFunc->type.simplifyWhiteSpace();
+ tmpFunc->access = tmpAccess;
+ tmpFunc->args = tmpArgList;
+ tmpFunc->lineNo = lineNo;
+
+ for ( ;; ) {
+ g->funcs.append( tmpFunc );
+
+ if ( m == SignalMember ) {
+ g->signals.append( tmpFunc );
+ break;
+ } else {
+ if ( m == SlotMember )
+ g->slots.append( tmpFunc );
+ // PropertyCandidateMember or SlotMember
+ if ( !tmpFunc->name.isEmpty() && tmpFunc->access == Public )
+ g->propfuncs.append( tmpFunc );
+ if ( !tmpFunc->args || !tmpFunc->args->hasDefaultArguments() )
+ break;
+ tmpFunc = new Function( *tmpFunc );
+ tmpFunc->args = tmpFunc->args->magicClone();
+ }
+ }
+
+ skipFunc = FALSE;
+ tmpFunc = new Function;
+ tmpArgList = new ArgList;
+}
+
+void checkPropertyName( const char* ident )
+{
+ if ( ident[0] == '_' ) {
+ moc_err( "Invalid property name '%s'.", ident );
+ return;
+ }
+}
diff --git a/src/moc/moc_lex.cpp b/src/moc/moc_lex.cpp
new file mode 100644
index 000000000..940c31b8c
--- /dev/null
+++ b/src/moc/moc_lex.cpp
@@ -0,0 +1,3230 @@
+
+#line 3 "lex.yy.c"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 31
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart(yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int yyleng;
+
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr) )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+ : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart (FILE *input_file );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
+void yy_delete_buffer (YY_BUFFER_STATE b );
+void yy_flush_buffer (YY_BUFFER_STATE b );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
+void yypop_buffer_state (void );
+
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
+
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
+
+void *yyalloc (yy_size_t );
+void *yyrealloc (void *,yy_size_t );
+void yyfree (void * );
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ yyensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ yyensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+typedef unsigned char YY_CHAR;
+
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[] );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ (yytext_ptr) = yy_bp; \
+ yyleng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 151
+#define YY_END_OF_BUFFER 152
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[615] =
+ { 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 152, 151,
+ 139, 150, 151, 139, 134, 146, 139, 146, 146, 105,
+ 105, 105, 105, 105, 139, 134, 148, 139, 113, 148,
+ 148, 148, 130, 148, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 139, 134, 140, 139, 140, 140, 106,
+ 106, 106, 106, 15, 16, 139, 134, 141, 139, 141,
+ 141, 107, 107, 107, 107, 107, 28, 29, 139, 134,
+
+ 145, 139, 54, 55, 58, 145, 59, 56, 57, 60,
+ 139, 134, 143, 139, 42, 43, 46, 143, 47, 44,
+ 45, 139, 134, 144, 139, 48, 49, 52, 144, 53,
+ 50, 51, 139, 134, 142, 139, 111, 142, 13, 14,
+ 139, 134, 137, 137, 112, 61, 62, 137, 137, 134,
+ 149, 139, 149, 139, 134, 147, 139, 147, 139, 134,
+ 34, 35, 100, 100, 100, 100, 100, 104, 101, 102,
+ 103, 139, 136, 135, 139, 134, 134, 134, 0, 108,
+ 0, 105, 105, 105, 105, 105, 113, 0, 0, 123,
+ 0, 0, 132, 131, 130, 92, 99, 99, 99, 99,
+
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 0, 109,
+ 0, 106, 106, 106, 106, 106, 106, 0, 110, 0,
+ 107, 107, 107, 107, 107, 111, 0, 138, 112, 0,
+ 138, 100, 100, 100, 100, 100, 100, 104, 0, 135,
+ 134, 105, 105, 105, 105, 114, 0, 0, 114, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 93, 131, 99, 99, 99, 99, 99, 99, 87, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 76,
+
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 106, 106, 106, 106, 106, 106, 106, 106,
+ 106, 106, 107, 107, 107, 107, 100, 100, 100, 100,
+ 100, 100, 134, 105, 105, 105, 105, 129, 125, 124,
+ 126, 0, 127, 122, 115, 116, 117, 118, 119, 120,
+ 121, 0, 99, 99, 99, 99, 99, 99, 99, 65,
+ 74, 99, 99, 99, 83, 99, 99, 99, 99, 77,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 82,
+
+ 99, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+ 106, 106, 107, 107, 107, 107, 100, 36, 100, 100,
+ 100, 100, 134, 1, 105, 105, 3, 127, 128, 99,
+ 99, 99, 99, 99, 99, 99, 84, 72, 99, 99,
+ 80, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 75, 99, 99, 7, 99, 99, 99, 96, 99, 86,
+ 99, 97, 99, 99, 106, 106, 106, 106, 106, 106,
+ 106, 106, 106, 106, 21, 30, 107, 107, 33, 100,
+ 39, 100, 100, 37, 134, 105, 105, 99, 99, 99,
+ 99, 99, 12, 99, 81, 68, 63, 69, 99, 99,
+
+ 99, 99, 99, 90, 99, 99, 78, 67, 85, 99,
+ 99, 99, 99, 99, 106, 106, 106, 106, 106, 27,
+ 106, 106, 17, 106, 107, 107, 100, 100, 38, 134,
+ 105, 105, 99, 11, 99, 99, 99, 99, 95, 99,
+ 99, 88, 99, 99, 6, 99, 64, 99, 71, 99,
+ 106, 26, 106, 106, 106, 19, 106, 20, 107, 107,
+ 100, 100, 134, 134, 105, 4, 99, 5, 99, 99,
+ 99, 99, 91, 99, 66, 94, 79, 73, 106, 23,
+ 106, 106, 106, 107, 31, 100, 100, 133, 2, 99,
+ 99, 99, 99, 98, 89, 106, 106, 106, 18, 32,
+
+ 100, 100, 99, 10, 9, 70, 106, 25, 24, 40,
+ 41, 8, 22, 0
+ } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 2, 3, 4,
+ 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 1, 5, 6, 1, 1, 1, 7, 8,
+ 9, 10, 1, 11, 1, 12, 13, 14, 15, 15,
+ 15, 15, 15, 15, 15, 16, 16, 17, 18, 19,
+ 1, 20, 1, 1, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 28, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 28, 43, 28,
+ 44, 45, 46, 1, 47, 1, 48, 49, 50, 51,
+
+ 52, 53, 54, 55, 56, 28, 28, 57, 58, 59,
+ 60, 61, 28, 62, 63, 64, 65, 66, 67, 68,
+ 69, 28, 70, 1, 71, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int32_t yy_meta[72] =
+ { 0,
+ 1, 1, 1, 2, 3, 1, 4, 1, 1, 1,
+ 1, 1, 1, 5, 5, 5, 1, 1, 1, 1,
+ 5, 5, 5, 5, 5, 5, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 1, 1, 1, 6, 5, 5, 5,
+ 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 1,
+ 1
+ } ;
+
+static yyconst flex_int16_t yy_base[642] =
+ { 0,
+ 0, 3, 16, 5, 87, 9, 158, 229, 300, 176,
+ 370, 440, 207, 510, 382, 555, 184, 399, 600, 645,
+ 188, 254, 204, 266, 691, 177, 278, 416, 1189, 1190,
+ 182, 1190, 183, 220, 1137, 1190, 196, 207, 214, 0,
+ 1130, 1138, 1133, 1121, 260, 1132, 1190, 211, 1137, 243,
+ 281, 251, 382, 1164, 0, 1133, 1132, 213, 320, 1118,
+ 226, 138, 1118, 1116, 1110, 1126, 1112, 327, 1120, 351,
+ 378, 350, 375, 434, 1120, 1190, 408, 394, 442, 0,
+ 1123, 392, 403, 1190, 1190, 459, 1118, 1190, 461, 427,
+ 458, 0, 1111, 1119, 1114, 1102, 1190, 1190, 471, 1113,
+
+ 1190, 464, 1190, 1190, 1190, 465, 1190, 1190, 1190, 1190,
+ 477, 1112, 1190, 479, 1190, 1190, 1190, 475, 1190, 1190,
+ 1190, 487, 1111, 1190, 489, 1190, 1190, 1190, 484, 1190,
+ 1190, 1190, 493, 1110, 1190, 498, 1115, 492, 1190, 1190,
+ 501, 1108, 1190, 506, 1113, 1190, 1190, 507, 523, 1106,
+ 1190, 528, 514, 530, 1105, 1190, 532, 527, 536, 1104,
+ 1190, 1190, 0, 1129, 1128, 411, 1115, 1106, 1190, 1190,
+ 1190, 541, 1190, 0, 543, 0, 0, 1098, 505, 1190,
+ 1145, 0, 1100, 1089, 1088, 1089, 1099, 543, 1136, 1135,
+ 758, 1129, 537, 555, 560, 1190, 0, 554, 1084, 1081,
+
+ 1074, 1089, 1088, 1076, 1069, 1068, 1068, 1071, 1074, 220,
+ 1070, 1064, 1069, 1074, 522, 1076, 1070, 1063, 1068, 1061,
+ 493, 1062, 1057, 1057, 382, 1061, 1054, 524, 517, 1190,
+ 1111, 0, 560, 530, 1065, 1059, 1052, 555, 1190, 1107,
+ 0, 1062, 1051, 1050, 1051, 1061, 592, 604, 1060, 606,
+ 612, 0, 1066, 477, 1066, 1068, 1072, 1055, 612, 0,
+ 1046, 1035, 1045, 1035, 1036, 1190, 1087, 1086, 1085, 614,
+ 616, 1084, 1083, 1082, 1081, 1080, 1079, 1078, 1077, 1076,
+ 1190, 610, 1051, 1048, 465, 1043, 1054, 1019, 0, 1017,
+ 1014, 1012, 1011, 1024, 1014, 1019, 1022, 1017, 1012, 0,
+
+ 1013, 1018, 1013, 1002, 997, 998, 1004, 1004, 997, 999,
+ 993, 992, 990, 993, 993, 1000, 991, 994, 990, 984,
+ 996, 998, 1014, 1011, 543, 1006, 1017, 975, 976, 982,
+ 979, 973, 973, 983, 973, 974, 1003, 1007, 1005, 1000,
+ 991, 988, 970, 962, 961, 966, 968, 1190, 1190, 1190,
+ 1190, 620, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190,
+ 1190, 1014, 999, 979, 988, 992, 982, 976, 957, 0,
+ 0, 950, 948, 954, 0, 948, 945, 949, 948, 0,
+ 957, 942, 956, 955, 950, 945, 937, 935, 539, 935,
+ 941, 946, 938, 927, 942, 933, 937, 936, 924, 0,
+
+ 924, 966, 946, 955, 959, 949, 943, 933, 928, 923,
+ 930, 914, 913, 912, 917, 919, 945, 0, 932, 935,
+ 944, 943, 908, 0, 905, 917, 0, 1190, 1190, 922,
+ 920, 921, 904, 905, 895, 876, 0, 0, 875, 867,
+ 0, 867, 858, 845, 836, 832, 824, 832, 775, 759,
+ 0, 764, 768, 0, 768, 752, 767, 0, 762, 0,
+ 754, 0, 764, 754, 771, 776, 780, 767, 767, 763,
+ 736, 749, 748, 740, 0, 0, 735, 747, 0, 761,
+ 0, 754, 768, 0, 739, 742, 725, 750, 749, 763,
+ 748, 759, 0, 724, 0, 0, 0, 0, 730, 733,
+
+ 720, 727, 714, 0, 725, 713, 0, 0, 0, 711,
+ 721, 719, 713, 712, 730, 729, 743, 727, 665, 0,
+ 636, 623, 0, 623, 637, 620, 662, 661, 0, 636,
+ 630, 627, 649, 0, 638, 647, 638, 622, 0, 623,
+ 610, 0, 619, 608, 0, 617, 0, 617, 0, 615,
+ 637, 0, 624, 633, 624, 0, 608, 0, 609, 605,
+ 634, 633, 607, 372, 593, 0, 610, 0, 618, 602,
+ 593, 587, 0, 587, 0, 0, 0, 0, 604, 0,
+ 612, 594, 581, 570, 0, 581, 562, 1190, 0, 541,
+ 451, 413, 376, 0, 0, 361, 357, 255, 0, 0,
+
+ 246, 234, 171, 0, 0, 0, 147, 0, 0, 0,
+ 0, 0, 0, 1190, 826, 832, 838, 844, 850, 856,
+ 862, 868, 874, 880, 886, 888, 894, 900, 902, 908,
+ 910, 916, 918, 924, 930, 932, 938, 944, 950, 953,
+ 958
+ } ;
+
+static yyconst flex_int16_t yy_def[642] =
+ { 0,
+ 615, 615, 614, 3, 614, 5, 616, 616, 614, 9,
+ 617, 617, 618, 618, 619, 619, 620, 620, 621, 621,
+ 622, 622, 623, 623, 614, 25, 615, 615, 614, 614,
+ 614, 614, 614, 614, 624, 614, 614, 625, 614, 626,
+ 626, 626, 626, 626, 614, 624, 614, 614, 627, 628,
+ 614, 614, 614, 614, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 614, 624, 614, 614, 630, 614, 631,
+ 631, 631, 631, 614, 614, 614, 624, 614, 614, 632,
+ 614, 633, 633, 633, 633, 633, 614, 614, 614, 624,
+
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 624, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 624, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 624, 614, 614, 634, 614, 614, 614,
+ 614, 624, 614, 614, 635, 614, 614, 614, 614, 624,
+ 614, 614, 614, 614, 624, 614, 614, 614, 614, 624,
+ 614, 614, 636, 636, 636, 636, 636, 637, 614, 614,
+ 614, 614, 614, 638, 614, 624, 624, 624, 625, 614,
+ 625, 626, 626, 626, 626, 626, 627, 627, 614, 614,
+ 639, 614, 614, 614, 614, 614, 629, 629, 629, 629,
+
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 630, 614,
+ 630, 631, 631, 631, 631, 631, 631, 632, 614, 632,
+ 633, 633, 633, 633, 633, 634, 634, 614, 635, 635,
+ 614, 636, 636, 636, 636, 636, 636, 637, 637, 638,
+ 624, 626, 626, 626, 626, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 640,
+ 614, 614, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 631, 631, 631, 631, 631, 631, 631, 631,
+ 631, 631, 633, 633, 633, 633, 636, 636, 636, 636,
+ 636, 636, 624, 626, 626, 626, 626, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 640, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+
+ 629, 631, 631, 631, 631, 631, 631, 631, 631, 631,
+ 631, 631, 633, 633, 633, 633, 636, 636, 636, 636,
+ 636, 636, 624, 626, 626, 626, 626, 614, 614, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 631, 631, 631, 631, 631, 631,
+ 631, 631, 631, 631, 631, 633, 633, 633, 633, 636,
+ 636, 636, 636, 636, 624, 626, 626, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 631, 631, 631, 631, 631, 631,
+ 631, 631, 631, 631, 633, 633, 636, 636, 636, 641,
+ 626, 626, 629, 629, 629, 629, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 629, 629,
+ 631, 631, 631, 631, 631, 631, 631, 631, 633, 633,
+ 636, 636, 641, 641, 626, 626, 629, 629, 629, 629,
+ 629, 629, 629, 629, 629, 629, 629, 629, 631, 631,
+ 631, 631, 631, 633, 633, 636, 636, 614, 626, 629,
+ 629, 629, 629, 629, 629, 631, 631, 631, 631, 633,
+
+ 636, 636, 629, 629, 629, 629, 631, 631, 631, 636,
+ 636, 629, 631, 0, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614
+ } ;
+
+static yyconst flex_int16_t yy_nxt[1262] =
+ { 0,
+ 614, 31, 31, 32, 31, 34, 32, 45, 35, 614,
+ 46, 74, 33, 614, 75, 33, 36, 37, 37, 32,
+ 38, 36, 36, 36, 36, 36, 36, 36, 39, 36,
+ 36, 36, 36, 36, 36, 36, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 36,
+ 36, 36, 40, 40, 40, 41, 40, 40, 40, 40,
+ 40, 40, 40, 40, 42, 40, 40, 40, 40, 43,
+ 44, 40, 40, 40, 40, 36, 36, 47, 48, 48,
+ 32, 49, 47, 50, 47, 47, 47, 47, 51, 52,
+
+ 53, 53, 53, 54, 47, 47, 47, 55, 55, 55,
+ 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
+ 55, 55, 56, 55, 55, 55, 55, 55, 55, 55,
+ 47, 47, 47, 57, 58, 55, 59, 60, 61, 62,
+ 55, 55, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 55, 55, 55, 47, 47, 76, 77,
+ 77, 32, 78, 76, 76, 76, 76, 76, 76, 76,
+ 79, 76, 76, 76, 76, 76, 76, 76, 99, 34,
+ 613, 100, 35, 172, 172, 136, 136, 32, 137, 152,
+ 152, 32, 173, 81, 208, 174, 138, 172, 172, 209,
+
+ 153, 76, 76, 76, 612, 157, 157, 32, 114, 114,
+ 32, 180, 172, 172, 115, 116, 158, 117, 82, 118,
+ 83, 172, 175, 173, 119, 176, 174, 84, 85, 76,
+ 77, 86, 32, 78, 87, 76, 76, 76, 76, 76,
+ 76, 79, 76, 76, 76, 76, 76, 76, 76, 190,
+ 120, 181, 121, 139, 140, 152, 154, 32, 611, 155,
+ 173, 172, 175, 174, 81, 176, 153, 157, 159, 32,
+ 610, 160, 76, 76, 76, 200, 299, 201, 158, 31,
+ 31, 32, 168, 300, 206, 169, 170, 191, 171, 82,
+ 33, 83, 192, 207, 193, 193, 193, 609, 84, 85,
+
+ 88, 89, 89, 32, 90, 88, 88, 88, 88, 88,
+ 88, 88, 91, 88, 88, 88, 88, 88, 88, 88,
+ 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
+ 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
+ 92, 92, 92, 88, 88, 88, 92, 92, 92, 93,
+ 92, 92, 92, 92, 92, 92, 92, 92, 94, 92,
+ 92, 92, 92, 95, 96, 92, 92, 92, 92, 97,
+ 98, 102, 102, 32, 202, 588, 203, 103, 104, 204,
+ 105, 608, 106, 125, 125, 32, 607, 107, 215, 126,
+ 127, 216, 128, 194, 129, 195, 195, 195, 230, 130,
+
+ 136, 141, 32, 137, 142, 218, 219, 220, 225, 172,
+ 172, 138, 226, 108, 221, 109, 564, 31, 34, 32,
+ 168, 35, 606, 169, 170, 131, 171, 132, 33, 222,
+ 227, 239, 223, 255, 228, 172, 175, 317, 231, 176,
+ 110, 102, 111, 32, 318, 112, 224, 103, 104, 256,
+ 105, 173, 106, 234, 174, 605, 235, 107, 236, 237,
+ 172, 175, 172, 172, 176, 172, 172, 173, 139, 140,
+ 174, 240, 172, 175, 173, 604, 176, 174, 172, 175,
+ 172, 172, 176, 108, 173, 109, 365, 174, 172, 175,
+ 172, 172, 176, 173, 172, 175, 174, 338, 176, 172,
+
+ 172, 173, 172, 175, 174, 366, 176, 248, 248, 180,
+ 110, 114, 122, 32, 339, 123, 173, 115, 116, 174,
+ 117, 230, 118, 173, 248, 251, 174, 119, 176, 172,
+ 172, 172, 175, 172, 172, 176, 173, 172, 175, 174,
+ 312, 176, 172, 172, 172, 175, 187, 187, 176, 181,
+ 193, 193, 193, 120, 313, 121, 125, 133, 32, 239,
+ 134, 231, 126, 127, 404, 128, 603, 129, 282, 282,
+ 282, 194, 130, 195, 195, 195, 283, 305, 284, 321,
+ 322, 306, 323, 405, 324, 328, 452, 285, 286, 329,
+ 453, 287, 602, 325, 326, 246, 246, 327, 131, 240,
+
+ 132, 144, 144, 32, 145, 248, 248, 146, 147, 249,
+ 249, 601, 148, 248, 251, 258, 258, 176, 146, 147,
+ 351, 600, 353, 282, 282, 282, 428, 352, 352, 352,
+ 352, 599, 598, 352, 352, 597, 596, 595, 594, 593,
+ 592, 591, 590, 146, 589, 147, 144, 149, 32, 145,
+ 150, 564, 146, 147, 587, 586, 585, 148, 584, 583,
+ 582, 581, 580, 146, 147, 579, 578, 577, 576, 575,
+ 574, 573, 572, 571, 570, 569, 568, 567, 566, 565,
+ 564, 562, 561, 560, 559, 558, 557, 556, 146, 555,
+ 147, 30, 31, 31, 32, 30, 30, 30, 161, 162,
+
+ 30, 30, 30, 33, 30, 30, 30, 30, 30, 30,
+ 30, 163, 163, 163, 164, 163, 163, 163, 163, 163,
+ 163, 163, 163, 163, 163, 163, 163, 165, 166, 163,
+ 163, 163, 167, 163, 30, 30, 30, 163, 163, 163,
+ 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
+ 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
+ 30, 30, 268, 554, 269, 553, 552, 551, 550, 549,
+ 548, 270, 271, 547, 546, 545, 544, 543, 542, 541,
+ 540, 539, 538, 537, 536, 535, 534, 533, 532, 531,
+ 530, 529, 528, 527, 526, 525, 524, 523, 522, 521,
+
+ 520, 519, 272, 518, 517, 273, 274, 516, 515, 514,
+ 275, 513, 512, 511, 510, 509, 276, 508, 507, 277,
+ 506, 278, 505, 279, 504, 280, 30, 30, 30, 30,
+ 30, 30, 80, 80, 80, 80, 80, 80, 101, 101,
+ 101, 101, 101, 101, 113, 113, 113, 113, 113, 113,
+ 124, 124, 124, 124, 124, 124, 135, 135, 135, 135,
+ 135, 135, 143, 143, 143, 143, 143, 143, 151, 151,
+ 151, 151, 151, 151, 156, 156, 156, 156, 156, 156,
+ 177, 503, 177, 177, 177, 177, 179, 502, 179, 179,
+ 179, 179, 182, 182, 187, 501, 500, 187, 187, 187,
+
+ 189, 499, 189, 189, 189, 189, 197, 197, 229, 498,
+ 229, 229, 229, 229, 232, 232, 238, 497, 238, 238,
+ 238, 238, 241, 241, 246, 496, 495, 246, 246, 246,
+ 249, 494, 493, 249, 249, 249, 252, 252, 258, 492,
+ 491, 258, 258, 258, 260, 490, 260, 260, 260, 260,
+ 267, 489, 267, 267, 267, 267, 362, 362, 563, 488,
+ 563, 563, 563, 563, 487, 486, 485, 484, 483, 482,
+ 481, 480, 479, 478, 477, 476, 475, 474, 473, 472,
+ 471, 470, 469, 468, 467, 466, 465, 464, 463, 462,
+ 461, 460, 459, 458, 457, 456, 455, 454, 451, 450,
+
+ 449, 448, 447, 446, 445, 444, 443, 442, 441, 440,
+ 439, 438, 437, 436, 435, 434, 433, 432, 431, 430,
+ 429, 427, 426, 425, 424, 423, 422, 421, 420, 419,
+ 418, 417, 416, 415, 414, 413, 412, 411, 410, 409,
+ 408, 407, 406, 403, 402, 401, 400, 399, 398, 397,
+ 396, 395, 394, 393, 392, 391, 390, 389, 388, 387,
+ 386, 385, 384, 383, 382, 381, 380, 379, 378, 377,
+ 376, 375, 374, 373, 372, 371, 370, 369, 368, 367,
+ 364, 363, 348, 361, 360, 359, 358, 357, 356, 355,
+ 354, 350, 349, 348, 347, 346, 345, 344, 343, 259,
+
+ 342, 341, 340, 337, 250, 247, 336, 335, 334, 333,
+ 238, 332, 331, 330, 229, 320, 319, 316, 315, 314,
+ 311, 310, 309, 308, 307, 304, 303, 302, 301, 298,
+ 297, 296, 295, 294, 293, 292, 291, 290, 289, 288,
+ 281, 266, 266, 188, 265, 264, 263, 262, 179, 261,
+ 259, 257, 254, 253, 178, 178, 178, 250, 178, 247,
+ 178, 178, 178, 178, 245, 244, 243, 242, 178, 233,
+ 178, 217, 214, 213, 212, 211, 210, 205, 199, 198,
+ 196, 188, 178, 186, 185, 184, 183, 178, 614, 29,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614
+ } ;
+
+static yyconst flex_int16_t yy_chk[1262] =
+ { 0,
+ 0, 1, 1, 1, 2, 2, 2, 4, 2, 0,
+ 4, 6, 1, 0, 6, 2, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 10, 26,
+ 607, 10, 26, 31, 31, 17, 17, 17, 17, 21,
+ 21, 21, 33, 7, 62, 33, 17, 37, 37, 62,
+
+ 21, 7, 7, 7, 603, 23, 23, 23, 13, 13,
+ 13, 38, 48, 48, 13, 13, 23, 13, 7, 13,
+ 7, 34, 34, 39, 13, 34, 39, 7, 7, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 50,
+ 13, 38, 13, 17, 17, 22, 22, 22, 602, 22,
+ 52, 45, 45, 52, 8, 45, 22, 24, 24, 24,
+ 601, 24, 8, 8, 8, 58, 210, 58, 24, 27,
+ 27, 27, 27, 210, 61, 27, 27, 50, 27, 8,
+ 27, 8, 51, 61, 51, 51, 51, 598, 8, 8,
+
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 11, 11, 11, 59, 564, 59, 11, 11, 59,
+ 11, 597, 11, 15, 15, 15, 596, 11, 68, 15,
+ 15, 68, 15, 53, 15, 53, 53, 53, 78, 15,
+
+ 18, 18, 18, 18, 18, 70, 70, 70, 72, 77,
+ 77, 18, 72, 11, 70, 11, 564, 28, 28, 28,
+ 28, 28, 593, 28, 28, 15, 28, 15, 28, 71,
+ 73, 90, 71, 166, 73, 74, 74, 225, 78, 74,
+ 11, 12, 12, 12, 225, 12, 71, 12, 12, 166,
+ 12, 79, 12, 82, 79, 592, 82, 12, 83, 83,
+ 86, 86, 89, 89, 86, 102, 102, 91, 18, 18,
+ 91, 90, 99, 99, 106, 591, 99, 106, 111, 111,
+ 114, 114, 111, 12, 118, 12, 285, 118, 122, 122,
+ 125, 125, 122, 129, 133, 133, 129, 254, 133, 136,
+
+ 136, 138, 141, 141, 138, 285, 141, 144, 144, 179,
+ 12, 14, 14, 14, 254, 14, 148, 14, 14, 148,
+ 14, 229, 14, 153, 149, 149, 153, 14, 149, 152,
+ 152, 154, 154, 157, 157, 154, 158, 159, 159, 158,
+ 221, 159, 172, 172, 175, 175, 188, 188, 175, 179,
+ 193, 193, 193, 14, 221, 14, 16, 16, 16, 238,
+ 16, 229, 16, 16, 325, 16, 590, 16, 194, 194,
+ 194, 195, 16, 195, 195, 195, 198, 215, 198, 228,
+ 228, 215, 233, 325, 233, 234, 389, 198, 198, 234,
+ 389, 198, 587, 233, 233, 247, 247, 233, 16, 238,
+
+ 16, 19, 19, 19, 19, 248, 248, 19, 19, 250,
+ 250, 586, 19, 251, 251, 259, 259, 251, 19, 19,
+ 270, 584, 271, 282, 282, 282, 352, 270, 270, 271,
+ 271, 583, 582, 352, 352, 581, 579, 574, 572, 571,
+ 570, 569, 567, 19, 565, 19, 20, 20, 20, 20,
+ 20, 563, 20, 20, 562, 561, 560, 20, 559, 557,
+ 555, 554, 553, 20, 20, 551, 550, 548, 546, 544,
+ 543, 541, 540, 538, 537, 536, 535, 533, 532, 531,
+ 530, 528, 527, 526, 525, 524, 522, 521, 20, 519,
+ 20, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+ 25, 25, 191, 518, 191, 517, 516, 515, 514, 513,
+ 512, 191, 191, 511, 510, 506, 505, 503, 502, 501,
+ 500, 499, 494, 492, 491, 490, 489, 488, 487, 486,
+ 485, 483, 482, 480, 478, 477, 474, 473, 472, 471,
+
+ 470, 469, 191, 468, 467, 191, 191, 466, 465, 464,
+ 191, 463, 461, 459, 457, 456, 191, 455, 453, 191,
+ 452, 191, 450, 191, 449, 191, 615, 615, 615, 615,
+ 615, 615, 616, 616, 616, 616, 616, 616, 617, 617,
+ 617, 617, 617, 617, 618, 618, 618, 618, 618, 618,
+ 619, 619, 619, 619, 619, 619, 620, 620, 620, 620,
+ 620, 620, 621, 621, 621, 621, 621, 621, 622, 622,
+ 622, 622, 622, 622, 623, 623, 623, 623, 623, 623,
+ 624, 448, 624, 624, 624, 624, 625, 447, 625, 625,
+ 625, 625, 626, 626, 627, 446, 445, 627, 627, 627,
+
+ 628, 444, 628, 628, 628, 628, 629, 629, 630, 443,
+ 630, 630, 630, 630, 631, 631, 632, 442, 632, 632,
+ 632, 632, 633, 633, 634, 440, 439, 634, 634, 634,
+ 635, 436, 435, 635, 635, 635, 636, 636, 637, 434,
+ 433, 637, 637, 637, 638, 432, 638, 638, 638, 638,
+ 639, 431, 639, 639, 639, 639, 640, 640, 641, 430,
+ 641, 641, 641, 641, 426, 425, 423, 422, 421, 420,
+ 419, 417, 416, 415, 414, 413, 412, 411, 410, 409,
+ 408, 407, 406, 405, 404, 403, 402, 401, 399, 398,
+ 397, 396, 395, 394, 393, 392, 391, 390, 388, 387,
+
+ 386, 385, 384, 383, 382, 381, 379, 378, 377, 376,
+ 374, 373, 372, 369, 368, 367, 366, 365, 364, 363,
+ 362, 347, 346, 345, 344, 343, 342, 341, 340, 339,
+ 338, 337, 336, 335, 334, 333, 332, 331, 330, 329,
+ 328, 327, 326, 324, 323, 322, 321, 320, 319, 318,
+ 317, 316, 315, 314, 313, 312, 311, 310, 309, 308,
+ 307, 306, 305, 304, 303, 302, 301, 299, 298, 297,
+ 296, 295, 294, 293, 292, 291, 290, 288, 287, 286,
+ 284, 283, 280, 279, 278, 277, 276, 275, 274, 273,
+ 272, 269, 268, 267, 265, 264, 263, 262, 261, 258,
+
+ 257, 256, 255, 253, 249, 246, 245, 244, 243, 242,
+ 240, 237, 236, 235, 231, 227, 226, 224, 223, 222,
+ 220, 219, 218, 217, 216, 214, 213, 212, 211, 209,
+ 208, 207, 206, 205, 204, 203, 202, 201, 200, 199,
+ 192, 190, 189, 187, 186, 185, 184, 183, 181, 178,
+ 168, 167, 165, 164, 160, 155, 150, 145, 142, 137,
+ 134, 123, 112, 100, 96, 95, 94, 93, 87, 81,
+ 75, 69, 67, 66, 65, 64, 63, 60, 57, 56,
+ 54, 49, 46, 44, 43, 42, 41, 35, 29, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
+ 614
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "moc.l"
+/****************************************************************************
+** $Id: qt/moc_lex.cpp 3.3.8 edited Feb 2 14:59 $
+**
+** Lexical analyzer for meta object compiler
+**
+** Created : 930417
+**
+** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
+**
+** This file is part of the TQt GUI Toolkit.
+**
+** This file may be used under the terms of the GNU General Public
+** License versions 2.0 or 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Alternatively you may (at your option) use any
+** later version of the GNU General Public License if such license has
+** been publicly approved by Trolltech ASA (or its successors, if any)
+** and the KDE Free TQt Foundation.
+**
+** Please review the following information to ensure GNU General
+** Public Licensing retquirements will be met:
+** http://trolltech.com/products/qt/licenses/licensing/opensource/.
+** If you are unsure which license is appropriate for your use, please
+** review the following information:
+** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
+** or contact the sales department at [email protected].
+**
+** This file may be used under the terms of the Q Public License as
+** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
+** included in the packaging of this file. Licensees holding valid TQt
+** Commercial licenses may use this file in accordance with the TQt
+** Commercial License Agreement provided with the Software.
+**
+** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
+** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
+** herein.
+**
+*****************************************************************************/
+#line 39 "moc.l"
+#ifdef MOC_YACC_CODE
+
+#ifdef MOC_MWERKS_PLUGIN
+#ifdef Q_OS_MAC9
+# define isascii(c) ((int)( (unsigned int) (c) <= (unsigned char)0x7F ))
+#endif
+const char *buf_buffer = NULL;
+long buf_size_total = 0, buf_index = 0;
+#define YY_INPUT(buf, result, max_size) \
+ { \
+ if(buf_index < buf_size_total ) { \
+ while(!isascii(buf_buffer[buf_index])) buf_index++; \
+ int ms = ((max_size < buf_size_total) ? max_size : buf_size_total); \
+ for(result = 0; result < ms; result++) { \
+ char c = buf_buffer[buf_index + result]; \
+ if(!isascii(c)) { \
+ buf_index++; \
+ break; \
+ } \
+ buf[result] = c == '\r' ? '\n' : c; \
+ } \
+ buf_index += result; \
+ } else result = YY_NULL; \
+ }
+#endif
+
+#include "qstring.h"
+
+
+#define input yyinput // yyinput in C++
+
+#define X if(lexDebug){fprintf(stderr,"LEX (%i) : %s\n",lineNo,yytext);};
+#define Y if(lexDebug){fprintf(stderr,"LEX (%i) : %s\n",lineNo,yytext);};
+/*
+#define Y if(lexDebug){fprintf(stderr,"LEX (%i) : %s updates level to %i\n"\
+ ,lineNo,yytext,templLevel);};
+*/
+#define Z if(lexDebug){fprintf(stderr,"LEX (%i) : skipped the string %s\"\n"\
+ ,lineNo,yytext);};
+#define BEGIN_INSIDE
+
+
+#define linput() \
+ ( (c = input()) == '\n' ? (lineNo++, c) : (c == EOF) ? 0 : c )
+
+#include <string.h>
+#include <stdlib.h>
+
+int classPLevel = 1; /* Depth of nested curly braces in IN_CLASS */
+int namespacePLevel = 1; /* Depth of nested curly braces in IN_NAMESPACE */
+int expLevel = 1; /* Depth of nested parentheses in IN_EXPR */
+int enumLevel = 1; /* Depth of nested parentheses in IN_ENUM */
+int fctLevel = 1; /* Depth of nested parentheses in IN_FCT */
+int templLevel = 1; /* Depth of levels in IN_TEMPL_ARGS */
+
+int lastState = 0; /* Remembers the state when a
+ MOC_SKIP_BEGIN is encountered */
+int skipLevel = 0; /* Depth of MOC_SKIP_BEGINs */
+
+class TQString;
+
+extern void addExpressionChar( const char );
+extern void addExpressionString( const char * );
+extern void moc_warn( const char *msg );
+
+#line 1033 "lex.yy.c"
+
+#define INITIAL 0
+#define OUTSIDE 1
+#define QT_DEF 2
+#define IN_CLASS 3
+#define IN_NAMESPACE 4
+#define IN_ENUM 5
+#define IN_EXPR 6
+#define IN_DEF_ARG 7
+#define IN_FCT 8
+#define IN_TEMPL_ARGS 9
+#define GIMME_SEMICOLON 10
+#define SKIP 11
+#define IN_PROPERTY 12
+#define IN_CLASSINFO 13
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap (void );
+#else
+extern int yywrap (void );
+#endif
+#endif
+
+ static void yyunput (int c,char *buf_ptr );
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ if ( yyleng > 0 ) \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+ (yytext[yyleng - 1] == '\n'); \
+ YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+#line 110 "moc.l"
+
+
+#line 1203 "lex.yy.c"
+
+ if ( (yy_init) )
+ {
+ (yy_init) = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer(yyin,YY_BUF_SIZE );
+ }
+
+ yy_load_buffer_state( );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
+
+ /* Support of yytext. */
+ *yy_cp = (yy_hold_char);
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = (yy_start);
+ yy_current_state += YY_AT_BOL();
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 615 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 1190 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 112 "moc.l"
+{ X;
+ BEGIN QT_DEF;
+ return CLASS; }
+ YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 115 "moc.l"
+{ X;
+ BEGIN QT_DEF;
+ return NAMESPACE; }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 118 "moc.l"
+{ X;
+ BEGIN QT_DEF;
+ return USING; }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 121 "moc.l"
+{ X;
+ BEGIN QT_DEF;
+ return TEMPLATE; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 124 "moc.l"
+{ X; return Q_OBJECT; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 125 "moc.l"
+{ X; return SIGNALS; }
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 126 "moc.l"
+{ X; return SLOTS; }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 127 "moc.l"
+{ X; return Q_CLASSINFO; }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 128 "moc.l"
+{ X; return Q_PROPERTY; }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 129 "moc.l"
+{ X; return Q_OVERRIDE; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 130 "moc.l"
+{ X; return Q_ENUMS; }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 131 "moc.l"
+{ X; return Q_SETS; }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 133 "moc.l"
+{ fctLevel++;Y; }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 134 "moc.l"
+{ fctLevel--;Y;if (fctLevel==0){X;return '}';}}
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 135 "moc.l"
+{ classPLevel++;Y; }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 136 "moc.l"
+{ classPLevel--;Y;if (classPLevel == 0)
+ {X;return '}';} }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 138 "moc.l"
+{ X;if( classPLevel == 1 ) return PUBLIC; }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 139 "moc.l"
+{ X;if( classPLevel == 1 ) return PROTECTED; }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 140 "moc.l"
+{ X;if( classPLevel == 1 ) return PRIVATE; }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 141 "moc.l"
+{ X;if( classPLevel == 1 ) return SIGNALS; }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 142 "moc.l"
+{ X;if( classPLevel == 1 ) return SLOTS; }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 143 "moc.l"
+{ X;if( classPLevel == 1 ) return Q_CLASSINFO; }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 144 "moc.l"
+{ X;
+ if ( classPLevel == 1 )
+ return Q_OBJECT;
+ else if ( classPLevel > 1 )
+ moc_warn( "Cannot use Q_OBJECT in nested class." );
+ }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 150 "moc.l"
+{ X;if( classPLevel == 1 ) return Q_PROPERTY; }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 151 "moc.l"
+{ X;if( classPLevel == 1 ) return Q_OVERRIDE; }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 152 "moc.l"
+{ X;if( classPLevel == 1 ) return Q_ENUMS; }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 153 "moc.l"
+{ X;if( classPLevel == 1 ) return Q_SETS; }
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 155 "moc.l"
+{ namespacePLevel++;Y; }
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 156 "moc.l"
+{ namespacePLevel--;Y;if (namespacePLevel == 0)
+ {X;return '}';}}
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 158 "moc.l"
+{ X;
+ BEGIN QT_DEF;
+ return CLASS; }
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 161 "moc.l"
+{ X;
+ BEGIN QT_DEF;
+ return TEMPLATE; }
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 164 "moc.l"
+{ X;
+ BEGIN QT_DEF;
+ return NAMESPACE; }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 167 "moc.l"
+{ X;
+ BEGIN QT_DEF;
+ return USING; }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 171 "moc.l"
+{ X; return '('; }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 172 "moc.l"
+{ X; return ')'; }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 173 "moc.l"
+{ X; return READ; }
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 174 "moc.l"
+{ X; return WRITE; }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 175 "moc.l"
+{ X; return STORED; }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 176 "moc.l"
+{ X; return RESET; }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 177 "moc.l"
+{ X; return DESIGNABLE; }
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 178 "moc.l"
+{ X; return SCRIPTABLE; }
+ YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 181 "moc.l"
+{ expLevel++;X; }
+ YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 182 "moc.l"
+{ expLevel--;Y;if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ')';} }
+ YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 184 "moc.l"
+{ expLevel++;X; }
+ YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 185 "moc.l"
+{ expLevel--;X;if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ']';} }
+ YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 187 "moc.l"
+{ if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ',' ;} }
+ YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 189 "moc.l"
+{ if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ';' ;} }
+ YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 191 "moc.l"
+{ expLevel++;X; }
+ YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 192 "moc.l"
+{ expLevel--;Y;if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ')';} }
+ YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 194 "moc.l"
+{ expLevel++;X; }
+ YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 195 "moc.l"
+{ expLevel--;X;if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ']';} }
+ YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 197 "moc.l"
+{ if (expLevel <= 1)
+ { X; BEGIN QT_DEF; return ',' ;} }
+ YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 199 "moc.l"
+{ if (expLevel == 0)
+ { X; BEGIN QT_DEF; return ';' ;} }
+ YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 201 "moc.l"
+{ enumLevel++;X; }
+ YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 202 "moc.l"
+{ enumLevel--;X; }
+ YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 203 "moc.l"
+{ enumLevel++;X; }
+ YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 204 "moc.l"
+{ enumLevel--;X }
+ YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 205 "moc.l"
+{ if (enumLevel == 0)
+ { X; BEGIN QT_DEF; return ',' ;} }
+ YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 207 "moc.l"
+{ if (enumLevel == 0)
+ { X; BEGIN QT_DEF; return ';' ;} }
+ YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 209 "moc.l"
+{ if (enumLevel == 0)
+ { X; BEGIN QT_DEF; return '}' ;} }
+ YY_BREAK
+case 61:
+YY_RULE_SETUP
+#line 211 "moc.l"
+{ templLevel++;
+ Y;
+ addExpressionChar( yytext[0] );
+ }
+ YY_BREAK
+case 62:
+YY_RULE_SETUP
+#line 215 "moc.l"
+{ templLevel--;
+ Y;
+ if ( templLevel == 0 ) {
+ X;
+ BEGIN QT_DEF;
+ return yytext[0];
+ } else {
+ addExpressionChar( yytext[0] );
+ }
+ }
+ YY_BREAK
+case 63:
+YY_RULE_SETUP
+#line 225 "moc.l"
+{ X;return FRIEND; }
+ YY_BREAK
+case 64:
+YY_RULE_SETUP
+#line 226 "moc.l"
+{ X;return TYPEDEF; }
+ YY_BREAK
+case 65:
+YY_RULE_SETUP
+#line 227 "moc.l"
+{ X;return AUTO; }
+ YY_BREAK
+case 66:
+YY_RULE_SETUP
+#line 228 "moc.l"
+{ X;return REGISTER; }
+ YY_BREAK
+case 67:
+YY_RULE_SETUP
+#line 229 "moc.l"
+{ X;return STATIC; }
+ YY_BREAK
+case 68:
+YY_RULE_SETUP
+#line 230 "moc.l"
+{ X;return EXTERN; }
+ YY_BREAK
+case 69:
+YY_RULE_SETUP
+#line 231 "moc.l"
+{ X;return INLINE; }
+ YY_BREAK
+case 70:
+YY_RULE_SETUP
+#line 232 "moc.l"
+{ X;return INLINE; }
+ YY_BREAK
+case 71:
+YY_RULE_SETUP
+#line 233 "moc.l"
+{ X;return VIRTUAL; }
+ YY_BREAK
+case 72:
+YY_RULE_SETUP
+#line 234 "moc.l"
+{ X;return CONST; }
+ YY_BREAK
+case 73:
+YY_RULE_SETUP
+#line 235 "moc.l"
+{ X;return VOLATILE; }
+ YY_BREAK
+case 74:
+YY_RULE_SETUP
+#line 236 "moc.l"
+{ X;return CHAR; }
+ YY_BREAK
+case 75:
+YY_RULE_SETUP
+#line 237 "moc.l"
+{ X;return SHORT; }
+ YY_BREAK
+case 76:
+YY_RULE_SETUP
+#line 238 "moc.l"
+{ X;return INT; }
+ YY_BREAK
+case 77:
+YY_RULE_SETUP
+#line 239 "moc.l"
+{ X;return LONG; }
+ YY_BREAK
+case 78:
+YY_RULE_SETUP
+#line 240 "moc.l"
+{ X;return SIGNED; }
+ YY_BREAK
+case 79:
+YY_RULE_SETUP
+#line 241 "moc.l"
+{ X;return UNSIGNED; }
+ YY_BREAK
+case 80:
+YY_RULE_SETUP
+#line 242 "moc.l"
+{ X;return FLOAT; }
+ YY_BREAK
+case 81:
+YY_RULE_SETUP
+#line 243 "moc.l"
+{ X;return DOUBLE; }
+ YY_BREAK
+case 82:
+YY_RULE_SETUP
+#line 244 "moc.l"
+{ X;return VOID; }
+ YY_BREAK
+case 83:
+YY_RULE_SETUP
+#line 245 "moc.l"
+{ X;return ENUM; }
+ YY_BREAK
+case 84:
+YY_RULE_SETUP
+#line 246 "moc.l"
+{ X;return CLASS; }
+ YY_BREAK
+case 85:
+YY_RULE_SETUP
+#line 247 "moc.l"
+{ X;return STRUCT; }
+ YY_BREAK
+case 86:
+YY_RULE_SETUP
+#line 248 "moc.l"
+{ X;return UNION; }
+ YY_BREAK
+case 87:
+YY_RULE_SETUP
+#line 249 "moc.l"
+{ X;return ASM; }
+ YY_BREAK
+case 88:
+YY_RULE_SETUP
+#line 250 "moc.l"
+{ X;return PRIVATE; }
+ YY_BREAK
+case 89:
+YY_RULE_SETUP
+#line 251 "moc.l"
+{ X;return PROTECTED; }
+ YY_BREAK
+case 90:
+YY_RULE_SETUP
+#line 252 "moc.l"
+{ X;return PUBLIC; }
+ YY_BREAK
+case 91:
+YY_RULE_SETUP
+#line 253 "moc.l"
+{ X;return OPERATOR; }
+ YY_BREAK
+case 92:
+YY_RULE_SETUP
+#line 254 "moc.l"
+{ X;return DBL_COLON; }
+ YY_BREAK
+case 93:
+YY_RULE_SETUP
+#line 255 "moc.l"
+{ X;return TRIPLE_DOT; }
+ YY_BREAK
+case 94:
+YY_RULE_SETUP
+#line 256 "moc.l"
+{ X;return TEMPLATE; }
+ YY_BREAK
+case 95:
+YY_RULE_SETUP
+#line 257 "moc.l"
+{ X;return MUTABLE; }
+ YY_BREAK
+case 96:
+YY_RULE_SETUP
+#line 258 "moc.l"
+{ X;return THROW; }
+ YY_BREAK
+case 97:
+YY_RULE_SETUP
+#line 259 "moc.l"
+{ X;return USING; }
+ YY_BREAK
+case 98:
+YY_RULE_SETUP
+#line 260 "moc.l"
+{ X;return NAMESPACE; }
+ YY_BREAK
+case 99:
+YY_RULE_SETUP
+#line 262 "moc.l"
+{
+ X;
+ yylval.string = qstrdup(yytext);
+ return IDENTIFIER;
+ }
+ YY_BREAK
+case 100:
+YY_RULE_SETUP
+#line 268 "moc.l"
+{
+ X;
+ yylval.string = qstrdup(yytext);
+ return IDENTIFIER;
+ }
+ YY_BREAK
+case 101:
+YY_RULE_SETUP
+#line 274 "moc.l"
+{ X; return '('; }
+ YY_BREAK
+case 102:
+YY_RULE_SETUP
+#line 275 "moc.l"
+{ X; return ')'; }
+ YY_BREAK
+case 103:
+YY_RULE_SETUP
+#line 276 "moc.l"
+{ X; return ','; }
+ YY_BREAK
+case 104:
+/* rule 104 can match eol */
+YY_RULE_SETUP
+#line 278 "moc.l"
+{
+ X;
+ yylval.string = qstrdup( yytext + 1 );
+ input(); /* discard the '"' */
+ return STRING;
+ }
+ YY_BREAK
+case 105:
+YY_RULE_SETUP
+#line 285 "moc.l"
+;
+ YY_BREAK
+case 106:
+YY_RULE_SETUP
+#line 286 "moc.l"
+;
+ YY_BREAK
+case 107:
+YY_RULE_SETUP
+#line 287 "moc.l"
+;
+ YY_BREAK
+case 108:
+/* rule 108 can match eol */
+YY_RULE_SETUP
+#line 289 "moc.l"
+{ /* discard strings */
+ Z;
+ }
+ YY_BREAK
+case 109:
+/* rule 109 can match eol */
+YY_RULE_SETUP
+#line 293 "moc.l"
+{ /* discard strings */
+ Z;
+ }
+ YY_BREAK
+case 110:
+/* rule 110 can match eol */
+YY_RULE_SETUP
+#line 297 "moc.l"
+{ /* discard strings */
+ Z;
+ }
+ YY_BREAK
+case 111:
+/* rule 111 can match eol */
+YY_RULE_SETUP
+#line 301 "moc.l"
+{ /* discard strings */
+ Z;
+ addExpressionString( yytext );
+ input(); /* discard the '"' */
+ }
+ YY_BREAK
+case 112:
+/* rule 112 can match eol */
+YY_RULE_SETUP
+#line 308 "moc.l"
+{
+ X;
+ addExpressionString( yytext );
+ input(); /* discard the '"' */
+ return STRING;
+ }
+ YY_BREAK
+case 113:
+/* rule 113 can match eol */
+YY_RULE_SETUP
+#line 315 "moc.l"
+{
+ X;
+ yylval.string = qstrdup( yytext + 1 );
+ input(); /* discard the '"' */
+ return STRING;
+ }
+ YY_BREAK
+case 114:
+YY_RULE_SETUP
+#line 322 "moc.l"
+{ X;
+ yylval.char_val = yytext[1];
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 115:
+YY_RULE_SETUP
+#line 327 "moc.l"
+{ X;
+ yylval.char_val = '\a';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 116:
+YY_RULE_SETUP
+#line 332 "moc.l"
+{ X;
+ yylval.char_val = '\b';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 117:
+YY_RULE_SETUP
+#line 337 "moc.l"
+{ X;
+ yylval.char_val = '\f';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 118:
+YY_RULE_SETUP
+#line 342 "moc.l"
+{ X;
+ yylval.char_val = '\n';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 119:
+YY_RULE_SETUP
+#line 347 "moc.l"
+{ X;
+ yylval.char_val = '\r';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 120:
+YY_RULE_SETUP
+#line 352 "moc.l"
+{ X;
+ yylval.char_val = '\t';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 121:
+YY_RULE_SETUP
+#line 357 "moc.l"
+{ X;
+ yylval.char_val = '\v';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 122:
+YY_RULE_SETUP
+#line 362 "moc.l"
+{ X;
+ yylval.char_val = '\\';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 123:
+YY_RULE_SETUP
+#line 367 "moc.l"
+{ X;
+ yylval.char_val = '\?';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 124:
+YY_RULE_SETUP
+#line 372 "moc.l"
+{ X;
+ yylval.char_val = '\'';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 125:
+YY_RULE_SETUP
+#line 377 "moc.l"
+{ X;
+ yylval.char_val = '\"'; /* " */
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 126:
+YY_RULE_SETUP
+#line 382 "moc.l"
+{ X;
+ yylval.char_val = '\0';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 127:
+YY_RULE_SETUP
+#line 387 "moc.l"
+{ X;
+ yylval.char_val =
+ (char)strtol( &yytext[1], 0, 8 );
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 128:
+YY_RULE_SETUP
+#line 393 "moc.l"
+{ X;
+ yylval.char_val =
+ (char)strtol( &yytext[2], 0, 16 );
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 129:
+YY_RULE_SETUP
+#line 399 "moc.l"
+{ X;
+ yylval.char_val = ' ';
+ return CHAR_VAL;
+ }
+ YY_BREAK
+case 130:
+YY_RULE_SETUP
+#line 404 "moc.l"
+{ X;
+ yylval.int_val = atoi(yytext);
+ return INT_VAL;
+ }
+ YY_BREAK
+case 131:
+YY_RULE_SETUP
+#line 409 "moc.l"
+{ X;
+ yylval.double_val = atof(yytext);
+ return DOUBLE_VAL;
+ }
+ YY_BREAK
+case 132:
+YY_RULE_SETUP
+#line 414 "moc.l"
+{ X;
+ yylval.double_val = atof(yytext);
+ return DOUBLE_VAL;
+ }
+ YY_BREAK
+case 133:
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
+(yy_c_buf_p) = yy_cp -= 1;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
+YY_RULE_SETUP
+#line 420 "moc.l"
+{ /* skip multi-line macro-definitions */
+ int c, c1;
+ input(); /* Discard the '\n'. */
+ do {
+ c1=' ';
+ while((c = linput()) != '\n' && c != 0) c1=c;
+ if (c == 0) break;
+ } while(c1=='\\');
+ unput(c); /* put back the '\n' or the EOF */
+ }
+ YY_BREAK
+case 134:
+YY_RULE_SETUP
+#line 431 "moc.l"
+{ /* preprocessor commands are skipped */}
+ YY_BREAK
+case 135:
+YY_RULE_SETUP
+#line 432 "moc.l"
+{ /* C++ comment */
+ TQCString s = yytext;
+ if ( s.contains( "MOC_SKIP_BEGIN" ) ) {
+ skipLevel++;
+ if ( skipLevel == 1 ) {
+ lastState = YYSTATE;
+ BEGIN SKIP;
+ }
+ } else
+ if ( s.contains( "MOC_SKIP_END" ) ) {
+ if ( skipLevel == 0 ) {
+ moc_warn(" MOC_SKIP_END without MOC_SKIP_BEGIN");
+ } else {
+ skipLevel--;
+ if ( skipLevel == 0 ) {
+ BEGIN lastState;
+ }
+ }
+ }
+ }
+ YY_BREAK
+case 136:
+YY_RULE_SETUP
+#line 452 "moc.l"
+{ /* C comment */
+ int c = ' ';
+ do {
+ if ( c!= '*' ) {
+ while((c = linput()) != '*' && c != 0)
+ ;
+ }
+ if (c == 0) break;
+ } while(((c = linput())) != '/' && c != 0);
+ if (c == 0)
+ unput(c);
+ }
+ YY_BREAK
+case 137:
+YY_RULE_SETUP
+#line 465 "moc.l"
+{ addExpressionChar( yytext[0] ); }
+ YY_BREAK
+case 138:
+YY_RULE_SETUP
+#line 467 "moc.l"
+{
+ /* spaces are important in template args,
+ e.g. Foo<const int> */
+ addExpressionChar( yytext[0] ); }
+ YY_BREAK
+case 139:
+YY_RULE_SETUP
+#line 471 "moc.l"
+;
+ YY_BREAK
+case 140:
+YY_RULE_SETUP
+#line 472 "moc.l"
+;
+ YY_BREAK
+case 141:
+YY_RULE_SETUP
+#line 473 "moc.l"
+;
+ YY_BREAK
+case 142:
+YY_RULE_SETUP
+#line 474 "moc.l"
+;
+ YY_BREAK
+case 143:
+YY_RULE_SETUP
+#line 475 "moc.l"
+{ addExpressionChar( yytext[0] ); }
+ YY_BREAK
+case 144:
+YY_RULE_SETUP
+#line 476 "moc.l"
+;
+ YY_BREAK
+case 145:
+YY_RULE_SETUP
+#line 477 "moc.l"
+{ addExpressionChar( yytext[0] ); }
+ YY_BREAK
+case 146:
+YY_RULE_SETUP
+#line 478 "moc.l"
+;
+ YY_BREAK
+case 147:
+YY_RULE_SETUP
+#line 479 "moc.l"
+;
+ YY_BREAK
+case 148:
+YY_RULE_SETUP
+#line 480 "moc.l"
+{
+ X;
+ return yytext[0];
+ }
+ YY_BREAK
+case 149:
+YY_RULE_SETUP
+#line 484 "moc.l"
+{
+ X;
+ return ';';
+ }
+ YY_BREAK
+case 150:
+/* rule 150 can match eol */
+YY_RULE_SETUP
+#line 488 "moc.l"
+{
+ lineNo++;
+ }
+ YY_BREAK
+case 151:
+YY_RULE_SETUP
+#line 493 "moc.l"
+ECHO;
+ YY_BREAK
+#line 2241 "lex.yy.c"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(OUTSIDE):
+case YY_STATE_EOF(QT_DEF):
+case YY_STATE_EOF(IN_CLASS):
+case YY_STATE_EOF(IN_NAMESPACE):
+case YY_STATE_EOF(IN_ENUM):
+case YY_STATE_EOF(IN_EXPR):
+case YY_STATE_EOF(IN_DEF_ARG):
+case YY_STATE_EOF(IN_FCT):
+case YY_STATE_EOF(IN_TEMPL_ARGS):
+case YY_STATE_EOF(GIMME_SEMICOLON):
+case YY_STATE_EOF(SKIP):
+case YY_STATE_EOF(IN_PROPERTY):
+case YY_STATE_EOF(IN_CLASSINFO):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( yywrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+} /* end of yylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (void)
+{
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ size_t num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart(yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state (void)
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = (yy_start);
+ yy_current_state += YY_AT_BOL();
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 615 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
+{
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 615 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 614);
+
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+ static void yyunput (int c, register char * yy_bp )
+{
+ register char *yy_cp;
+
+ yy_cp = (yy_c_buf_p);
+
+ /* undo effects of setting up yytext */
+ *yy_cp = (yy_hold_char);
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+ static int yyinput (void)
+#else
+ static int input (void)
+#endif
+
+{
+ int c;
+
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart(yyin );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
+ (yy_hold_char) = *++(yy_c_buf_p);
+
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+
+ return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ *
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void yyrestart (FILE * input_file )
+{
+
+ if ( ! YY_CURRENT_BUFFER ){
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer(yyin,YY_BUF_SIZE );
+ }
+
+ yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+ yy_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ *
+ */
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+{
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
+ */
+ yyensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ yy_load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void yy_load_buffer_state (void)
+{
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ *
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer(b,file );
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ *
+ */
+ void yy_delete_buffer (YY_BUFFER_STATE b )
+{
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yyfree((void *) b->yy_ch_buf );
+
+ yyfree((void *) b );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
+
+{
+ int oerrno = errno;
+
+ yy_flush_buffer(b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ *
+ */
+ void yy_flush_buffer (YY_BUFFER_STATE b )
+{
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ yy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ *
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+ if (new_buffer == NULL)
+ return;
+
+ yyensure_buffer_stack();
+
+ /* This block is copied from yy_switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ *
+ */
+void yypop_buffer_state (void)
+{
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
+}
+
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+ int num_to_alloc;
+
+ if (!(yy_buffer_stack)) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
+{
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer(b );
+
+ return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ *
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
+{
+
+ return yy_scan_bytes(yy_str,strlen(yy_str) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
+{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yyalloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg )
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yytext[yyleng] = (yy_hold_char); \
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ *
+ */
+int yyget_lineno (void)
+{
+
+ return yylineno;
+}
+
+/** Get the input stream.
+ *
+ */
+FILE *yyget_in (void)
+{
+ return yyin;
+}
+
+/** Get the output stream.
+ *
+ */
+FILE *yyget_out (void)
+{
+ return yyout;
+}
+
+/** Get the length of the current token.
+ *
+ */
+int yyget_leng (void)
+{
+ return yyleng;
+}
+
+/** Get the current token.
+ *
+ */
+
+char *yyget_text (void)
+{
+ return yytext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ *
+ */
+void yyset_lineno (int line_number )
+{
+
+ yylineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ *
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE * in_str )
+{
+ yyin = in_str ;
+}
+
+void yyset_out (FILE * out_str )
+{
+ yyout = out_str ;
+}
+
+int yyget_debug (void)
+{
+ return yy_flex_debug;
+}
+
+void yyset_debug (int bdebug )
+{
+ yy_flex_debug = bdebug ;
+}
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (void)
+{
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ yypop_buffer_state();
+ }
+
+ /* Destroy the stack itself. */
+ yyfree((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
+
+ return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *yyalloc (yy_size_t size )
+{
+ return (void *) malloc( size );
+}
+
+void *yyrealloc (void * ptr, yy_size_t size )
+{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+}
+
+void yyfree (void * ptr )
+{
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef yytext_ptr
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
+#endif
+#line 493 "moc.l"
+
+
+
+#endif // MOC_YACC_CODE
+
diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp
new file mode 100644
index 000000000..81c7c5eaa
--- /dev/null
+++ b/src/moc/moc_yacc.cpp
@@ -0,0 +1,4814 @@
+#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"
+#define MOC_YACC_CODE
+void yyerror( const char *msg );
+
+#include "qplatformdefs.h"
+#include "qasciidict.h"
+#include "qdatetime.h"
+#include "qdict.h"
+#include "qfile.h"
+#include "qdir.h"
+#include "qptrlist.h"
+#include "qregexp.h"
+#include "qstrlist.h"
+#ifdef MOC_MWERKS_PLUGIN
+# ifdef Q_OS_MACX
+# undef OLD_DEBUG
+# ifdef DEBUG
+# define OLD_DEBUG DEBUG
+# undef DEBUG
+# endif
+# define DEBUG 0
+# ifndef __IMAGECAPTURE__
+# define __IMAGECAPTURE__
+# endif
+# include <Carbon/Carbon.h>
+# endif
+# include "mwerks_mac.h"
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#if defined CONST
+#undef CONST
+#endif
+#if defined VOID
+#undef VOID
+#endif
+
+bool isEnumType( const char* type );
+int enumIndex( const char* type );
+bool isVariantType( const char* type );
+int qvariant_nameToType( const char* name );
+static void init(); /* initialize*/
+static void initClass(); /* prepare for new class*/
+static void generateClass(); /* generate C++ code for class*/
+static void initExpression(); /* prepare for new expression*/
+static void enterNameSpace( const char *name = 0 );
+static void leaveNameSpace();
+static void selectOutsideClassState();
+static void registerClassInNamespace();
+static bool suppress_func_warn = FALSE;
+static void func_warn( const char *msg );
+static void moc_warn( const char *msg );
+static void moc_err( const char *s );
+static void moc_err( const char *s1, const char *s2 );
+static void operatorError();
+static void checkPropertyName( const char* ident );
+
+static const char* const utype_map[] =
+{
+ "bool",
+ "int",
+ "double",
+ "TQString",
+ "TQVariant",
+ 0
+};
+
+inline bool isIdentChar( char x )
+{ /* Avoid bug in isalnum*/
+ return x == '_' || (x >= '0' && x <= '9') ||
+ (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z');
+}
+
+bool validUType( TQCString ctype )
+{
+ if ( ctype.left(6) == "const " )
+ ctype = ctype.mid( 6, ctype.length() - 6 );
+ if ( ctype.right(1) == "&" )
+ ctype = ctype.left( ctype.length() - 1 );
+ else if ( ctype.right(1) == "*" )
+ return TRUE;
+
+ int i = -1;
+ while ( utype_map[++i] )
+ if ( ctype == utype_map[i] )
+ return TRUE;
+
+ return isEnumType( ctype );
+}
+
+TQCString castToUType( TQCString ctype )
+{
+ if ( ctype.right(1) == "&" )
+ ctype = ctype.left( ctype.length() - 1 );
+ if( ctype.right(1) == "]") {
+ int lb = ctype.findRev('[');
+ if(lb != -1)
+ ctype = ctype.left(lb) + "*";
+ }
+ return ctype;
+}
+
+TQCString rawUType( TQCString ctype )
+{
+ ctype = castToUType( ctype );
+ if ( ctype.left(6) == "const " )
+ ctype = ctype.mid( 6, ctype.length() - 6 );
+ return ctype;
+}
+
+TQCString uType( TQCString ctype )
+{
+ if ( !validUType( ctype ) ) {
+ if ( isVariantType( rawUType(ctype) ) )
+ return "varptr";
+ else
+ return "ptr";
+ }
+ if ( ctype.left(6) == "const " )
+ ctype = ctype.mid( 6, ctype.length() - 6 );
+ if ( ctype.right(1) == "&" ) {
+ ctype = ctype.left( ctype.length() - 1 );
+ } else if ( ctype.right(1) == "*" ) {
+ TQCString raw = ctype.left( ctype.length() - 1 );
+ ctype = "ptr";
+ if ( raw == "char" )
+ ctype = "charstar";
+ else if ( raw == "TQUnknownInterface" )
+ ctype = "iface";
+ else if ( raw == "TQDispatchInterface" )
+ ctype = "idisp";
+ else if ( isVariantType( raw ) )
+ ctype = "varptr";
+ }
+ if ( isEnumType( ctype ) )
+ ctype = "enum";
+ return ctype;
+}
+
+bool isInOut( TQCString ctype )
+{
+ if ( ctype.left(6) == "const " )
+ return FALSE;
+ if ( ctype.right(1) == "&" )
+ return TRUE;
+ if ( ctype.right(2) == "**" )
+ return TRUE;
+ return FALSE;
+}
+
+TQCString uTypeExtra( TQCString ctype )
+{
+ TQCString typeExtra = "0";
+ if ( !validUType( ctype ) ) {
+ if ( isVariantType( rawUType(ctype) ) )
+ typeExtra.sprintf("\"\\x%02x\"", qvariant_nameToType( rawUType(ctype) ) );
+ else
+ typeExtra.sprintf( "\"%s\"", rawUType(ctype).data() );
+ return typeExtra;
+ }
+ if ( ctype.left(6) == "const " )
+ ctype = ctype.mid( 6, ctype.length() - 6 );
+ if ( ctype.right(1) == "&" )
+ ctype = ctype.left( ctype.length() - 1 );
+ if ( ctype.right(1) == "*" ) {
+ TQCString raw = ctype.left( ctype.length() - 1 );
+ ctype = "ptr";
+ if ( raw == "char" )
+ ;
+ else if ( isVariantType( raw ) )
+ typeExtra.sprintf("\"\\x%02x\"", qvariant_nameToType( raw ) );
+ else
+ typeExtra.sprintf( "\"%s\"", raw.stripWhiteSpace().data() );
+
+ } else if ( isEnumType( ctype ) ) {
+ int idx = enumIndex( ctype );
+ if ( idx >= 0 ) {
+ typeExtra.sprintf( "&enum_tbl[%d]", enumIndex( ctype ) );
+ } else {
+ typeExtra.sprintf( "parentObject->enumerator(\"%s\", TRUE )", ctype.data() );
+ }
+ typeExtra =
+ "\n#ifndef QT_NO_PROPERTIES\n\t " + typeExtra +
+ "\n#else"
+ "\n\t 0"
+ "\n#endif // QT_NO_PROPERTIES\n\t ";
+ }
+ return typeExtra;
+}
+
+/*
+ Attention!
+ This table is copied from qvariant.cpp. If you change
+ one, change both.
+*/
+static const int ntypes = 35;
+static const char* const type_map[ntypes] =
+{
+ 0,
+ "TQMap<TQString,TQVariant>",
+ "TQValueList<TQVariant>",
+ "TQString",
+ "TQStringList",
+ "TQFont",
+ "TQPixmap",
+ "TQBrush",
+ "TQRect",
+ "TQSize",
+ "TQColor",
+ "TQPalette",
+ "TQColorGroup",
+ "TQIconSet",
+ "TQPoint",
+ "TQImage",
+ "int",
+ "uint",
+ "bool",
+ "double",
+ "TQCString",
+ "TQPointArray",
+ "TQRegion",
+ "TQBitmap",
+ "TQCursor",
+ "TQSizePolicy",
+ "TQDate",
+ "TQTime",
+ "TQDateTime",
+ "TQByteArray",
+ "TQBitArray",
+ "TQKeySequence",
+ "TQPen",
+ "Q_LLONG",
+ "Q_ULLONG"
+};
+
+int qvariant_nameToType( const char* name )
+{
+ for ( int i = 0; i < ntypes; i++ ) {
+ if ( !qstrcmp( type_map[i], name ) )
+ return i;
+ }
+ return 0;
+}
+
+/*
+ Returns TRUE if the type is a TQVariant types.
+*/
+bool isVariantType( const char* type )
+{
+ return qvariant_nameToType( type ) != 0;
+}
+
+/*
+ Replaces '>>' with '> >' (as in 'TQValueList<TQValueList<double> >').
+ This function must be called to produce valid C++ code. However,
+ the string representation still uses '>>'.
+*/
+void fixRightAngles( TQCString *str )
+{
+ str->replace( TQRegExp(">>"), "> >" );
+}
+
+static TQCString rmWS( const char * );
+
+enum Access { Private, Protected, Public };
+
+
+class Argument /* single arg meta data*/
+{
+public:
+ Argument( const char *left, const char *right, const char* argName = 0, bool isDefaultArgument = FALSE )
+ {
+ leftType = rmWS( left );
+ rightType = rmWS( right );
+ if ( leftType == "void" && rightType.isEmpty() )
+ leftType = "";
+
+ int len = leftType.length();
+
+ /*
+ Convert 'char const *' into 'const char *'. Start at index 1,
+ not 0, because 'const char *' is already OK.
+ */
+ for ( int i = 1; i < len; i++ ) {
+ if ( leftType[i] == 'c' &&
+ strncmp(leftType.data() + i + 1, "onst", 4) == 0
+ && (i + 5 >= len || !isIdentChar(leftType[i + 5]))
+ && !isIdentChar(i-1)
+ ) {
+ leftType.remove( i, 5 );
+ if ( leftType[i - 1] == ' ' )
+ leftType.remove( i - 1, 1 );
+ leftType.prepend( "const " );
+ break;
+ }
+
+ /*
+ We musn't convert 'char * const *' into 'const char **'
+ and we must beware of 'Bar<const Bla>'.
+ */
+ if ( leftType[i] == '&' || leftType[i] == '*' ||
+ leftType[i] == '<' )
+ break;
+ }
+
+ name = argName;
+ isDefault = isDefaultArgument;
+ }
+
+ TQCString leftType;
+ TQCString rightType;
+ TQCString name;
+ bool isDefault;
+};
+
+class ArgList : public TQPtrList<Argument> { /* member function arg list*/
+public:
+ ArgList() { setAutoDelete( TRUE ); }
+ ~ArgList() { clear(); }
+
+ /* the clone has one default argument less, the orignal has all default arguments removed */
+ ArgList* magicClone() {
+ ArgList* l = new ArgList;
+ bool firstDefault = FALSE;
+ for ( first(); current(); next() ) {
+ bool isDefault = current()->isDefault;
+ if ( !firstDefault && isDefault ) {
+ isDefault = FALSE;
+ firstDefault = TRUE;
+ }
+ l->append( new Argument( current()->leftType, current()->rightType, current()->name, isDefault ) );
+ }
+ for ( first(); current(); ) {
+ if ( current()->isDefault )
+ remove();
+ else
+ next();
+ }
+ return l;
+ }
+
+ bool hasDefaultArguments() {
+ for ( Argument* a = first(); a; a = next() ) {
+ if ( a->isDefault )
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+};
+
+
+struct Function /* member function meta data*/
+{
+ Access access;
+ TQCString qualifier; /* const or volatile*/
+ TQCString name;
+ TQCString type;
+ TQCString signature;
+ 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 TQPtrList<Function> { /* list of member functions*/
+public:
+ FuncList( bool autoDelete = FALSE ) { setAutoDelete( autoDelete ); }
+
+ FuncList find( const char* name )
+ {
+ FuncList result;
+ for ( TQPtrListIterator<Function> it(*this); it.current(); ++it ) {
+ if ( it.current()->name == name )
+ result.append( it.current() );
+ }
+ return result;
+ }
+};
+
+class Enum : public TQStrList
+{
+public:
+ TQCString name;
+ bool set;
+};
+
+class EnumList : public TQPtrList<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 TQCString& st, const TQCString& d, const TQCString& sc, bool ov )
+ : lineNo(l), type(t), name(n), set(s), get(g), reset(r), setfunc(0), getfunc(0),
+ sspec(Unspecified), gspec(Unspecified), stored( st ),
+ designable( d ), scriptable( sc ), override( ov ), oredEnum( -1 )
+ {
+ /*
+ The Q_PROPERTY construct cannot contain any commas, since
+ commas separate macro arguments. We therefore expect users
+ to type "TQMap" instead of "TQMap<TQString, TQVariant>". For
+ coherence, we also expect the same for
+ TQValueList<TQVariant>, the other template class supported by
+ TQVariant.
+ */
+ if ( type == "TQMap" ) {
+ type = "TQMap<TQString,TQVariant>";
+ } else if ( type == "TQValueList" ) {
+ type = "TQValueList<TQVariant>";
+ } else if ( type == "LongLong" ) {
+ type = "Q_LLONG";
+ } else if ( type == "ULongLong" ) {
+ type = "Q_ULLONG";
+ }
+ }
+
+ int lineNo;
+ TQCString type;
+ TQCString name;
+ TQCString set;
+ TQCString get;
+ TQCString reset;
+ TQCString stored;
+ TQCString designable;
+ TQCString scriptable;
+ bool override;
+
+ Function* setfunc;
+ Function* getfunc;
+
+ 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)*/
+ TQCString enumsettype; /* contains the set function type in case of oredEnum*/
+ TQCString enumgettype; /* contains the get function type in case of oredEnum*/
+
+ enum Specification { Unspecified, Class, Reference, Pointer, ConstCharStar };
+ Specification sspec;
+ Specification gspec;
+
+ bool stdSet() {
+ TQCString 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 TQPtrList<Property> { /* list of properties*/
+public:
+ PropList() { setAutoDelete( TRUE ); }
+};
+
+
+struct ClassInfo
+{
+ ClassInfo( const char* n, const char* v )
+ : name(n), value(v)
+ {}
+ TQCString name;
+ TQCString value;
+};
+
+class ClassInfoList : public TQPtrList<ClassInfo> { /* list of class infos*/
+public:
+ ClassInfoList() { setAutoDelete( TRUE ); }
+};
+
+class parser_reg {
+ public:
+ parser_reg();
+ ~parser_reg();
+
+ /* some temporary values*/
+ TQCString tmpExpression; /* Used to store the characters the lexer*/
+ /* is currently skipping (see addExpressionChar and friends)*/
+ TQCString fileName; /* file name*/
+ TQCString outputFile; /* output file name*/
+ TQCString pchFile; /* name of PCH file (used on Windows)*/
+ TQStrList includeFiles; /* name of #include files*/
+ TQCString includePath; /* #include file path*/
+ TQCString qtPath; /* #include qt file path*/
+ int gen_count; /*number of classes generated*/
+ bool noInclude; /* no #include <filename>*/
+ bool generatedCode; /* no code generated*/
+ bool mocError; /* moc parsing error occurred*/
+ bool hasVariantIncluded; /*whether or not qvariant.h was included yet*/
+ TQCString className; /* name of parsed class*/
+ TQCString superClassName; /* name of first super class*/
+ TQStrList multipleSuperClasses; /* other superclasses*/
+ FuncList signals; /* signal interface*/
+ FuncList slots; /* slots interface*/
+ FuncList propfuncs; /* all possible property access functions*/
+ FuncList funcs; /* 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*/
+ TQCString propWrite; /* set function*/
+ TQCString propRead; /* get function*/
+ TQCString propReset; /* reset function*/
+ TQCString propStored; /**/
+ TQCString propDesignable; /* "true", "false" or function or empty if not specified*/
+ TQCString propScriptable; /* "true", "false" or function or empty if not specified*/
+ bool propOverride; /* Wether OVERRIDE was detected*/
+
+ TQStrList qtEnums; /* Used to store the contents of Q_ENUMS*/
+ TQStrList qtSets; /* Used to store the contents of Q_SETS*/
+
+};
+
+static parser_reg *g = 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 *stradd( const char *, const char * ); /* add two strings*/
+char *stradd( const char *, const char *, /* add three strings*/
+ const char * );
+char *stradd( const char *, const char *, /* adds 4 strings*/
+ const char *, 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; /* controled 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*/
+
+int tmpYYStart; /* Used to store the lexers current mode*/
+int tmpYYStart2; /* Used to store the lexers current mode*/
+ /* (if tmpYYStart is already used)*/
+
+/* if the format revision changes, you MUST change it in qmetaobject.h too*/
+const int formatRevision = 26; /* moc output format revision*/
+
+/* if the flags change, you HAVE to change it in qmetaobject.h too*/
+enum Flags {
+ Invalid = 0x00000000,
+ Readable = 0x00000001,
+ Writable = 0x00000002,
+ EnumOrSet = 0x00000004,
+ UnresolvedEnum = 0x00000008,
+ StdSet = 0x00000100,
+ Override = 0x00000200,
+ NotDesignable = 0x00001000,
+ DesignableOverride = 0x00002000,
+ NotScriptable = 0x00004000,
+ ScriptableOverride = 0x00008000,
+ NotStored = 0x00010000,
+ StoredOverride = 0x00020000
+};
+
+
+#ifdef YYBISON
+# if defined(Q_OS_WIN32)
+# include <io.h>
+# undef isatty
+extern "C" int hack_isatty( int )
+ {
+ return 0;
+ }
+# define isatty hack_isatty
+# else
+# include <unistd.h>
+# endif
+
+# define YYDEBUG 1
+# include "moc_yacc.h"
+# include "moc_lex.cpp"
+#endif /*YYBISON*/
+#line 689 "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 653 "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 THROW 296
+#define SIGNALS 297
+#define SLOTS 298
+#define Q_OBJECT 299
+#define Q_PROPERTY 300
+#define Q_OVERRIDE 301
+#define Q_CLASSINFO 302
+#define Q_ENUMS 303
+#define Q_SETS 304
+#define READ 305
+#define WRITE 306
+#define STORED 307
+#define DESIGNABLE 308
+#define SCRIPTABLE 309
+#define RESET 310
+#define YYERRCODE 256
+short yylhs[] = { -1,
+ 0, 0, 40, 40, 40, 40, 40, 42, 42, 48,
+ 50, 46, 51, 52, 47, 49, 43, 45, 44, 44,
+ 54, 41, 1, 1, 2, 55, 56, 57, 58, 30,
+ 30, 30, 30, 30, 29, 31, 31, 32, 32, 59,
+ 59, 59, 59, 34, 34, 33, 33, 11, 11, 11,
+ 12, 12, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 3, 60, 60, 14, 14, 15, 15, 16, 16,
+ 17, 17, 17, 19, 19, 21, 21, 25, 25, 61,
+ 61, 20, 20, 24, 62, 24, 24, 63, 24, 22,
+ 22, 23, 64, 23, 65, 23, 23, 23, 35, 35,
+ 66, 35, 35, 39, 67, 10, 10, 73, 10, 74,
+ 10, 75, 72, 76, 72, 38, 38, 37, 37, 36,
+ 36, 26, 26, 27, 27, 28, 28, 71, 71, 71,
+ 78, 77, 81, 53, 53, 53, 53, 53, 53, 18,
+ 18, 18, 18, 18, 82, 82, 79, 83, 69, 69,
+ 84, 68, 68, 85, 86, 86, 88, 87, 4, 4,
+ 80, 80, 89, 89, 91, 91, 93, 90, 94, 90,
+ 90, 96, 99, 90, 100, 101, 90, 102, 103, 90,
+ 104, 106, 90, 107, 109, 90, 92, 92, 111, 92,
+ 92, 98, 98, 112, 112, 113, 95, 95, 115, 115,
+ 116, 110, 110, 117, 117, 118, 119, 119, 5, 6,
+ 6, 7, 7, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 9, 9, 9, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 121, 121, 122,
+ 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
+ 122, 114, 114, 114, 114, 114, 114, 114, 114, 126,
+ 127, 114, 124, 124, 128, 129, 128, 130, 128, 123,
+ 131, 123, 125, 133, 133, 132, 132, 70, 70, 134,
+ 134, 134, 135, 136, 135, 138, 97, 137, 137, 137,
+ 137, 137, 137, 137, 105, 105, 108, 108,
+};
+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, 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, 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, 8, 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, 3, 3, 4, 2, 1,
+ 1, 1, 1, 1, 2, 3, 2, 3, 0, 1,
+ 4, 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, 3, 3, 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, 140, 40,
+ 41, 42, 43, 44, 45, 46, 47, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 141, 139, 142, 144,
+ 143, 0, 70, 24, 0, 22, 65, 66, 133, 0,
+ 0, 0, 0, 147, 160, 0, 0, 0, 0, 11,
+ 1, 0, 26, 146, 0, 0, 0, 136, 137, 0,
+ 0, 224, 225, 226, 0, 219, 211, 0, 214, 0,
+ 17, 1, 0, 0, 62, 0, 69, 169, 166, 171,
+ 172, 175, 178, 181, 184, 165, 0, 0, 164, 167,
+ 138, 0, 221, 0, 216, 0, 0, 223, 218, 0,
+ 15, 25, 0, 0, 0, 0, 0, 0, 134, 163,
+ 0, 0, 0, 220, 215, 210, 222, 217, 12, 0,
+ 0, 0, 0, 0, 0, 191, 0, 0, 189, 168,
+ 212, 213, 0, 33, 34, 0, 0, 0, 0, 0,
+ 0, 64, 271, 0, 0, 52, 0, 49, 48, 38,
+ 0, 31, 32, 30, 0, 170, 201, 0, 200, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 187, 0, 0, 108, 112, 0, 0, 0, 303, 73,
+ 0, 0, 0, 263, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 278, 0,
+ 0, 0, 0, 0, 0, 0, 270, 0, 118, 0,
+ 51, 0, 0, 0, 0, 0, 39, 290, 207, 199,
+ 0, 0, 301, 207, 0, 309, 0, 316, 173, 176,
+ 0, 326, 182, 328, 185, 188, 206, 0, 205, 190,
+ 0, 195, 196, 27, 27, 110, 114, 0, 0, 0,
+ 311, 252, 253, 0, 254, 0, 267, 266, 244, 248,
+ 259, 242, 261, 243, 0, 262, 245, 246, 247, 249,
+ 260, 250, 251, 0, 0, 288, 0, 207, 277, 126,
+ 127, 120, 0, 124, 121, 0, 0, 0, 275, 119,
+ 148, 72, 0, 71, 0, 0, 272, 0, 0, 0,
+ 83, 0, 0, 27, 0, 207, 0, 207, 0, 0,
+ 0, 0, 0, 0, 204, 194, 109, 0, 27, 27,
+ 0, 314, 0, 0, 257, 258, 264, 227, 228, 207,
+ 0, 125, 0, 276, 280, 0, 291, 208, 0, 0,
+ 81, 74, 93, 0, 0, 0, 97, 0, 302, 0,
+ 0, 0, 298, 0, 99, 0, 293, 0, 0, 0,
+ 0, 0, 0, 0, 317, 174, 177, 179, 183, 186,
+ 113, 111, 0, 0, 29, 312, 307, 0, 281, 0,
+ 273, 0, 0, 75, 82, 27, 0, 104, 85, 0,
+ 95, 92, 35, 296, 0, 27, 101, 100, 207, 0,
+ 0, 0, 0, 0, 0, 0, 0, 115, 306, 315,
+ 279, 207, 0, 0, 153, 0, 98, 28, 0, 27,
+ 27, 103, 299, 27, 0, 294, 319, 320, 322, 323,
+ 324, 321, 180, 0, 0, 154, 0, 0, 0, 150,
+ 94, 86, 88, 0, 297, 0, 157, 0, 0, 0,
+ 28, 96, 102, 27, 156, 79, 0, 131, 0, 128,
+ 105, 129, 89, 0, 151, 0, 0, 158, 132, 130,
+};
+short yydgoto[] = { 93,
+ 53, 54, 162, 64, 65, 85, 86, 87, 88, 163,
+ 164, 165, 166, 167, 168, 69, 169, 48, 318, 319,
+ 320, 365, 366, 321, 477, 302, 303, 304, 322, 170,
+ 217, 171, 172, 173, 374, 229, 306, 307, 375, 4,
+ 5, 6, 7, 8, 9, 10, 11, 26, 94, 92,
+ 14, 71, 21, 12, 72, 337, 462, 430, 174, 22,
+ 362, 438, 471, 406, 440, 444, 244, 434, 459, 247,
+ 481, 196, 264, 339, 265, 340, 482, 486, 23, 107,
+ 76, 24, 175, 460, 435, 456, 457, 474, 108, 109,
+ 110, 150, 131, 123, 176, 124, 184, 260, 330, 125,
+ 331, 126, 427, 127, 188, 333, 128, 190, 334, 256,
+ 193, 261, 262, 263, 178, 179, 258, 259, 316, 219,
+ 180, 181, 245, 376, 182, 315, 402, 377, 441, 416,
+ 324, 199, 344, 270, 271, 395, 385, 329,
+};
+short yysindex[] = { 0,
+ 70, -206, -111, 0, 0, 0, 0, 0, 0, 0,
+ 0, -220, 41, 10, 0, 0, 0, 67, 912, -96,
+ 152, 124, 91, 559, -81, 98, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 11, 0, 0, -54, 0, 0, 0, 0, -14,
+ -3, 59, 354, 0, 0, 201, 61, 233, -54, 0,
+ 0, 266, 0, 0, 61, 1186, 329, 0, 0, 206,
+ 245, 0, 0, 0, 328, 0, 0, -83, 0, -54,
+ 0, 0, 70, 287, 0, 348, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 295, 1186, 0, 0,
+ 0, 438, 0, -66, 0, 354, -66, 0, 0, 303,
+ 0, 0, 384, 406, 411, 457, 468, 480, 0, 0,
+ -42, 434, 481, 0, 0, 0, 0, 0, 0, 1064,
+ 265, 265, 291, 292, 306, 0, 506, 515, 0, 0,
+ 0, 0, 353, 0, 0, 0, -71, 315, 467, 337,
+ -48, 0, 0, 276, 1230, 0, 374, 0, 0, 0,
+ 1098, 0, 0, 0, -26, 0, 0, 1064, 0, 436,
+ 119, 375, 377, 568, 575, 545, 292, 604, 306, 607,
+ 0, 1064, 1064, 0, 0, -30, 520, 389, 0, 0,
+ 596, 393, 394, 0, 570, 624, 600, 177, 355, 379,
+ 605, 606, 609, 22, 612, 613, 986, 1229, 0, 572,
+ -81, 635, 13, 467, 349, 349, 0, 363, 0, -36,
+ 0, 201, -53, 440, 1229, 441, 0, 0, 0, 0,
+ 443, 1229, 0, 0, 204, 0, 649, 0, 0, 0,
+ 463, 0, 0, 0, 0, 0, 0, 1064, 0, 0,
+ 1064, 0, 0, 0, 0, 0, 0, 389, 664, 665,
+ 0, 0, 0, 702, 0, 708, 0, 0, 0, 0,
+ 0, 0, 0, 0, 626, 0, 0, 0, 0, 0,
+ 0, 0, 0, 285, 285, 0, 667, 0, 0, 0,
+ 0, 0, 349, 0, 0, 285, -201, 467, 0, 0,
+ 0, 0, 285, 0, 599, 724, 0, 743, 742, 494,
+ 0, 277, 1119, 0, 724, 0, -21, 0, 764, 1064,
+ 1064, 746, 1064, 1064, 0, 0, 0, 719, 0, 0,
+ 665, 0, 389, 693, 0, 0, 0, 0, 0, 0,
+ 724, 0, 467, 0, 0, -38, 0, 0, 349, 784,
+ 0, 0, 0, 277, -22, 178, 0, 1229, 0, 724,
+ 798, 29, 0, 407, 0, 458, 0, 724, 601, 617,
+ 622, 625, 646, 647, 0, 0, 0, 0, 0, 0,
+ 0, 0, 786, 762, 0, 0, 0, 724, 0, 467,
+ 0, 874, 881, 0, 0, 0, 65, 0, 0, 277,
+ 0, 0, 0, 0, 385, 0, 0, 0, 0, -21,
+ 764, 764, 764, 764, 764, 764, 1064, 0, 0, 0,
+ 0, 0, -81, 657, 0, 861, 0, 0, 894, 0,
+ 0, 0, 0, 0, 724, 0, 0, 0, 0, 0,
+ 0, 0, 0, 724, 916, 0, 913, 948, 375, 0,
+ 0, 0, 0, 889, 0, 933, 0, -81, 1229, 26,
+ 0, 0, 0, 0, 0, 0, 991, 0, 799, 0,
+ 0, 0, 0, 1015, 0, 936, 1004, 0, 0, 0,
+};
+short yyrindex[] = { 0,
+ 330, 941, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 199, 943, 0, 0, 0, 0, 0, 373, 0,
+ 0, 0, 0, 5, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 76, 0, 0, 327, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 40, 0, 0, 71, 0,
+ 0, 0, 0, 0, 0, 940, 0, 0, 0, 31,
+ 0, 0, 0, 0, 78, 0, 0, 0, 0, 82,
+ 0, 0, -90, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 953, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 594,
+ 0, 0, 0, 1062, 1068, 0, 0, 0, 0, 0,
+ 0, 0, 113, 0, 0, 1032, 0, 0, 1140, 0,
+ 0, 0, 0, 0, 126, 0, 0, 0, 0, 0,
+ 199, 0, 0, 0, 0, 0, 0, 602, 0, 0,
+ 504, 1065, 0, 0, 0, 0, 1062, 0, 1068, 0,
+ 0, 911, 934, 0, 0, 516, 316, 33, 0, 0,
+ 548, 618, 620, 0, 0, 0, 663, 1018, 1160, 1209,
+ 1364, 1366, 1386, 1388, 1391, 1393, 0, 4, 0, 0,
+ 0, 0, 1396, 1140, -18, -18, 0, 37, 0, 0,
+ 0, 168, 80, 0, 191, 0, 0, 0, 0, 0,
+ 0, 187, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 942, 0, 0,
+ 988, 0, 0, 0, 0, 0, 0, 33, 49, 998,
+ 0, 0, 0, 1398, 0, 1418, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1420, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1423, 1423, 0, 0, 0, 0, 0,
+ 0, 0, -29, 0, 0, 360, 0, 1140, 0, 0,
+ 0, 0, 37, 0, 0, 478, 0, 0, -37, 1084,
+ 0, -27, 199, 0, 527, 0, 0, 0, 1085, 934,
+ 934, 0, 934, 934, 0, 0, 0, 0, 0, 0,
+ 998, 0, 1002, 0, 0, 0, 0, 0, 0, 0,
+ 571, 0, 1140, 0, 0, 0, 0, 0, 298, 408,
+ 0, 0, 0, 0, -23, 64, 0, 9, 0, 648,
+ 477, 0, 0, 510, 0, 0, 0, 697, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 741, 0, 1140,
+ 0, 0, 238, 0, 0, 0, 0, 0, 0, -34,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1085, 1085, 1085, 1085, 1085, 1085, 934, 0, 0, 0,
+ 0, 0, 0, -2, 0, 0, 0, 0, -16, 0,
+ 0, 0, 0, 0, 818, 0, 0, 0, 0, 0,
+ 0, 0, 0, 867, 0, 0, 350, 0, 58, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 211, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+short yygindex[] = { 1152,
+ 347, 0, 1150, 930, 0, 0, 435, 1056, 449, 283,
+ -135, 0, 57, -11, -25, 122, 0, 0, 0, 0,
+ 0, 765, 810, -294, 0, -159, 0, 892, 0, -10,
+ -44, -156, 1177, 1182, 830, 244, 1039, 301, 840, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1114, 0,
+ 0, 0, 0, 0, 1134, 231, 752, 0, 1207, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 768,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 780, 0, 0, 0, 1142,
+ 0, 0, 0, 0, 0, 0, 1109, -186, 0, 0,
+ 0, 0, 0, 0, 1067, 0, 0, 1063, 0, 0,
+ 0, 0, 994, -82, 0, 1078, 0, 999, 274, -170,
+ 0, 0, 0, 0, 0, 0, 0, 849, 0, 0,
+ 0, 0, 931, 1005, 974, 0, 856, 0,
+};
+#define YYTABLESIZE 1510
+short yytable[] = { 68,
+ 20, 226, 218, 77, 63, 225, 90, 228, 123, 90,
+ 123, 123, 123, 90, 123, 149, 90, 84, 372, 122,
+ 84, 122, 122, 122, 87, 122, 90, 87, 123, 123,
+ 266, 123, 239, 90, 16, 235, 373, 89, 409, 122,
+ 122, 37, 122, 37, 37, 37, 36, 37, 36, 36,
+ 36, 198, 36, 299, 13, 115, 149, 177, 149, 223,
+ 267, 123, 119, 135, 37, 405, 305, 218, 372, 36,
+ 73, 18, 122, 194, 23, 47, 310, 23, 218, 23,
+ 23, 23, 290, 23, 480, 218, 479, 353, 135, 23,
+ 89, 138, 313, 123, 37, 177, 238, 23, 23, 36,
+ 23, 25, 226, 195, 91, 437, 225, 91, 67, 257,
+ 67, 67, 67, 23, 67, 23, 308, 23, 308, 68,
+ 149, 68, 68, 68, 91, 68, 28, 159, 67, 67,
+ 23, 67, 27, 23, 23, 222, 209, 355, 159, 68,
+ 68, 55, 68, 386, 387, 291, 389, 390, 478, 15,
+ 23, 218, 106, 23, 23, 411, 106, 310, 242, 236,
+ 237, 67, 23, 50, 52, 50, 50, 50, 133, 50,
+ 106, 106, 68, 313, 476, 257, 243, 80, 16, 66,
+ 308, 17, 399, 50, 50, 117, 50, 368, 90, 197,
+ 313, 21, 21, 67, 80, 297, 218, 323, 23, 403,
+ 209, 21, 159, 218, 68, 71, 67, 237, 67, 71,
+ 56, 218, 66, 59, 281, 226, 50, 237, 146, 225,
+ 70, 231, 223, 67, 223, 23, 23, 76, 36, 431,
+ 274, 123, 36, 90, 274, 75, 75, 280, 408, 371,
+ 453, 67, 122, 218, 221, 112, 77, 327, 274, 274,
+ 400, 78, 308, 77, 147, 148, 90, 78, 149, 123,
+ 73, 123, 326, 90, 37, 73, 123, 84, 411, 36,
+ 122, 66, 122, 295, 87, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 233, 408,
+ 23, 91, 37, 37, 37, 37, 152, 116, 152, 36,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 236, 218, 226, 226, 323, 364, 225, 225, 79,
+ 23, 66, 226, 413, 91, 116, 225, 95, 23, 23,
+ 23, 67, 67, 67, 67, 67, 67, 67, 67, 67,
+ 67, 67, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 72, 91, 122, 122, 72, 122, 67,
+ 152, 67, 2, 3, 145, 23, 145, 363, 145, 111,
+ 68, 116, 68, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 23, 145, 145, 50, 50, 50, 50,
+ 50, 50, 50, 50, 50, 50, 50, 283, 74, 117,
+ 226, 23, 23, 117, 225, 57, 58, 455, 155, 122,
+ 155, 121, 73, 194, 50, 282, 50, 117, 117, 129,
+ 122, 97, 226, 286, 323, 442, 225, 139, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 284,
+ 285, 140, 455, 195, 226, 141, 227, 36, 225, 145,
+ 142, 36, 274, 273, 275, 276, 71, 23, 36, 36,
+ 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+ 36, 36, 155, 310, 151, 417, 36, 76, 36, 36,
+ 63, 63, 36, 36, 36, 36, 36, 36, 36, 36,
+ 36, 36, 36, 36, 36, 338, 143, 417, 152, 216,
+ 36, 420, 36, 212, 208, 80, 206, 144, 207, 209,
+ 204, 210, 309, 211, 104, 113, 419, 325, 104, 145,
+ 104, 152, 118, 317, 106, 183, 202, 201, 203, 114,
+ 82, 83, 84, 152, 67, 104, 223, 154, 155, 30,
+ 31, 32, 33, 34, 35, 36, 37, 300, 134, 310,
+ 186, 137, 187, 295, 369, 107, 106, 205, 122, 107,
+ 213, 241, 300, 191, 224, 367, 189, 104, 295, 392,
+ 393, 351, 192, 107, 107, 200, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 239, 251, 354,
+ 214, 239, 215, 122, 348, 349, 62, 220, 60, 370,
+ 61, 378, 289, 289, 72, 239, 239, 367, 249, 412,
+ 155, 21, 21, 356, 80, 250, 63, 418, 300, 301,
+ 117, 21, 81, 398, 154, 155, 30, 31, 32, 33,
+ 34, 35, 36, 37, 232, 246, 436, 248, 401, 82,
+ 83, 84, 268, 67, 253, 155, 443, 255, 117, 269,
+ 412, 282, 282, 367, 64, 64, 272, 240, 418, 241,
+ 279, 240, 277, 241, 278, 287, 288, 347, 36, 289,
+ 464, 465, 292, 293, 466, 240, 240, 241, 241, 36,
+ 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+ 36, 36, 445, 298, 296, 286, 286, 36, 132, 36,
+ 312, 314, 231, 223, 484, 454, 231, 328, 343, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 197, 268,
+ 231, 231, 332, 357, 342, 350, 198, 268, 154, 155,
+ 30, 31, 32, 33, 34, 35, 36, 37, 289, 289,
+ 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
+ 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
+ 289, 289, 345, 289, 289, 289, 289, 289, 346, 289,
+ 289, 289, 283, 283, 289, 289, 289, 289, 289, 289,
+ 289, 289, 358, 359, 361, 360, 388, 282, 282, 282,
+ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
+ 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
+ 282, 391, 282, 282, 282, 282, 282, 397, 282, 282,
+ 282, 285, 285, 282, 282, 282, 282, 282, 282, 282,
+ 282, 286, 286, 286, 286, 286, 286, 286, 286, 286,
+ 286, 286, 286, 286, 286, 286, 286, 286, 286, 286,
+ 286, 286, 286, 286, 286, 414, 286, 286, 286, 286,
+ 286, 421, 286, 286, 286, 287, 287, 286, 286, 286,
+ 286, 286, 286, 286, 286, 63, 63, 422, 428, 197,
+ 197, 197, 423, 63, 63, 424, 429, 198, 198, 198,
+ 197, 197, 197, 197, 197, 197, 197, 197, 198, 198,
+ 198, 198, 198, 198, 198, 198, 425, 426, 283, 283,
+ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
+ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
+ 283, 283, 432, 283, 283, 283, 283, 283, 433, 283,
+ 283, 283, 284, 284, 283, 283, 283, 283, 283, 283,
+ 283, 283, 458, 461, 463, 467, 468, 285, 285, 285,
+ 285, 285, 285, 285, 285, 285, 285, 285, 285, 285,
+ 285, 285, 285, 285, 285, 285, 285, 285, 285, 285,
+ 285, 472, 285, 285, 285, 285, 285, 469, 285, 285,
+ 285, 292, 292, 285, 285, 285, 285, 285, 285, 285,
+ 285, 287, 287, 287, 287, 287, 287, 287, 287, 287,
+ 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
+ 287, 287, 287, 287, 287, 473, 287, 287, 287, 287,
+ 287, 485, 287, 287, 287, 202, 268, 287, 287, 287,
+ 287, 287, 287, 287, 287, 154, 155, 30, 31, 32,
+ 33, 34, 35, 36, 37, 488, 487, 235, 192, 268,
+ 489, 235, 490, 13, 161, 10, 203, 268, 379, 380,
+ 381, 382, 383, 384, 404, 235, 235, 162, 284, 284,
+ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
+ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
+ 284, 284, 325, 284, 284, 284, 284, 284, 327, 284,
+ 284, 284, 193, 268, 284, 284, 284, 284, 284, 284,
+ 284, 284, 304, 308, 80, 318, 305, 292, 292, 292,
+ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292,
+ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292,
+ 292, 1, 292, 292, 292, 292, 292, 269, 292, 292,
+ 292, 19, 311, 292, 292, 292, 292, 292, 292, 292,
+ 292, 136, 29, 407, 439, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 63, 63, 352, 49, 202, 202, 202, 229,
+ 50, 415, 230, 229, 410, 120, 96, 202, 202, 202,
+ 202, 202, 202, 202, 202, 63, 63, 229, 229, 192,
+ 192, 192, 483, 63, 63, 51, 470, 203, 203, 203,
+ 192, 192, 192, 192, 192, 192, 192, 192, 203, 203,
+ 203, 203, 203, 203, 203, 203, 294, 475, 230, 130,
+ 185, 254, 230, 252, 336, 240, 335, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 230, 230, 446, 63,
+ 63, 394, 341, 193, 193, 193, 447, 448, 449, 450,
+ 451, 452, 0, 0, 193, 193, 193, 193, 193, 193,
+ 193, 193, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 396, 0, 0, 0,
+ 0, 45, 0, 45, 153, 154, 155, 30, 31, 32,
+ 33, 34, 156, 36, 37, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 157, 0, 0, 158, 0, 0,
+ 0, 0, 159, 67, 0, 18, 160, 161, 66, 154,
+ 155, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 234, 66,
+ 0, 158, 0, 0, 0, 0, 0, 67, 0, 18,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 234,
+ 36, 0, 158, 232, 0, 233, 0, 232, 67, 233,
+ 18, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+ 0, 232, 232, 233, 233, 234, 0, 236, 0, 234,
+ 237, 236, 238, 0, 237, 106, 238, 255, 0, 106,
+ 0, 255, 0, 234, 234, 236, 236, 0, 237, 237,
+ 238, 238, 0, 106, 106, 255, 255, 256, 0, 265,
+ 0, 256, 116, 265, 0, 0, 116, 0, 0, 0,
+ 0, 82, 83, 84, 0, 256, 256, 265, 265, 0,
+ 116, 116, 98, 99, 100, 101, 102, 103, 104, 105,
+ 154, 155, 30, 31, 32, 33, 34, 35, 36, 37,
+ 0, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+};
+short yycheck[] = { 25,
+ 12, 38, 159, 41, 58, 42, 41, 164, 38, 44,
+ 40, 41, 42, 41, 44, 58, 44, 41, 40, 38,
+ 44, 40, 41, 42, 41, 44, 61, 44, 58, 59,
+ 61, 61, 59, 61, 125, 171, 58, 63, 61, 58,
+ 59, 38, 61, 40, 41, 42, 38, 44, 40, 41,
+ 42, 123, 44, 224, 261, 81, 59, 140, 61, 261,
+ 91, 91, 88, 59, 61, 360, 226, 224, 40, 61,
+ 60, 292, 91, 61, 44, 19, 44, 38, 235, 40,
+ 41, 42, 61, 44, 59, 242, 61, 289, 114, 59,
+ 116, 117, 44, 123, 91, 178, 123, 58, 59, 91,
+ 61, 61, 38, 91, 41, 41, 42, 44, 38, 192,
+ 40, 41, 42, 38, 44, 40, 59, 42, 61, 38,
+ 123, 40, 41, 42, 61, 44, 60, 123, 58, 59,
+ 91, 61, 123, 58, 59, 161, 59, 308, 59, 58,
+ 59, 20, 61, 330, 331, 124, 333, 334, 123, 261,
+ 38, 308, 40, 123, 42, 91, 44, 125, 40, 171,
+ 171, 91, 123, 38, 261, 40, 41, 42, 112, 44,
+ 58, 59, 91, 125, 469, 258, 58, 261, 290, 261,
+ 123, 293, 353, 58, 59, 269, 61, 323, 67, 261,
+ 235, 282, 283, 123, 261, 221, 353, 242, 123, 359,
+ 123, 292, 123, 360, 123, 38, 290, 218, 290, 42,
+ 59, 368, 261, 123, 38, 38, 91, 228, 261, 42,
+ 123, 165, 261, 290, 261, 58, 59, 41, 38, 400,
+ 40, 261, 42, 261, 44, 290, 290, 61, 261, 261,
+ 427, 290, 261, 400, 293, 40, 261, 44, 58, 59,
+ 289, 41, 289, 291, 297, 298, 291, 261, 261, 289,
+ 60, 291, 59, 291, 261, 60, 296, 291, 91, 261,
+ 289, 261, 291, 217, 291, 272, 273, 274, 275, 276,
+ 277, 278, 279, 280, 281, 282, 283, 284, 167, 261,
+ 123, 59, 289, 290, 291, 292, 59, 261, 61, 291,
+ 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
+ 271, 323, 469, 38, 38, 360, 40, 42, 42, 261,
+ 290, 261, 38, 368, 261, 289, 42, 62, 289, 290,
+ 291, 261, 262, 263, 264, 265, 266, 267, 268, 269,
+ 270, 271, 261, 262, 263, 264, 265, 266, 267, 268,
+ 269, 270, 271, 38, 291, 58, 59, 42, 61, 289,
+ 123, 291, 293, 294, 38, 290, 40, 91, 42, 41,
+ 289, 44, 291, 261, 262, 263, 264, 265, 266, 267,
+ 268, 269, 270, 271, 58, 59, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 43, 52, 40,
+ 38, 289, 290, 44, 42, 282, 283, 433, 59, 62,
+ 61, 125, 60, 61, 289, 61, 291, 58, 59, 125,
+ 123, 75, 38, 45, 469, 41, 42, 125, 261, 262,
+ 263, 264, 265, 266, 267, 268, 269, 270, 271, 61,
+ 62, 58, 468, 91, 38, 40, 164, 261, 42, 123,
+ 40, 261, 60, 61, 61, 62, 289, 290, 272, 273,
+ 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
+ 284, 261, 123, 230, 41, 91, 290, 291, 292, 289,
+ 282, 283, 272, 273, 274, 275, 276, 277, 278, 279,
+ 280, 281, 282, 283, 284, 265, 40, 91, 261, 33,
+ 290, 44, 292, 37, 38, 261, 40, 40, 42, 43,
+ 44, 45, 230, 47, 38, 81, 59, 244, 42, 40,
+ 44, 41, 88, 241, 76, 261, 60, 61, 62, 81,
+ 286, 287, 288, 296, 290, 59, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 44, 114, 306,
+ 260, 117, 261, 44, 324, 40, 108, 91, 261, 44,
+ 94, 126, 59, 58, 289, 322, 261, 91, 59, 339,
+ 340, 298, 58, 58, 59, 261, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 40, 44, 307,
+ 124, 44, 126, 296, 294, 295, 38, 261, 40, 326,
+ 42, 328, 125, 126, 289, 58, 59, 364, 41, 366,
+ 261, 282, 283, 313, 261, 41, 58, 374, 270, 271,
+ 261, 292, 269, 350, 262, 263, 264, 265, 266, 267,
+ 268, 269, 270, 271, 261, 261, 406, 261, 356, 286,
+ 287, 288, 123, 290, 41, 296, 416, 41, 289, 261,
+ 407, 125, 126, 410, 282, 283, 61, 40, 415, 40,
+ 61, 44, 93, 44, 41, 61, 61, 42, 261, 61,
+ 440, 441, 61, 61, 444, 58, 59, 58, 59, 272,
+ 273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
+ 283, 284, 419, 59, 123, 125, 126, 290, 261, 292,
+ 261, 261, 40, 261, 474, 432, 44, 59, 44, 272,
+ 273, 274, 275, 276, 277, 278, 279, 280, 125, 126,
+ 58, 59, 260, 125, 61, 59, 125, 126, 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, 61, 286, 287, 288, 289, 290, 61, 292,
+ 293, 294, 125, 126, 297, 298, 299, 300, 301, 302,
+ 303, 304, 59, 41, 291, 44, 41, 261, 262, 263,
+ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
+ 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
+ 284, 93, 286, 287, 288, 289, 290, 125, 292, 293,
+ 294, 125, 126, 297, 298, 299, 300, 301, 302, 303,
+ 304, 261, 262, 263, 264, 265, 266, 267, 268, 269,
+ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
+ 280, 281, 282, 283, 284, 58, 286, 287, 288, 289,
+ 290, 261, 292, 293, 294, 125, 126, 297, 298, 299,
+ 300, 301, 302, 303, 304, 282, 283, 261, 93, 286,
+ 287, 288, 261, 282, 283, 261, 125, 286, 287, 288,
+ 297, 298, 299, 300, 301, 302, 303, 304, 297, 298,
+ 299, 300, 301, 302, 303, 304, 261, 261, 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, 58, 292,
+ 293, 294, 125, 126, 297, 298, 299, 300, 301, 302,
+ 303, 304, 296, 93, 61, 40, 44, 261, 262, 263,
+ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
+ 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
+ 284, 93, 286, 287, 288, 289, 290, 40, 292, 293,
+ 294, 125, 126, 297, 298, 299, 300, 301, 302, 303,
+ 304, 261, 262, 263, 264, 265, 266, 267, 268, 269,
+ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279,
+ 280, 281, 282, 283, 284, 93, 286, 287, 288, 289,
+ 290, 41, 292, 293, 294, 125, 126, 297, 298, 299,
+ 300, 301, 302, 303, 304, 262, 263, 264, 265, 266,
+ 267, 268, 269, 270, 271, 41, 258, 40, 125, 126,
+ 125, 44, 59, 123, 125, 123, 125, 126, 305, 306,
+ 307, 308, 309, 310, 291, 58, 59, 125, 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, 125, 126, 297, 298, 299, 300, 301, 302,
+ 303, 304, 125, 59, 41, 41, 125, 261, 262, 263,
+ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
+ 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
+ 284, 0, 286, 287, 288, 289, 290, 126, 292, 293,
+ 294, 12, 233, 297, 298, 299, 300, 301, 302, 303,
+ 304, 116, 261, 364, 410, 264, 265, 266, 267, 268,
+ 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
+ 279, 280, 282, 283, 303, 19, 286, 287, 288, 40,
+ 19, 372, 164, 44, 365, 92, 73, 297, 298, 299,
+ 300, 301, 302, 303, 304, 282, 283, 58, 59, 286,
+ 287, 288, 471, 282, 283, 19, 459, 286, 287, 288,
+ 297, 298, 299, 300, 301, 302, 303, 304, 297, 298,
+ 299, 300, 301, 302, 303, 304, 261, 468, 40, 108,
+ 142, 189, 44, 187, 261, 178, 258, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 58, 59, 420, 282,
+ 283, 341, 268, 286, 287, 288, 421, 422, 423, 424,
+ 425, 426, -1, -1, 297, 298, 299, 300, 301, 302,
+ 303, 304, 261, 262, 263, 264, 265, 266, 267, 268,
+ 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
+ 279, 280, 281, 282, 283, 284, 343, -1, -1, -1,
+ -1, 290, -1, 292, 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, 293, 294, 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,
+ 261, -1, 284, 40, -1, 40, -1, 44, 290, 44,
+ 292, 272, 273, 274, 275, 276, 277, 278, 279, 280,
+ -1, 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, 40,
+ -1, 44, 40, 44, -1, -1, 44, -1, -1, -1,
+ -1, 286, 287, 288, -1, 58, 59, 58, 59, -1,
+ 58, 59, 297, 298, 299, 300, 301, 302, 303, 304,
+ 262, 263, 264, 265, 266, 267, 268, 269, 270, 271,
+ -1, 272, 273, 274, 275, 276, 277, 278, 279, 280,
+};
+#define YYFINAL 1
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 310
+#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","THROW","SIGNALS","SLOTS",
+"Q_OBJECT","Q_PROPERTY","Q_OVERRIDE","Q_CLASSINFO","Q_ENUMS","Q_SETS","READ",
+"WRITE","STORED","DESIGNABLE","SCRIPTABLE","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 :",
+"def_argument :",
+"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",
+"opt_exception_argument :",
+"opt_exception_argument : argument_declaration",
+"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 def_argument",
+"argument_declaration : decl_specifiers abstract_decl_opt dname abstract_decl_opt",
+"$$7 :",
+"argument_declaration : decl_specifiers abstract_decl_opt dname abstract_decl_opt '=' $$7 def_argument",
+"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 exception_spec_opt opt_identifier 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 : class_head '&' IDENTIFIER",
+"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",
+"exception_spec_opt :",
+"exception_spec_opt : exception_spec",
+"exception_spec : THROW '(' opt_exception_argument ')'",
+"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",
+"prop_statements : DESIGNABLE IDENTIFIER prop_statements",
+"prop_statements : SCRIPTABLE IDENTIFIER 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 1606 "moc.y"
+
+#ifndef YYBISON
+# if defined(Q_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 "moc_lex.cpp"
+#endif //YYBISON
+
+void cleanup();
+TQCString combinePath( const char *, const char * );
+
+FILE *out; // output file
+
+parser_reg::parser_reg() : funcs(TRUE)
+{
+ gen_count = 0;
+ noInclude = FALSE; // no #include <filename>
+ generatedCode = FALSE; // no code generated
+ mocError = FALSE; // moc parsing error occurred
+ hasVariantIncluded = FALSE;
+}
+
+
+parser_reg::~parser_reg()
+{
+ slots.clear();
+ signals.clear();
+ propfuncs.clear();
+ funcs.clear();
+ infos.clear();
+ props.clear();
+ infos.clear();
+}
+
+int yyparse();
+
+void replace( char *s, char c1, char c2 );
+
+void setDefaultIncludeFile()
+{
+ if ( g->includeFiles.isEmpty() ) {
+ if ( g->includePath.isEmpty() ) {
+ if ( !g->fileName.isEmpty() && !g->outputFile.isEmpty() ) {
+ g->includeFiles.append( combinePath(g->fileName, g->outputFile) );
+ } else {
+ g->includeFiles.append( g->fileName );
+ }
+ } else {
+ g->includeFiles.append( combinePath(g->fileName, g->fileName) );
+ }
+ }
+}
+
+#ifdef Q_CC_MSVC
+#define ErrorFormatString "%s(%d):"
+#else
+#define ErrorFormatString "%s:%d:"
+#endif
+
+#ifndef MOC_MWERKS_PLUGIN
+int main( int argc, char **argv )
+{
+ init();
+
+ bool autoInclude = TRUE;
+ const char *error = 0;
+ g->qtPath = "";
+ for ( int n=1; n<argc && error==0; n++ ) {
+ TQCString arg = argv[n];
+ if ( arg[0] == '-' ) { // option
+ TQCString opt = &arg[1];
+ if ( opt[0] == 'o' ) { // output redirection
+ if ( opt[1] == '\0' ) {
+ if ( !(n < argc-1) ) {
+ error = "Missing output file name";
+ break;
+ }
+ g->outputFile = argv[++n];
+ } else
+ g->outputFile = &opt[1];
+ } else if ( opt == "i" ) { // no #include statement
+ g->noInclude = TRUE;
+ autoInclude = FALSE;
+ } else if ( opt[0] == 'f' ) { // produce #include statement
+ g->noInclude = FALSE;
+ autoInclude = FALSE;
+ if ( opt[1] ) // -fsomething.h
+ g->includeFiles.append( &opt[1] );
+ } else if ( opt == "pch" ) { // produce #include statement for PCH
+ if ( !(n < argc-1) ) {
+ error = "Missing name of PCH file";
+ break;
+ }
+ g->pchFile = argv[++n];
+ } 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;
+ }
+ g->includePath = argv[++n];
+ } else {
+ g->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;
+ }
+ g->qtPath = argv[++n];
+ } else {
+ g->qtPath = &opt[1];
+ }
+ replace(g->qtPath.data(),'\\','/');
+ if ( g->qtPath.right(1) != "/" )
+ g->qtPath += '/';
+ } else if ( opt == "v" ) { // version number
+ fprintf( stderr, "TQt Meta Object Compiler version %d"
+ " (TQt %s)\n", formatRevision,
+ QT_VERSION_STR );
+ cleanup();
+ return 1;
+ } else if ( opt == "k" ) { // 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 ( !g->fileName.isNull() ) // can handle only one file
+ error = "Too many input files specified";
+ else
+ g->fileName = arg.copy();
+ }
+ }
+
+ if ( autoInclude ) {
+ int ppos = g->fileName.findRev('.');
+ if ( ppos != -1 && tolower( g->fileName[ppos + 1] ) == 'h' )
+ g->noInclude = FALSE;
+ else
+ g->noInclude = TRUE;
+ }
+ setDefaultIncludeFile();
+
+ if ( g->fileName.isNull() && !error ) {
+ g->fileName = "standard input";
+ yyin = stdin;
+ } else if ( argc < 2 || error ) { // incomplete/wrong args
+ fprintf( stderr, "TQt 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-f[file] Force #include, optional file name\n"
+ "\t-p path Path prefix for included file\n"
+ "\t-i Do not generate an #include statement\n"
+ "\t-k Do not stop on errors\n"
+ "\t-nw Do not display warnings\n"
+ "\t-v Display version of moc\n" );
+ cleanup();
+ return 1;
+ } else {
+ yyin = fopen( (const char *)g->fileName, "r" );
+ if ( !yyin ) {
+ fprintf( stderr, "moc: %s: No such file\n", (const char*)g->fileName);
+ cleanup();
+ return 1;
+ }
+ }
+ if ( !g->outputFile.isEmpty() ) { // output file specified
+ out = fopen( (const char *)g->outputFile, "w" ); // create output file
+ if ( !out ) {
+ fprintf( stderr, "moc: Cannot create %s\n",
+ (const char*)g->outputFile );
+ cleanup();
+ return 1;
+ }
+ } else { // use stdout
+ out = stdout;
+ }
+ yyparse();
+ fclose( yyin );
+ if ( !g->outputFile.isNull() )
+ fclose( out );
+
+ if ( !g->generatedCode && displayWarnings && !g->mocError ) {
+ fprintf( stderr, ErrorFormatString" Warning: %s\n", g->fileName.data(), 0,
+ "No relevant classes found. No output generated." );
+ }
+
+ int ret = g->mocError ? 1 : 0;
+ cleanup();
+ return ret;
+}
+#else
+bool qt_is_gui_used = FALSE;
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#ifdef Q_OS_MAC9
+# include <Files.h>
+# include <Strings.h>
+# include <Errors.h>
+# include "Aliases.h"
+#endif
+#include "CWPluginErrors.h"
+#include <CWPlugins.h>
+#include "DropInCompilerLinker.h"
+#include <stat.h>
+
+const unsigned char *p_str(const char *, int =-1);
+
+CWPluginContext g_ctx;
+
+moc_status do_moc( CWPluginContext ctx, const TQCString &fin, const TQCString &fout, CWFileSpec *dspec, bool i)
+{
+ init();
+
+ g_ctx = ctx;
+ g->noInclude = i;
+ g->fileName = fin;
+ g->outputFile = fout;
+
+ setDefaultIncludeFile();
+
+ CWFileInfo fi;
+ memset(&fi, 0, sizeof(fi));
+ fi.fullsearch = TRUE;
+ fi.dependencyType = cwNormalDependency;
+ fi.isdependentoffile = kCurrentCompiledFile;
+ if(CWFindAndLoadFile( ctx, fin.data(), &fi) != cwNoErr) {
+ cleanup();
+ return moc_no_source;
+ }
+
+ if(dspec) {
+ memcpy(dspec, &fi.filespec, sizeof(fi.filespec));
+ const unsigned char *f = p_str(fout.data());
+ memcpy(dspec->name, f, f[0]+1);
+ free(f);
+ }
+ buf_size_total = fi.filedatalength;
+ buf_buffer = fi.filedata;
+
+ TQCString path("");
+ AliasHandle alias;
+ Str63 str;
+ AliasInfoType x = 1;
+ char tmp[sizeof(Str63)+2];
+ if(NewAlias( NULL, &fi.filespec, &alias) != noErr) {
+ cleanup();
+ return moc_general_error;
+ }
+ for(;;) {
+ GetAliasInfo(alias, x++, str);
+ if(!str[0])
+ break;
+ strncpy((char *)tmp, (const char *)str+1, str[0]);
+ tmp[str[0]] = '\0';
+ path.prepend(":");
+ path.prepend((char *)tmp);
+ }
+ path.prepend("MacOS 9:"); //FIXME
+
+ TQString inpath = path + fin, outpath = path + fout;
+ struct stat istat, ostat;
+ if(stat(inpath, &istat) == -1) {
+ cleanup();
+ return moc_no_source;
+ }
+ if(stat(outpath, &ostat) == 0 && istat.st_mtime < ostat.st_mtime) {
+ cleanup();
+ return moc_not_time;
+ }
+
+ unlink(outpath.data());
+ out = fopen(outpath.data(), "w+");
+ if(!out) {
+ cleanup();
+ return moc_general_error;
+ }
+
+ yyparse();
+ if(out != stdout)
+ fclose(out);
+
+ if(g->mocError || !g->generatedCode) {
+ unlink(outpath.data());
+ moc_status ret = !g->generatedCode ? moc_no_qobject : moc_parse_error;
+ cleanup();
+ return ret;
+ }
+
+ cleanup();
+ return moc_success;
+}
+#endif
+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
+ */
+
+TQCString combinePath( const char *infile, const char *outfile )
+{
+ TQFileInfo inFileInfo( TQDir::current(), TQFile::decodeName(infile) );
+ TQFileInfo outFileInfo( TQDir::current(), TQFile::decodeName(outfile) );
+ int numCommonComponents = 0;
+
+ TQStringList inSplitted =
+ TQStringList::split( '/', inFileInfo.dir().canonicalPath(), TRUE );
+ TQStringList outSplitted =
+ TQStringList::split( '/', outFileInfo.dir().canonicalPath(), TRUE );
+
+ while ( !inSplitted.isEmpty() && !outSplitted.isEmpty() &&
+ inSplitted.first() == outSplitted.first() ) {
+ inSplitted.remove( inSplitted.begin() );
+ outSplitted.remove( outSplitted.begin() );
+ numCommonComponents++;
+ }
+
+ if ( numCommonComponents < 2 ) {
+ /*
+ The paths don't have the same drive, or they don't have the
+ same root directory. Use an absolute path.
+ */
+ return TQFile::encodeName( inFileInfo.absFilePath() );
+ } else {
+ /*
+ The paths have something in common. Use a path relative to
+ the output file.
+ */
+ while ( !outSplitted.isEmpty() ) {
+ outSplitted.remove( outSplitted.begin() );
+ inSplitted.prepend( ".." );
+ }
+ inSplitted.append( inFileInfo.fileName() );
+ return TQFile::encodeName( inSplitted.join("/") );
+ }
+}
+
+
+#define getenv hack_getenv // workaround for byacc
+char *getenv() { return 0; }
+char *getenv( const char * ) { return 0; }
+
+void init() // initialize
+{
+ BEGIN OUTSIDE;
+ if(g)
+ delete g;
+ g = new parser_reg;
+ lineNo = 1;
+ skipClass = FALSE;
+ skipFunc = FALSE;
+ tmpArgList = new ArgList;
+ tmpFunc = new Function;
+ tmpEnum = new Enum;
+
+#ifdef MOC_MWERKS_PLUGIN
+ buf_buffer = NULL;
+ buf_index = 0;
+ buf_size_total = 0;
+#endif
+}
+
+void cleanup()
+{
+ delete g;
+ g = NULL;
+
+#ifdef MOC_MWERKS_PLUGIN
+ if(buf_buffer && g_ctx)
+ CWReleaseFileText(g_ctx, buf_buffer);
+#endif
+}
+
+void initClass() // prepare for new class
+{
+ tmpAccess = Private;
+ subClassPerm = Private;
+ Q_OBJECTdetected = FALSE;
+ Q_PROPERTYdetected = FALSE;
+ skipClass = FALSE;
+ templateClass = FALSE;
+ g->slots.clear();
+ g->signals.clear();
+ g->propfuncs.clear();
+ g->enums.clear();
+ g->funcs.clear();
+ g->props.clear();
+ g->infos.clear();
+ g->qtSets.clear();
+ g->qtEnums.clear();
+ g->multipleSuperClasses.clear();
+}
+
+struct NamespaceInfo
+{
+ TQCString name;
+ int pLevelOnEntering; // Parenthesis level on entering the namespace
+ TQDict<char> definedClasses; // Classes defined in the namespace
+};
+
+TQPtrList<NamespaceInfo> namespaces;
+
+void enterNameSpace( const char *name ) // 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();
+}
+
+TQCString nameQualifier()
+{
+ TQPtrListIterator<NamespaceInfo> iter( namespaces );
+ NamespaceInfo *tmp;
+ TQCString 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;
+ TQPtrListIterator<NamespaceInfo> iter( namespaces );
+ NamespaceInfo *tmp;
+ TQCString 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++;
+ }
+ }
+ TQCString nm = g->className;
+ int pos;
+ while( (pos = nm.find( "::" )) != -1 ) {
+ TQCString 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 *)g->className,(char*)1);
+}
+
+//
+// Remove white space from SIGNAL and SLOT names.
+// This function has been copied from qobject.cpp.
+//
+
+inline bool isSpace( char x )
+{
+#if defined(Q_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( (uchar) x );
+#endif
+}
+
+static TQCString rmWS( const char *src )
+{
+ TQCString 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()
+{
+ g->tmpExpression = "";
+}
+
+void addExpressionString( const char *s )
+{
+ g->tmpExpression += s;
+}
+
+void addExpressionChar( const char c )
+{
+ g->tmpExpression += c;
+}
+
+void yyerror( const char *msg ) // print yacc error message
+{
+ g->mocError = TRUE;
+#ifndef MOC_MWERKS_PLUGIN
+ fprintf( stderr, ErrorFormatString" Error: %s\n", g->fileName.data(), lineNo, msg );
+#else
+ char msg2[200];
+ sprintf(msg2, ErrorFormatString" Error: %s", g->fileName.data(), lineNo, msg);
+ CWReportMessage(g_ctx, NULL, msg2, NULL, messagetypeError, 0);
+#endif
+ if ( errorControl ) {
+ if ( !g->outputFile.isEmpty() && yyin && fclose(yyin) == 0 )
+ remove( g->outputFile );
+ exit( -1 );
+ }
+}
+
+void moc_err( const char *s )
+{
+ yyerror( s );
+}
+
+void moc_err( const char *s1, const char *s2 )
+{
+ static char tmp[1024];
+ sprintf( tmp, s1, s2 );
+ yyerror( tmp );
+}
+
+void moc_warn( const char *msg )
+{
+ if ( displayWarnings )
+ fprintf( stderr, ErrorFormatString" Warning: %s\n", g->fileName.data(), lineNo, msg);
+}
+
+void moc_warn( char *s1, char *s2 )
+{
+ static char tmp[1024];
+ sprintf( tmp, s1, s2 );
+ if ( displayWarnings )
+ fprintf( stderr, ErrorFormatString" Warning: %s\n", g->fileName.data(), lineNo, tmp);
+}
+
+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
+
+
+/*
+ We call B::qt_invoke() rather than A::B::qt_invoke() to
+ work around a bug in MSVC 6. The bug occurs if the
+ super-class is in a namespace and the sub-class isn't.
+
+ Exception: If the superclass has the same name as the subclass, we
+ want non-MSVC users to have a working generated files.
+*/
+TQCString purestSuperClassName()
+{
+ TQCString sc = g->superClassName;
+ TQCString c = g->className;
+ /*
+ Make sure qualified template arguments (e.g., foo<bar::baz>)
+ don't interfere.
+ */
+ int pos = sc.findRev( "::", sc.find( '<' ) );
+ if ( pos != -1 ) {
+ sc = sc.right( sc.length() - pos - 2 );
+ pos = c.findRev( "::" );
+ if ( pos != -1 )
+ c = c.right( c.length() - pos - 2 );
+ if ( sc == c )
+ sc = g->superClassName;
+ }
+ return sc;
+}
+
+TQCString qualifiedClassName()
+{
+ return nameQualifier() + g->className;
+}
+
+const int Slot_Num = 1;
+const int Signal_Num = 2;
+const int Prop_Num = 3;
+
+void generateFuncs( FuncList *list, const char *functype, int num )
+{
+ Function *f;
+ for ( f=list->first(); f; f=list->next() ) {
+ bool hasReturnValue = f->type != "void" && (validUType( f->type ) || isVariantType( f->type) );
+
+ if ( hasReturnValue || !f->args->isEmpty() ) {
+ fprintf( out, " static const TQUParameter param_%s_%d[] = {\n", functype, list->at() );
+ if ( hasReturnValue ) {
+ if ( validUType( f->type ) )
+ fprintf( out, "\t{ 0, &static_QUType_%s, %s, TQUParameter::Out }", uType(f->type).data(), uTypeExtra(f->type).data() );
+ else
+ fprintf( out, "\t{ 0, &static_QUType_TQVariant, %s, TQUParameter::Out }", uTypeExtra(f->type).data() );
+ if ( !f->args->isEmpty() )
+ fprintf( out, ",\n" );
+ }
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ if( a->name.isEmpty() )
+ fprintf( out, "\t{ 0, &static_QUType_%s, %s, TQUParameter::%s }",
+ uType( type ).data(), uTypeExtra( type ).data(),
+ isInOut( type ) ? "InOut" : "In" );
+ else
+ fprintf( out, "\t{ \"%s\", &static_QUType_%s, %s, TQUParameter::%s }",
+ a->name.data(), uType( type ).data(), uTypeExtra( type ).data(),
+ isInOut( type ) ? "InOut" : "In" );
+ a = f->args->next();
+ if ( a )
+ fprintf( out, ",\n" );
+ }
+ fprintf( out, "\n };\n");
+ }
+
+ fprintf( out, " static const TQUMethod %s_%d = {", functype, list->at() );
+ int n = f->args->count();
+ if ( hasReturnValue )
+ n++;
+ fprintf( out, "\"%s\", %d,", f->name.data(), n );
+ if ( n )
+ fprintf( out, " param_%s_%d };\n", functype, list->at() );
+ else
+ fprintf( out, " 0 };\n" );
+
+ TQCString 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();
+ }
+ f->signature = f->name;
+ f->signature += "(";
+ f->signature += typstr;
+ f->signature += ")";
+ }
+ if ( list->count() ) {
+ fprintf(out," static const TQMetaData %s_tbl[] = {\n", functype );
+ f = list->first();
+ while ( f ) {
+ fprintf( out, "\t{ \"%s\",", f->signature.data() );
+ fprintf( out, " &%s_%d,", functype, list->at() );
+ fprintf( out, " TQMetaData::%s }", f->accessAsString() );
+ f = list->next();
+ if ( f )
+ fprintf( out, ",\n");
+ }
+ fprintf( out, "\n };\n" );
+ }
+}
+
+
+int enumIndex( const char* type )
+{
+ int index = 0;
+ for( TQPtrListIterator<Enum> lit( g->enums ); lit.current(); ++lit ) {
+ if ( lit.current()->name == type )
+ return index;
+ index++;
+ }
+ return -1;
+}
+
+bool isEnumType( const char* type )
+{
+ return enumIndex( type ) >= 0 || ( g->qtEnums.contains( type ) || g->qtSets.contains( type ) );
+}
+
+bool isPropertyType( const char* type )
+{
+ if ( isVariantType( type ) )
+ return TRUE;
+
+ return isEnumType( type );
+}
+
+int generateEnums()
+{
+ if ( g->enums.count() == 0 )
+ return 0;
+
+ fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
+ int i = 0;
+ for ( TQPtrListIterator<Enum> it( g->enums ); it.current(); ++it, ++i ) {
+ fprintf( out, " static const TQMetaEnum::Item enum_%i[] = {\n", i );
+ int k = 0;
+ for( TQStrListIterator eit( *it.current() ); eit.current(); ++eit, ++k ) {
+ if ( k )
+ fprintf( out, ",\n" );
+ fprintf( out, "\t{ \"%s\", (int) %s::%s }", eit.current(), (const char*) g->className, eit.current() );
+ }
+ fprintf( out, "\n };\n" );
+ }
+ fprintf( out, " static const TQMetaEnum enum_tbl[] = {\n" );
+ i = 0;
+ for ( TQPtrListIterator<Enum> it2( g->enums ); it2.current(); ++it2, ++i ) {
+ if ( i )
+ fprintf( out, ",\n" );
+ fprintf( out, "\t{ \"%s\", %u, enum_%i, %s }",
+ (const char*)it2.current()->name,
+ it2.current()->count(),
+ i,
+ it2.current()->set ? "TRUE" : "FALSE" );
+ }
+ fprintf( out, "\n };\n" );
+ fprintf( out, "#endif // QT_NO_PROPERTIES\n" );
+
+ return g->enums.count();
+}
+
+int generateProps()
+{
+ //
+ // Resolve and verify property access functions
+ //
+ for( TQPtrListIterator<Property> it( g->props ); it.current(); ) {
+ Property* p = it.current();
+ ++it;
+
+ // verify get function
+ if ( !p->get.isEmpty() ) {
+ FuncList candidates = g->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;
+ TQCString tmp = f->type;
+ Property::Specification spec = Property::Unspecified;
+ if ( p->type == "TQCString" && (tmp == "const char*" || tmp == "const char *" ) ) {
+ tmp = "TQCString";
+ 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( TQPtrListIterator<Enum> lit( g->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 ( !isVariantType( p->type ) ) {
+ if ( tmp == "int" || tmp == "uint" || tmp == "unsigned int" ) {
+ // Test whether the enum is really a set (unfortunately we don't know enums of super classes)
+ bool ok = TRUE;
+ for( TQPtrListIterator<Enum> lit( g->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;
+ p->enumgettype = tmp;
+ }
+ }
+ }
+ if ( p->getfunc == 0 ) {
+ if ( displayWarnings ) {
+
+ // Is the type a set, that means, mentioned in Q_SETS?
+ bool set = FALSE;
+ for( TQPtrListIterator<Enum> lit( g->enums ); lit.current(); ++lit )
+ if ( lit.current()->name == p->type && lit.current()->set )
+ set = TRUE;
+
+ fprintf( stderr, ErrorFormatString" Warning: Property '%s' not available.\n",
+ g->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 == "TQCString" )
+ 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 mismatching candidate(s)\n");
+ for ( Function* f = candidates.first(); f; f = candidates.next() ) {
+ TQCString 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", g->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 = g->propfuncs.find( p->set );
+ for ( Function* f = candidates.first(); f; f = candidates.next() ) {
+ if ( !f->args || f->args->isEmpty() )
+ continue;
+ TQCString 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 == "TQCString" && (tmp == "const char*" || tmp == "const char *" ) ) {
+ tmp = "TQCString";
+ 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( TQPtrListIterator<Enum> lit( g->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 ( !isVariantType( 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( TQPtrListIterator<Enum> lit( g->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;
+ p->enumsettype = tmp;
+ }
+ }
+ }
+ if ( p->setfunc == 0 ) {
+ if ( displayWarnings ) {
+
+ // Is the type a set, that means, mentioned in Q_SETS ?
+ bool set = FALSE;
+ for( TQPtrListIterator<Enum> lit( g->enums ); lit.current(); ++lit )
+ if ( lit.current()->name == p->type && lit.current()->set )
+ set = TRUE;
+
+ fprintf( stderr, ErrorFormatString" Warning: Property '%s' not writable.\n",
+ g->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 == "TQCString" )
+ fprintf( stderr, " void %s( const char* ) const\n",
+ (const char*) p->set );
+
+ if ( !candidates.isEmpty() ) {
+ fprintf( stderr, " but only found the mismatching candidate(s)\n");
+ for ( Function* f = candidates.first(); f; f = candidates.next() ) {
+ TQCString 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", g->fileName.data(), f->lineNo,
+ (const char*) f->type,(const char*) f->name, (const char*) typstr );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //
+ // Create meta data
+ //
+ if ( g->props.count() ) {
+ if ( displayWarnings && !Q_OBJECTdetected )
+ moc_err("The declaration of the class \"%s\" contains properties"
+ " but no Q_OBJECT macro.", g->className.data());
+
+ fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
+
+ fprintf( out, " static const TQMetaProperty props_tbl[%d] = {\n ", g->props.count() );
+ for( TQPtrListIterator<Property> it( g->props ); it.current(); ++it ) {
+
+ fprintf( out, "\t{ \"%s\",\"%s\", ", it.current()->type.data(), it.current()->name.data() );
+ int flags = Invalid;
+ if ( !isVariantType( it.current()->type ) ) {
+ flags |= EnumOrSet;
+ if ( !isEnumType( it.current()->type ) )
+ flags |= UnresolvedEnum;
+ } else {
+ flags |= qvariant_nameToType( it.current()->type ) << 24;
+ }
+ if ( it.current()->getfunc )
+ flags |= Readable;
+ if ( it.current()->setfunc ) {
+ flags |= Writable;
+ if ( it.current()->stdSet() )
+ flags |= StdSet;
+ }
+ if ( it.current()->override )
+ flags |= Override;
+
+ if ( it.current()->designable.isEmpty() )
+ flags |= DesignableOverride;
+ else if ( it.current()->designable == "false" )
+ flags |= NotDesignable;
+
+ if ( it.current()->scriptable.isEmpty() )
+ flags |= ScriptableOverride;
+ else if ( it.current()->scriptable == "false" )
+ flags |= NotScriptable;
+
+ if ( it.current()->stored.isEmpty() )
+ flags |= StoredOverride;
+ else if ( it.current()->stored == "false" )
+ flags |= NotStored;
+
+
+ fprintf( out, "0x%.4x, ", flags );
+ fprintf( out, "&%s::metaObj, ", (const char*) qualifiedClassName() );
+ if ( !isVariantType( it.current()->type ) ) {
+ int enumpos = -1;
+ int k = 0;
+ for( TQPtrListIterator<Enum> eit( g->enums ); eit.current(); ++eit, ++k ) {
+ if ( eit.current()->name == it.current()->type )
+ enumpos = k;
+ }
+
+ // Is it an enum of this class ?
+ if ( enumpos != -1 )
+ fprintf( out, "&enum_tbl[%i], ", enumpos );
+ else
+ fprintf( out, "0, ");
+ } else {
+ fprintf( out, "0, ");
+ }
+ fprintf( out, "-1 }" );
+ if ( !it.atLast() )
+ fprintf( out, ",\n" );
+ else
+ fprintf( out, "\n" );
+ }
+ fprintf( out, " };\n" );
+ fprintf( out, "#endif // QT_NO_PROPERTIES\n" );
+ }
+
+ return g->props.count();
+}
+
+
+
+int generateClassInfos()
+{
+ if ( g->infos.isEmpty() )
+ return 0;
+
+ if ( displayWarnings && !Q_OBJECTdetected )
+ moc_err("The declaration of the class \"%s\" contains class infos"
+ " but no Q_OBJECT macro.", g->className.data());
+
+ fprintf( out, " static const TQClassInfo classinfo_tbl[] = {\n" );
+ int i = 0;
+ for( TQPtrListIterator<ClassInfo> it( g->infos ); it.current(); ++it, ++i ) {
+ if ( i )
+ fprintf( out, ",\n" );
+ fprintf( out, "\t{ \"%s\", \"%s\" }", it.current()->name.data(),it.current()->value.data() );
+ }
+ fprintf( out, "\n };\n" );
+ return i;
+}
+
+
+void generateClass() // generate C++ source code for a class
+{
+ const char *hdr1 = "/****************************************************************************\n"
+ "** %s meta object code from reading C++ file '%s'\n**\n";
+ const char *hdr2 = "** Created: %s\n"
+ "** by: The TQt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)\n**\n";
+ const char *hdr3 = "** WARNING! All changes made in this file will be lost!\n";
+ const char *hdr4 = "*****************************************************************************/\n\n";
+ int i;
+
+ if ( skipClass ) // don't generate for class
+ return;
+
+ if ( !Q_OBJECTdetected ) {
+ if ( g->signals.count() == 0 && g->slots.count() == 0 && g->props.count() == 0 && g->infos.count() == 0 )
+ return;
+ if ( displayWarnings && (g->signals.count() + g->slots.count()) != 0 )
+ moc_err("The declaration of the class \"%s\" contains signals "
+ "or slots\n\t but no Q_OBJECT macro.", g->className.data());
+ } else {
+ if ( g->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 TQObject or one of its descendants"
+ " or remove Q_OBJECT.", g->className.data() );
+ }
+ if ( templateClass ) { // don't generate for class
+ moc_err( "Sorry, TQt does not support templates that contain\n"
+ "\tsignals, slots or Q_OBJECT." );
+ return;
+ }
+ g->generatedCode = TRUE;
+ g->gen_count++;
+
+ if ( g->gen_count == 1 ) { // first class to be generated
+ TQDateTime dt = TQDateTime::currentDateTime();
+ TQCString dstr = dt.toString().ascii();
+ TQCString fn = g->fileName;
+ i = g->fileName.length()-1;
+ while ( i>0 && g->fileName[i-1] != '/' && g->fileName[i-1] != '\\' )
+ i--; // skip path
+ if ( i >= 0 )
+ fn = &g->fileName[i];
+ fprintf( out, hdr1, (const char*)qualifiedClassName(),(const char*)fn);
+ fprintf( out, hdr2, (const char*)dstr );
+ fprintf( out, hdr3 );
+ fprintf( out, hdr4 );
+
+ if ( !g->noInclude ) {
+ /*
+ The header file might be a TQt header file with
+ QT_NO_COMPAT macros around signals, slots or
+ properties. Without the #undef, we cannot compile the
+ TQt library with QT_NO_COMPAT defined.
+
+ Header files of libraries build around TQt can also use
+ QT_NO_COMPAT, so this #undef might be beneficial to
+ users of TQt, and not only to developers of TQt.
+ */
+ fprintf( out, "#undef QT_NO_COMPAT\n" );
+
+ if ( !g->pchFile.isEmpty() )
+ fprintf( out, "#include \"%s\" // PCH include\n", (const char*)g->pchFile );
+ if ( !g->includePath.isEmpty() && g->includePath.right(1) != "/" )
+ g->includePath += "/";
+
+ g->includeFiles.first();
+ while ( g->includeFiles.current() ) {
+ TQCString inc = g->includeFiles.current();
+ if ( inc[0] != '<' && inc[0] != '"' ) {
+ if ( !g->includePath.isEmpty() && g->includePath != "./" )
+ inc.prepend( g->includePath );
+ inc = "\"" + inc + "\"";
+ }
+ fprintf( out, "#include %s\n", (const char *)inc );
+ g->includeFiles.next();
+ }
+ }
+ fprintf( out, "#include <%sqmetaobject.h>\n", (const char*)g->qtPath );
+ fprintf( out, "#include <%sqapplication.h>\n\n", (const char*)g->qtPath );
+ fprintf( out, "#include <%sprivate/qucomextra_p.h>\n", (const char*)g->qtPath );
+ fprintf( out, "#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != %d)\n", formatRevision );
+ fprintf( out, "#error \"This file was generated using the moc from %s."
+ " It\"\n#error \"cannot be used with the include files from"
+ " this version of TQt.\"\n#error \"(The moc has changed too"
+ " much.)\"\n", QT_VERSION_STR );
+ fprintf( out, "#endif\n\n" );
+ } else {
+ fprintf( out, "\n\n" );
+ }
+
+ if ( !g->hasVariantIncluded ) {
+ bool needToIncludeVariant = !g->props.isEmpty();
+ for ( Function* f =g->slots.first(); f && !needToIncludeVariant; f=g->slots.next() )
+ needToIncludeVariant = ( f->type != "void" && !validUType( f->type ) && isVariantType( f->type) );
+
+ if ( needToIncludeVariant ) {
+ fprintf( out, "#include <%sqvariant.h>\n", (const char*)g->qtPath );
+ g->hasVariantIncluded = TRUE;
+ }
+ }
+
+ bool isTQObject = g->className == "TQObject" ;
+
+
+//
+// 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, "TQMetaObject *%s::metaObj = 0;\n", (const char*)qualifiedClassName());
+
+//
+// Generate static cleanup object variable
+//
+ TQCString cleanup = qualifiedClassName().copy();
+ for ( int cnpos = 0; cnpos < cleanup.length(); cnpos++ ) {
+ if ( cleanup[cnpos] == ':' )
+ cleanup[cnpos] = '_';
+ }
+
+ fprintf( out, "static TQMetaObjectCleanUp cleanUp_%s( \"%s\", &%s::staticMetaObject );\n\n", (const char*)cleanup, (const char*)qualifiedClassName(), (const char*)qualifiedClassName() );
+
+//
+// Generate tr and trUtf8 member functions
+//
+ fprintf( out, "#ifndef QT_NO_TRANSLATION\n" );
+ fprintf( out, "TQString %s::tr( const char *s, const char *c )\n{\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " if ( qApp )\n" );
+ fprintf( out, "\treturn qApp->translate( \"%s\", s, c,"
+ " TQApplication::DefaultCodec );\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " else\n" );
+ fprintf( out, "\treturn TQString::fromLatin1( s );\n");
+ fprintf( out, "}\n" );
+ fprintf( out, "#ifndef QT_NO_TRANSLATION_UTF8\n" );
+ fprintf( out, "TQString %s::trUtf8( const char *s, const char *c )\n{\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " if ( qApp )\n" );
+ fprintf( out, "\treturn qApp->translate( \"%s\", s, c,"
+ " TQApplication::UnicodeUTF8 );\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " else\n" );
+ fprintf( out, "\treturn TQString::fromUtf8( s );\n" );
+ fprintf( out, "}\n" );
+ fprintf( out, "#endif // QT_NO_TRANSLATION_UTF8\n\n" );
+ fprintf( out, "#endif // QT_NO_TRANSLATION\n\n" );
+
+//
+// Generate staticMetaObject member function
+//
+ fprintf( out, "TQMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() );
+ fprintf( out, " if ( metaObj )\n\treturn metaObj;\n" );
+ if ( isTQObject )
+ fprintf( out, " TQMetaObject* parentObject = staticTQtMetaObject();\n" );
+ else if ( !g->superClassName.isEmpty() )
+ fprintf( out, " TQMetaObject* parentObject = %s::staticMetaObject();\n", (const char*)g->superClassName );
+ else
+ fprintf( out, " TQMetaObject* parentObject = 0;\n" );
+
+//
+// Build the classinfo array
+//
+ int n_infos = generateClassInfos();
+
+// Build the enums array
+// Enums HAVE to be generated BEFORE the properties and slots
+//
+ int n_enums = generateEnums();
+
+//
+// Build slots array in staticMetaObject()
+//
+ generateFuncs( &g->slots, "slot", Slot_Num );
+
+//
+// Build signals array in staticMetaObject()
+//
+ generateFuncs( &g->signals, "signal", Signal_Num );
+
+//
+// Build property array in staticMetaObject()
+//
+ int n_props = generateProps();
+
+//
+// Finally code to create and return meta object
+//
+ fprintf( out, " metaObj = TQMetaObject::new_metaobject(\n"
+ "\t\"%s\", parentObject,\n", (const char*)qualifiedClassName() );
+
+ if ( g->slots.count() )
+ fprintf( out, "\tslot_tbl, %d,\n", g->slots.count() );
+ else
+ fprintf( out, "\t0, 0,\n" );
+
+ if ( g->signals.count() )
+ fprintf( out, "\tsignal_tbl, %d,\n", g->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" );
+
+
+//
+// Setup cleanup handler and return meta object
+//
+ fprintf( out, " cleanUp_%s.setMetaObject( metaObj );\n", cleanup.data() );
+ fprintf( out, " return metaObj;\n}\n" );
+
+//
+// End of function staticMetaObject()
+//
+
+//
+// Generate smart cast function
+//
+ fprintf( out, "\nvoid* %s::qt_cast( const char* clname )\n{\n",
+ (const char*)qualifiedClassName() );
+ fprintf( out, " if ( !qstrcmp( clname, \"%s\" ) )\n"
+ "\treturn this;\n",
+ (const char*)qualifiedClassName() );
+ for ( const char* cname = g->multipleSuperClasses.first(); cname; cname = g->multipleSuperClasses.next() ) {
+ fprintf( out, " if ( !qstrcmp( clname, \"%s\" ) )\n", cname);
+ TQCString fixed(cname);
+ while (fixed.find(">>") != -1)
+ fixed = fixed.replace(">>", "> >");
+ fprintf( out, "\treturn (%s*)this;\n", fixed.data());
+ }
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, " return %s::qt_cast( clname );\n",
+ (const char*)purestSuperClassName() );
+ else
+ fprintf( out, " return 0;\n" );
+ fprintf( out, "}\n" );
+
+//
+// Generate internal signal functions
+//
+ Function *f;
+ f = g->signals.first(); // make internal signal methods
+ static bool included_list_headers = FALSE;
+ int sigindex = 0;
+ while ( f ) {
+ TQCString argstr;
+ char buf[12];
+ Argument *a = f->args->first();
+ int offset = 0;
+ const char *predef_call_func = 0;
+ bool hasReturnValue = f->type != "void" && (validUType( f->type ) || isVariantType( f->type) );
+ if ( hasReturnValue ) {
+ ; // no predefined function available
+ } else if ( !a ) {
+ predef_call_func = "activate_signal";
+ } else if ( f->args->count() == 1 ) {
+ TQCString ctype = (a->leftType + ' ' + a->rightType).simplifyWhiteSpace();
+ if ( !isInOut( ctype ) ) {
+ TQCString utype = uType( ctype );
+ if ( utype == "bool" )
+ predef_call_func = "activate_signal_bool";
+ else if ( utype == "TQString" || utype == "int" || utype == "double" )
+ predef_call_func = "activate_signal";
+ }
+ }
+
+ if ( !predef_call_func && !included_list_headers ) {
+ // yes we need it, because otherwise QT_VERSION may not be defined
+ fprintf( out, "\n#include <%sqobjectdefs.h>\n", (const char*)g->qtPath );
+ fprintf( out, "#include <%sqsignalslotimp.h>\n", (const char*)g->qtPath );
+ included_list_headers = TRUE;
+ }
+
+ while ( a ) { // argument list
+ if ( !a->leftType.isEmpty() || !a->rightType.isEmpty() ) {
+ argstr += a->leftType;
+ argstr += " ";
+ sprintf( buf, "t%d", offset++ );
+ argstr += buf;
+ argstr += a->rightType;
+ a = f->args->next();
+ if ( a )
+ argstr += ", ";
+ } else {
+ a = f->args->next();
+ }
+ }
+
+ fixRightAngles( &argstr );
+
+ fprintf( out, "\n// SIGNAL %s\n", (const char*)f->name );
+ fprintf( out, "%s %s::%s(", (const char*) f->type,
+ (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( staticMetaObject()->signalOffset() + %d", predef_call_func, sigindex );
+ if ( !argstr.isEmpty() )
+ fprintf( out, ", t0" );
+ fprintf( out, " );\n}\n" );
+ } else {
+ if ( hasReturnValue )
+ fprintf( out, " %s something;\n", f->type.data() );
+ int nargs = f->args->count();
+ fprintf( out, " if ( signalsBlocked() )\n\treturn%s;\n", hasReturnValue ? " something" : "" );
+ fprintf( out, " TQConnectionList *clist = receivers( staticMetaObject()->signalOffset() + %d );\n",
+ sigindex );
+ fprintf( out, " if ( !clist )\n\treturn%s;\n", hasReturnValue ? " something" : "" );
+ fprintf( out, " TQUObject o[%d];\n", f->args->count() + 1 );
+
+ // initialize return value to something
+ if ( hasReturnValue ) {
+ if ( validUType( f->type ) ) {
+ TQCString utype = uType( f->type );
+ fprintf( out, " static_QUType_%s.set(o,something);\n", utype.data() );
+ } else if ( uType( f->type ) == "varptr" ) {
+ fprintf( out, " static_QUType_varptr.set(o,&something);\n" );
+ } else {
+ fprintf( out, " static_QUType_ptr.set(o,&something);\n" );
+ }
+ }
+
+ // initialize arguments
+ if ( !f->args->isEmpty() ) {
+ offset = 0;
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ if ( validUType( type ) ) {
+ TQCString utype = uType( type );
+ fprintf( out, " static_QUType_%s.set(o+%d,t%d);\n", utype.data(), offset+1, offset );
+ } else if ( uType( type ) == "varptr" ) {
+ fprintf( out, " static_QUType_varptr.set(o+%d,&t%d);\n", offset+1, offset );
+ } else {
+ fprintf( out, " static_QUType_ptr.set(o+%d,&t%d);\n", offset+1, offset );
+ }
+ a = f->args->next();
+ offset++;
+ }
+ }
+ fprintf( out, " activate_signal( clist, o );\n" );
+
+ // get return values from inOut parameters
+ if ( !f->args->isEmpty() ) {
+ offset = 0;
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ if ( validUType( type ) && isInOut( type ) ) {
+ TQCString utype = uType( type );
+ if ( utype == "enum" )
+ fprintf( out, " t%d = (%s)static_QUType_%s.get(o+%d);\n", offset, type.data(), utype.data(), offset+1 );
+ else if ( utype == "ptr" && type.right(2) == "**" )
+ fprintf( out, " if (t%d) *t%d = *(%s)static_QUType_ptr.get(o+%d);\n", offset, offset, type.data(), offset+1 );
+ else
+ fprintf( out, " t%d = static_QUType_%s.get(o+%d);\n", offset, utype.data(), offset+1 );
+ }
+ a = f->args->next();
+ offset++;
+ }
+ }
+
+ // get and return return value
+ if ( hasReturnValue ) {
+ TQCString utype = uType( f->type );
+ if ( utype == "enum" || utype == "ptr" || utype == "varptr" ) // need cast
+ fprintf( out, " return (%s)static_QUType_%s.get(o);\n", f->type.data(), utype.data() );
+ else
+ fprintf( out, " return static_QUType_%s.get(o);\n", utype.data() );
+ }
+
+ fprintf( out, "}\n" );
+ }
+
+ f = g->signals.next();
+ sigindex++;
+ }
+
+
+//
+// Generate internal qt_invoke() function
+//
+ fprintf( out, "\nbool %s::qt_invoke( int _id, TQUObject* _o )\n{\n", qualifiedClassName().data() );
+
+ if( !g->slots.isEmpty() ) {
+ fprintf( out, " switch ( _id - staticMetaObject()->slotOffset() ) {\n" );
+ int slotindex = -1;
+ for ( f = g->slots.first(); f; f = g->slots.next() ) {
+ slotindex ++;
+ if ( f->type == "void" && f->args->isEmpty() ) {
+ fprintf( out, " case %d: %s(); break;\n", slotindex, f->name.data() );
+ continue;
+ }
+
+ fprintf( out, " case %d: ", slotindex );
+ bool hasReturnValue = FALSE;
+ bool hasVariantReturn = FALSE;
+ if ( f->type != "void" ) {
+ if ( validUType( f->type )) {
+ hasReturnValue = TRUE;
+ fprintf( out, "static_QUType_%s.set(_o,", uType(f->type).data() );
+ } else if ( isVariantType( f->type ) ) {
+ hasReturnValue = hasVariantReturn = TRUE;
+ // do not need special handling for bool since this is handled as utype
+ fprintf( out, "static_QUType_TQVariant.set(_o,TQVariant(" );
+ }
+ }
+ int offset = 0;
+ fprintf( out, "%s(", f->name.data() );
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ fixRightAngles( &type );
+ if ( validUType( type ) ) {
+ TQCString utype = uType( type );
+ if ( utype == "ptr" || utype == "varptr" || utype == "enum" )
+ fprintf( out, "(%s)static_QUType_%s.get(_o+%d)", type.data(), utype.data(), offset+1 );
+ else
+ fprintf( out, "(%s)static_QUType_%s.get(_o+%d)", type.data(), utype.data(), offset+1 );
+ } else {
+ TQCString castType = castToUType( type );
+ if(castType == type)
+ fprintf( out, "(%s)(*((%s*)static_QUType_ptr.get(_o+%d)))", type.data(),
+ castType.data(), offset+1 );
+ else
+ fprintf( out, "(%s)*((%s*)static_QUType_ptr.get(_o+%d))", type.data(),
+ castType.data(), offset+1 );
+ }
+ a = f->args->next();
+ if ( a )
+ fprintf( out, "," );
+ offset++;
+ }
+ fprintf( out, ")" );
+ if ( hasReturnValue )
+ fprintf( out, ")" );
+ if ( hasVariantReturn )
+ fprintf( out, ")" );
+ fprintf( out, "; break;\n" );
+ }
+ fprintf( out, " default:\n" );
+
+ if ( !g->superClassName.isEmpty() && !isTQObject ) {
+ fprintf( out, "\treturn %s::qt_invoke( _id, _o );\n",
+ (const char *) purestSuperClassName() );
+ } else {
+ fprintf( out, "\treturn FALSE;\n" );
+ }
+ fprintf( out, " }\n" );
+ fprintf( out, " return TRUE;\n}\n" );
+ } else {
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, " return %s::qt_invoke(_id,_o);\n}\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, " return FALSE;\n}\n" );
+ }
+
+
+//
+// Generate internal qt_emit() function
+//
+ fprintf( out, "\nbool %s::qt_emit( int _id, TQUObject* _o )\n{\n", qualifiedClassName().data() );
+
+ if ( !g->signals.isEmpty() ) {
+ fprintf( out, " switch ( _id - staticMetaObject()->signalOffset() ) {\n" );
+ int signalindex = -1;
+ for ( f = g->signals.first(); f; f = g->signals.next() ) {
+ signalindex++;
+ if ( f->type == "void" && f->args->isEmpty() ) {
+ fprintf( out, " case %d: %s(); break;\n", signalindex, f->name.data() );
+ continue;
+ }
+
+ fprintf( out, " case %d: ", signalindex );
+ bool hasReturnValue = FALSE;
+ if ( f->type != "void" && validUType( f->type )) {
+ hasReturnValue = TRUE;
+ fprintf( out, "static_QUType_%s.set(_o,", uType(f->type).data() );
+ }
+ int offset = 0;
+ fprintf( out, "%s(", f->name.data() );
+ Argument* a = f->args->first();
+ while ( a ) {
+ TQCString type = a->leftType + ' ' + a->rightType;
+ type = type.simplifyWhiteSpace();
+ fixRightAngles( &type );
+ if ( validUType( type ) ) {
+ TQCString utype = uType( type );
+ if ( utype == "ptr" || utype == "varptr" || utype == "enum" )
+ fprintf( out, "(%s)static_QUType_%s.get(_o+%d)", type.data(), utype.data(), offset+1 );
+ else
+ fprintf( out, "(%s)static_QUType_%s.get(_o+%d)", type.data(), utype.data(), offset+1 );
+ } else {
+ TQCString castType = castToUType( type );
+ if(castType == type)
+ fprintf( out, "(%s)(*((%s*)static_QUType_ptr.get(_o+%d)))", type.data(),
+ castType.data(), offset+1 );
+ else
+ fprintf( out, "(%s)*((%s*)static_QUType_ptr.get(_o+%d))", type.data(),
+ castType.data(), offset+1 );
+ }
+ a = f->args->next();
+ if ( a )
+ fprintf( out, "," );
+ offset++;
+ }
+ fprintf( out, ")" );
+ if ( hasReturnValue )
+ fprintf( out, ")" );
+ fprintf( out, "; break;\n" );
+ }
+ fprintf( out, " default:\n" );
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, "\treturn %s::qt_emit(_id,_o);\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, "\treturn FALSE;\n" );
+ fprintf( out, " }\n" );
+ fprintf( out, " return TRUE;\n}\n" );
+ } else {
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, " return %s::qt_emit(_id,_o);\n}\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, " return FALSE;\n}\n" );
+ }
+
+
+ fprintf( out, "#ifndef QT_NO_PROPERTIES\n" );
+//
+// Generate internal qt_property() functions
+//
+
+ fprintf( out, "\nbool %s::qt_property( int id, int f, TQVariant* v)\n{\n", qualifiedClassName().data() );
+
+ if ( !g->props.isEmpty() ) {
+ fprintf( out, " switch ( id - staticMetaObject()->propertyOffset() ) {\n" );
+ int propindex = -1;
+ bool need_resolve = FALSE;
+
+ for( TQPtrListIterator<Property> it( g->props ); it.current(); ++it ){
+ propindex ++;
+ fprintf( out, " case %d: ", propindex );
+ fprintf( out, "switch( f ) {\n" );
+
+ uint flag_break = 0;
+ uint flag_propagate = 0;
+
+ if ( it.current()->setfunc ) {
+ fprintf( out, "\tcase 0: %s(", it.current()->setfunc->name.data() );
+ TQCString type = it.current()->type.copy(); // detach on purpose
+ if ( it.current()->oredEnum )
+ type = it.current()->enumsettype;
+ if ( type == "uint" )
+ fprintf( out, "v->asUInt()" );
+ else if ( type == "unsigned int" )
+ fprintf( out, "(uint)v->asUInt()" );
+ else if ( type == "TQMap<TQString,TQVariant>" )
+ fprintf( out, "v->asMap()" );
+ else if ( type == "TQValueList<TQVariant>" )
+ fprintf( out, "v->asList()" );
+ else if ( type == "Q_LLONG" )
+ fprintf( out, "v->asLongLong()" );
+ else if ( type == "Q_ULLONG" )
+ fprintf( out, "v->asULongLong()" );
+ else if ( isVariantType( type ) ) {
+ if (( type[0] == 'T' ) && ( type[1] == 'Q' ))
+ type = type.mid(2);
+ else
+ type[0] = toupper( type[0] );
+ fprintf( out, "v->as%s()", type.data() );
+ } else {
+ fprintf( out, "(%s&)v->asInt()", type.data() );
+ }
+ fprintf( out, "); break;\n" );
+
+ } else if ( it.current()->override ) {
+ flag_propagate |= 1 << (0+1);
+ }
+ if ( it.current()->getfunc ) {
+ if ( it.current()->gspec == Property::Pointer )
+ fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s()%s ); break;\n",
+ it.current()->getfunc->name.data(),
+ !isVariantType( it.current()->type ) ? "(int)" : "",
+ it.current()->getfunc->name.data(),
+ it.current()->type == "bool" ? ", 0" : "" );
+ else
+ fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s()%s ); break;\n",
+ !isVariantType( it.current()->type ) ? "(int)" : "",
+ it.current()->getfunc->name.data(),
+ it.current()->type == "bool" ? ", 0" : "" );
+ } else if ( it.current()->override ) {
+ flag_propagate |= 1<< (1+1);
+ }
+
+ if ( !it.current()->reset.isEmpty() )
+ fprintf( out, "\tcase 2: this->%s(); break;\n", it.current()->reset.data() );
+
+ if ( it.current()->designable.isEmpty() )
+ flag_propagate |= 1 << (3+1);
+ else if ( it.current()->designable == "true" )
+ flag_break |= 1 << (3+1);
+ else if ( it.current()->designable != "false" )
+ fprintf( out, "\tcase 3: return this->%s();\n", it.current()->designable.data() );
+
+ if ( it.current()->scriptable.isEmpty() )
+ flag_propagate |= 1 << (4+1);
+ else if ( it.current()->scriptable == "true" )
+ flag_break |= 1 << (4+1);
+ else if ( it.current()->scriptable != "false" )
+ fprintf( out, "\tcase 4: return this->%s();\n", it.current()->scriptable.data() );
+
+ if ( it.current()->stored.isEmpty() )
+ flag_propagate |= 1 << (5+1);
+ else if ( it.current()->stored == "true" )
+ flag_break |= 1 << (5+1);
+ else if ( it.current()->stored != "false" )
+ fprintf( out, "\tcase 5: return this->%s();\n", it.current()->stored.data() );
+
+ int i = 0;
+ if ( flag_propagate != 0 ) {
+ fprintf( out, "\t" );
+ for ( i = 0; i <= 5; i++ ) {
+ if ( flag_propagate & (1 << (i+1) ) )
+ fprintf( out, "case %d: ", i );
+ }
+ if (!g->superClassName.isEmpty() && !isTQObject ) {
+ fprintf( out, "goto resolve;\n" );
+ need_resolve = TRUE;
+ } else {
+ fprintf( out, " return FALSE;\n" );
+ }
+ }
+ if ( flag_break != 0 ) {
+ fprintf( out, "\t" );
+ for ( i = 0; i <= 5; i++ ) {
+ if ( flag_break & (1 << (i+1) ) )
+ fprintf( out, "case %d: ", i );
+ }
+ fprintf( out, "break;\n");
+ }
+
+ fprintf( out, "\tdefault: return FALSE;\n } break;\n" );
+ }
+ fprintf( out, " default:\n" );
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, "\treturn %s::qt_property( id, f, v );\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, "\treturn FALSE;\n" );
+ fprintf( out, " }\n" );
+ fprintf( out, " return TRUE;\n" );
+
+ if ( need_resolve )
+ fprintf( out, "resolve:\n return %s::qt_property( staticMetaObject()->resolveProperty(id), f, v );\n",
+ (const char *) purestSuperClassName() );
+ fprintf( out, "}\n" );
+ } else {
+ if ( !g->superClassName.isEmpty() && !isTQObject )
+ fprintf( out, " return %s::qt_property( id, f, v);\n}\n",
+ (const char *) purestSuperClassName() );
+ else
+ fprintf( out, " return FALSE;\n}\n" );
+ }
+
+ fprintf( out, "\nbool %s::qt_static_property( TQObject* , int , int , TQVariant* ){ return FALSE; }\n", qualifiedClassName().data() );
+ fprintf( out, "#endif // QT_NO_PROPERTIES\n" );
+}
+
+
+ArgList *addArg( Argument *a ) // add argument to list
+{
+ if ( (!a->leftType.isEmpty() || !a->rightType.isEmpty() ) ) //filter out truely void arguments
+ tmpArgList->append( a );
+ return tmpArgList;
+}
+
+void addEnum()
+{
+ // Avoid duplicates
+ for( TQPtrListIterator<Enum> lit( g->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 types mentioned in Q_ENUMS and Q_SETS
+ if ( g->qtEnums.contains( tmpEnum->name ) || g->qtSets.contains( tmpEnum->name ) )
+ {
+ g->enums.append( tmpEnum );
+ if ( g->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->type = tmpFunc->type.simplifyWhiteSpace();
+ tmpFunc->access = tmpAccess;
+ tmpFunc->args = tmpArgList;
+ tmpFunc->lineNo = lineNo;
+
+ for ( ;; ) {
+ g->funcs.append( tmpFunc );
+
+ if ( m == SignalMember ) {
+ g->signals.append( tmpFunc );
+ break;
+ } else {
+ if ( m == SlotMember )
+ g->slots.append( tmpFunc );
+ // PropertyCandidateMember or SlotMember
+ if ( !tmpFunc->name.isEmpty() && tmpFunc->access == Public )
+ g->propfuncs.append( tmpFunc );
+ if ( !tmpFunc->args || !tmpFunc->args->hasDefaultArguments() )
+ break;
+ tmpFunc = new Function( *tmpFunc );
+ tmpFunc->args = tmpFunc->args->magicClone();
+ }
+ }
+
+ skipFunc = FALSE;
+ tmpFunc = new Function;
+ tmpArgList = new ArgList;
+}
+
+void checkPropertyName( const char* ident )
+{
+ if ( ident[0] == '_' ) {
+ moc_err( "Invalid property name '%s'.", ident );
+ return;
+ }
+}
+#line 3649 "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 821 "moc.y"
+{ enterNameSpace(yyvsp[0].string); }
+break;
+case 11:
+#line 822 "moc.y"
+{ BEGIN IN_NAMESPACE; }
+break;
+case 12:
+#line 824 "moc.y"
+{ leaveNameSpace();
+ selectOutsideClassState();
+ }
+break;
+case 13:
+#line 829 "moc.y"
+{ enterNameSpace(); }
+break;
+case 14:
+#line 830 "moc.y"
+{ BEGIN IN_NAMESPACE; }
+break;
+case 15:
+#line 832 "moc.y"
+{ leaveNameSpace();
+ selectOutsideClassState();
+ }
+break;
+case 17:
+#line 841 "moc.y"
+{ selectOutsideClassState(); }
+break;
+case 18:
+#line 845 "moc.y"
+{ selectOutsideClassState(); }
+break;
+case 19:
+#line 848 "moc.y"
+{ selectOutsideClassState(); }
+break;
+case 20:
+#line 849 "moc.y"
+{ selectOutsideClassState(); }
+break;
+case 21:
+#line 852 "moc.y"
+{ initClass(); }
+break;
+case 22:
+#line 853 "moc.y"
+{ generateClass();
+ registerClassInNamespace();
+ selectOutsideClassState(); }
+break;
+case 23:
+#line 861 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 24:
+#line 862 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 25:
+#line 866 "moc.y"
+{ g->tmpExpression = rmWS( g->tmpExpression );
+ yyval.string = stradd( yyvsp[-3].string, "<",
+ g->tmpExpression, ">" ); }
+break;
+case 26:
+#line 877 "moc.y"
+{ initExpression();
+ templLevel = 1;
+ BEGIN IN_TEMPL_ARGS; }
+break;
+case 27:
+#line 890 "moc.y"
+{ initExpression();
+ BEGIN IN_EXPR; }
+break;
+case 28:
+#line 899 "moc.y"
+{ BEGIN IN_DEF_ARG; }
+break;
+case 29:
+#line 902 "moc.y"
+{ initExpression();
+ BEGIN IN_ENUM; }
+break;
+case 30:
+#line 908 "moc.y"
+{ yyval.string = ""; }
+break;
+case 31:
+#line 909 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 32:
+#line 910 "moc.y"
+{ yyval.string = ""; }
+break;
+case 33:
+#line 911 "moc.y"
+{ skipFunc = TRUE; yyval.string = ""; }
+break;
+case 34:
+#line 912 "moc.y"
+{ skipFunc = TRUE; yyval.string = ""; }
+break;
+case 35:
+#line 916 "moc.y"
+{ yyval.string = straddSpc(yyvsp[-2].string,yyvsp[-1].string,yyvsp[0].string); }
+break;
+case 36:
+#line 918 "moc.y"
+{ yyval.string = ""; }
+break;
+case 37:
+#line 919 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 38:
+#line 922 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 39:
+#line 923 "moc.y"
+{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
+break;
+case 42:
+#line 928 "moc.y"
+{ skipFunc = TRUE; }
+break;
+case 44:
+#line 932 "moc.y"
+{ }
+break;
+case 45:
+#line 933 "moc.y"
+{ }
+break;
+case 46:
+#line 936 "moc.y"
+{ yyval.string = "const"; }
+break;
+case 47:
+#line 937 "moc.y"
+{ yyval.string = "volatile"; }
+break;
+case 48:
+#line 940 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 49:
+#line 941 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 50:
+#line 942 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 51:
+#line 946 "moc.y"
+{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
+break;
+case 52:
+#line 947 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 53:
+#line 950 "moc.y"
+{ yyval.string = "char"; }
+break;
+case 54:
+#line 951 "moc.y"
+{ yyval.string = "short"; }
+break;
+case 55:
+#line 952 "moc.y"
+{ yyval.string = "int"; }
+break;
+case 56:
+#line 953 "moc.y"
+{ yyval.string = "long"; }
+break;
+case 57:
+#line 954 "moc.y"
+{ yyval.string = "signed"; }
+break;
+case 58:
+#line 955 "moc.y"
+{ yyval.string = "unsigned"; }
+break;
+case 59:
+#line 956 "moc.y"
+{ yyval.string = "float"; }
+break;
+case 60:
+#line 957 "moc.y"
+{ yyval.string = "double"; }
+break;
+case 61:
+#line 958 "moc.y"
+{ yyval.string = "void"; }
+break;
+case 62:
+#line 962 "moc.y"
+{ g->tmpExpression = rmWS( g->tmpExpression );
+ yyval.string = stradd( "template<",
+ g->tmpExpression, ">" ); }
+break;
+case 64:
+#line 968 "moc.y"
+{ templateClassOld = templateClass;
+ templateClass = TRUE;
+ }
+break;
+case 65:
+#line 974 "moc.y"
+{ yyval.string = "class"; }
+break;
+case 66:
+#line 975 "moc.y"
+{ yyval.string = "struct"; }
+break;
+case 67:
+#line 978 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 68:
+#line 980 "moc.y"
+{ yyval.string = stradd( "::", yyvsp[0].string ); }
+break;
+case 69:
+#line 984 "moc.y"
+{ yyval.string = stradd( yyvsp[-2].string, "::", yyvsp[0].string );}
+break;
+case 70:
+#line 985 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 71:
+#line 989 "moc.y"
+{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
+break;
+case 72:
+#line 990 "moc.y"
+{ yyval.string = stradd("enum ",yyvsp[0].string); }
+break;
+case 73:
+#line 991 "moc.y"
+{ yyval.string = stradd("union ",yyvsp[0].string); }
+break;
+case 74:
+#line 996 "moc.y"
+{ yyval.arg_list = yyvsp[-1].arg_list;}
+break;
+case 75:
+#line 997 "moc.y"
+{ yyval.arg_list = yyvsp[-2].arg_list;
+ func_warn("Ellipsis not supported"
+ " in signals and slots.\n"
+ "Ellipsis argument ignored."); }
+break;
+case 76:
+#line 1003 "moc.y"
+{ yyval.arg_list = tmpArgList; }
+break;
+case 77:
+#line 1004 "moc.y"
+{ yyval.arg_list = yyvsp[0].arg_list; }
+break;
+case 78:
+#line 1007 "moc.y"
+{ yyval.arg = 0; }
+break;
+case 81:
+#line 1012 "moc.y"
+{ func_warn("Ellipsis not supported"
+ " in signals and slots.\n"
+ "Ellipsis argument ignored."); }
+break;
+case 82:
+#line 1020 "moc.y"
+{ yyval.arg_list = addArg(yyvsp[0].arg); }
+break;
+case 83:
+#line 1021 "moc.y"
+{ yyval.arg_list = addArg(yyvsp[0].arg); }
+break;
+case 84:
+#line 1025 "moc.y"
+{ yyval.arg = new Argument(straddSpc(yyvsp[-1].string,yyvsp[0].string),""); }
+break;
+case 85:
+#line 1027 "moc.y"
+{ expLevel = 1; }
+break;
+case 86:
+#line 1029 "moc.y"
+{ yyval.arg = new Argument(straddSpc(yyvsp[-4].string,yyvsp[-3].string),"", 0, TRUE ); }
+break;
+case 87:
+#line 1032 "moc.y"
+{ yyval.arg = new Argument(straddSpc(yyvsp[-3].string,yyvsp[-2].string),yyvsp[0].string, yyvsp[-1].string); }
+break;
+case 88:
+#line 1035 "moc.y"
+{ expLevel = 1; }
+break;
+case 89:
+#line 1037 "moc.y"
+{ yyval.arg = new Argument(straddSpc(yyvsp[-6].string,yyvsp[-5].string),yyvsp[-3].string, yyvsp[-4].string, TRUE); }
+break;
+case 90:
+#line 1041 "moc.y"
+{ yyval.string = ""; }
+break;
+case 91:
+#line 1042 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 92:
+#line 1046 "moc.y"
+{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
+break;
+case 93:
+#line 1047 "moc.y"
+{ expLevel = 1; }
+break;
+case 94:
+#line 1049 "moc.y"
+{ yyval.string = stradd( "[",
+ g->tmpExpression =
+ g->tmpExpression.stripWhiteSpace(), "]" ); }
+break;
+case 95:
+#line 1052 "moc.y"
+{ expLevel = 1; }
+break;
+case 96:
+#line 1054 "moc.y"
+{ yyval.string = stradd( yyvsp[-4].string,"[",
+ g->tmpExpression =
+ g->tmpExpression.stripWhiteSpace(),"]" ); }
+break;
+case 97:
+#line 1057 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 98:
+#line 1058 "moc.y"
+{ yyval.string = yyvsp[-1].string; }
+break;
+case 99:
+#line 1061 "moc.y"
+{ yyval.string = ""; }
+break;
+case 100:
+#line 1063 "moc.y"
+{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string);}
+break;
+case 101:
+#line 1064 "moc.y"
+{ expLevel = 1; }
+break;
+case 102:
+#line 1066 "moc.y"
+{ yyval.string = stradd( yyvsp[-4].string,"[",
+ g->tmpExpression =
+ g->tmpExpression.stripWhiteSpace(),"]" ); }
+break;
+case 103:
+#line 1069 "moc.y"
+{ yyval.string = yyvsp[-1].string; }
+break;
+case 105:
+#line 1083 "moc.y"
+{ tmpFunc->args = yyvsp[-6].arg_list;
+ tmpFunc->qualifier = yyvsp[-4].string; }
+break;
+case 107:
+#line 1089 "moc.y"
+{ func_warn("Variable as signal or slot."); }
+break;
+case 108:
+#line 1090 "moc.y"
+{ expLevel=0; }
+break;
+case 109:
+#line 1092 "moc.y"
+{ skipFunc = TRUE; }
+break;
+case 110:
+#line 1093 "moc.y"
+{ expLevel=0; }
+break;
+case 111:
+#line 1095 "moc.y"
+{ skipFunc = TRUE; }
+break;
+case 112:
+#line 1099 "moc.y"
+{ expLevel = 1; }
+break;
+case 114:
+#line 1101 "moc.y"
+{ expLevel = 1; }
+break;
+case 116:
+#line 1106 "moc.y"
+{ yyval.string = ""; }
+break;
+case 117:
+#line 1107 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 118:
+#line 1110 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 119:
+#line 1111 "moc.y"
+{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string);}
+break;
+case 120:
+#line 1114 "moc.y"
+{ yyval.string = straddSpc("*",yyvsp[0].string);}
+break;
+case 121:
+#line 1115 "moc.y"
+{ yyval.string = stradd("&",yyvsp[0].string);}
+break;
+case 122:
+#line 1122 "moc.y"
+{ yyval.string = ""; }
+break;
+case 123:
+#line 1123 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 124:
+#line 1126 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 125:
+#line 1128 "moc.y"
+{ yyval.string = straddSpc(yyvsp[-1].string,yyvsp[0].string); }
+break;
+case 126:
+#line 1131 "moc.y"
+{ yyval.string = "const"; }
+break;
+case 127:
+#line 1132 "moc.y"
+{ yyval.string = "volatile"; }
+break;
+case 131:
+#line 1140 "moc.y"
+{ BEGIN IN_FCT; fctLevel = 1;}
+break;
+case 132:
+#line 1141 "moc.y"
+{ BEGIN QT_DEF; }
+break;
+case 133:
+#line 1148 "moc.y"
+{ BEGIN IN_CLASS;
+ classPLevel = 1;
+ }
+break;
+case 134:
+#line 1152 "moc.y"
+{ BEGIN QT_DEF; }
+break;
+case 135:
+#line 1153 "moc.y"
+{ BEGIN QT_DEF; /* -- " -- */
+ skipClass = TRUE; }
+break;
+case 136:
+#line 1155 "moc.y"
+{ BEGIN QT_DEF; /* -- " -- */
+ skipClass = TRUE; }
+break;
+case 137:
+#line 1157 "moc.y"
+{ BEGIN QT_DEF; /* -- " -- */
+ skipClass = TRUE; }
+break;
+case 138:
+#line 1161 "moc.y"
+{ BEGIN QT_DEF; /* catch ';' */
+ skipClass = TRUE; }
+break;
+case 139:
+#line 1163 "moc.y"
+{ skipClass = TRUE;
+ BEGIN GIMME_SEMICOLON; }
+break;
+case 143:
+#line 1170 "moc.y"
+{ yyval.string = ""; }
+break;
+case 145:
+#line 1176 "moc.y"
+{ g->className = yyvsp[0].string;
+ if ( g->className == "TQObject" )
+ Q_OBJECTdetected = TRUE;
+ }
+break;
+case 146:
+#line 1182 "moc.y"
+{ g->className = yyvsp[0].string;
+ if ( g->className == "TQObject" )
+ Q_OBJECTdetected = TRUE;
+ }
+break;
+case 147:
+#line 1189 "moc.y"
+{ g->superClassName = yyvsp[0].string; }
+break;
+case 148:
+#line 1194 "moc.y"
+{ templateClass = templateClassOld; }
+break;
+case 157:
+#line 1217 "moc.y"
+{ expLevel = 1; }
+break;
+case 159:
+#line 1222 "moc.y"
+{ yyval.string = 0; }
+break;
+case 160:
+#line 1223 "moc.y"
+{ yyval.string = yyvsp[0].string; }
+break;
+case 165:
+#line 1235 "moc.y"
+{ tmpAccess = yyvsp[0].access; }
+break;
+case 166:
+#line 1236 "moc.y"
+{ moc_err( "Missing access specifier"
+ " before \"slots:\"." ); }
+break;
+case 167:
+#line 1240 "moc.y"
+{ BEGIN QT_DEF; }
+break;
+case 169:
+#line 1242 "moc.y"
+{ BEGIN QT_DEF; }
+break;
+case 171:
+#line 1244 "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 172:
+#line 1252 "moc.y"
+{ tmpYYStart = YY_START;
+ tmpPropOverride = FALSE;
+ BEGIN IN_PROPERTY; }
+break;
+case 173:
+#line 1255 "moc.y"
+{
+ BEGIN tmpYYStart;
+ }
+break;
+case 175:
+#line 1259 "moc.y"
+{ tmpYYStart = YY_START;
+ tmpPropOverride = TRUE;
+ BEGIN IN_PROPERTY; }
+break;
+case 176:
+#line 1262 "moc.y"
+{
+ BEGIN tmpYYStart;
+ }
+break;
+case 178:
+#line 1266 "moc.y"
+{ tmpYYStart = YY_START; BEGIN IN_CLASSINFO; }
+break;
+case 179:
+#line 1268 "moc.y"
+{
+ g->infos.append( new ClassInfo( yyvsp[-3].string, yyvsp[-1].string ) );
+ BEGIN tmpYYStart;
+ }
+break;
+case 181:
+#line 1273 "moc.y"
+{ tmpYYStart = YY_START; BEGIN IN_PROPERTY; }
+break;
+case 182:
+#line 1274 "moc.y"
+{
+ Q_PROPERTYdetected = TRUE;
+ BEGIN tmpYYStart;
+ }
+break;
+case 184:
+#line 1279 "moc.y"
+{ tmpYYStart = YY_START; BEGIN IN_PROPERTY; }
+break;
+case 185:
+#line 1280 "moc.y"
+{
+ Q_PROPERTYdetected = TRUE;
+ BEGIN tmpYYStart;
+ }
+break;
+case 187:
+#line 1287 "moc.y"
+{ moc_err( "Signals cannot "
+ "have access specifiers" ); }
+break;
+case 189:
+#line 1290 "moc.y"
+{ if ( tmpAccess == Public && Q_PROPERTYdetected )
+ BEGIN QT_DEF;
+ else
+ BEGIN IN_CLASS;
+ suppress_func_warn = TRUE;
+ }
+break;
+case 190:
+#line 1297 "moc.y"
+{
+ suppress_func_warn = FALSE;
+ }
+break;
+case 191:
+#line 1300 "moc.y"
+{ BEGIN IN_CLASS;
+ if ( classPLevel != 1 )
+ moc_warn( "unexpected access"
+ "specifier" );
+ }
+break;
+case 196:
+#line 1315 "moc.y"
+{ addMember( PropertyCandidateMember ); }
+break;
+case 201:
+#line 1327 "moc.y"
+{ addMember( SignalMember ); }
+break;
+case 206:
+#line 1338 "moc.y"
+{ addMember( SlotMember ); }
+break;
+case 209:
+#line 1345 "moc.y"
+{ yyval.string=yyvsp[0].string; }
+break;
+case 210:
+#line 1348 "moc.y"
+{ g->multipleSuperClasses.append( yyvsp[0].string ); }
+break;
+case 212:
+#line 1353 "moc.y"
+{ yyval.string = stradd( yyvsp[-3].string, "(", yyvsp[-1].string, ")" ); }
+break;
+case 213:
+#line 1355 "moc.y"
+{ yyval.string = stradd( yyvsp[-3].string, "(", yyvsp[-1].string, ")" ); }
+break;
+case 214:
+#line 1358 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 215:
+#line 1359 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 216:
+#line 1360 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 217:
+#line 1361 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 218:
+#line 1362 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 219:
+#line 1363 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 220:
+#line 1364 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 221:
+#line 1365 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 222:
+#line 1366 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 223:
+#line 1367 "moc.y"
+{yyval.string=yyvsp[0].string;}
+break;
+case 224:
+#line 1370 "moc.y"
+{ yyval.access=Private; }
+break;
+case 225:
+#line 1371 "moc.y"
+{ yyval.access=Protected; }
+break;
+case 226:
+#line 1372 "moc.y"
+{ yyval.access=Public; }
+break;
+case 227:
+#line 1375 "moc.y"
+{ }
+break;
+case 228:
+#line 1376 "moc.y"
+{ }
+break;
+case 270:
+#line 1424 "moc.y"
+{ tmpFunc->type = yyvsp[-1].string;
+ tmpFunc->name = yyvsp[0].string; }
+break;
+case 271:
+#line 1427 "moc.y"
+{ tmpFunc->type = "int";
+ tmpFunc->name = yyvsp[0].string;
+ if ( tmpFunc->name == g->className )
+ func_warn( "Constructors cannot be"
+ " signals or slots.");
+ }
+break;
+case 272:
+#line 1434 "moc.y"
+{ tmpFunc->type = "void";
+ tmpFunc->name = "~";
+ tmpFunc->name += yyvsp[0].string;
+ func_warn( "Destructors cannot be"
+ " signals or slots.");
+ }
+break;
+case 273:
+#line 1442 "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 274:
+#line 1449 "moc.y"
+{ skipFunc = TRUE; }
+break;
+case 275:
+#line 1451 "moc.y"
+{ tmpFunc->type =
+ straddSpc(yyvsp[-2].string,yyvsp[-1].string);
+ tmpFunc->name = yyvsp[0].string; }
+break;
+case 276:
+#line 1456 "moc.y"
+{ tmpFunc->type =
+ straddSpc(yyvsp[-3].string,yyvsp[-2].string,yyvsp[-1].string);
+ tmpFunc->name = yyvsp[0].string; }
+break;
+case 277:
+#line 1460 "moc.y"
+{ operatorError(); }
+break;
+case 278:
+#line 1462 "moc.y"
+{ operatorError(); }
+break;
+case 279:
+#line 1465 "moc.y"
+{ operatorError(); }
+break;
+case 280:
+#line 1467 "moc.y"
+{ operatorError(); }
+break;
+case 281:
+#line 1470 "moc.y"
+{ operatorError(); }
+break;
+case 283:
+#line 1476 "moc.y"
+{ func_warn("Unexpected variable declaration."); }
+break;
+case 284:
+#line 1479 "moc.y"
+{ func_warn("Unexpected variable declaration."); }
+break;
+case 285:
+#line 1481 "moc.y"
+{ func_warn("Unexpected enum declaration."); }
+break;
+case 286:
+#line 1483 "moc.y"
+{ func_warn("Unexpected using declaration."); }
+break;
+case 287:
+#line 1485 "moc.y"
+{ func_warn("Unexpected using declaration."); }
+break;
+case 288:
+#line 1487 "moc.y"
+{ classPLevel++;
+ moc_err("Unexpected namespace declaration."); }
+break;
+case 289:
+#line 1490 "moc.y"
+{ func_warn("Unexpected class declaration.");}
+break;
+case 290:
+#line 1492 "moc.y"
+{ func_warn("Unexpected class declaration.");
+ BEGIN IN_FCT; fctLevel=1;
+ }
+break;
+case 291:
+#line 1495 "moc.y"
+{ BEGIN QT_DEF; }
+break;
+case 295:
+#line 1504 "moc.y"
+{ }
+break;
+case 296:
+#line 1505 "moc.y"
+{ expLevel = 0; }
+break;
+case 298:
+#line 1507 "moc.y"
+{ expLevel = 0; }
+break;
+case 301:
+#line 1512 "moc.y"
+{ expLevel = 0; }
+break;
+case 306:
+#line 1527 "moc.y"
+{ BEGIN QT_DEF;
+ if ( tmpAccess == Public) {
+ tmpEnum->name = yyvsp[-4].string;
+ addEnum();
+ }
+ }
+break;
+case 307:
+#line 1534 "moc.y"
+{ tmpEnum->clear();}
+break;
+case 309:
+#line 1538 "moc.y"
+{ }
+break;
+case 313:
+#line 1546 "moc.y"
+{ if ( tmpAccess == Public) tmpEnum->append( yyvsp[0].string ); }
+break;
+case 314:
+#line 1547 "moc.y"
+{ enumLevel=0; }
+break;
+case 315:
+#line 1548 "moc.y"
+{ if ( tmpAccess == Public) tmpEnum->append( yyvsp[-3].string ); }
+break;
+case 316:
+#line 1552 "moc.y"
+{
+ g->propWrite = "";
+ g->propRead = "";
+ g->propOverride = tmpPropOverride;
+ g->propReset = "";
+ if ( g->propOverride ) {
+ g->propStored = "";
+ g->propDesignable = "";
+ g->propScriptable = "";
+ } else {
+ g->propStored = "true";
+ g->propDesignable = "true";
+ g->propScriptable = "true";
+ }
+ }
+break;
+case 317:
+#line 1568 "moc.y"
+{
+ if ( g->propRead.isEmpty() && !g->propOverride )
+ moc_err( "A property must at least feature a read method." );
+ checkPropertyName( yyvsp[-2].string );
+ Q_PROPERTYdetected = TRUE;
+ /* Avoid duplicates*/
+ for( TQPtrListIterator<Property> lit( g->props ); lit.current(); ++lit ) {
+ if ( lit.current()->name == yyvsp[-2].string ) {
+ if ( displayWarnings )
+ moc_err( "Property '%s' defined twice.",
+ (const char*)lit.current()->name );
+ }
+ }
+ g->props.append( new Property( lineNo, yyvsp[-3].string, yyvsp[-2].string,
+ g->propWrite, g->propRead, g->propReset,
+ g->propStored, g->propDesignable,
+ g->propScriptable, g->propOverride ) );
+ }
+break;
+case 319:
+#line 1589 "moc.y"
+{ g->propRead = yyvsp[-1].string; }
+break;
+case 320:
+#line 1590 "moc.y"
+{ g->propWrite = yyvsp[-1].string; }
+break;
+case 321:
+#line 1591 "moc.y"
+{ g->propReset = yyvsp[-1].string; }
+break;
+case 322:
+#line 1592 "moc.y"
+{ g->propStored = yyvsp[-1].string; }
+break;
+case 323:
+#line 1593 "moc.y"
+{ g->propDesignable = yyvsp[-1].string; }
+break;
+case 324:
+#line 1594 "moc.y"
+{ g->propScriptable = yyvsp[-1].string; }
+break;
+case 325:
+#line 1597 "moc.y"
+{ }
+break;
+case 326:
+#line 1598 "moc.y"
+{ g->qtEnums.append( yyvsp[-1].string ); }
+break;
+case 327:
+#line 1601 "moc.y"
+{ }
+break;
+case 328:
+#line 1602 "moc.y"
+{ g->qtSets.append( yyvsp[-1].string ); }
+break;
+#line 4759 "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);
+}
diff --git a/src/moc/moc_yacc.h b/src/moc/moc_yacc.h
new file mode 100644
index 000000000..b4ea3123e
--- /dev/null
+++ b/src/moc/moc_yacc.h
@@ -0,0 +1,65 @@
+#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 THROW 296
+#define SIGNALS 297
+#define SLOTS 298
+#define Q_OBJECT 299
+#define Q_PROPERTY 300
+#define Q_OVERRIDE 301
+#define Q_CLASSINFO 302
+#define Q_ENUMS 303
+#define Q_SETS 304
+#define READ 305
+#define WRITE 306
+#define STORED 307
+#define DESIGNABLE 308
+#define SCRIPTABLE 309
+#define RESET 310
+typedef union {
+ char char_val;
+ int int_val;
+ double double_val;
+ char *string;
+ Access access;
+ Function *function;
+ ArgList *arg_list;
+ Argument *arg;
+} YYSTYPE;
+extern YYSTYPE yylval;