]> git.draconx.ca Git - gob-dx.git/commitdiff
Release 0.92.1 v0.92.1
authorGeorge Lebl <jirka@5z.com>
Fri, 7 Jan 2000 10:55:00 +0000 (02:55 -0800)
committerNick Bowler <nbowler@draconx.ca>
Tue, 19 Feb 2019 17:19:02 +0000 (12:19 -0500)
17 files changed:
ChangeLog
NEWS
README
configure
configure.in
doc/gob.1.in
examples/my-person.gob
gob.spec
src/lexer.c
src/lexer.l
src/main.c
src/out.c
src/parse.c
src/parse.y
src/test.gob
src/tree.c
src/tree.h

index 2b9a5be605ee3038c13fe4efcfeb74f0a16edd5d..1348d62db7b5c6689de343b2d8257edec2c3f4e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,102 @@
+Thu Jan 06 17:32:46 2000  George Lebl <jirka@5z.com>
+
+       * Release 0.92.1
+
+Thu Jan 06 17:13:22 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: be consistent with the use of "namespacing", we
+         prefix ALL internal gob stuff with "___".  This should make it
+         easier to avoid name conflicts with user code and glibc/gcc (Which
+         seems to use __ prefix)
+
+       * src/main.c: check for init and class_init names for non-constructor
+         methods and give an error if found.
+
+       * src/main.c: check argument types and flags for correctness, error
+         on unknown type, but just a warning on unknown flag
+
+       * doc/gob.1.in: add a section for name conflicts
+
+Wed Jan 05 02:23:21 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: doh! the symbols for the aliases need to be declared as
+         static.
+
+Wed Jan 05 02:13:59 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: just realized that args... for macros is a GNU
+         extention and so the PARENT_HANDLER no longer uses it, but prints
+         the argument names with __ prefixed into the argument list.
+
+Wed Jan 05 01:58:32 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: if using gnu c, also define macros using varargs for
+         function aliases.  This should allow the compiler to optimize
+         further and if we have arguments for the defines there are
+         no adverse side effects as there are for straight defines.
+
+Wed Jan 05 01:48:12 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: fixup the aliases.  They didn't actually work right.
+         now we set it up as a const pointer to a function using typeof.
+
+Tue Jan 04 17:57:55 2000  George Lebl <jirka@5z.com>
+
+       * src/lexer.l: add support for 'requires x.y.z' line.  This is
+         so that a .gob file can require at least version x.y.z of gob
+
+       * src/test.gob: update
+
+       * doc/gob.1.in: update for requires and run trhough ispell
+
+Tue Jan 04 17:10:54 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: fix the non-gnu aliases
+
+Tue Jan 04 16:46:16 2000  George Lebl <jirka@5z.com>
+
+       * src/{main.c,parser.y,tree.[ch]}: add optional C type specification
+         to arguments for full type safety 
+
+       * doc/gob.1.in: updated
+
+Tue Jan 04 15:34:16 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: --no-gnu option to completely disable any use
+         of GNU C extentions.  This is for those weird people that don't
+         wish to use those extentions even with GNU C.
+
+Tue Jan 04 14:43:49 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: use some GNU extentions (guarded with #ifdef __GNUC__)
+         to make arguments fully typesafe, and to make it easier for
+         GNU to optimize the aliases, as well as to avoid the ugly
+         hack on GNU C.
+
+       * src/main.c: don't put #line 0 for the .gob file for method prototypes
+
+       * src/main.c: move the _priv structure freeing into finalize to enable
+         people to work with the private stuff inside the destroy handler
+
+       * src/main.c: use #line before every precondition check so that failed
+         checks should point to the function prototype rather then into
+         generated file.
+
+       * src/main.c: remove the _END_ARG macro
+
+       * src/main.c: add GOB_VERSION_MAJOR, GOB_VERSION_MINOR and
+         GOB_VERSION_PATCHLEVEL defines into the generated C file
+
+       * src/out.c: don't redundantly put #line for outfile if we're already
+         in the outfile
+
+       * configure.in: raise version number
+
+Tue Jan 04 02:22:33 2000  George Lebl <jirka@5z.com>
+
+       * src/main.c: add argument wrapper macros to make the argument system
+         a little more type safe.
+
 Fri Dec 31 17:39:22 1999  George Lebl <jirka@5z.com>
 
        * Release 0.92.0
diff --git a/NEWS b/NEWS
index 2bf0cf3458d9a9423d6f6ff63b17a35f5725c075..52beb5c973d6d65a3b6701f36122e64d79b8d7f7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+0.92.1
+       * typesafe macros for argument setting/getting
+       * generated code will take advantage of GNU C extentions if compiled
+         under GNU C
+       * move _priv structure freeing into finalize
+       * more gob file compilation checks
+       * other improvements and fixes
+
+       NOTE: The generated files with this version will be larger because
+       of some more preprocessor magic that is done to make the thing saner,
+       and faster.  Don't worry about it as the resulting object file should
+       not get larger.
+
 0.92.0
        * added protected methods and datamembers.
        * better handeling of empty methods
diff --git a/README b/README
index c20e5ba9c895d4d5d0746928c2de3e527b141284..cb1c740ef9b22ed2fa7ee05edfe738cb62f41911 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 GTK+ Object Builder (GOB)
 
 Very simple preprocessor for making GTK+ objects with inline C code so that
-generatedfiles are not editted.  Syntax is inspired by java and yacc or lex.
+generated files are not editted.  Syntax is inspired by java and yacc or lex.
 The implementation is intentionaly kept simple, and no C code parsing is done.
 
 Reasons:
index f856045dee7207557084811938531e2f8ed47767..32150cf3e71a5149396accc1778ec76552aa8699 100755 (executable)
--- a/configure
+++ b/configure
@@ -703,7 +703,7 @@ fi
 
 PACKAGE=gob
 
-VERSION=0.92.0
+VERSION=0.92.1
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
index 4445dbe23251038b88c8220a605a18c1824cb845..ea9f23f0ba0de1c28cc6d0e21ebe4b3ec3ff54ac 100644 (file)
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.2)
 AC_INIT(src/tree.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(gob,0.92.0)
+AM_INIT_AUTOMAKE(gob,0.92.1)
 
 if test -f ../NOINST_GOB ; then
   DOINSTGOB=
index 1f88d7c446359257cf15288105ef17212c270141..be027ace0f6b2b7faa4e79d09d01535837287a9a 100644 (file)
@@ -11,7 +11,8 @@ GOB \- The GTK+ Object Builder
 .SH SYNOPSIS
 .PP
 .B gob [-?] [-h] [--help] [--version] [-w] [--exit-on-warn]
-[--no-exit-on-warn] [--for-cpp] [--no-touch-headers] file
+[--no-exit-on-warn] [--for-cpp] [--no-gnu] [--always-private-header]
+[--no-private-header] [--no-touch-headers] file
 .SH DESCRIPTION
 .PP
 GTK+ Object Builder is a simple preprocessor for easily creating
@@ -34,7 +35,7 @@ Display version information (note, --version was not added until 0.92.0)
 .B -w
 .TP
 .B --exit-on-warn
-Exit with an errorcode even when you encounter a warning.
+Exit with an error code even when you encounter a warning.
 .TP
 .B --no-exit-on-warn
 Exit with an error only on errors, not on warnings, this is the default.
@@ -42,6 +43,13 @@ Exit with an error only on errors, not on warnings, this is the default.
 .B --for-cpp
 Generate C++ code.
 .TP
+.B --no-gnu
+Never generate any code with GNU C extensions.  However all the GNU C
+extensions are always wrapped in #ifdef __GNUC__, so code using them compiles
+correctly even on non-GNU compilers.  This option is for purists only.
+(using GNU extensions some warnings are eliminated, some ugly hacks and there
+is better argument type safety, so it's good to use them)
+.TP
 .B --no-touch-headers
 Don't touch the generated header file unless it really changed, this avoids
 spurious rebuilds, but can confuse some make systems (automake in particular),
@@ -54,7 +62,7 @@ Otherwise, it is only created when there are private data members in the class.
 This option implicitly negates --no-private-header
 .TP
 .B --no-private-header
-Never create a private header file.  If we use any private datamembers,
+Never create a private header file.  If we use any private data members,
 define the private data structure at the point in the .c source where
 the class definition begins.  This option implicitly negates
 --always-private-header
@@ -84,7 +92,7 @@ The public header file is created to be human readable and to be used as a
 reference to the object.  The .c source file is not created as a human
 readable source and is littered with #line statements, which make the
 compiler attempt to point you to the right line in your .gob file in
-case of parsing errors.  The output should not be editted by hand, and
+case of parsing errors.  The output should not be edited by hand, and
 you should only edit the .gob file.
 
 .SH INCLUDING NORMAL C CODE IN THE OUTPUT FILES
@@ -189,7 +197,7 @@ In case you use the \fB--no-private-header\fR option, no
 private header file is created and you can only access the _priv pointer
 below the class definition in the .gob file.
 .PP
-The fourth type is an argument type.  It is a named datamember which
+The fourth type is an argument type.  It is a named data member which
 is one of the features of the GTK+ object system.  You need to define a get
 and a set handler.  They are fragments of C code that will be used to 
 get the value or set the value of the argument.  Inside them you can use the
@@ -204,8 +212,8 @@ For example:
 
 .fi
 .PP
-If you don't define a set or a get handler it will be a readonly
-or a writeonly argument.  If you want to add extra argument flags, add
+If you don't define a set or a get handler it will be a read-only
+or a write-only argument.  If you want to add extra argument flags, add
 them into parenthesis after the argument keyword, separated by '|' and
 without the GTK_ARG_ prefix.  For example:
 .nf
@@ -219,6 +227,40 @@ that people can pass it to gtk_object_new function.  Useful is also
 CONSTRUCT_ONLY flag which makes the argument only available during
 construction of the object.
 .PP
+Since 0.92.1, gob creates macros which can be used for type safe access to
+gtk arguments.  The macros are called <type>_ARG_<argument name>(x) and
+<type>_GET_ARG_<argument name>(x).  They define both the string and the
+value part of the argument.  So for setting an argument of height, one would
+use (for object type My:Object):
+.nf
+
+  gtk_object_set(GTK_OBJECT(object),
+                 MY_OBJECT_ARG_HEIGHT(7),
+                 NULL);
+
+.fi
+And for getting, you would use:
+.nf
+
+  int height;
+  gtk_object_set(GTK_OBJECT(object),
+                 MY_OBJECT_GET_ARG_HEIGHT(&height),
+                 NULL);
+
+.fi
+Note however that the type safety only works completely on GNU C compilers.
+The code will compile on other compilers but with minimal type safety.
+.PP
+To get good type safety on POINTER types however, you should specify
+an optional C type that gob should use.  For other then POINTER types
+this is redundant but possible.  To do this, place '(type <c type>)'
+right after the GTK+ type.  Example:
+.nf
+
+  argument POINTER (type char *) foo set { /* foo */ } get { /* bar */ };
+
+.fi
+.PP
 Methods:
 .PP
 There is a whole array of possible methods.  The three normal,
@@ -290,7 +332,7 @@ this later.
 .PP
 Constructor methods:
 .PP
-There are two methods that handle the cosntruction of an object, init and
+There are two methods that handle the construction of an object, init and
 class_init.  You define them by just using the init or class_init keyword 
 with an untyped argument in the argument list.  The argument will be
 usable in your function as a pointer to your object or class depending if
@@ -429,18 +471,66 @@ will fetch a new object, so a fairly standard new method would look like:
   }
 
 .fi
+.PP
+
+.SH DEALING WITH DIFFERENT GOB VERSIONS
+.PP
+Defines:
+.PP
+In your generated C file, you can use the defines GOB_VERSION_MAJOR
+GOB_VERSION_MINOR and GOB_VERSION_PATCHLEVEL if you wish to for example
+use a feature that is only available in some newer gob version.  Note however
+that you can only use these defines in the C code portions of your .gob file,
+and #ifdef's cannot span multiple functions.  Check the BUGS section
+for more on using the C preprocessor and gob.  Also note that these
+have only been available since the 0.92.1 version of gob.
+.PP
+Minimum version requires:
+.PP
+You can also make your .gob file require at least certain version of gob.  You
+do this by putting 'requires x.y.z' (where x.y.z is the version number) outside
+of any C block, comment or class, usually you should make this the first line
+in the file or close to the top.  If gob finds this and the version of gob used
+to compile the code is lower then that listed in the require, gob will generate
+an error and exit.  For example to require that gob version 0.92.1 or higher
+be used to compile a file, put this at the top of that file:
+.nf
+
+  requires 0.92.1
+
+.fi
+It should be noted however that this feature was not added until 0.92.1, and
+so if the file gets compiled by a lower version, gob would generate a 
+syntax error.  Thus by putting in a requires line, you are implicitly
+requiring at least 0.92.1.
 
 .SH C++ MODE
 .PP
 There is a C++ mode so that gob creates C++ compiler friendly files.  You need
 to use the --for-cpp argument to gob.  This will make the generated file have
-a .cc instead of a .c extention, and several things will be adjusted to
+a .cc instead of a .c extension, and several things will be adjusted to
 make it all work for a C++ compiler.  One thing that will be missing is an
 alias to the new method, as that clashes with C++, so instead you'll have to
 use the full name of the method inside your code.  Also note that gob does
 not use any C++ features, this option will just make the generated code
 compile with a C++ compiler.
 
+.SH IDENTIFIER CONFLICTS
+.PP
+Gob will need to define some local varibles and functions in the generated
+files, so you need to take some precaution not to conflict with these.  The
+general rule of thumb is that all of these start with three underscores.  There
+is one, "parent_class" which doesn't because it's intended for use in your
+code.  For virtuals or signals, you cannot use the identifier __parent__
+which is used for the parent of the object.  You should actually never access
+__parent__ either as it not guaranteed that it will stay named this way.
+Data members cannot be named __parent__ nor _priv.  For methods, you cannot
+use the identifiers "init" or "class_init" unless you mean the constructor
+methods.  You shouldn't generally use 3 underscores even in override method
+argument lists and virtual and signal method names as it might confuse the
+PARENT_HANDLER macro.  In fact avoiding all names with three underscores is
+the best policy when working with gob.
+
 .SH BUGS
 .PP
 Also the lexer does not actually parse the C code, so I'm sure that some corner
index abf1d0146b727b97e187c897ba0702ec520f8857..61bd6ddf2f964602ed6ba9f375af1b7abf3ec57b 100644 (file)
@@ -1,3 +1,5 @@
+require 0.92.1
+
 %{
 #include <time.h>
 #include "my-person.h"
@@ -11,7 +13,7 @@ class My:Person from Gtk:Object {
 
        private int rounds_in_shotgun; /* number of rounds in our shotgun */
 
-       argument POINTER name
+       argument POINTER (type char *) name
        get {
                if(self->name)
                        ARG = g_strdup(self->name);
index faa5343562550e86497031e39cf7f52cab39ac6b..56b168bd12f3d0a77d6ef1ca9f0c7da0e4deddc7 100644 (file)
--- a/gob.spec
+++ b/gob.spec
@@ -1,4 +1,4 @@
-%define  ver     0.92.0
+%define  ver     0.92.1
 %define  rel     1
 %define  prefix  /usr
 
index fc6e1d1831841aefcf157ea5d74e2875a2060fbc..eecf02becdecc36faf806cf1057ae008b57f7031 100644 (file)
@@ -284,82 +284,86 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
        *yy_cp = '\0'; \
        yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 69
-#define YY_END_OF_BUFFER 70
-static yyconst short int yy_acclist[351] =
+#define YY_NUM_RULES 70
+#define YY_END_OF_BUFFER 71
+static yyconst short int yy_acclist[357] =
     {   0,
-       70,   67,   69,   66,   67,   69,    1,   68,   69,   67,
-       68,   69,   67,   69,   67,   69,   67,   69,   67,   69,
-       13,   67,   69,    1,   14,   68,   69,   13,   67,   68,
-       69,   13,   67,   69,   13,   67,   69,   32,   67,   69,
-        1,   33,   68,   69,   32,   67,   68,   69,   25,   32,
-       67,   69,   32,   67,   69,   32,   67,   69,   32,   67,
-       69,   32,   67,   69,   30,   32,   67,   69,   31,   32,
-       67,   69,   32,   67,   69,   32,   67,   69,   28,   67,
-       69,    1,   29,   68,   69,   28,   67,   68,   69,   27,
-       28,   67,   69,   28,   67,   69,   28,   67,   69,   67,
-
-       69,   67,   69,   61,   67,   69,   61,   67,   69,   61,
-       67,   69,   61,   67,   69,   61,   67,   69,   63,   67,
-       69,   67,   69,   67,   69,   59,   67,   69,   59,   67,
-       69,   67,   69,   61,   67,   69,   61,   67,   69,   61,
-       67,   69,   61,   67,   69,   61,   67,   69,   61,   67,
-       69,   61,   67,   69,   61,   67,   69,   61,   67,   69,
-       61,   67,   69,   61,   67,   69,   61,   67,   69,   64,
-       67,   69,   65,   67,   69,    8,   16,   12,    9,   24,
-       17,   26,   10,   61,   60,   61,   61,   61,   61,   59,
-       11,   59,   59,   62,   61,   61,   61,   61,   61,   61,
-
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,    3,   15,   22,   18,   20,    5,    6,   60,
-       61,   61,   61,   61,   50,   59,    7,   59,   59,   61,
-       61,   61,   61,   61,   61,   45,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       23,   19,   21,   61,   61,   36,   61,   35,   61,   61,
-       48,   61,   61,   61,   40,   61,   61,   43,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       37,   61,   34,   61,   61,   49,   61,   61,   46,   61,
-       61,   61,   61,   61,   61,   44,   61,   61,   61,   61,
-
-       39,   61,   61,   61,   61,   61,   47,   61,   61,   61,
-       61,   61,   51,   61,   56,   61,   41,   61,   38,   61,
-       61,   61,   61,   61,   58,   61,   61,   52,   61,   61,
-       61,   55,   61,   61,   54,   61,   57,   61,   61,   42,
-       61,   61,   53,   61,   61,    4,   61,    2,    2,   61
+       71,   68,   70,   67,   68,   70,    1,   69,   70,   68,
+       69,   70,   68,   70,   68,   70,   68,   70,   67,   68,
+       70,   68,   70,   68,   70,   13,   68,   70,    1,   14,
+       69,   70,   13,   68,   69,   70,   13,   68,   70,   13,
+       68,   70,   32,   68,   70,    1,   33,   69,   70,   32,
+       68,   69,   70,   25,   32,   68,   70,   32,   68,   70,
+       32,   68,   70,   32,   68,   70,   32,   68,   70,   30,
+       32,   68,   70,   31,   32,   68,   70,   32,   68,   70,
+       32,   68,   70,   28,   68,   70,    1,   29,   69,   70,
+       28,   68,   69,   70,   27,   28,   68,   70,   28,   68,
+
+       70,   28,   68,   70,   68,   70,   68,   70,   62,   68,
+       70,   62,   68,   70,   62,   68,   70,   62,   68,   70,
+       62,   68,   70,   64,   68,   70,   68,   70,   68,   70,
+       60,   68,   70,   60,   68,   70,   68,   70,   62,   68,
+       70,   62,   68,   70,   62,   68,   70,   62,   68,   70,
+       62,   68,   70,   62,   68,   70,   62,   68,   70,   62,
+       68,   70,   62,   68,   70,   62,   68,   70,   62,   68,
+       70,   62,   68,   70,   65,   68,   70,   66,   68,   70,
+        8,   16,   12,    9,   24,   17,   26,   10,   62,   61,
+       62,   62,   62,   62,   60,   11,   60,   60,   63,   62,
+
+       62,   62,   62,   62,   62,   62,   62,   62,   62,   62,
+       62,   62,   62,   62,   62,   62,   62,    3,   15,   22,
+       18,   20,    5,    6,   61,   62,   62,   62,   62,   51,
+       60,    7,   60,   60,   62,   62,   62,   62,   62,   62,
+       46,   62,   62,   62,   62,   62,   62,   62,   62,   62,
+       62,   62,   62,   62,   62,   23,   19,   21,   62,   62,
+       37,   62,   36,   62,   62,   49,   62,   62,   62,   41,
+       62,   62,   44,   62,   62,   62,   62,   62,   62,   62,
+       62,   62,   62,   62,   62,   38,   62,   34,   62,   62,
+       50,   62,   62,   47,   62,   62,   62,   62,   62,   62,
+
+       45,   62,   62,   62,   62,   40,   62,   62,   62,   62,
+       62,   48,   62,   62,   62,   62,   62,   52,   62,   57,
+       62,   42,   62,   39,   62,   62,   62,   62,   62,   59,
+       62,   62,   53,   62,   62,   62,   56,   62,   62,   55,
+       62,   58,   62,   62,   43,   62,   62,   54,   62,   62,
+        4,   62,    2,    2,   62,   35
     } ;
 
-static yyconst short int yy_accept[273] =
+static yyconst short int yy_accept[292] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    2,    4,    7,   10,   13,   15,   17,
-       19,   21,   24,   28,   32,   35,   38,   41,   45,   49,
-       53,   56,   59,   62,   65,   69,   73,   76,   79,   82,
-       86,   90,   94,   97,  100,  102,  104,  107,  110,  113,
-      116,  119,  122,  124,  126,  129,  132,  134,  137,  140,
-      143,  146,  149,  152,  155,  158,  161,  164,  167,  170,
-      173,  176,  177,  177,  177,  177,  177,  178,  179,  179,
-      179,  179,  179,  180,  180,  181,  181,  181,  182,  183,
-      184,  184,  184,  185,  186,  187,  188,  189,  190,  190,
-
-      191,  192,  192,  192,  193,  193,  193,  194,  194,  195,
-      196,  197,  198,  199,  200,  201,  202,  203,  204,  205,
-      206,  207,  208,  209,  210,  211,  212,  213,  213,  214,
-      214,  214,  215,  216,  216,  216,  216,  217,  218,  218,
-      219,  219,  219,  220,  220,  221,  222,  223,  224,  225,
-      226,  227,  227,  228,  229,  230,  230,  231,  232,  233,
-      234,  235,  236,  238,  239,  240,  241,  242,  243,  244,
-      245,  246,  247,  248,  249,  250,  251,  251,  251,  252,
-      253,  254,  254,  255,  256,  258,  260,  261,  263,  264,
-      265,  267,  268,  270,  271,  272,  273,  274,  275,  276,
-
-      277,  278,  279,  280,  281,  283,  283,  284,  284,  285,
-      286,  288,  289,  291,  292,  293,  294,  295,  296,  298,
-      299,  300,  301,  303,  304,  305,  305,  305,  306,  307,
-      309,  310,  311,  312,  313,  315,  317,  319,  321,  322,
-      323,  323,  323,  324,  325,  327,  328,  330,  331,  332,
-      334,  334,  334,  335,  337,  339,  340,  342,  342,  342,
-      343,  345,  345,  345,  346,  346,  346,  347,  348,  349,
-      351,  351
+       19,   22,   24,   26,   29,   33,   37,   40,   43,   46,
+       50,   54,   58,   61,   64,   67,   70,   74,   78,   81,
+       84,   87,   91,   95,   99,  102,  105,  107,  109,  112,
+      115,  118,  121,  124,  127,  129,  131,  134,  137,  139,
+      142,  145,  148,  151,  154,  157,  160,  163,  166,  169,
+      172,  175,  178,  181,  182,  182,  182,  182,  182,  182,
+      182,  183,  183,  184,  184,  184,  184,  184,  185,  185,
+      186,  186,  186,  187,  188,  189,  189,  189,  190,  191,
+
+      192,  193,  194,  195,  195,  196,  197,  197,  197,  198,
+      198,  198,  199,  199,  200,  201,  202,  203,  204,  205,
+      206,  207,  208,  209,  210,  211,  212,  213,  214,  215,
+      216,  217,  218,  218,  219,  219,  219,  220,  220,  221,
+      221,  221,  221,  222,  223,  223,  224,  224,  224,  225,
+      225,  226,  227,  228,  229,  230,  231,  232,  232,  233,
+      234,  235,  235,  236,  237,  238,  239,  240,  241,  243,
+      244,  245,  246,  247,  248,  249,  250,  251,  252,  253,
+      254,  255,  256,  256,  256,  256,  257,  258,  259,  259,
+      260,  261,  263,  265,  266,  268,  269,  270,  272,  273,
+
+      275,  276,  277,  278,  279,  280,  281,  282,  283,  284,
+      285,  286,  288,  288,  289,  289,  289,  290,  291,  293,
+      294,  296,  297,  298,  299,  300,  301,  303,  304,  305,
+      306,  308,  309,  310,  310,  310,  310,  311,  312,  314,
+      315,  316,  317,  318,  320,  322,  324,  326,  327,  328,
+      328,  328,  328,  329,  330,  332,  333,  335,  336,  337,
+      339,  339,  339,  339,  340,  342,  344,  345,  347,  347,
+      347,  347,  348,  350,  350,  350,  350,  351,  351,  351,
+      351,  352,  353,  354,  354,  356,  356,  356,  356,  357,
+      357
+
     } ;
 
 static yyconst int yy_ec[256] =
@@ -376,8 +380,8 @@ static yyconst int yy_ec[256] =
        30,   31,   32,    1,   22,    1,   33,   34,   35,   36,
 
        37,   38,   39,   40,   41,   22,   22,   42,   43,   44,
-       45,   46,   22,   47,   48,   49,   50,   51,   22,   52,
-       22,   22,   53,    1,   54,    1,    1,    1,    1,    1,
+       45,   46,   47,   48,   49,   50,   51,   52,   22,   53,
+       22,   22,   54,    1,   55,    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,
@@ -394,234 +398,246 @@ static yyconst int yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-static yyconst int yy_meta[55] =
+static yyconst int yy_meta[56] =
     {   0,
         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
         1,    3,    3,    3,    4,    1,    1,    5,    5,    5,
         5,    6,    6,    6,    6,    6,    6,    6,    6,    1,
         1,    1,    5,    5,    5,    5,    5,    5,    6,    6,
         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
-        6,    6,    1,    1
+        6,    6,    6,    1,    1
     } ;
 
-static yyconst short int yy_base[288] =
+static yyconst short int yy_base[307] =
     {   0,
-        0,    3,    9,   12,   36,   88,   26,   45,  142,    0,
-      187,    0,  586,  587,  587,  587,  587,    8,  559,  542,
-        2,  587,  587,  587,  572,  556,  587,  587,  587,  587,
-       15,   13,  555,    0,  587,  587,   21,  526,  587,  587,
-      587,  587,  553,    0,   34,    0,  563,   37,   11,   12,
-       18,  587,   61,   45,   68,   73,   52,   57,   82,   62,
-       64,   73,   85,   83,   86,   88,   91,   90,  189,  587,
-      587,  587,  574,  548,  542,  521,  587,  587,  565,  197,
-      564,  563,  587,  567,  587,  201,  525,  587,  587,  587,
-      565,  552,  551,  550,   95,  103,   94,  190,  554,  194,
-
-      587,  560,  197,  202,  233,    0,  242,  245,  532,   21,
-      203,  204,  211,  212,  224,  229,  238,   96,  234,  245,
-       87,  248,  249,  250,  251,  253,  255,  558,  587,  537,
-      511,  587,  587,  550,  549,  548,  587,  587,  552,  587,
-      519,  550,  587,  537,  536,  102,  257,  252,  258,  587,
-      262,  547,  587,  267,    0,  271,  272,  274,  276,  279,
-      283,  286,  534,  289,  287,  292,  293,  294,  295,  299,
-      296,  297,  300,  301,  302,  305,  528,  499,  587,  587,
-      587,  504,  303,  310,  530,  529,  312,  528,  314,  315,
-      527,  316,  526,  317,  320,  321,  323,  318,  333,  335,
-
-      334,  337,  338,  341,  525,  512,  587,  488,   99,  346,
-      522,  347,  521,  351,  356,  355,  358,  359,  520,  360,
-      363,  361,  519,  364,  365,  512,  496,  371,  370,  516,
-      372,  373,  374,  375,  515,  514,  513,  508,  380,  385,
-      491,  439,  386,  388,  455,  391,  428,  392,  390,  427,
-      422,  438,   97,  424,  423,  397,  421,  410,  415,  398,
-      410,  201,  413,  401,  186,  418,  587,  417,  587,   17,
-      587,  444,  450,  456,  462,  468,  474,  476,  480,  486,
-      492,  498,  502,  506,  512,  516,  521
+        0,    3,    9,   12,   49,  102,   19,   36,  157,    0,
+      203,    0,  624,  625,  625,  625,  625,    8,  597,  580,
+        7,    2,  584,  625,  625,  625,  609,  593,  625,  625,
+      625,  625,   15,   18,  592,    0,  625,  625,    6,  562,
+      625,  625,  625,  625,  590,    0,   21,    0,  600,   33,
+       16,   18,   28,  625,   63,   53,   69,   74,   79,   30,
+       56,   50,   70,   21,   74,   57,   79,   84,   75,   82,
+       97,  625,  625,  625,  611,  585,  579,   98,  574,  556,
+      625,  562,  625,  600,  213,  599,  598,  625,  602,  625,
+      218,  560,  625,  625,  625,  600,  587,  586,  585,  102,
+
+      104,  105,  106,  589,  127,  625,  595,  131,  139,  209,
+        0,  214,  218,  567,  109,  121,  219,  210,  214,  227,
+      220,  222,  232,  236,  238,  228,  231,  241,  245,  249,
+      256,  114,  593,  625,  572,  545,  625,  542,  625,  584,
+      583,  582,  625,  625,  586,  625,  553,  584,  625,  571,
+      570,  259,  260,  262,  263,  625,  272,  581,  625,  275,
+        0,  282,  266,  276,  277,  282,  284,  285,  568,  286,
+      287,  288,  291,  292,  295,  293,  296,  298,  300,  305,
+      304,  308,  562,  532,  539,  625,  625,  625,  537,  313,
+      306,  563,  562,  307,  561,  314,  315,  560,  316,  559,
+
+      317,  319,  323,  324,  332,  333,  337,  336,  338,  345,
+      343,  558,  545,  625,  523,  519,  348,  344,  554,  353,
+      553,  347,  354,  357,  361,  362,  552,  363,  364,  365,
+      551,  370,  371,  544,  527,  527,  113,  372,  547,  373,
+      374,  376,  378,  546,  545,  544,  539,  383,  384,  522,
+      458,  464,  388,  386,  457,  387,  456,  393,  391,  455,
+      450,  466,  465,  403,  441,  433,  396,  423,  401,  421,
+      424,  422,  397,  389,  429,  414,  429,   22,  438,  440,
+      625,  432,  625,  448,   11,  441,  461,  463,  625,  625,
+      475,  481,  487,  493,  499,  505,  507,  511,  517,  523,
+
+      529,  533,  537,  543,  547,  552
     } ;
 
-static yyconst short int yy_def[288] =
+static yyconst short int yy_def[307] =
     {   0,
-      272,  272,  273,  273,  274,  274,  275,  275,  271,    9,
-        9,   11,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  276,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  277,  271,  278,  279,  279,  279,  279,
-      279,  271,  271,  271,  271,  271,  271,  279,  279,  279,
-      279,  279,  279,  279,  279,  279,  279,  279,  279,  271,
-      271,  271,  280,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  281,  271,  271,  271,  271,  271,  271,
-      282,  283,  279,  284,  279,  279,  279,  279,  271,  271,
-
-      271,  285,  271,  271,  271,  286,  271,  271,  271,  279,
-      279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
-      279,  279,  279,  279,  279,  279,  279,  280,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  281,  271,
-      271,  282,  271,  283,  284,  279,  279,  279,  279,  271,
-      271,  285,  271,  271,  286,  271,  279,  279,  279,  279,
-      279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
-      279,  279,  279,  279,  279,  279,  271,  271,  271,  271,
-      271,  271,  279,  279,  279,  279,  279,  279,  279,  279,
-      279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
-
-      279,  279,  279,  279,  279,  271,  271,  271,  279,  279,
-      279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
-      279,  279,  279,  279,  279,  271,  271,  279,  279,  279,
-      279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
-      271,  271,  279,  279,  279,  279,  279,  279,  279,  279,
-      271,  271,  279,  279,  279,  279,  279,  271,  271,  279,
-      279,  271,  287,  279,  271,  287,  271,  279,  271,  279,
-        0,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271
+      291,  291,  292,  292,  293,  293,  294,  294,  290,    9,
+        9,   11,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  295,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  296,  290,  297,  298,  298,
+      298,  298,  298,  290,  290,  290,  290,  290,  290,  298,
+      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
+      298,  290,  290,  290,  299,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  300,  290,
+      290,  290,  290,  290,  290,  301,  302,  298,  303,  298,
+
+      298,  298,  298,  290,  290,  290,  304,  290,  290,  290,
+      305,  290,  290,  290,  298,  298,  298,  298,  298,  298,
+      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
+      298,  298,  299,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  300,  290,  290,  301,  290,  302,
+      303,  298,  298,  298,  298,  290,  290,  304,  290,  290,
+      305,  290,  298,  298,  298,  298,  298,  298,  298,  298,
+      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
+      298,  298,  290,  290,  290,  290,  290,  290,  290,  298,
+      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
+
+      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
+      298,  298,  290,  290,  290,  290,  298,  298,  298,  298,
+      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
+      298,  298,  298,  290,  290,  290,  298,  298,  298,  298,
+      298,  298,  298,  298,  298,  298,  298,  298,  298,  290,
+      290,  290,  298,  298,  298,  298,  298,  298,  298,  298,
+      290,  290,  290,  298,  298,  298,  298,  298,  290,  290,
+      290,  298,  298,  290,  290,  306,  298,  290,  290,  306,
+      290,  298,  290,  290,  298,  290,  290,  290,  290,    0,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+
+      290,  290,  290,  290,  290,  290
     } ;
 
-static yyconst short int yy_nxt[642] =
+static yyconst short int yy_nxt[681] =
     {   0,
-      271,   15,   16,   17,   15,   16,   17,  271,  271,   21,
-       18,   23,   24,   18,   23,   24,   72,   25,   73,   79,
-       25,   83,   86,   84,   19,   94,   94,   19,   40,   41,
-       42,   94,   94,   26,   20,   94,   26,   20,   28,   29,
-       30,   76,   90,   31,   91,   80,   32,   40,   41,   42,
-       43,   94,   96,  101,   77,  102,   44,   98,   97,  157,
-       33,   87,   95,  108,  108,  108,   34,   81,   82,   43,
-       99,   94,  100,  100,  100,   44,   94,  103,   94,  104,
-      104,  105,  103,  109,  107,  107,  107,   94,   35,   36,
-       28,   29,   30,   37,   38,   31,   94,   94,   32,   94,
-
-       94,   94,   94,  110,   94,   94,  113,  114,   94,   94,
-       94,   94,   33,   94,  115,  260,   94,   94,   34,  106,
-      169,  111,  146,   96,  183,  228,  112,  117,  116,  118,
-      122,  123,  165,  125,  120,  147,  119,  121,  148,  124,
-       35,   36,   14,   15,   16,   17,   14,   14,   14,   14,
-       14,   14,   45,   14,   14,   14,   46,   14,   14,   47,
-       47,   47,   47,   47,   47,   47,   48,   47,   47,   47,
-       47,   14,   14,   14,   47,   47,   49,   47,   47,   50,
-       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
-       51,   47,   47,   47,   52,   14,   53,   54,   55,   56,
-
-       56,  134,   86,   94,   94,  151,  151,  151,  154,  154,
-      154,  103,  269,  104,  104,  105,   57,   94,   94,   58,
-      265,   59,   60,   61,   62,   94,   94,   63,   64,  126,
-      149,   65,   66,  127,   67,  158,   68,   69,   94,   70,
-       71,   87,  103,   94,  105,  105,  105,  159,   94,  135,
-      136,  103,   94,  107,  107,  107,  108,  108,  108,   94,
-      160,  161,   94,   94,   94,   94,   94,   94,  162,   94,
-      166,   94,   94,  151,  151,  151,  109,  163,  154,  154,
-      154,  164,  108,  108,  108,  167,   94,  171,   94,  168,
-       94,  173,  170,   94,  185,  176,  172,   94,  174,  175,
-
-       94,   94,  109,   94,  184,  186,   94,   94,   94,   94,
-       94,   94,  190,   94,   94,   94,   94,   94,  192,   94,
-      188,  187,  209,  189,   94,  191,   94,  193,   94,   94,
-       94,   94,   94,  194,   94,   94,  198,   94,  195,  200,
-      205,  203,  197,  196,  202,  199,  201,   94,   94,   94,
-      204,   94,   94,  216,  210,   94,  212,  186,  218,  217,
-       94,   94,  211,  214,  213,   94,  215,  220,  222,   94,
-       94,  221,   94,   94,   94,   94,  224,   94,   94,   94,
-      223,  219,  229,  230,   94,   94,   94,   94,   94,   94,
-      225,  243,  234,  235,   94,  231,  232,  240,  237,   94,
-
-       94,  236,   94,  233,   94,   94,   94,  239,  246,  238,
-      247,   94,   94,  244,  253,   94,  249,  267,  245,  263,
-      268,  264,  267,  248,   94,  257,  250,  255,  256,  267,
-      263,   94,  261,  262,  267,   94,  254,   94,   94,  259,
-      258,   94,   94,  270,   14,   14,   14,   14,   14,   14,
-       22,   22,   22,   22,   22,   22,   27,   27,   27,   27,
-       27,   27,   39,   39,   39,   39,   39,   39,   85,   94,
-       85,   85,   85,   85,   89,  252,   89,   89,   89,   89,
-       92,   92,   93,   93,   93,   93,  128,  128,  128,  128,
-      128,  128,  139,  139,  139,  139,  139,  139,  142,  142,
-
-      142,  142,  142,  142,  144,  144,  144,  144,  145,  145,
-      145,  145,  152,  152,  152,  152,  152,  152,  155,  251,
-      155,  266,   94,  266,  266,  266,  266,   94,   94,   94,
-       94,  242,  241,   94,   94,   94,   94,  227,  226,   94,
-       94,   94,   94,   94,   94,  208,  207,  206,   94,  153,
-       94,   94,  143,  182,  140,  181,  180,  179,  178,  177,
-      129,  156,  153,  150,   94,   94,   94,  143,  141,  140,
-      138,  137,  133,  132,  131,  130,  129,   94,   74,   88,
-       74,   74,   78,   75,   74,  271,   13,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271
+      290,   15,   16,   17,   21,   16,   17,   91,   78,   22,
+       18,   25,   26,   18,   25,   26,   74,   27,   75,   84,
+       27,   42,   43,   44,   19,   99,   88,   19,   89,   95,
+       99,   96,   99,   28,   20,   99,   28,   20,   42,   43,
+       44,   80,   99,   45,   99,   85,   92,   99,  283,   46,
+       23,   30,   31,   32,   79,   81,   33,  101,  100,   34,
+       45,  106,  120,  107,   99,  102,   46,  103,   86,   87,
+       99,   99,  104,   35,  105,  105,  105,  115,  108,   36,
+      109,  109,  110,  108,   99,  112,  112,  112,   99,   99,
+      113,  113,  113,   99,  118,  116,   99,  101,   99,   78,
+
+      117,  122,   37,   38,   30,   31,   32,   39,   40,   33,
+      114,   99,   34,  119,  127,  128,   99,  121,   99,   99,
+       99,  111,  123,   99,  129,  130,   35,   99,   99,  152,
+      124,  125,   36,  253,  126,   99,  153,  131,  157,  157,
+      157,  132,  160,  160,  160,   79,  155,  163,  108,  154,
+      109,  109,  110,  164,  182,   37,   38,   14,   15,   16,
+       17,   14,   14,   14,   14,   14,   14,   47,   14,   14,
+       14,   48,   14,   14,   49,   49,   49,   49,   49,   49,
+       49,   50,   49,   49,   49,   49,   14,   14,   14,   49,
+       49,   51,   49,   49,   52,   49,   49,   49,   49,   49,
+
+       49,   49,   49,   49,   49,   49,   53,   49,   49,   49,
+       54,   14,   55,   56,   57,   58,   58,  140,  108,   91,
+      110,  110,  110,  108,   99,  112,  112,  112,   99,  113,
+      113,  113,   59,   99,   99,   60,   99,   61,   62,   63,
+       64,   99,   99,   65,   66,   99,   99,   67,   68,  114,
+       99,   69,   99,   70,   71,   99,   72,   73,   92,   99,
+      166,  175,  165,   99,  167,  170,  141,  142,  171,  169,
+       99,  168,  172,   99,   99,  176,   99,   99,  173,  177,
+       99,  190,  174,  157,  157,  157,  160,  160,  160,  179,
+       99,   99,  178,  113,  113,  113,   99,  180,   99,   99,
+
+       99,   99,   99,  181,  192,   99,   99,   99,  191,   99,
+       99,  193,   99,  114,   99,  197,  194,  199,   99,   99,
+       99,   99,   99,  195,  200,  196,  198,   99,   99,   99,
+       99,   99,  217,   99,  201,  202,  205,   99,   99,  207,
+      206,  204,  203,  212,  209,  210,   99,   99,  208,  218,
+       99,   99,   99,  211,  193,  224,  220,   99,   99,   99,
+      225,   99,   99,  219,  222,  221,  223,   99,   99,  228,
+      230,   99,  226,  229,  237,   99,   99,   99,   99,   99,
+      238,  231,  227,  232,   99,   99,   99,   99,   99,  239,
+       99,  240,   99,  233,  241,  243,  244,   99,   99,  246,
+
+       99,   99,   99,  249,  245,   99,  242,   99,  278,  256,
+       99,   99,  257,  248,  247,  254,  264,   99,  281,  259,
+      255,  272,  270,  266,  274,  260,  268,  258,  276,  267,
+      281,  273,  275,  275,  275,  265,   99,   99,  279,  276,
+      275,  275,  275,   99,  281,  277,   99,   99,  282,  284,
+      284,  284,  287,  287,  287,   99,  281,  286,  285,  284,
+      284,  284,  288,  289,  288,  289,  271,  270,  269,   99,
+       99,   99,  287,  287,  287,   14,   14,   14,   14,   14,
+       14,   24,   24,   24,   24,   24,   24,   29,   29,   29,
+       29,   29,   29,   41,   41,   41,   41,   41,   41,   90,
+
+      263,   90,   90,   90,   90,   94,  262,   94,   94,   94,
+       94,   97,   97,   98,   98,   98,   98,  133,  133,  133,
+      133,  133,  133,  145,  145,  145,  145,  145,  145,  148,
+      148,  148,  148,  148,  148,  150,  150,  150,  150,  151,
+      151,  151,  151,  158,  158,  158,  158,  158,  158,  161,
+      261,  161,  280,   99,  280,  280,  280,  280,   99,   99,
+       99,   99,  252,  251,  250,   99,   99,   99,   99,  236,
+      235,  234,   99,   99,   99,   99,   99,   99,  216,  215,
+      214,  213,   99,  159,   99,   99,  149,  189,  146,  188,
+      187,  186,  185,  184,  183,  134,  162,  159,  156,   99,
+
+       99,   99,  149,  147,  146,  144,  143,  139,  138,  137,
+       82,  136,  135,  134,   99,   76,   93,   76,   76,   83,
+       82,   77,   76,  290,   13,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290
     } ;
 
-static yyconst short int yy_chk[642] =
+static yyconst short int yy_chk[681] =
     {   0,
-        0,    1,    1,    1,    2,    2,    2,    0,    0,    2,
-        1,    3,    3,    2,    4,    4,   18,    3,   18,   31,
-        4,   32,   37,   32,    1,   49,   50,    2,    7,    7,
-        7,  270,   51,    3,    1,  110,    4,    2,    5,    5,
-        5,   21,   45,    5,   45,   31,    5,    8,    8,    8,
-        7,   48,   49,   54,   21,   54,    7,   51,   50,  110,
-        5,   37,   48,   57,   57,   57,    5,   31,   31,    8,
-       53,   58,   53,   53,   53,    8,   60,   55,   61,   55,
-       55,   55,   56,   57,   56,   56,   56,   62,    5,    5,
-        6,    6,    6,    6,    6,    6,   59,   64,    6,   63,
-
-       65,  121,   66,   58,   68,   67,   60,   61,   97,   95,
-      118,  253,    6,  209,   62,  253,  146,   96,    6,   55,
-      121,   59,   95,   59,  146,  209,   59,   64,   63,   65,
-       67,   67,  118,   68,   66,   96,   65,   66,   97,   67,
-        6,    6,    9,    9,    9,    9,    9,    9,    9,    9,
+        0,    1,    1,    1,    2,    2,    2,   39,   21,    2,
+        1,    3,    3,    2,    4,    4,   18,    3,   18,   33,
+        4,    7,    7,    7,    1,  285,   34,    2,   34,   47,
+       51,   47,   52,    3,    1,   64,    4,    2,    8,    8,
+        8,   22,   53,    7,   60,   33,   39,   50,  278,    7,
+        2,    5,    5,    5,   21,   22,    5,   51,   50,    5,
+        8,   56,   64,   56,   62,   52,    8,   53,   33,   33,
+       61,   66,   55,    5,   55,   55,   55,   60,   57,    5,
+       57,   57,   57,   58,   63,   58,   58,   58,   65,   69,
+       59,   59,   59,   67,   62,   61,   70,   61,   68,   78,
+
+       61,   66,    5,    5,    6,    6,    6,    6,    6,    6,
+       59,   71,    6,   63,   69,   69,  100,   65,  101,  102,
+      103,   57,   67,  115,   69,   70,    6,  237,  132,  100,
+       67,   68,    6,  237,   68,  116,  101,   71,  105,  105,
+      105,   71,  108,  108,  108,   78,  103,  115,  109,  102,
+      109,  109,  109,  116,  132,    6,    6,    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,   11,
-
-       11,   80,   86,   69,   98,  100,  100,  100,  103,  103,
-      103,  104,  265,  104,  104,  104,   11,  111,  112,   11,
-      262,   11,   11,   11,   11,  113,  114,   11,   11,   69,
-       98,   11,   11,   69,   11,  111,   11,   11,  115,   11,
-       11,   86,  105,  116,  105,  105,  105,  112,  119,   80,
-       80,  107,  117,  107,  107,  107,  108,  108,  108,  120,
-      113,  114,  122,  123,  124,  125,  148,  126,  115,  127,
-      119,  147,  149,  151,  151,  151,  108,  116,  154,  154,
-      154,  117,  156,  156,  156,  120,  157,  123,  158,  120,
-      159,  125,  122,  160,  148,  127,  124,  161,  125,  126,
-
-      162,  165,  156,  164,  147,  149,  166,  167,  168,  169,
-      171,  172,  160,  170,  173,  174,  175,  183,  162,  176,
-      158,  157,  183,  159,  184,  161,  187,  164,  189,  190,
-      192,  194,  198,  165,  195,  196,  169,  197,  166,  171,
-      176,  174,  168,  167,  173,  170,  172,  199,  201,  200,
-      175,  202,  203,  196,  187,  204,  190,  184,  198,  197,
-      210,  212,  189,  194,  192,  214,  195,  200,  201,  216,
-      215,  200,  217,  218,  220,  222,  203,  221,  224,  225,
-      202,  199,  210,  212,  229,  228,  231,  232,  233,  234,
-      204,  228,  217,  218,  239,  214,  215,  225,  221,  240,
-
-      243,  220,  244,  216,  249,  246,  248,  224,  232,  222,
-      233,  256,  260,  229,  243,  264,  239,  263,  231,  259,
-      264,  260,  266,  234,  261,  249,  240,  246,  248,  263,
-      259,  268,  256,  258,  266,  257,  244,  255,  254,  252,
-      251,  250,  247,  268,  272,  272,  272,  272,  272,  272,
-      273,  273,  273,  273,  273,  273,  274,  274,  274,  274,
-      274,  274,  275,  275,  275,  275,  275,  275,  276,  245,
-      276,  276,  276,  276,  277,  242,  277,  277,  277,  277,
-      278,  278,  279,  279,  279,  279,  280,  280,  280,  280,
-      280,  280,  281,  281,  281,  281,  281,  281,  282,  282,
-
-      282,  282,  282,  282,  283,  283,  283,  283,  284,  284,
-      284,  284,  285,  285,  285,  285,  285,  285,  286,  241,
-      286,  287,  238,  287,  287,  287,  287,  237,  236,  235,
-      230,  227,  226,  223,  219,  213,  211,  208,  206,  205,
-      193,  191,  188,  186,  185,  182,  178,  177,  163,  152,
-      145,  144,  142,  141,  139,  136,  135,  134,  131,  130,
-      128,  109,  102,   99,   94,   93,   92,   91,   87,   84,
-       82,   81,   79,   76,   75,   74,   73,   47,   43,   38,
-       33,   26,   25,   20,   19,   13,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271,  271,  271,  271,  271,  271,  271,  271,  271,  271,
-      271
+        9,    9,   11,   11,   11,   11,   11,   85,  110,   91,
+      110,  110,  110,  112,  118,  112,  112,  112,  119,  113,
+      113,  113,   11,  117,  121,   11,  122,   11,   11,   11,
+       11,  120,  126,   11,   11,  127,  123,   11,   11,  113,
+      124,   11,  125,   11,   11,  128,   11,   11,   91,  129,
+      118,  126,  117,  130,  119,  122,   85,   85,  123,  121,
+      131,  120,  124,  152,  153,  127,  154,  155,  125,  128,
+      163,  152,  125,  157,  157,  157,  160,  160,  160,  130,
+      164,  165,  129,  162,  162,  162,  166,  130,  167,  168,
+
+      170,  171,  172,  131,  154,  173,  174,  176,  153,  175,
+      177,  155,  178,  162,  179,  166,  163,  168,  181,  180,
+      191,  194,  182,  164,  170,  165,  167,  190,  196,  197,
+      199,  201,  190,  202,  171,  172,  175,  203,  204,  177,
+      176,  174,  173,  182,  179,  180,  205,  206,  178,  194,
+      208,  207,  209,  181,  191,  203,  197,  211,  218,  210,
+      204,  222,  217,  196,  201,  199,  202,  220,  223,  207,
+      208,  224,  205,  207,  217,  225,  226,  228,  229,  230,
+      218,  209,  206,  210,  232,  233,  238,  240,  241,  220,
+      242,  222,  243,  211,  223,  225,  226,  248,  249,  229,
+
+      254,  256,  253,  233,  228,  259,  224,  258,  274,  241,
+      267,  273,  242,  232,  230,  238,  253,  264,  276,  248,
+      240,  264,  270,  256,  269,  249,  259,  243,  271,  258,
+      276,  267,  270,  270,  270,  254,  272,  268,  275,  271,
+      275,  275,  275,  277,  280,  272,  282,  266,  277,  279,
+      279,  279,  286,  286,  286,  265,  280,  284,  282,  284,
+      284,  284,  287,  287,  288,  288,  263,  262,  261,  260,
+      257,  255,  287,  287,  287,  291,  291,  291,  291,  291,
+      291,  292,  292,  292,  292,  292,  292,  293,  293,  293,
+      293,  293,  293,  294,  294,  294,  294,  294,  294,  295,
+
+      252,  295,  295,  295,  295,  296,  251,  296,  296,  296,
+      296,  297,  297,  298,  298,  298,  298,  299,  299,  299,
+      299,  299,  299,  300,  300,  300,  300,  300,  300,  301,
+      301,  301,  301,  301,  301,  302,  302,  302,  302,  303,
+      303,  303,  303,  304,  304,  304,  304,  304,  304,  305,
+      250,  305,  306,  247,  306,  306,  306,  306,  246,  245,
+      244,  239,  236,  235,  234,  231,  227,  221,  219,  216,
+      215,  213,  212,  200,  198,  195,  193,  192,  189,  185,
+      184,  183,  169,  158,  151,  150,  148,  147,  145,  142,
+      141,  140,  138,  136,  135,  133,  114,  107,  104,   99,
+
+       98,   97,   96,   92,   89,   87,   86,   84,   82,   80,
+       79,   77,   76,   75,   49,   45,   40,   35,   28,   27,
+       23,   20,   19,   13,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290,
+      290,  290,  290,  290,  290,  290,  290,  290,  290,  290
     } ;
 
 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
@@ -715,7 +731,7 @@ add_to_cbuf(char *s)
 
 #define CLASS_CODE_I 5
 
-#line 719 "lex.yy.c"
+#line 735 "lex.yy.c"
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -872,7 +888,7 @@ YY_DECL
 #line 74 "lexer.l"
 
 
-#line 876 "lex.yy.c"
+#line 892 "lex.yy.c"
 
        if ( yy_init )
                {
@@ -921,14 +937,14 @@ yy_match:
                        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 >= 272 )
+                               if ( yy_current_state >= 291 )
                                        yy_c = yy_meta[(unsigned int) yy_c];
                                }
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
                        *yy_state_ptr++ = yy_current_state;
                        ++yy_cp;
                        }
-               while ( yy_base[yy_current_state] != 587 );
+               while ( yy_base[yy_current_state] != 625 );
 
 yy_find_action:
                yy_current_state = *--yy_state_ptr;
@@ -1218,8 +1234,38 @@ YY_RULE_SETUP
                }
        YY_BREAK
 case 35:
+*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 198 "lexer.l"
+{
+                       int maj = 0,min = 0,pl = 0;
+                       int rmaj = 0,rmin = 0,rpl = 0;
+                       char *p;
+                       
+                       sscanf(VERSION,"%d.%d.%d",&rmaj,&rmin,&rpl);
+                       p = strchr(yytext,'r');
+                       g_assert(p); /* we MUST have found it */
+                       sscanf(p,"requires %d.%d.%d",&maj,&min,&pl);
+                       if(rmaj < maj ||
+                          (rmaj == maj && rmin < min) ||
+                          (rmaj == maj && rmin == min && rpl < pl)) {
+                               char *s;
+                               s = g_strdup_printf(
+                                   "GOB version %d.%d.%d required "
+                                   "(this is %s)\n"
+                                   "To upgrade your gob, see: "
+                                   "http://www.5z.com/jirka/gob.html",
+                                   maj,min,pl,VERSION);
+                               print_error(FALSE,s, line_no);
+                               g_free(s);
+                       }
+               }
+       YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 222 "lexer.l"
 {
                        if(for_cpp) {
                                char *s;
@@ -1232,164 +1278,164 @@ YY_RULE_SETUP
                        REJECT;
                }
        YY_BREAK
-case 36:
+case 37:
 YY_RULE_SETUP
-#line 210 "lexer.l"
+#line 234 "lexer.l"
 {return FROM;}
        YY_BREAK
-case 37:
+case 38:
 YY_RULE_SETUP
-#line 212 "lexer.l"
+#line 236 "lexer.l"
 {return VOID;}
        YY_BREAK
-case 38:
+case 39:
 YY_RULE_SETUP
-#line 213 "lexer.l"
+#line 237 "lexer.l"
 {return STRUCT;}
        YY_BREAK
-case 39:
+case 40:
 YY_RULE_SETUP
-#line 214 "lexer.l"
+#line 238 "lexer.l"
 {return UNION;}
        YY_BREAK
-case 40:
+case 41:
 YY_RULE_SETUP
-#line 215 "lexer.l"
+#line 239 "lexer.l"
 {return ENUM;}
        YY_BREAK
-case 41:
+case 42:
 YY_RULE_SETUP
-#line 216 "lexer.l"
+#line 240 "lexer.l"
 {return SIGNED;}
        YY_BREAK
-case 42:
+case 43:
 YY_RULE_SETUP
-#line 217 "lexer.l"
+#line 241 "lexer.l"
 {return UNSIGNED;}
        YY_BREAK
-case 43:
+case 44:
 YY_RULE_SETUP
-#line 218 "lexer.l"
+#line 242 "lexer.l"
 {return LONG;}
        YY_BREAK
-case 44:
+case 45:
 YY_RULE_SETUP
-#line 219 "lexer.l"
+#line 243 "lexer.l"
 {return SHORT;}
        YY_BREAK
-case 45:
+case 46:
 YY_RULE_SETUP
-#line 220 "lexer.l"
+#line 244 "lexer.l"
 {return INT;}
        YY_BREAK
-case 46:
+case 47:
 YY_RULE_SETUP
-#line 221 "lexer.l"
+#line 245 "lexer.l"
 {return FLOAT;}
        YY_BREAK
-case 47:
+case 48:
 YY_RULE_SETUP
-#line 222 "lexer.l"
+#line 246 "lexer.l"
 {return DOUBLE;}
        YY_BREAK
-case 48:
+case 49:
 YY_RULE_SETUP
-#line 223 "lexer.l"
+#line 247 "lexer.l"
 {return CHAR;}
        YY_BREAK
-case 49:
+case 50:
 YY_RULE_SETUP
-#line 224 "lexer.l"
+#line 248 "lexer.l"
 {return CONST;}
        YY_BREAK
-case 50:
+case 51:
 YY_RULE_SETUP
-#line 226 "lexer.l"
+#line 250 "lexer.l"
 {return THREEDOTS;}
        YY_BREAK
-case 51:
+case 52:
 YY_RULE_SETUP
-#line 228 "lexer.l"
+#line 252 "lexer.l"
 {yylval.line = line_no; return PUBLIC;}
        YY_BREAK
-case 52:
+case 53:
 YY_RULE_SETUP
-#line 229 "lexer.l"
+#line 253 "lexer.l"
 {yylval.line = line_no; return PRIVATE;}
        YY_BREAK
-case 53:
+case 54:
 YY_RULE_SETUP
-#line 230 "lexer.l"
+#line 254 "lexer.l"
 {yylval.line = line_no; return PROTECTED;}
        YY_BREAK
-case 54:
+case 55:
 YY_RULE_SETUP
-#line 231 "lexer.l"
+#line 255 "lexer.l"
 {yylval.line = line_no; return ARGUMENT;}
        YY_BREAK
-case 55:
+case 56:
 YY_RULE_SETUP
-#line 232 "lexer.l"
+#line 256 "lexer.l"
 {yylval.line = line_no; return VIRTUAL;}
        YY_BREAK
-case 56:
+case 57:
 YY_RULE_SETUP
-#line 233 "lexer.l"
+#line 257 "lexer.l"
 {yylval.line = line_no; return SIGNAL;}
        YY_BREAK
-case 57:
+case 58:
 YY_RULE_SETUP
-#line 234 "lexer.l"
+#line 258 "lexer.l"
 {yylval.line = line_no; return OVERRIDE;}
        YY_BREAK
-case 58:
+case 59:
 YY_RULE_SETUP
-#line 235 "lexer.l"
+#line 259 "lexer.l"
 {return ONERROR;}
        YY_BREAK
-case 59:
+case 60:
 YY_RULE_SETUP
-#line 236 "lexer.l"
+#line 260 "lexer.l"
 {
                        yylval.id = g_strdup(yytext);
                        return NUMBER;
                }
        YY_BREAK
-case 60:
+case 61:
 YY_RULE_SETUP
-#line 240 "lexer.l"
+#line 264 "lexer.l"
 {
                        yylval.id = g_strdup(yytext);
                        return TYPETOKEN;
                }
        YY_BREAK
-case 61:
+case 62:
 YY_RULE_SETUP
-#line 244 "lexer.l"
+#line 268 "lexer.l"
 {
                        yylval.id = g_strdup(yytext);
                        return TOKEN;
                }
        YY_BREAK
-case 62:
+case 63:
 YY_RULE_SETUP
-#line 249 "lexer.l"
+#line 273 "lexer.l"
 {
                        yylval.id = g_strdup(yytext);
                        return ARRAY_DIM;
                }
        YY_BREAK
-case 63:
+case 64:
 YY_RULE_SETUP
-#line 254 "lexer.l"
+#line 278 "lexer.l"
 {
                        BEGIN(CLASS_CODE_I);
                        return '{';
                }
        YY_BREAK
-case 64:
+case 65:
 YY_RULE_SETUP
-#line 258 "lexer.l"
+#line 282 "lexer.l"
 {
                        BEGIN(C_CODE);
                        parenth_depth=1;
@@ -1400,38 +1446,38 @@ YY_RULE_SETUP
                        return '{';
                }
        YY_BREAK
-case 65:
+case 66:
 YY_RULE_SETUP
-#line 267 "lexer.l"
+#line 291 "lexer.l"
 {
                                BEGIN(INITIAL);
                                return '}';
                        }
        YY_BREAK
-case 66:
+case 67:
 YY_RULE_SETUP
-#line 272 "lexer.l"
+#line 296 "lexer.l"
 ;  /*ignore*/
        YY_BREAK
-case 67:
+case 68:
 YY_RULE_SETUP
-#line 274 "lexer.l"
+#line 298 "lexer.l"
 {
                        yylval.line = line_no;
                        return yytext[0];
                }
        YY_BREAK
-case 68:
+case 69:
 YY_RULE_SETUP
-#line 279 "lexer.l"
+#line 303 "lexer.l"
 ;  /*ignore*/
        YY_BREAK
-case 69:
+case 70:
 YY_RULE_SETUP
-#line 280 "lexer.l"
+#line 304 "lexer.l"
 ECHO;
        YY_BREAK
-#line 1435 "lex.yy.c"
+#line 1481 "lex.yy.c"
                        case YY_STATE_EOF(INITIAL):
                        case YY_STATE_EOF(COMMENT):
                        case YY_STATE_EOF(C_CODE):
@@ -1726,7 +1772,7 @@ static yy_state_type yy_get_previous_state()
                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 >= 272 )
+                       if ( yy_current_state >= 291 )
                                yy_c = yy_meta[(unsigned int) yy_c];
                        }
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1756,11 +1802,11 @@ yy_state_type yy_current_state;
        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 >= 272 )
+               if ( yy_current_state >= 291 )
                        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 == 271);
+       yy_is_jam = (yy_current_state == 290);
        if ( ! yy_is_jam )
                *yy_state_ptr++ = yy_current_state;
 
@@ -2318,4 +2364,4 @@ int main()
        return 0;
        }
 #endif
-#line 280 "lexer.l"
+#line 304 "lexer.l"
index d80b927394a82931b20f8b5bfe534871c0e011ee..392a6364aad9fe21548648fc56e3beea115a2eb8 100644 (file)
@@ -195,6 +195,30 @@ class              {
                        return CLASS;
                }
 
+^[ \t]*requires[ \t]+[0-9]+\.[0-9]+\.[0-9]+[\t ]*$     {
+                       int maj = 0,min = 0,pl = 0;
+                       int rmaj = 0,rmin = 0,rpl = 0;
+                       char *p;
+                       
+                       sscanf(VERSION,"%d.%d.%d",&rmaj,&rmin,&rpl);
+                       p = strchr(yytext,'r');
+                       g_assert(p); /* we MUST have found it */
+                       sscanf(p,"requires %d.%d.%d",&maj,&min,&pl);
+                       if(rmaj < maj ||
+                          (rmaj == maj && rmin < min) ||
+                          (rmaj == maj && rmin == min && rpl < pl)) {
+                               char *s;
+                               s = g_strdup_printf(
+                                   "GOB version %d.%d.%d required "
+                                   "(this is %s)\n"
+                                   "To upgrade your gob, see: "
+                                   "http://www.5z.com/jirka/gob.html",
+                                   maj,min,pl,VERSION);
+                               print_error(FALSE,s, line_no);
+                               g_free(s);
+                       }
+               }
+
 <CLASS_CODE,CLASS_CODE_I>class|this    {
                        if(for_cpp) {
                                char *s;
index b429ef991362f324e2710f5274c51410e944e975..d58aef46636ea6ab001ab8e28e5a1d4144f7fd3c 100644 (file)
@@ -71,6 +71,7 @@ FILE *outph = NULL;
 
 gboolean no_touch_headers = FALSE;
 gboolean for_cpp = FALSE;
+gboolean no_gnu = FALSE;
 gboolean exit_on_warn = FALSE;
 gboolean exit_on_error = TRUE;
 gboolean got_error = FALSE;
@@ -189,17 +190,19 @@ make_bases(void)
        ptypebase = remove_sep(((Class *)class)->ptype);
 }
 
-static void
-print_type(FILE *fp, Type *t, gboolean postfix_to_stars)
+static char *
+get_type(Type *t, gboolean postfix_to_stars)
 {
        char *s;
        int i;
        int extra;
+       GString *gs;
 
        s = remove_sep(t->name);
-       out_printf(fp,"%s ",s); 
+       gs = g_string_new(s);
        g_free(s);
 
+
        extra = 0;
        if(postfix_to_stars) {
                char *p;
@@ -210,11 +213,27 @@ print_type(FILE *fp, Type *t, gboolean postfix_to_stars)
                for(p=t->postfix; p && *p; p++)
                        if(*p == '[') extra++;
        }
+       g_string_append_c(gs,' ');
        
        for(i=0;i<(t->stars+extra);i++)
-               out_printf(fp,"*"); 
+               g_string_append_c(gs,'*');
+
+       s = gs->str;
+       g_string_free(gs,FALSE);
+       return s;
 }
 
+static void
+print_type(FILE *fp, Type *t, gboolean postfix_to_stars)
+{
+       char *s;
+
+       s = get_type(t,postfix_to_stars);
+       out_printf(fp,"%s",s); 
+       g_free(s);
+}
+
+
 static void
 print_method(FILE *fp, char *typeprefix, char *nameprefix,
             char *namepostfix,char *postfix, Method *m,
@@ -254,11 +273,39 @@ print_method(FILE *fp, char *typeprefix, char *nameprefix,
 
 
 static void
-make_method_pointers(Class *c)
+make_method_gnu_aliases(Class *c)
+{
+       GList *li;
+       
+       for(li=c->nodes;li;li=g_list_next(li)) {
+               Node *node = li->data;
+               if(node->type == METHOD_NODE) {
+                       Method *m = (Method *)node;
+                       
+                       if(m->method == INIT_METHOD ||
+                          m->method == CLASS_INIT_METHOD ||
+                          m->method == OVERRIDE_METHOD)
+                               continue;
+
+                       /* in C++ mode don't alias new */
+                       if(for_cpp && strcmp(m->id, "new")==0)
+                               continue;
+
+                       out_printf(out, "static const typeof(&%s_%s) %s "
+                                  "__attribute__ ((__unused__)) "
+                                  "= %s_%s;\n", funcbase, m->id, m->id,
+                                  funcbase, m->id);
+                       out_printf(out, "#define %s(args...) "
+                                  "%s_%s(##args)\n", m->id, funcbase, m->id);
+               }
+       }
+}
+
+static void
+make_method_nongnu_aliases(Class *c)
 {
        GList *li;
        
-       out_printf(out,"\n");
        for(li=c->nodes;li;li=g_list_next(li)) {
                Node *node = li->data;
                if(node->type == METHOD_NODE) {
@@ -279,7 +326,6 @@ make_method_pointers(Class *c)
                        made_aliases = TRUE;
                }
        }
-       out_printf(out,"\n");
 }
 
 static void
@@ -291,12 +337,16 @@ add_bad_hack_to_avoid_unused_warnings(Class *c)
        if(!made_aliases)
                return;
        
-       out_printf(out,"\n\n/*REALLY BAD HACK\n"
+       if(!no_gnu)
+               out_printf(out,"\n\n#ifndef __GNUC__\n");
+       out_printf(out,
+                  "/*REALLY BAD HACK\n"
                   "  This is to avoid unused warnings if you don't call\n"
                   "  some method.  I need to find a better way to do\n"
-                  "  this */\n");
-       out_printf(out,"static void\n"
-                  "__%s_really_bad_hack_to_avoid_warnings(void)\n"
+                  "  this, not needed in GCC since we use some gcc\n"
+                  "  extentions to make saner, faster code */\n"
+                  "static void\n"
+                  "___%s_really_bad_hack_to_avoid_warnings(void)\n"
                   "{\n",funcbase);
        for(li=c->nodes;li;li=g_list_next(li)) {
                Node *node = li->data;
@@ -315,9 +365,12 @@ add_bad_hack_to_avoid_unused_warnings(Class *c)
                        out_printf(out,"\t((void (*)(void))%s)();\n",m->id);
                }
        }
-       out_printf(out, "\t__%s_really_bad_hack_to_avoid_warnings();\n",
+       out_printf(out, "\t___%s_really_bad_hack_to_avoid_warnings();\n",
                   funcbase);
-       out_printf(out,"}\n\n");
+       if(!no_gnu)
+               out_printf(out,"}\n#endif /* __GNUC__ */\n\n");
+       else
+               out_printf(out,"}\n\n");
 }
 
 static void
@@ -380,7 +433,9 @@ put_priv_method_prot(Method *m)
           m->method == CLASS_INIT_METHOD ||
           (m->method == OVERRIDE_METHOD &&
            m->cbuf))
-               print_method(out,"static ",""," ",";\n",m,FALSE);
+               print_method(out,"static ",""," ",
+                            no_gnu?";\n":" ___NO_UNUSED_WARNING;\n"
+                            ,m,FALSE);
 }
 
 static GList *
@@ -441,9 +496,9 @@ make_inits(Class *cl)
 }
 
 static void
-make_destroy(Class *cl)
+make_finalize(Class *cl)
 {
-       int got_destroy = FALSE;
+       int got_finalize = FALSE;
        GList *li;
        Node *node;
        for(li=cl->nodes;li;li=g_list_next(li)) {
@@ -451,12 +506,12 @@ make_destroy(Class *cl)
                if(n->type == METHOD_NODE) {
                        Method *m = (Method *)n;
                        if(m->method == OVERRIDE_METHOD &&
-                          strcmp(m->id,"destroy")==0) {
+                          strcmp(m->id,"finalize")==0) {
                                if(strcmp(m->otype,"Gtk:Object")==0) {
-                                       got_destroy = TRUE;
+                                       got_finalize = TRUE;
                                        break;
                                } else {
-                                       print_error(FALSE,"destroy method override "
+                                       print_error(FALSE,"finalize method override "
                                                    "of class other then Gtk:Object",
                                                    m->line_no);
                                }
@@ -464,11 +519,11 @@ make_destroy(Class *cl)
                        }
                }
        }
-       if(!got_destroy) {
+       if(!got_finalize) {
                node = new_method(NO_SCOPE, OVERRIDE_METHOD,
                                  (Type *)new_type(0,g_strdup("void"),NULL),
                                  g_strdup("Gtk:Object"),
-                                 NULL,g_strdup("destroy"),
+                                 NULL,g_strdup("finalize"),
                                  make_func_arg("Gtk:Object",FALSE,g_strdup("o")),
                                  NULL,
                                  g_strdup("PARENT_HANDLER (o);\n"),
@@ -482,40 +537,44 @@ make_destroy(Class *cl)
 /* the commented out types mean that these types don't actually
    exist. so we "emulate them" with an equivalent */
 const struct {
+       gboolean simple;
        char *gtkname;
        char *typename;
 } our_gtk_type_table[] = {
-       { "NONE",       "void" },
-       { "CHAR",       "gchar" },
-       { "UCHAR",      "guchar" },
-       { "BOOL",       "gboolean" },
-       { "INT",        "gint" },
-       { "UINT",       "guint" },
-       { "LONG",       "glong" },
-       { "ULONG",      "gulong" },
-       { "FLOAT",      "gfloat" },
-       { "DOUBLE",     "gdouble" },
-       { "STRING",     /*"GtkString"*/"gchar *" },
-       { "ENUM",       /*"GtkEnum"*/"gint" },
-       { "FLAGS",      /*"GtkFlags"*/"guint" },
-       { "BOXED",      /*"GtkBoxed"*/"gpointer" },
-       { "POINTER",    "gpointer" },
-       { "OBJECT",     "GtkObject *" },
-       { "SIGNAL",     /*"GtkSignal"*/"__twopointertype" },
-       { "ARGS",       /*"GtkArgs"*/"__twopointertype" },
-       { "CALLBACK",   /*"GtkCallback"*/"__threepointertype" },
-       { "C_CALLBACK", /*"GtkCCallback"*/"__twopointertype" },
-       { "FOREIGN",    /*"GtkForeign"*/"__twopointertype" },
-
-       { NULL, NULL }
+       { TRUE, "NONE", "void " },
+       { TRUE, "CHAR", "gchar " },
+       { TRUE, "UCHAR",        "guchar " },
+       { TRUE, "BOOL", "gboolean " },
+       { TRUE, "INT",  "gint " },
+       { TRUE, "UINT", "guint " },
+       { TRUE, "LONG", "glong " },
+       { TRUE, "ULONG",        "gulong " },
+       { TRUE, "FLOAT",        "gfloat " },
+       { TRUE, "DOUBLE",       "gdouble " },
+       { TRUE, "STRING",       /*"GtkString"*/"gchar *" },
+       { TRUE, "ENUM", /*"GtkEnum"*/"gint " },
+       { TRUE, "FLAGS",        /*"GtkFlags"*/"guint " },
+       { TRUE, "BOXED",        /*"GtkBoxed"*/"gpointer " },
+       { TRUE, "POINTER",      "gpointer " },
+       { TRUE, "OBJECT",       "GtkObject *" },
+       { FALSE, "SIGNAL",      /*"GtkSignal"*/"___twopointertype " },
+       { FALSE, "ARGS",        /*"GtkArgs"*/"___twopointertype " },
+       { FALSE, "CALLBACK",    /*"GtkCallback"*/"___threepointertype " },
+       { FALSE, "C_CALLBACK",  /*"GtkCCallback"*/"___twopointertype " },
+       { FALSE, "FOREIGN",     /*"GtkForeign"*/"___twopointertype " },
+
+       { FALSE, NULL, NULL }
 };
 
 static const char *
-get_cast(char *type)
+get_cast(char *type, gboolean simple_only)
 {
        int i;
        for(i=0;our_gtk_type_table[i].gtkname;i++) {
                if(strcmp(our_gtk_type_table[i].gtkname,type)==0) {
+                       if(simple_only &&
+                          !our_gtk_type_table[i].simple)
+                               return NULL;
                        return our_gtk_type_table[i].typename;
                }
        }
@@ -572,7 +631,7 @@ print_signal_marsal_args(Method *m)
                        else {
                                out_printf(out, ",\n\t\t(%s)"
                                           "GTK_VALUE_%s(args[%d])",
-                                          get_cast(li->data),
+                                          get_cast(li->data,FALSE),
                                           (char *)li->data,i);
                        }
                }
@@ -608,21 +667,21 @@ add_signal_prots(Method *m)
                return;
        }
        
-       s = g_strdup_printf("__Sig%d",sig++);
+       s = g_strdup_printf("Sig%d",sig++);
        
        g_hash_table_insert(marsh,m,s);
        eq_signal_methods = g_list_prepend(eq_signal_methods,m);
        
        /* we know that we'll know all the gtktypes (so get_cast can't fail) */
        out_printf(out,"\ntypedef %s (*%s) (%s *, ",
-                  get_cast(m->gtktypes->data),s, typebase);
+                  get_cast(m->gtktypes->data,FALSE),s, typebase);
        
        for(li=m->gtktypes->next;li;li=g_list_next(li))
-               out_printf(out,"%s, ",get_cast(li->data));
+               out_printf(out,"%s, ",get_cast(li->data,FALSE));
        out_printf(out,"gpointer);\n"); 
        
        out_printf(out,"\nstatic void\n"
-               "marshal_%s (GtkObject * object,\n"
+               "___marshal_%s (GtkObject * object,\n"
                "\tGtkSignalFunc func,\n"
                "\tgpointer func_data,\n"
                "\tGtkArg * args)\n"
@@ -781,7 +840,7 @@ add_signals(Class *c)
                        last = TRUE;
 
                if(g_hash_table_lookup(marsh,m))
-                       mar = g_strconcat("marshal_",
+                       mar = g_strconcat("___marshal_",
                                          (char *)g_hash_table_lookup(marsh,m),
                                          NULL);
                else
@@ -860,6 +919,13 @@ static void
 make_arguments(Class *c)
 {
        GList *li;
+       char *argflags[] = {
+               "CONSTRUCT",
+               "CONSTRUCT_ONLY",
+               "CHILD_ARG",
+               "MASK",
+               NULL
+       };
 
        out_printf(out,"\n");
        for(li=c->nodes;li;li=g_list_next(li)) {
@@ -880,8 +946,32 @@ make_arguments(Class *c)
                else
                        flags = g_string_new("GTK_ARG_WRITABLE");
                
-               for(l=a->flags;l;l=g_list_next(l))
-                       g_string_sprintfa(flags," | GTK_ARG_%s",(char *)l->data);
+               for(l=a->flags;l;l=g_list_next(l)) {
+                       char *flag = l->data;
+                       int i;
+                       if(strcmp(flag,"READWRITE")==0 ||
+                          strcmp(flag,"READABLE")==0 ||
+                          strcmp(flag,"WRITABLE")==0) {
+                               print_error(TRUE,"READWRITE, READABLE and "
+                                           "WRITABLE argument flags are "
+                                           "set automatically",a->line_no);
+                               continue;
+                       }
+                       for(i=0;argflags[i];i++) {
+                               if(strcmp(argflags[i],flag)==0)
+                                       break;
+                       }
+                       /* if we haven't found it in our list */
+                       if(!argflags[i]) {
+                               char *s;
+                               s = g_strdup_printf("Unknown flag '%s' used, "
+                                                   "perhaps it was misspelled",
+                                                   flag);
+                               print_error(TRUE,s,a->line_no);
+                               g_free(s);
+                       }
+                       g_string_sprintfa(flags, " | GTK_ARG_%s",flag);
+               }
 
                s = g_strdup(a->name);
                g_strup(s);
@@ -895,8 +985,8 @@ make_arguments(Class *c)
        }
        
        out_printf(out,
-                  "\n\tgtk_object_class->set_arg = __object_set_arg;\n"
-                  "\tgtk_object_class->get_arg = __object_get_arg;\n");
+                  "\n\tgtk_object_class->set_arg = ___object_set_arg;\n"
+                  "\tgtk_object_class->get_arg = ___object_get_arg;\n");
 }
 
 static void
@@ -977,7 +1067,7 @@ add_getset_arg(Class *c, int is_set)
 {
        GList *li;
        out_printf(out,"\nstatic void\n"
-               "__object_%s_arg (GtkObject *object,\n"
+               "___object_%s_arg (GtkObject *object,\n"
                "\tGtkArg *arg,\n"
                "\tguint arg_id)\n"
                "{\n"
@@ -1025,12 +1115,16 @@ print_checks(Method *m, FuncArg *fa)
 {
        GList *li;
        gboolean is_void;
+       gboolean checked_null = FALSE;
        is_void = (strcmp(m->mtype->name,"void")==0 &&
                   m->mtype->stars == 0);
        
        for(li=fa->checks;li;li=g_list_next(li)) {
                Check *ch = li->data;
                char *s;
+               /* point to the method prot in .gob for failed checks */
+               if(m->line_no>0)
+                       out_addline_infile(out,m->line_no);
                if(is_void)
                        out_printf(out,"\tg_return_if_fail (");
                else
@@ -1038,10 +1132,16 @@ print_checks(Method *m, FuncArg *fa)
                switch(ch->chtype) {
                case NULL_CHECK:
                        out_printf(out,"%s != NULL",fa->name);
+                       checked_null = TRUE;
                        break;
                case TYPE_CHECK:
                        s = make_pre_macro(fa->atype->name,"IS");
-                       out_printf(out,"%s (%s)",s,fa->name);
+                       if(checked_null)
+                               out_printf(out,"%s (%s)",s,fa->name);
+                       else
+                               /* if not check null, null may be valid */
+                               out_printf(out,"!(%s) || %s (%s)",fa->name,s,
+                                          fa->name);
                        g_free(s);
                        break;
                case LT_CHECK:
@@ -1084,6 +1184,8 @@ print_preconditions(Method *m)
                if(fa->checks)
                        print_checks(m,fa);
        }
+       if(m->line_no>0)
+               out_addline_outfile(out);
 }
 
 /* put in code if it's needed */
@@ -1093,14 +1195,13 @@ put_in_gen_code(Method *m)
        /* now we only have the freeing of the private structure */
        if(privates>0 &&
           m->method == OVERRIDE_METHOD &&
-          strcmp(m->id,"destroy")==0) {
+          strcmp(m->id,"finalize")==0) {
                out_printf(out,"\tg_free (%s (%s)->_priv);\n"
                           "\t%s (%s)->_priv = NULL;\n",
                           macrobase,
                           ((FuncArg *)m->args->data)->name,
                           macrobase,
                           ((FuncArg *)m->args->data)->name);
-
        }
 }
 
@@ -1110,6 +1211,7 @@ print_method_body(Method *m, int pre)
        out_printf(out,"{\n");
        if(pre)
                print_preconditions(m);
+
        put_in_gen_code(m);
 
        /* Note: the trailing }'s are on one line, this is so
@@ -1119,7 +1221,8 @@ print_method_body(Method *m, int pre)
           human readable anyway. */
        if(m->cbuf) {
                out_printf(out,"{\n");
-               out_addline_infile(out,m->ccode_line);
+               if(m->ccode_line>0)
+                       out_addline_infile(out,m->ccode_line);
                out_printf(out,"\t%s}",m->cbuf);
        }
 
@@ -1138,7 +1241,7 @@ put_signal_args(Method *m)
            li && ali;
            li=li->next, ali=ali->next) {
                FuncArg *fa = li->data;
-               const char *cast = get_cast(ali->data);
+               const char *cast = get_cast(ali->data,FALSE);
                /* we should have already proved before that
                   the we know all the types */
                g_assert(cast);
@@ -1148,17 +1251,35 @@ put_signal_args(Method *m)
        }
 }
 
+static char *
+get_arg_names_for_macro(Method *m)
+{
+       char *p;
+       GList *li;
+       GString *gs = g_string_new("");
+       p = "";
+       for(li=m->args;li;li=g_list_next(li)) {
+               FuncArg *arg = li->data;
+               g_string_sprintfa(gs, "%s___%s", p, arg->name);
+               p = ",";
+       }
+       p = gs->str;
+       g_string_free(gs,FALSE);
+       return p;
+}
+
 static void
 put_method(Method *m)
 {
-       char *s;
+       char *s,*args;
        gboolean is_void;
        is_void = (strcmp(m->mtype->name,"void")==0 &&
                   m->mtype->stars == 0);
        out_printf(out,"\n");
        switch(m->method) {
        case REGULAR_METHOD:
-               out_addline_infile(out,m->line_no);
+               if(m->line_no>0)
+                       out_addline_infile(out,m->line_no);
                if(m->scope == PRIVATE_SCOPE)
                        print_method(out,"static ","\n"," ","\n",m,FALSE);
                else /* PUBLIC, PROTECTED */
@@ -1167,7 +1288,8 @@ put_method(Method *m)
                break;
        case SIGNAL_FIRST_METHOD:
        case SIGNAL_LAST_METHOD:
-               out_addline_infile(out,m->line_no);
+               if(m->line_no>0)
+                       out_addline_infile(out,m->line_no);
                if(m->scope == PRIVATE_SCOPE)
                        print_method(out,"static ","\n"," ","\n",m,FALSE);
                else
@@ -1200,12 +1322,14 @@ put_method(Method *m)
 
                if(!m->cbuf)
                        break;
-               out_addline_infile(out,m->line_no);
+               if(m->line_no>0)
+                       out_addline_infile(out,m->line_no);
                print_method(out,"static ","\n_real_"," ","\n",m,FALSE);
                print_method_body(m,FALSE);
                break;
        case VIRTUAL_METHOD:
-               out_addline_infile(out,m->line_no);
+               if(m->line_no>0)
+                       out_addline_infile(out,m->line_no);
                if(m->scope==PRIVATE_SCOPE)
                        print_method(out,"static ","\n"," ","\n",m,FALSE);
                else
@@ -1245,33 +1369,37 @@ put_method(Method *m)
 
                if(!m->cbuf)
                        break;
-               out_addline_infile(out,m->line_no);
+               if(m->line_no>0)
+                       out_addline_infile(out,m->line_no);
                print_method(out,"static ","\n_real_"," ","\n",m,FALSE);
                print_method_body(m,FALSE);
                break;
        case OVERRIDE_METHOD:
                if(!m->cbuf)
                        break;
-               out_addline_infile(out,m->line_no);
+               if(m->line_no>0)
+                       out_addline_infile(out,m->line_no);
                print_method(out,"static ","\n"," ","\n",m,FALSE);
                s = replace_sep(m->otype,'_');
                g_strup(s);
+               args = get_arg_names_for_macro(m);
                if(is_void) {
-                       out_printf(out,"#define PARENT_HANDLER(args...) \\\n"
+                       out_printf(out,"#define PARENT_HANDLER(%s) \\\n"
                                   "\t{ if(%s_CLASS(parent_class)->%s) \\\n"
-                                  "\t\t(* %s_CLASS(parent_class)->%s)(##args); }\n",
-                                  s,m->id,s,m->id);
+                                  "\t\t(* %s_CLASS(parent_class)->%s)(%s); }\n",
+                                  args,s,m->id,s,m->id,args);
                } else {
-                       out_printf(out,"#define PARENT_HANDLER(args...) \\\n"
+                       out_printf(out,"#define PARENT_HANDLER(%s) \\\n"
                                   "\t((%s_CLASS(parent_class)->%s)? \\\n"
-                                  "\t\t(* %s_CLASS(parent_class)->%s)(##args): \\\n"
+                                  "\t\t(* %s_CLASS(parent_class)->%s)(%s): \\\n"
                                   "\t\t(",
-                                  s,m->id,s,m->id);
+                                  args,s,m->id,s,m->id,args);
                        out_printf(out,"(");
                        print_type(out,m->mtype,TRUE);
                        out_printf(out,")%s))\n",
                                   m->onerror?m->onerror:"0");
                }
+               g_free(args);
                g_free(s);
                print_method_body(m,TRUE);
                out_printf(out,"#undef PARENT_HANDLER\n");
@@ -1348,13 +1476,22 @@ check_bad_symbols(Class *c)
                                print_error(FALSE,s,m->line_no);
                                g_free(s);
                        }
+                       if(m->method != INIT_METHOD &&
+                          m->method != CLASS_INIT_METHOD &&
+                          (strcmp(m->id,"init")==0 ||
+                           strcmp(m->id,"class_init")==0)) {
+                               print_error(FALSE,"init, or class_init not "
+                                           "allowed as an "
+                                           "identifier of non-"
+                                           "constructor methods",m->line_no);
+                       }
                } else if(n->type == VARIABLE_NODE) {
                        Variable *v = (Variable *)n;
                        if(strcmp(v->id,"_priv")==0 ||
                           strcmp(v->id,"__parent__")==0) {
-                       char *s;
-                               s = g_strdup_printf("'%s' not allowed as a data "
-                                                   "member name",v->id);
+                               char *s;
+                               s = g_strdup_printf("'%s' not allowed as a "
+                                                   "data member name",v->id);
                                print_error(FALSE,s,v->line_no);
                                g_free(s);
                        }
@@ -1525,7 +1662,7 @@ check_signal_args(Class *c)
 
                        for(l=m->gtktypes;l;l=l->next) {
                                char *s;
-                               if(get_cast(l->data))
+                               if(get_cast(l->data,FALSE))
                                        continue;
                                s = g_strdup_printf("Unknown GTK+ type '%s' "
                                                    "among signal types",
@@ -1537,6 +1674,29 @@ check_signal_args(Class *c)
        }
 }
 
+static void
+check_argument_types(Class *c)
+{
+       GList *l;
+       for(l=c->nodes;l;l=g_list_next(l)) {
+               Node *n = l->data;
+               if(n->type == ARGUMENT_NODE) {
+                       Argument *a = (Argument *)n;
+                       char *s;
+                       if(get_cast(a->gtktype,FALSE))
+                               continue;
+                       s = g_strdup_printf("Unknown GTK+ type '%s' "
+                                           "as argument type",
+                                           a->gtktype);
+                       /* this could perhaps be a warning, but
+                          can there really be a type beyond the
+                          fundementals? */
+                       print_error(FALSE, s, a->line_no);
+                       g_free(s);
+               }
+       }
+}
+
 static int
 count_signals(Class *c)
 {
@@ -1654,6 +1814,97 @@ open_files(void)
        }
 }
 
+static void
+put_argument_nongnu_wrappers(Class *c)
+{
+       GList *li;
+
+       if(arguments<0)
+               return;
+
+       for(li=c->nodes;li;li=g_list_next(li)) {
+               Node *n = li->data;
+               Argument *a = (Argument *)n;
+               char *s;
+               char *cast;
+               if(n->type != ARGUMENT_NODE)
+                       continue;
+               s = g_strdup(a->name);
+               g_strup(s);
+               if(a->atype)
+                       cast = get_type(a->atype,TRUE);
+               else
+                       cast = g_strdup(get_cast(a->gtktype,TRUE));
+
+               if(cast) {
+                       if(a->set)
+                               out_printf(outh, "#define %s_ARG_%s(arg)    \t"
+                                          "\"%s\",(%s)(arg)\n",
+                                          macrobase, s, a->name, cast);
+                       if(a->get)
+                               out_printf(outh, "#define %s_GET_ARG_%s(arg)\t"
+                                          "\"%s\",(%s*)(arg)\n",
+                                          macrobase, s, a->name, cast);
+               } else {
+                       if(a->set)
+                               out_printf(outh, "#define %s_ARG_%s(arg)    \t"
+                                          "\"%s\",(arg)\n",
+                                          macrobase, s, a->name);
+                       if(a->get)
+                               out_printf(outh, "#define %s_GET_ARG_%s(arg)\t"
+                                          "\"%s\",(arg)\n",
+                                          macrobase, s, a->name);
+               }
+               g_free(cast);
+               g_free(s);
+       }
+}
+
+static void
+put_argument_gnu_wrappers(Class *c)
+{
+       GList *li;
+
+       if(arguments<0)
+               return;
+
+       for(li=c->nodes;li;li=g_list_next(li)) {
+               Node *n = li->data;
+               Argument *a = (Argument *)n;
+               char *s;
+               char *cast;
+               if(n->type != ARGUMENT_NODE)
+                       continue;
+               s = g_strdup(a->name);
+               g_strup(s);
+               if(a->atype)
+                       cast = get_type(a->atype,TRUE);
+               else
+                       cast = g_strdup(get_cast(a->gtktype,TRUE));
+               if(cast) {
+                       if(a->set)
+                               out_printf(outh, "#define %s_ARG_%s(arg)    \t"
+                                          "\"%s\",({%sz = (arg); z;})\n",
+                                          macrobase, s, a->name, cast);
+                       if(a->get)
+                               out_printf(outh, "#define %s_GET_ARG_%s(arg)\t"
+                                          "\"%s\",({%s*z = (arg); z;})\n",
+                                          macrobase, s, a->name, cast);
+               } else {
+                       if(a->set)
+                               out_printf(outh, "#define %s_ARG_%s(arg)    \t"
+                                          "\"%s\",(arg)\n",
+                                          macrobase, s, a->name);
+                       if(a->get)
+                               out_printf(outh, "#define %s_GET_ARG_%s(arg)\t"
+                                          "\"%s\",(arg)\n",
+                                          macrobase, s, a->name);
+               }
+               g_free(cast);
+               g_free(s);
+       }
+}
+
 static void
 generate_outfiles(void)
 {
@@ -1670,6 +1921,15 @@ generate_outfiles(void)
                           "   (do not edit directly) */\n\n",VERSION);
        out_printf(out,"/* Generated by GOB (v%s) on %s"
               "   (do not edit directly) */\n\n",VERSION,ctime(&curtime));
+
+       {
+               int major=0,minor=0,pl=0;
+               sscanf(VERSION,"%d.%d.%d",&major,&minor,&pl);
+
+               out_printf(out,"#define GOB_VERSION_MAJOR %d\n", major);
+               out_printf(out,"#define GOB_VERSION_MINOR %d\n", minor);
+               out_printf(out,"#define GOB_VERSION_PATCHLEVEL %d\n\n", pl);
+       }
        
        p = replace_sep(((Class *)class)->otype,'_');
        g_strup(p);
@@ -1742,11 +2002,11 @@ generate_outfiles(void)
                        out_printf(out,"/* utility types we may need */\n");
                        out_printf(out,"typedef struct { "
                                   "gpointer a; gpointer b; "
-                                  "} __twopointertype;\n");
+                                  "} ___twopointertype;\n");
                        out_printf(out,"typedef struct { "
                                   "gpointer a; gpointer b; "
                                   "gpointer c; "
-                                  "} __threepointertype;\n");
+                                  "} ___threepointertype;\n");
 
                        out_printf(outh,"\n#define %s\t"
                                "(%s_get_type())\n",
@@ -1761,6 +2021,17 @@ generate_outfiles(void)
                                "GTK_CHECK_TYPE((obj), %s_get_type ())\n\n",
                                macrois,funcbase);
 
+                       /* argument wrapping macros */
+                       if(arguments>0 && !no_gnu) {
+                               out_printf(outh,"\n#ifdef __GNUC__\n");
+                               put_argument_gnu_wrappers(c);
+                               out_printf(outh,"#else /* __GNUC__ */\n");
+                               put_argument_nongnu_wrappers(c);
+                               out_printf(outh,"#endif /* __GNUC__ */\n\n");
+                       } else if(arguments>0 && no_gnu) {
+                               put_argument_nongnu_wrappers(c);
+                       }
+
                        if(privates>0)
                                out_printf(outh,"\ntypedef struct _%sPrivate %sPrivate;\n",typebase,typebase);
 
@@ -1826,16 +2097,24 @@ generate_outfiles(void)
 
                        out_printf(outh,"guint\t%s_get_type\t(void);\n",funcbase);
                        
+                       out_printf(out,"/* here are local prototypes */\n");
+                       if(!no_gnu) {
+                               out_printf(out,"#ifdef __GNUC__\n"
+                                          "#define ___NO_UNUSED_WARNING "
+                                          "__attribute__ ((__unused__))\n"
+                                          "#else /* __GNUC__ */\n"
+                                          "#define ___NO_UNUSED_WARNING\n"
+                                          "#endif /* __GNUC__ */\n");
+                       }
                        if(arguments>0) {
-                               out_printf(out,"static void __object_set_arg "
+                               out_printf(out,"static void ___object_set_arg "
                                           "(GtkObject *object, GtkArg *arg, "
                                           "guint arg_id);\n"
-                                          "static void __object_get_arg "
+                                          "static void ___object_get_arg "
                                           "(GtkObject *object, GtkArg *arg, "
                                           "guint arg_id);\n");
                        }
 
-                       out_printf(out,"/* here are local prototypes */\n");
                        for(l=c->nodes;l;l=g_list_next(l)) {
                                Node *n = l->data;
                                if(n->type == METHOD_NODE) {
@@ -1852,12 +2131,23 @@ generate_outfiles(void)
                                                add_signal_prots((Method *)n);
                                }
                        }
+
+                       if(!no_gnu)
+                               out_printf(out,"#undef ___NO_UNUSED_WARNING\n");
                        
                        add_enums(c);
                        
                        add_get_type();
 
-                       make_method_pointers(c);
+                       if(no_gnu)
+                               make_method_nongnu_aliases(c);
+                       else {
+                               out_printf(out,"\n#ifdef __GNUC__\n");
+                               make_method_gnu_aliases(c);
+                               out_printf(out,"#else /* __GNUC__ */\n");
+                               make_method_nongnu_aliases(c);
+                               out_printf(out,"#endif /* __GNUC__ */\n\n");
+                       }
 
                        out_printf(out,"#define GET_NEW (gtk_type_new(%s_get_type()))\n",
                                   funcbase);
@@ -1917,6 +2207,7 @@ print_help(void)
                "\t--exit-on-warn,-w       Exit with an error on warnings\n"
                "\t--no-exit-on-warn       Don't exit on warnings [default]\n"
                "\t--for-cpp               Create C++ files\n"
+               "\t--no-gnu                Never use GNU extentions\n"
                "\t--no-touch-headers      Don't touch headers unless they "
                                          "really changed\n"
                "\t--always-private-header Always create a private header "
@@ -1967,6 +2258,8 @@ parse_options(int argc, char *argv[])
                } else if(strcmp(argv[i],"--no-private-header")==0) {
                        always_private_header = FALSE;
                        no_private_header = TRUE;
+               } else if(strcmp(argv[i],"--no-gnu")==0) {
+                       no_gnu = TRUE;
                } else if(strcmp(argv[i],"--")==0) {
                        /*further arguments are files*/
                        no_opts = TRUE;
@@ -2091,7 +2384,7 @@ main(int argc, char *argv[])
        make_bases();
        make_inits((Class *)class);
        if(privates>0)
-               make_destroy((Class *)class);
+               make_finalize((Class *)class);
        check_bad_symbols((Class *)class);
        check_duplicate_symbols((Class *)class);
        check_duplicate_signals_args((Class *)class);
@@ -2100,6 +2393,7 @@ main(int argc, char *argv[])
        check_firstarg((Class *)class);
        check_nonvoidempty((Class *)class);
        check_signal_args((Class *)class);
+       check_argument_types((Class *)class);
 
        exit_on_error = TRUE;
        
index ee1d3289d3853cda215208b390f3900e0d6acd9b..3fdf7cf35df9b1847c192cda319d01a910ccaf8e 100644 (file)
--- a/src/out.c
+++ b/src/out.c
@@ -14,8 +14,11 @@ extern char *filename;
 extern char *filebase;
 
 int outline = 1;
+static gboolean in_out = TRUE;
 int outhline = 1;
+static gboolean in_outh = TRUE;
 int outphline = 1;
+static gboolean in_outph = TRUE;
 
 static int
 strchrcnt(char *s, char c)
@@ -53,13 +56,16 @@ out_printf(FILE *fp,char *format,...)
 void
 out_addline_infile(FILE *fp, int line)
 {
-       if(fp == out)
+       if(fp == out) {
                outline++;
-       else if(fp == outh)
+               in_out = FALSE;
+       } else if(fp == outh) {
                outhline++;
-       else if(fp == outph)
+               in_outh = FALSE;
+       } else if(fp == outph) {
                outphline++;
-       else
+               in_outph = FALSE;
+       } else
                g_assert_not_reached();
 
        fprintf(fp,"#line %d \"%s\"\n",line,filename);
@@ -69,18 +75,23 @@ void
 out_addline_outfile(FILE *fp)
 {
        if(fp == out) {
+               if(in_out) return;
                outline++;
                if(!for_cpp)
                        fprintf(fp,"#line %d \"%s.c\"\n",outline,filebase);
                else
                        fprintf(fp,"#line %d \"%s.cc\"\n",outline,filebase);
+               in_out = TRUE;
        } else if(fp == outh) {
+               if(in_outh) return;
                outhline++;
                fprintf(fp,"#line %d \"%s.h\"\n",outhline,filebase);
+               in_outh = TRUE;
        } else if(fp == outph) {
+               if(in_outph) return;
                outphline++;
                fprintf(fp,"#line %d \"%s-private.h\"\n",outphline,filebase);
+               in_outph = TRUE;
        } else
                g_assert_not_reached();
-
 }
index 6614f29cf40604bd7a59f1f63699f76c3b4a2612..783037da27db002d2d225729105684f6595d79e2 100644 (file)
@@ -101,12 +101,19 @@ yyerror(char *str)
        exit(1);
 }
 
+static Type *
+pop_type(void)
+{
+       Type *type = typestack->data;
+       typestack = g_list_remove(typestack,typestack->data);
+       return type;
+}
+
 static void
 push_variable(char *name, int scope, int line_no, char *postfix)
 {
        Node *var;
-       Type *type = typestack->data;
-       typestack = g_list_remove(typestack,typestack->data);
+       Type *type = pop_type();
 
        type->postfix = postfix;
        
@@ -123,8 +130,7 @@ push_function(int scope, int method, char *oid, char *id, char *onerror,
        char *c_cbuf;
        
        if(method!=INIT_METHOD && method!=CLASS_INIT_METHOD) {
-               type = typestack->data;
-               typestack = g_list_remove(typestack,typestack->data);
+               type = pop_type();
        } else {
                type = (Type *)new_type(0,g_strdup("void"),NULL);
        }
@@ -169,8 +175,7 @@ static void
 push_funcarg(char *name, char *postfix)
 {
        Node *node;
-       Type *type = typestack->data;
-       typestack = g_list_remove(typestack,typestack->data);
+       Type *type = pop_type();
 
        type->postfix = postfix;
        
@@ -211,7 +216,7 @@ push_self(char *id)
 }
 
 
-#line 197 "parse.y"
+#line 202 "parse.y"
 typedef union {
        char *id;
        GString *cbuf;
@@ -233,11 +238,11 @@ typedef union {
 
 
 
-#define        YYFINAL         214
+#define        YYFINAL         219
 #define        YYFLAG          -32768
 #define        YYNTBASE        46
 
-#define YYTRANSLATE(x) ((unsigned)(x) <= 286 ? yytranslate[x] : 76)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 286 ? yytranslate[x] : 77)
 
 static const char yytranslate[] = {     0,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -275,69 +280,72 @@ static const char yytranslate[] = {     0,
 static const short yyprhs[] = {     0,
      0,     4,     7,    10,    12,    15,    18,    20,    22,    27,
     31,    36,    39,    42,    45,    47,    49,    51,    53,    55,
-    57,    62,    68,    80,    89,    93,    94,    98,   100,   102,
-   105,   107,   110,   113,   116,   118,   121,   124,   126,   128,
-   130,   132,   135,   137,   139,   142,   144,   147,   149,   151,
-   153,   155,   157,   160,   162,   165,   167,   171,   175,   178,
-   180,   185,   189,   191,   194,   196,   206,   217,   227,   237,
-   246,   258,   267,   273,   276,   280,   281,   283,   285,   289,
-   291,   295,   297,   301,   303,   306,   310,   317,   325,   328,
-   330,   332,   335,   338,   342,   346,   350,   354,   356,   359
+    57,    62,    68,    80,    89,    95,    97,   101,   102,   106,
+   108,   110,   113,   115,   118,   121,   124,   126,   129,   132,
+   134,   136,   138,   140,   143,   145,   147,   150,   152,   155,
+   157,   159,   161,   163,   165,   168,   170,   173,   175,   179,
+   183,   186,   188,   193,   197,   199,   202,   204,   214,   225,
+   235,   245,   254,   266,   275,   281,   284,   288,   289,   291,
+   293,   297,   299,   303,   305,   309,   311,   314,   318,   325,
+   333,   336,   338,   340,   343,   346,   350,   354,   358,   362,
+   364,   367
 };
 
 static const short yyrhs[] = {    47,
     48,    47,     0,    48,    47,     0,    47,    48,     0,    48,
      0,    47,    24,     0,    47,    25,     0,    24,     0,    25,
      0,    49,    33,    50,    34,     0,    49,    33,    34,     0,
-     3,    22,     4,    22,     0,    50,    67,     0,    50,    52,
-     0,    50,    53,     0,    67,     0,    52,     0,    53,     0,
-    26,     0,    27,     0,    28,     0,    51,    56,    20,    35,
-     0,    51,    56,    20,    23,    35,     0,    29,    54,    20,
+     3,    22,     4,    22,     0,    50,    68,     0,    50,    52,
+     0,    50,    53,     0,    68,     0,    52,     0,    53,     0,
+    26,     0,    27,     0,    28,     0,    51,    57,    20,    35,
+     0,    51,    57,    20,    23,    35,     0,    29,    55,    54,
     20,    20,    33,    24,    20,    33,    24,    35,     0,    29,
-    54,    20,    20,    20,    33,    24,    35,     0,    36,    55,
-    37,     0,     0,    20,    38,    55,     0,    20,     0,    57,
-     0,     5,    57,     0,    58,     0,    58,    61,     0,    12,
-    59,     0,    11,    59,     0,    59,     0,    12,    18,     0,
-    11,    18,     0,    18,     0,    17,     0,    16,     0,    20,
-     0,    60,    20,     0,    22,     0,     6,     0,    13,    15,
-     0,    13,     0,    14,    15,     0,    14,     0,    15,     0,
-     9,     0,     8,     0,     7,     0,    39,    61,     0,    39,
-     0,    20,    64,     0,    64,     0,    51,    20,    64,     0,
-    20,    51,    64,     0,    51,    64,     0,    62,     0,    20,
-    36,    65,    37,     0,    65,    40,    20,     0,    20,     0,
-    33,    24,     0,    35,     0,    31,    63,    56,    20,    36,
-    69,    37,    68,    66,     0,    51,    31,    62,    56,    20,
-    36,    69,    37,    68,    66,     0,    30,    51,    56,    20,
-    36,    69,    37,    68,    66,     0,    51,    30,    56,    20,
-    36,    69,    37,    68,    66,     0,    30,    56,    20,    36,
-    69,    37,    68,    66,     0,    32,    36,    22,    37,    56,
-    20,    36,    69,    37,    68,    66,     0,    51,    56,    20,
-    36,    69,    37,    68,    66,     0,    20,    36,    20,    37,
-    66,     0,    19,    75,     0,    19,    33,    24,     0,     0,
-     6,     0,    20,     0,    20,    40,    70,     0,    70,     0,
-    71,    40,    10,     0,    71,     0,    71,    40,    72,     0,
-    72,     0,    56,    20,     0,    56,    20,    23,     0,    56,
-    20,    36,    20,    73,    37,     0,    56,    20,    23,    36,
-    20,    73,    37,     0,    73,    74,     0,    74,     0,    20,
-     0,    41,    75,     0,    42,    75,     0,    41,    43,    75,
-     0,    42,    43,    75,     0,    43,    43,    75,     0,    44,
-    43,    75,     0,    21,     0,    45,    21,     0,    20,     0
+    55,    54,    20,    20,    33,    24,    35,     0,    20,    36,
+    20,    57,    37,     0,    20,     0,    36,    56,    37,     0,
+     0,    20,    38,    56,     0,    20,     0,    58,     0,     5,
+    58,     0,    59,     0,    59,    62,     0,    12,    60,     0,
+    11,    60,     0,    60,     0,    12,    18,     0,    11,    18,
+     0,    18,     0,    17,     0,    16,     0,    20,     0,    61,
+    20,     0,    22,     0,     6,     0,    13,    15,     0,    13,
+     0,    14,    15,     0,    14,     0,    15,     0,     9,     0,
+     8,     0,     7,     0,    39,    62,     0,    39,     0,    20,
+    65,     0,    65,     0,    51,    20,    65,     0,    20,    51,
+    65,     0,    51,    65,     0,    63,     0,    20,    36,    66,
+    37,     0,    66,    40,    20,     0,    20,     0,    33,    24,
+     0,    35,     0,    31,    64,    57,    20,    36,    70,    37,
+    69,    67,     0,    51,    31,    63,    57,    20,    36,    70,
+    37,    69,    67,     0,    30,    51,    57,    20,    36,    70,
+    37,    69,    67,     0,    51,    30,    57,    20,    36,    70,
+    37,    69,    67,     0,    30,    57,    20,    36,    70,    37,
+    69,    67,     0,    32,    36,    22,    37,    57,    20,    36,
+    70,    37,    69,    67,     0,    51,    57,    20,    36,    70,
+    37,    69,    67,     0,    20,    36,    20,    37,    67,     0,
+    19,    76,     0,    19,    33,    24,     0,     0,     6,     0,
+    20,     0,    20,    40,    71,     0,    71,     0,    72,    40,
+    10,     0,    72,     0,    72,    40,    73,     0,    73,     0,
+    57,    20,     0,    57,    20,    23,     0,    57,    20,    36,
+    20,    74,    37,     0,    57,    20,    23,    36,    20,    74,
+    37,     0,    74,    75,     0,    75,     0,    20,     0,    41,
+    76,     0,    42,    76,     0,    41,    43,    76,     0,    42,
+    43,    76,     0,    43,    43,    76,     0,    44,    43,    76,
+     0,    21,     0,    45,    21,     0,    20,     0
 };
 
 #endif
 
 #if YYDEBUG != 0
 static const short yyrline[] = { 0,
-   216,   217,   218,   219,   222,   228,   233,   239,   246,   251,
-   258,   263,   264,   265,   266,   267,   268,   271,   272,   273,
-   276,   279,   283,   316,   344,   345,   348,   351,   357,   358,
-   366,   370,   377,   380,   383,   386,   389,   392,   395,   398,
-   401,   404,   408,   411,   416,   419,   422,   425,   428,   433,
-   436,   439,   444,   445,   449,   461,   467,   479,   491,   494,
-   500,   505,   508,   513,   514,   518,   528,   538,   548,   558,
-   568,   574,   579,   600,   601,   605,   608,   609,   620,   630,
-   633,   634,   637,   638,   641,   644,   647,   655,   665,   666,
-   669,   682,   686,   690,   694,   698,   702,   708,   709,   713
+   221,   222,   223,   224,   227,   233,   238,   244,   251,   256,
+   263,   268,   269,   270,   271,   272,   273,   276,   277,   278,
+   281,   284,   288,   323,   353,   362,   368,   369,   372,   375,
+   381,   382,   390,   394,   401,   404,   407,   410,   413,   416,
+   419,   422,   425,   428,   432,   435,   440,   443,   446,   449,
+   452,   457,   460,   463,   468,   469,   473,   485,   491,   503,
+   515,   518,   524,   529,   532,   537,   538,   542,   552,   562,
+   572,   582,   592,   598,   603,   624,   625,   629,   632,   633,
+   644,   654,   657,   658,   661,   662,   665,   668,   671,   679,
+   689,   690,   693,   706,   710,   714,   718,   722,   726,   732,
+   733,   737
 };
 #endif
 
@@ -350,9 +358,10 @@ static const char * const yytname[] = {   "$","error","$undefined.","CLASS",
 "ARRAY_DIM","CCODE","HCODE","PUBLIC","PRIVATE","PROTECTED","ARGUMENT","VIRTUAL",
 "SIGNAL","OVERRIDE","'{'","'}'","';'","'('","')'","'|'","'*'","','","'>'","'<'",
 "'='","'!'","'-'","prog","ccodes","class","classdec","classcode","scope","variable",
-"argument","argflags","flaglist","type","type1","type2","integer","tspecifier",
-"stars","simplesigtype","fullsigtype","sigtype","tokenlist","codenocode","method",
-"onerror","funcargs","arglist","arglist1","arg","checklist","check","numtok", NULL
+"argument","argtype","argflags","flaglist","type","type1","type2","integer",
+"tspecifier","stars","simplesigtype","fullsigtype","sigtype","tokenlist","codenocode",
+"method","onerror","funcargs","arglist","arglist1","arg","checklist","check",
+"numtok", NULL
 };
 #endif
 
@@ -360,166 +369,164 @@ static const short yyr1[] = {     0,
     46,    46,    46,    46,    47,    47,    47,    47,    48,    48,
     49,    50,    50,    50,    50,    50,    50,    51,    51,    51,
     52,    52,    53,    53,    54,    54,    55,    55,    56,    56,
-    57,    57,    58,    58,    58,    58,    58,    58,    58,    58,
-    58,    58,    58,    58,    59,    59,    59,    59,    59,    60,
-    60,    60,    61,    61,    62,    62,    63,    63,    63,    63,
-    64,    65,    65,    66,    66,    67,    67,    67,    67,    67,
-    67,    67,    67,    68,    68,    68,    69,    69,    69,    69,
-    70,    70,    71,    71,    72,    72,    72,    72,    73,    73,
-    74,    74,    74,    74,    74,    74,    74,    75,    75,    75
+    57,    57,    58,    58,    59,    59,    59,    59,    59,    59,
+    59,    59,    59,    59,    59,    59,    60,    60,    60,    60,
+    60,    61,    61,    61,    62,    62,    63,    63,    64,    64,
+    64,    64,    65,    66,    66,    67,    67,    68,    68,    68,
+    68,    68,    68,    68,    68,    69,    69,    69,    70,    70,
+    70,    70,    71,    71,    72,    72,    73,    73,    73,    73,
+    74,    74,    75,    75,    75,    75,    75,    75,    75,    76,
+    76,    76
 };
 
 static const short yyr2[] = {     0,
      3,     2,     2,     1,     2,     2,     1,     1,     4,     3,
      4,     2,     2,     2,     1,     1,     1,     1,     1,     1,
-     4,     5,    11,     8,     3,     0,     3,     1,     1,     2,
-     1,     2,     2,     2,     1,     2,     2,     1,     1,     1,
-     1,     2,     1,     1,     2,     1,     2,     1,     1,     1,
-     1,     1,     2,     1,     2,     1,     3,     3,     2,     1,
-     4,     3,     1,     2,     1,     9,    10,     9,     9,     8,
-    11,     8,     5,     2,     3,     0,     1,     1,     3,     1,
-     3,     1,     3,     1,     2,     3,     6,     7,     2,     1,
-     1,     2,     2,     3,     3,     3,     3,     1,     2,     1
+     4,     5,    11,     8,     5,     1,     3,     0,     3,     1,
+     1,     2,     1,     2,     2,     2,     1,     2,     2,     1,
+     1,     1,     1,     2,     1,     1,     2,     1,     2,     1,
+     1,     1,     1,     1,     2,     1,     2,     1,     3,     3,
+     2,     1,     4,     3,     1,     2,     1,     9,    10,     9,
+     9,     8,    11,     8,     5,     2,     3,     0,     1,     1,
+     3,     1,     3,     1,     3,     1,     2,     3,     6,     7,
+     2,     1,     1,     2,     2,     3,     3,     3,     3,     1,
+     2,     1
 };
 
 static const short yydefact[] = {     0,
      0,     7,     8,     0,     4,     0,     0,     5,     6,     3,
-     2,     0,     0,     1,     0,    18,    19,    20,    26,     0,
+     2,     0,     0,     1,     0,    18,    19,    20,    28,     0,
      0,     0,    10,     0,     0,    16,    17,    15,    11,     0,
-     0,     0,     0,    44,    52,    51,    50,     0,     0,    46,
-    48,    49,    40,    39,    38,    41,    43,     0,     0,    29,
-    31,    35,     0,     0,     0,    60,     0,    56,     0,     9,
-    13,    14,    12,     0,     0,     0,     0,    28,     0,     0,
-    30,    37,    34,    36,    33,    45,    47,     0,     0,    54,
-    32,    42,     0,     0,     0,    55,     0,    59,     0,     0,
-     0,     0,     0,     0,     0,     0,    25,     0,     0,     0,
-    53,    63,     0,    58,    57,     0,     0,     0,     0,     0,
-    21,     0,     0,    65,    73,    27,     0,     0,    44,    41,
-     0,     0,    80,    82,    84,    61,     0,     0,     0,     0,
-     0,    22,     0,    64,     0,     0,     0,    85,    76,     0,
-    62,     0,     0,     0,     0,    76,     0,    76,    79,    86,
-     0,     0,     0,    81,    83,    76,     0,    76,     0,     0,
-     0,    24,     0,     0,     0,   100,    98,     0,     0,    74,
-    70,     0,     0,     0,    76,    72,     0,    68,     0,    91,
-     0,     0,     0,     0,     0,    90,    75,    99,    66,    76,
-    69,     0,     0,     0,     0,    92,     0,    93,     0,     0,
-    87,    89,     0,    67,    23,    88,    94,    95,    96,    97,
-    71,     0,     0,     0
+     0,     0,     0,    46,    54,    53,    52,     0,     0,    48,
+    50,    51,    42,    41,    40,    43,    45,     0,     0,    31,
+    33,    37,     0,     0,     0,    62,     0,    58,     0,     9,
+    13,    14,    12,     0,     0,     0,     0,    30,     0,    26,
+     0,    32,    39,    36,    38,    35,    47,    49,     0,     0,
+    56,    34,    44,     0,     0,     0,    57,     0,    61,     0,
+     0,     0,     0,     0,     0,     0,     0,    27,     0,     0,
+     0,     0,    55,    65,     0,    60,    59,     0,     0,     0,
+     0,     0,    21,     0,     0,    67,    75,    29,     0,     0,
+     0,    46,    43,     0,     0,    82,    84,    86,    63,     0,
+     0,     0,     0,     0,    22,     0,    66,     0,     0,     0,
+     0,    87,    78,     0,    64,     0,     0,     0,     0,    78,
+    25,     0,    78,    81,    88,     0,     0,     0,    83,    85,
+    78,     0,    78,     0,     0,     0,    24,     0,     0,     0,
+   102,   100,     0,     0,    76,    72,     0,     0,     0,    78,
+    74,     0,    70,     0,    93,     0,     0,     0,     0,     0,
+    92,    77,   101,    68,    78,    71,     0,     0,     0,     0,
+    94,     0,    95,     0,     0,    89,    91,     0,    69,    23,
+    90,    96,    97,    98,    99,    73,     0,     0,     0
 };
 
-static const short yydefgoto[] = {   212,
-     4,     5,     6,    24,    25,    26,    27,    32,    69,   121,
-    50,    51,    52,    53,    81,    56,    57,    58,   103,   115,
-    28,   153,   122,   123,   124,   125,   185,   186,   170
+static const short yydefgoto[] = {   217,
+     4,     5,     6,    24,    25,    26,    27,    71,    32,    69,
+   124,    50,    51,    52,    53,    82,    56,    57,    58,   105,
+   117,    28,   158,   125,   126,   127,   128,   190,   191,   175
 };
 
-static const short yypact[] = {    77,
-   -16,-32768,-32768,    85,    65,     6,    51,-32768,-32768,    65,
-   120,   216,    42,   120,    46,-32768,-32768,-32768,    62,   115,
-    15,    89,-32768,   229,    54,-32768,-32768,-32768,-32768,    91,
-   116,   131,   206,-32768,-32768,-32768,-32768,    79,   135,   125,
-   140,-32768,-32768,-32768,-32768,-32768,-32768,   171,   161,-32768,
-   151,-32768,   172,   205,   179,-32768,   171,-32768,   186,-32768,
--32768,-32768,-32768,   171,   190,   196,   197,   199,   198,   207,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,   218,   203,   151,
--32768,-32768,   204,   231,   232,-32768,    -7,-32768,   233,   217,
-   242,    -7,   171,   111,   139,   116,-32768,   244,   230,   189,
--32768,-32768,   -30,-32768,-32768,   234,   171,   235,   245,   237,
--32768,   189,   243,-32768,-32768,-32768,   236,   189,   238,    59,
-   248,   239,-32768,   240,-32768,-32768,   253,   189,   254,   189,
-   241,-32768,   246,-32768,   255,   247,   171,     9,   259,   153,
--32768,   249,   251,   252,   189,   259,    -5,   259,-32768,   256,
-   261,     5,   139,-32768,-32768,   259,   189,   259,   257,   139,
-   258,-32768,   139,   262,    75,-32768,-32768,   264,   269,-32768,
--32768,   139,   260,   139,   259,-32768,   271,-32768,    75,-32768,
-    13,    32,   250,   263,    63,-32768,-32768,-32768,-32768,   259,
--32768,   139,   265,    71,    58,-32768,    58,-32768,    58,    58,
--32768,-32768,   139,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,   285,   296,-32768
+static const short yypact[] = {    69,
+   -13,-32768,-32768,    73,    89,   -19,    17,-32768,-32768,    89,
+   125,   216,    11,   125,     6,-32768,-32768,-32768,    46,   115,
+   120,    50,-32768,   229,    53,-32768,-32768,-32768,-32768,    68,
+    76,    81,   206,-32768,-32768,-32768,-32768,   251,   257,    92,
+   110,-32768,-32768,-32768,-32768,-32768,-32768,   171,   131,-32768,
+   114,-32768,   135,   205,   152,-32768,   171,-32768,   159,-32768,
+-32768,-32768,-32768,   171,   154,   170,   155,   161,   173,   172,
+   196,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   207,   193,
+   114,-32768,-32768,   194,   214,   215,-32768,   -10,-32768,   217,
+   201,   219,   -10,   171,    56,   101,    76,-32768,   220,   231,
+   218,   189,-32768,-32768,    -5,-32768,-32768,   226,   171,   232,
+   233,   238,-32768,   189,   228,-32768,-32768,-32768,   171,   234,
+   189,   237,    16,   256,   240,-32768,   239,-32768,-32768,   258,
+   189,   260,   189,   245,-32768,   246,-32768,   247,   261,   249,
+   171,    -7,   263,   153,-32768,   250,   252,   253,   189,   263,
+-32768,    -8,   263,-32768,   255,   269,    10,   101,-32768,-32768,
+   263,   189,   263,   259,   101,   262,-32768,   101,   272,     4,
+-32768,-32768,   270,   276,-32768,-32768,   101,   264,   101,   263,
+-32768,   274,-32768,     4,-32768,    57,    60,   265,   266,    67,
+-32768,-32768,-32768,-32768,   263,-32768,   101,   267,    75,    18,
+-32768,    18,-32768,    18,    18,-32768,-32768,   101,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,   293,   299,-32768
 };
 
 static const short yypgoto[] = {-32768,
-    76,   294,-32768,-32768,     3,   275,   277,-32768,   208,   -20,
-   270,-32768,   191,-32768,   222,   266,-32768,   -38,-32768,  -152,
-   281,  -144,  -109,   170,-32768,   168,   130,  -167,   -43
+    80,   296,-32768,-32768,   -18,   279,   280,-32768,-32768,   208,
+   -20,   273,-32768,   106,-32768,   230,   242,-32768,   -36,-32768,
+  -157,   286,  -146,  -108,   174,-32768,   168,   129,   -84,   -48
 };
 
 
-#define        YYLAST          331
+#define        YYLAST          315
 
 
 static const short yytable[] = {    49,
-   171,   160,   133,   163,    66,     7,   126,   176,   136,   127,
-   178,   172,    83,   174,   161,    86,    88,   202,   142,   189,
-   144,   191,    48,    55,   166,   167,   202,    78,    84,   162,
-   192,   150,   166,   167,    54,   159,    89,   168,    12,   204,
-    16,    17,    18,    91,   151,   203,   104,   173,   105,   169,
-   211,   166,   167,    86,    13,   195,    85,   169,    33,    34,
-    35,    36,    37,    29,    38,    39,    40,    41,    42,    43,
-    44,    45,   109,    46,   197,    47,   169,   166,   167,     1,
-    11,    30,   180,    64,    65,    14,   129,     1,     2,     3,
-   180,    40,    41,    42,   180,   -78,    72,    31,   137,   201,
-     2,     3,   169,   181,   182,   183,   184,   206,     8,     9,
-    67,   181,   182,   183,   184,   181,   182,   183,   184,    33,
-    34,    35,    36,    37,    59,    38,    39,    40,    41,    42,
-    43,    44,    45,   110,    46,    68,    47,   196,   198,    76,
-    16,    17,    18,     8,     9,   111,   112,    40,    41,    42,
-    70,   207,    74,   208,    77,   209,   210,    33,    34,    35,
-    36,    37,   154,    38,    39,    40,    41,    42,    43,    44,
-    45,   113,    46,   114,    47,    33,    34,    35,    36,    37,
-    79,    38,    39,    40,    41,    42,    43,    44,    45,    80,
-    46,    82,    47,    33,   119,    35,    36,    37,    87,    38,
-    39,    40,    41,    42,    43,    44,    45,    90,   120,    92,
-    47,    34,    35,    36,    37,    94,    38,    39,    40,    41,
-    42,    43,    44,    45,    83,    46,    98,    47,    73,    75,
-    16,    17,    18,    95,    97,    15,    96,    99,   100,    84,
-    84,    16,    17,    18,    19,    20,    21,    22,    15,    23,
-   102,    83,   106,   107,    16,    17,    18,    19,    20,    21,
-    22,   108,    60,   117,   131,   118,   134,   138,   135,   128,
-   130,   132,   141,   143,   -77,   139,   145,   152,   147,   140,
-   165,   179,   146,   148,   213,   156,   157,   187,   158,   188,
-   177,   164,   199,   175,   193,   214,   190,    10,    61,   205,
-    62,   101,    71,   116,    63,   200,   149,   155,   194,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    93
+   176,    48,    55,   165,    66,   136,   168,   181,     7,    84,
+   183,   166,   140,    12,   177,   155,   179,    87,    89,   194,
+    13,   196,   146,   185,   148,    85,   167,    79,   156,   171,
+   172,   129,    29,   197,   130,    86,    90,   171,   172,   209,
+   164,    30,   173,    92,   186,   187,   188,   189,   208,   106,
+   216,   107,   -80,   178,   174,   141,    87,    33,    34,    35,
+    36,    37,   174,    38,    39,    40,    41,    42,    43,    44,
+    45,     1,    46,   111,    47,     1,   171,   172,   112,   171,
+   172,    31,    64,    65,    11,    59,   185,    67,   132,    14,
+   113,   114,     2,     3,   185,    68,     8,     9,   138,   200,
+    70,   174,   202,   206,   174,   207,    77,   186,   187,   188,
+   189,   211,     2,     3,   207,   186,   187,   188,   189,    33,
+    34,    35,    36,    37,    78,    38,    39,    40,    41,    42,
+    43,    44,    45,   115,    46,   116,    47,   201,   203,    54,
+    16,    17,    18,    74,    76,    16,    17,    18,     8,     9,
+    80,   212,    81,   213,    83,   214,   215,    33,    34,    35,
+    36,    37,   159,    38,    39,    40,    41,    42,    43,    44,
+    45,    88,    46,    93,    47,    33,    34,    35,    36,    37,
+    91,    38,    39,    40,    41,    42,    43,    44,    45,    95,
+    46,    96,    47,    33,   122,    35,    36,    37,    97,    38,
+    39,    40,    41,    42,    43,    44,    45,    99,   123,    98,
+    47,    34,    35,    36,    37,   100,    38,    39,    40,    41,
+    42,    43,    44,    45,    84,    46,   101,    47,   102,    85,
+    16,    17,    18,   104,    84,    15,   108,   109,   110,   119,
+    85,    16,    17,    18,    19,    20,    21,    22,    15,    23,
+   120,   137,   134,   121,    16,    17,    18,    19,    20,    21,
+    22,   131,    60,    40,    41,    42,   139,   133,    73,    40,
+    41,    42,   135,   -79,    75,   142,   143,   145,   144,   147,
+   149,   157,   150,   151,   152,   153,   161,   162,   170,   163,
+   169,   184,   218,   192,   182,   180,   193,   198,   219,    10,
+   195,   210,    61,    62,   118,    72,    94,   204,   205,    63,
+   103,   160,   199,     0,   154
 };
 
 static const short yycheck[] = {    20,
-   153,   146,   112,   148,    25,    22,    37,   160,   118,    40,
-   163,   156,    20,   158,    20,    54,    55,   185,   128,   172,
-   130,   174,    20,    21,    20,    21,   194,    48,    36,    35,
-   175,    23,    20,    21,    20,   145,    57,    33,    33,   192,
-    26,    27,    28,    64,    36,   190,    85,   157,    87,    45,
-   203,    20,    21,    92,     4,    43,    54,    45,     5,     6,
-     7,     8,     9,    22,    11,    12,    13,    14,    15,    16,
-    17,    18,    93,    20,    43,    22,    45,    20,    21,     3,
-     5,    36,    20,    30,    31,    10,   107,     3,    24,    25,
-    20,    13,    14,    15,    20,    37,    18,    36,    40,    37,
-    24,    25,    45,    41,    42,    43,    44,    37,    24,    25,
-    20,    41,    42,    43,    44,    41,    42,    43,    44,     5,
-     6,     7,     8,     9,    36,    11,    12,    13,    14,    15,
-    16,    17,    18,    23,    20,    20,    22,   181,   182,    15,
-    26,    27,    28,    24,    25,    35,    36,    13,    14,    15,
-    20,   195,    18,   197,    15,   199,   200,     5,     6,     7,
+   158,    20,    21,   150,    25,   114,   153,   165,    22,    20,
+   168,    20,   121,    33,   161,    23,   163,    54,    55,   177,
+     4,   179,   131,    20,   133,    36,    35,    48,    36,    20,
+    21,    37,    22,   180,    40,    54,    57,    20,    21,   197,
+   149,    36,    33,    64,    41,    42,    43,    44,   195,    86,
+   208,    88,    37,   162,    45,    40,    93,     5,     6,     7,
+     8,     9,    45,    11,    12,    13,    14,    15,    16,    17,
+    18,     3,    20,    94,    22,     3,    20,    21,    23,    20,
+    21,    36,    30,    31,     5,    36,    20,    20,   109,    10,
+    35,    36,    24,    25,    20,    20,    24,    25,   119,    43,
+    20,    45,    43,    37,    45,   190,    15,    41,    42,    43,
+    44,    37,    24,    25,   199,    41,    42,    43,    44,     5,
+     6,     7,     8,     9,    15,    11,    12,    13,    14,    15,
+    16,    17,    18,    33,    20,    35,    22,   186,   187,    20,
+    26,    27,    28,    38,    39,    26,    27,    28,    24,    25,
+    20,   200,    39,   202,    20,   204,   205,     5,     6,     7,
      8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
-    18,    33,    20,    35,    22,     5,     6,     7,     8,     9,
-    20,    11,    12,    13,    14,    15,    16,    17,    18,    39,
-    20,    20,    22,     5,     6,     7,     8,     9,    20,    11,
-    12,    13,    14,    15,    16,    17,    18,    22,    20,    20,
+    18,    20,    20,    20,    22,     5,     6,     7,     8,     9,
+    22,    11,    12,    13,    14,    15,    16,    17,    18,    20,
+    20,    37,    22,     5,     6,     7,     8,     9,    38,    11,
+    12,    13,    14,    15,    16,    17,    18,    36,    20,    37,
     22,     6,     7,     8,     9,    20,    11,    12,    13,    14,
-    15,    16,    17,    18,    20,    20,    20,    22,    38,    39,
-    26,    27,    28,    37,    37,    20,    38,    20,    36,    36,
+    15,    16,    17,    18,    20,    20,    20,    22,    36,    36,
+    26,    27,    28,    20,    20,    20,    20,    37,    20,    20,
     36,    26,    27,    28,    29,    30,    31,    32,    20,    34,
-    20,    20,    20,    37,    26,    27,    28,    29,    30,    31,
-    32,    20,    34,    20,    20,    36,    24,    20,    33,    36,
-    36,    35,    20,    20,    37,    37,    36,    19,    24,    40,
-    20,    20,    37,    37,     0,    37,    36,    24,    37,    21,
-    33,    36,    43,    37,    24,     0,    37,     4,    24,    35,
-    24,    80,    33,    96,    24,    43,   137,   140,   179,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    65
+    20,    24,    20,    36,    26,    27,    28,    29,    30,    31,
+    32,    36,    34,    13,    14,    15,    33,    36,    18,    13,
+    14,    15,    35,    37,    18,    20,    37,    20,    40,    20,
+    36,    19,    37,    37,    24,    37,    37,    36,    20,    37,
+    36,    20,     0,    24,    33,    37,    21,    24,     0,     4,
+    37,    35,    24,    24,    97,    33,    65,    43,    43,    24,
+    81,   144,   184,    -1,   141
 };
 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
 #line 3 "/usr/lib/bison.simple"
@@ -1065,23 +1072,23 @@ yyreduce:
   switch (yyn) {
 
 case 1:
-#line 216 "parse.y"
+#line 221 "parse.y"
 { ; ;
     break;}
 case 2:
-#line 217 "parse.y"
+#line 222 "parse.y"
 { ; ;
     break;}
 case 3:
-#line 218 "parse.y"
+#line 223 "parse.y"
 { ; ;
     break;}
 case 4:
-#line 219 "parse.y"
+#line 224 "parse.y"
 { ; ;
     break;}
 case 5:
-#line 222 "parse.y"
+#line 227 "parse.y"
 {
                        Node *node = new_ccode(FALSE,(yyvsp[0].cbuf)->str,
                                               ccode_line);
@@ -1090,7 +1097,7 @@ case 5:
                                        ;
     break;}
 case 6:
-#line 228 "parse.y"
+#line 233 "parse.y"
 {
                        Node *node = new_ccode(TRUE,(yyvsp[0].cbuf)->str,ccode_line);
                        nodes = g_list_append(nodes,node);
@@ -1098,7 +1105,7 @@ case 6:
                                        ;
     break;}
 case 7:
-#line 233 "parse.y"
+#line 238 "parse.y"
 {
                        Node *node = new_ccode(FALSE,(yyvsp[0].cbuf)->str,
                                               ccode_line);
@@ -1107,7 +1114,7 @@ case 7:
                                        ;
     break;}
 case 8:
-#line 239 "parse.y"
+#line 244 "parse.y"
 {
                        Node *node = new_ccode(TRUE,(yyvsp[0].cbuf)->str,ccode_line);
                        nodes = g_list_append(nodes,node);
@@ -1115,7 +1122,7 @@ case 8:
                                        ;
     break;}
 case 9:
-#line 246 "parse.y"
+#line 251 "parse.y"
 {
                        ((Class *)class)->nodes = class_nodes;
                        class_nodes = NULL;
@@ -1123,7 +1130,7 @@ case 9:
                                                ;
     break;}
 case 10:
-#line 251 "parse.y"
+#line 256 "parse.y"
 {
                        ((Class *)class)->nodes = NULL;
                        class_nodes = NULL;
@@ -1131,67 +1138,68 @@ case 10:
                                                ;
     break;}
 case 11:
-#line 258 "parse.y"
+#line 263 "parse.y"
 {
                        class = new_class(yyvsp[-2].id,yyvsp[0].id,NULL);
                                                ;
     break;}
 case 12:
-#line 263 "parse.y"
+#line 268 "parse.y"
 { ; ;
     break;}
 case 13:
-#line 264 "parse.y"
+#line 269 "parse.y"
 { ; ;
     break;}
 case 14:
-#line 265 "parse.y"
+#line 270 "parse.y"
 { ; ;
     break;}
 case 15:
-#line 266 "parse.y"
+#line 271 "parse.y"
 { ; ;
     break;}
 case 16:
-#line 267 "parse.y"
+#line 272 "parse.y"
 { ; ;
     break;}
 case 17:
-#line 268 "parse.y"
+#line 273 "parse.y"
 { ; ;
     break;}
 case 18:
-#line 271 "parse.y"
+#line 276 "parse.y"
 { the_scope = PUBLIC_SCOPE; ;
     break;}
 case 19:
-#line 272 "parse.y"
+#line 277 "parse.y"
 { the_scope = PRIVATE_SCOPE; ;
     break;}
 case 20:
-#line 273 "parse.y"
+#line 278 "parse.y"
 { the_scope = PROTECTED_SCOPE; ;
     break;}
 case 21:
-#line 276 "parse.y"
+#line 281 "parse.y"
 {
                        push_variable(yyvsp[-1].id,the_scope,yyvsp[-3].line,NULL);
                                                ;
     break;}
 case 22:
-#line 279 "parse.y"
+#line 284 "parse.y"
 {
                        push_variable(yyvsp[-2].id,the_scope,yyvsp[-4].line,yyvsp[-1].id);
                                                ;
     break;}
 case 23:
-#line 283 "parse.y"
+#line 288 "parse.y"
 {
                        if(strcmp(yyvsp[-6].id,"get")==0 &&
                           strcmp(yyvsp[-3].id,"set")==0) {
                                Node *node;
+                               Type *type = pop_type();
                                g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
-                               node = new_argument(yyvsp[-8].id,yyvsp[-9].list,yyvsp[-7].id,
+                               node = new_argument(yyvsp[-8].id,type,yyvsp[-9].list,yyvsp[-7].id,
                                                    (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
                                                    (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
                                                    yyvsp[-10].line);
@@ -1201,8 +1209,9 @@ case 23:
                        } else if(strcmp(yyvsp[-6].id,"set")==0 &&
                                strcmp(yyvsp[-3].id,"get")==0) {
                                Node *node;
+                               Type *type = pop_type();
                                g_free(yyvsp[-6].id); g_free(yyvsp[-3].id);
-                               node = new_argument(yyvsp[-8].id,yyvsp[-9].list,yyvsp[-7].id,
+                               node = new_argument(yyvsp[-8].id,type,yyvsp[-9].list,yyvsp[-7].id,
                                                    (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
                                                    (yyvsp[-4].cbuf)->str,yyvsp[-5].line,
                                                    yyvsp[-10].line);
@@ -1221,20 +1230,22 @@ case 23:
                                                ;
     break;}
 case 24:
-#line 316 "parse.y"
+#line 323 "parse.y"
 {
                        if(strcmp(yyvsp[-3].id,"get")==0) {
                                Node *node;
+                               Type *type = pop_type();
                                g_free(yyvsp[-3].id);
-                               node = new_argument(yyvsp[-5].id,yyvsp[-6].list,yyvsp[-4].id,
+                               node = new_argument(yyvsp[-5].id,type,yyvsp[-6].list,yyvsp[-4].id,
                                                    (yyvsp[-1].cbuf)->str,yyvsp[-2].line,
                                                    NULL,0, yyvsp[-7].line);
                                g_string_free(yyvsp[-1].cbuf,FALSE);
                                class_nodes = g_list_append(class_nodes,node);
                        } else if(strcmp(yyvsp[-3].id,"set")==0) {
                                Node *node;
+                               Type *type = pop_type();
                                g_free(yyvsp[-3].id);
-                               node = new_argument(yyvsp[-5].id,yyvsp[-6].list,yyvsp[-4].id,
+                               node = new_argument(yyvsp[-5].id,type,yyvsp[-6].list,yyvsp[-4].id,
                                                    NULL,0,(yyvsp[-1].cbuf)->str,
                                                    yyvsp[-2].line, yyvsp[-7].line);
                                g_string_free(yyvsp[-1].cbuf,FALSE);
@@ -1250,31 +1261,50 @@ case 24:
                                                ;
     break;}
 case 25:
-#line 344 "parse.y"
-{ yyval.list = yyvsp[-1].list; ;
+#line 353 "parse.y"
+{
+                       if(strcmp(yyvsp[-2].id,"type")!=0) {
+                               g_free(yyvsp[-4].id);
+                               g_free(yyvsp[-2].id);
+                               yyerror(_("parse error"));
+                               YYERROR;
+                       }
+                       yyval.id = yyvsp[-4].id;
+                                               ;
     break;}
 case 26:
-#line 345 "parse.y"
-{ yyval.list = NULL; ;
+#line 362 "parse.y"
+{
+                       yyval.id = yyvsp[0].id;
+                       typestack = g_list_prepend(typestack,NULL);
+                                               ;
     break;}
 case 27:
-#line 348 "parse.y"
+#line 368 "parse.y"
+{ yyval.list = yyvsp[-1].list; ;
+    break;}
+case 28:
+#line 369 "parse.y"
+{ yyval.list = NULL; ;
+    break;}
+case 29:
+#line 372 "parse.y"
 {
                        yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
                                                ;
     break;}
-case 28:
-#line 351 "parse.y"
+case 30:
+#line 375 "parse.y"
 {
                        yyval.list = g_list_append(NULL,yyvsp[0].id);
                                                ;
     break;}
-case 29:
-#line 357 "parse.y"
+case 31:
+#line 381 "parse.y"
 { ; ;
     break;}
-case 30:
-#line 358 "parse.y"
+case 32:
+#line 382 "parse.y"
 {
                        Type *type = typestack->data;
                        char *oldname = type->name;
@@ -1282,152 +1312,152 @@ case 30:
                        g_free(oldname);
                                                ;
     break;}
-case 31:
-#line 366 "parse.y"
+case 33:
+#line 390 "parse.y"
 {
                        Node *node = new_type(0,yyvsp[0].id,NULL);
                        typestack = g_list_prepend(typestack,node);
                                                ;
     break;}
-case 32:
-#line 370 "parse.y"
+case 34:
+#line 394 "parse.y"
 {
                        Node *node = new_type(stars,yyvsp[-1].id,NULL);
                        stars = 0;
                        typestack = g_list_prepend(typestack,node);
                                                ;
     break;}
-case 33:
-#line 377 "parse.y"
+case 35:
+#line 401 "parse.y"
 {
                        yyval.id = g_strconcat("unsigned ",yyvsp[0].id,NULL);
                                                ;
     break;}
-case 34:
-#line 380 "parse.y"
+case 36:
+#line 404 "parse.y"
 {
                        yyval.id = g_strconcat("signed ",yyvsp[0].id,NULL);
                                                ;
     break;}
-case 35:
-#line 383 "parse.y"
+case 37:
+#line 407 "parse.y"
 {
                        yyval.id = g_strdup(yyvsp[0].id);
                                                ;
     break;}
-case 36:
-#line 386 "parse.y"
+case 38:
+#line 410 "parse.y"
 {
                        yyval.id = g_strdup("unsigned char");
                                                ;
     break;}
-case 37:
-#line 389 "parse.y"
+case 39:
+#line 413 "parse.y"
 {
                        yyval.id = g_strdup("signed char");
                                                ;
     break;}
-case 38:
-#line 392 "parse.y"
+case 40:
+#line 416 "parse.y"
 {
                        yyval.id = g_strdup("char");
                                                ;
     break;}
-case 39:
-#line 395 "parse.y"
+case 41:
+#line 419 "parse.y"
 {
                        yyval.id = g_strdup("double");
                                                ;
     break;}
-case 40:
-#line 398 "parse.y"
+case 42:
+#line 422 "parse.y"
 {
                        yyval.id = g_strdup("float");
                                                ;
     break;}
-case 41:
-#line 401 "parse.y"
+case 43:
+#line 425 "parse.y"
 {
                        yyval.id = yyvsp[0].id;
                                                ;
     break;}
-case 42:
-#line 404 "parse.y"
+case 44:
+#line 428 "parse.y"
 {
                        yyval.id = g_strconcat(yyvsp[-1].id,yyvsp[0].id,NULL);
                        g_free(yyvsp[0].id);
                                                ;
     break;}
-case 43:
-#line 408 "parse.y"
+case 45:
+#line 432 "parse.y"
 {
                        yyval.id = yyvsp[0].id;
                                                ;
     break;}
-case 44:
-#line 411 "parse.y"
+case 46:
+#line 435 "parse.y"
 {
                        yyval.id = g_strdup("void");
                                                ;
     break;}
-case 45:
-#line 416 "parse.y"
+case 47:
+#line 440 "parse.y"
 {
                        yyval.id = "long int";
                                                ;
     break;}
-case 46:
-#line 419 "parse.y"
+case 48:
+#line 443 "parse.y"
 {
                        yyval.id = "long";
                                                ;
     break;}
-case 47:
-#line 422 "parse.y"
+case 49:
+#line 446 "parse.y"
 {
                        yyval.id = "short int";
                                                ;
     break;}
-case 48:
-#line 425 "parse.y"
+case 50:
+#line 449 "parse.y"
 {
                        yyval.id = "short";
                                                ;
     break;}
-case 49:
-#line 428 "parse.y"
+case 51:
+#line 452 "parse.y"
 {
                        yyval.id = "int";
                                                ;
     break;}
-case 50:
-#line 433 "parse.y"
+case 52:
+#line 457 "parse.y"
 {
                        yyval.id = "enum ";
                                                ;
     break;}
-case 51:
-#line 436 "parse.y"
+case 53:
+#line 460 "parse.y"
 {
                        yyval.id = "union ";
                                                ;
     break;}
-case 52:
-#line 439 "parse.y"
+case 54:
+#line 463 "parse.y"
 {
                        yyval.id = "struct ";
                                                ;
     break;}
-case 53:
-#line 444 "parse.y"
+case 55:
+#line 468 "parse.y"
 { stars++; ;
     break;}
-case 54:
-#line 445 "parse.y"
+case 56:
+#line 469 "parse.y"
 { stars++; ;
     break;}
-case 55:
-#line 449 "parse.y"
+case 57:
+#line 473 "parse.y"
 {
                        if(strcmp(yyvsp[-1].id,"first")==0)
                                yyval.sigtype = SIGNAL_FIRST_METHOD;
@@ -1441,14 +1471,14 @@ case 55:
                        g_free(yyvsp[-1].id);
                                        ;
     break;}
-case 56:
-#line 461 "parse.y"
+case 58:
+#line 485 "parse.y"
 {
                        yyval.sigtype = SIGNAL_LAST_METHOD;
                                        ;
     break;}
-case 57:
-#line 467 "parse.y"
+case 59:
+#line 491 "parse.y"
 {
                        if(strcmp(yyvsp[-1].id,"first")==0)
                                yyval.sigtype = SIGNAL_FIRST_METHOD;
@@ -1462,8 +1492,8 @@ case 57:
                        g_free(yyvsp[-1].id);
                                        ;
     break;}
-case 58:
-#line 479 "parse.y"
+case 60:
+#line 503 "parse.y"
 {
                        if(strcmp(yyvsp[-2].id,"first")==0)
                                yyval.sigtype = SIGNAL_FIRST_METHOD;
@@ -1477,47 +1507,47 @@ case 58:
                        g_free(yyvsp[-2].id);
                                        ;
     break;}
-case 59:
-#line 491 "parse.y"
+case 61:
+#line 515 "parse.y"
 {
                        yyval.sigtype = SIGNAL_LAST_METHOD;
                                        ;
     break;}
-case 60:
-#line 494 "parse.y"
+case 62:
+#line 518 "parse.y"
 {
                        /* the_scope was default thus public */
                        the_scope = PUBLIC_SCOPE;
                                        ;
     break;}
-case 61:
-#line 500 "parse.y"
+case 63:
+#line 524 "parse.y"
 {
                        gtktypes = g_list_prepend(gtktypes,yyvsp[-3].id);
                                                ;
     break;}
-case 62:
-#line 505 "parse.y"
+case 64:
+#line 529 "parse.y"
 {
                        gtktypes = g_list_append(gtktypes,yyvsp[0].id);
                                                ;
     break;}
-case 63:
-#line 508 "parse.y"
+case 65:
+#line 532 "parse.y"
 { 
                        gtktypes = g_list_append(gtktypes,yyvsp[0].id);
                                                        ;
     break;}
-case 64:
-#line 513 "parse.y"
+case 66:
+#line 537 "parse.y"
 { yyval.cbuf = yyvsp[0].cbuf; ;
     break;}
-case 65:
-#line 514 "parse.y"
+case 67:
+#line 538 "parse.y"
 { yyval.cbuf = NULL; ;
     break;}
-case 66:
-#line 518 "parse.y"
+case 68:
+#line 542 "parse.y"
 {
                        if(!has_self) {
                                yyerror(_("signal without 'self' as "
@@ -1529,8 +1559,8 @@ case 66:
                                      ccode_line,vararg);
                                                                        ;
     break;}
-case 67:
-#line 528 "parse.y"
+case 69:
+#line 552 "parse.y"
 {
                        if(!has_self) {
                                yyerror(_("signal without 'self' as "
@@ -1542,8 +1572,8 @@ case 67:
                                      ccode_line,vararg);
                                                                        ;
     break;}
-case 68:
-#line 538 "parse.y"
+case 70:
+#line 562 "parse.y"
 {
                        if(!has_self) {
                                yyerror(_("virtual method without 'self' as "
@@ -1555,8 +1585,8 @@ case 68:
                                      ccode_line,vararg);
                                                                        ;
     break;}
-case 69:
-#line 548 "parse.y"
+case 71:
+#line 572 "parse.y"
 {
                        if(!has_self) {
                                yyerror(_("virtual method without 'self' as "
@@ -1568,8 +1598,8 @@ case 69:
                                      ccode_line,vararg);
                                                                        ;
     break;}
-case 70:
-#line 558 "parse.y"
+case 72:
+#line 582 "parse.y"
 {
                        if(!has_self) {
                                yyerror(_("virtual method without 'self' as "
@@ -1581,8 +1611,8 @@ case 70:
                                      ccode_line,vararg);
                                                                        ;
     break;}
-case 71:
-#line 568 "parse.y"
+case 73:
+#line 592 "parse.y"
 {
                        push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
                                      yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,
@@ -1590,16 +1620,16 @@ case 71:
                                      vararg);
                                                                        ;
     break;}
-case 72:
-#line 574 "parse.y"
+case 74:
+#line 598 "parse.y"
 {
                        push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
                                      yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,ccode_line,
                                      vararg);
                                                                ;
     break;}
-case 73:
-#line 579 "parse.y"
+case 75:
+#line 603 "parse.y"
 {
                        if(strcmp(yyvsp[-4].id,"init")==0) {
                                push_init_arg(yyvsp[-2].id,FALSE);
@@ -1620,27 +1650,27 @@ case 73:
                        }
                                                ;
     break;}
-case 74:
-#line 600 "parse.y"
+case 76:
+#line 624 "parse.y"
 { yyval.id = yyvsp[0].id; ;
     break;}
-case 75:
-#line 601 "parse.y"
+case 77:
+#line 625 "parse.y"
 {
                        yyval.id = (yyvsp[0].cbuf)->str;
                        g_string_free(yyvsp[0].cbuf,FALSE);
                                        ;
     break;}
-case 76:
-#line 605 "parse.y"
+case 78:
+#line 629 "parse.y"
 { yyval.id = NULL; ;
     break;}
-case 77:
-#line 608 "parse.y"
+case 79:
+#line 632 "parse.y"
 { vararg = FALSE; has_self = FALSE; ;
     break;}
-case 78:
-#line 609 "parse.y"
+case 80:
+#line 633 "parse.y"
 {
                        vararg = FALSE;
                        has_self = TRUE;
@@ -1653,8 +1683,8 @@ case 78:
                        }
                                                ;
     break;}
-case 79:
-#line 620 "parse.y"
+case 81:
+#line 644 "parse.y"
 {
                        has_self = TRUE;
                        if(strcmp(yyvsp[-2].id,"self")==0)
@@ -1666,40 +1696,40 @@ case 79:
                        }
                                        ;
     break;}
-case 80:
-#line 630 "parse.y"
+case 82:
+#line 654 "parse.y"
 { has_self = FALSE; ;
     break;}
-case 81:
-#line 633 "parse.y"
+case 83:
+#line 657 "parse.y"
 { vararg = TRUE; ;
     break;}
-case 82:
-#line 634 "parse.y"
+case 84:
+#line 658 "parse.y"
 { vararg = FALSE; ;
     break;}
-case 83:
-#line 637 "parse.y"
+case 85:
+#line 661 "parse.y"
 { ; ;
     break;}
-case 84:
-#line 638 "parse.y"
+case 86:
+#line 662 "parse.y"
 { ; ;
     break;}
-case 85:
-#line 641 "parse.y"
+case 87:
+#line 665 "parse.y"
 {
                        push_funcarg(yyvsp[0].id,NULL);
                                                                ;
     break;}
-case 86:
-#line 644 "parse.y"
+case 88:
+#line 668 "parse.y"
 {
                        push_funcarg(yyvsp[-1].id,yyvsp[0].id);
                                                                ;
     break;}
-case 87:
-#line 647 "parse.y"
+case 89:
+#line 671 "parse.y"
 {
                        if(strcmp(yyvsp[-2].id,"check")!=0) {
                                yyerror(_("parse error"));
@@ -1709,8 +1739,8 @@ case 87:
                        push_funcarg(yyvsp[-4].id,NULL);
                                                                ;
     break;}
-case 88:
-#line 655 "parse.y"
+case 90:
+#line 679 "parse.y"
 {
                        if(strcmp(yyvsp[-2].id,"check")!=0) {
                                yyerror(_("parse error"));
@@ -1720,16 +1750,16 @@ case 88:
                        push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
                                                                ;
     break;}
-case 89:
-#line 665 "parse.y"
+case 91:
+#line 689 "parse.y"
 { ; ;
     break;}
-case 90:
-#line 666 "parse.y"
+case 92:
+#line 690 "parse.y"
 { ; ;
     break;}
-case 91:
-#line 669 "parse.y"
+case 93:
+#line 693 "parse.y"
 {
                        if(strcmp(yyvsp[0].id,"type")==0) {
                                Node *node = new_check(TYPE_CHECK,NULL);
@@ -1744,61 +1774,61 @@ case 91:
                        g_free(yyvsp[0].id);
                                        ;
     break;}
-case 92:
-#line 682 "parse.y"
+case 94:
+#line 706 "parse.y"
 {
                        Node *node = new_check(GT_CHECK,yyvsp[0].id);
                        checks = g_list_append(checks,node);
                                        ;
     break;}
-case 93:
-#line 686 "parse.y"
+case 95:
+#line 710 "parse.y"
 {
                        Node *node = new_check(LT_CHECK,yyvsp[0].id);
                        checks = g_list_append(checks,node);
                                        ;
     break;}
-case 94:
-#line 690 "parse.y"
+case 96:
+#line 714 "parse.y"
 {
                        Node *node = new_check(GE_CHECK,yyvsp[0].id);
                        checks = g_list_append(checks,node);
                                        ;
     break;}
-case 95:
-#line 694 "parse.y"
+case 97:
+#line 718 "parse.y"
 {
                        Node *node = new_check(LE_CHECK,yyvsp[0].id);
                        checks = g_list_append(checks,node);
                                        ;
     break;}
-case 96:
-#line 698 "parse.y"
+case 98:
+#line 722 "parse.y"
 {
                        Node *node = new_check(EQ_CHECK,yyvsp[0].id);
                        checks = g_list_append(checks,node);
                                        ;
     break;}
-case 97:
-#line 702 "parse.y"
+case 99:
+#line 726 "parse.y"
 {
                        Node *node = new_check(NE_CHECK,yyvsp[0].id);
                        checks = g_list_append(checks,node);
                                        ;
     break;}
-case 98:
-#line 708 "parse.y"
+case 100:
+#line 732 "parse.y"
 { yyval.id = yyvsp[0].id; ;
     break;}
-case 99:
-#line 709 "parse.y"
+case 101:
+#line 733 "parse.y"
 {
                        yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
                        g_free(yyvsp[0].id);
                                        ;
     break;}
-case 100:
-#line 713 "parse.y"
+case 102:
+#line 737 "parse.y"
 { yyval.id = yyvsp[0].id; ;
     break;}
 }
@@ -2023,5 +2053,5 @@ yyerrhandle:
     }
   return 1;
 }
-#line 716 "parse.y"
+#line 740 "parse.y"
 
index f4c4a409f7bfc7c5089813b8f3f452e813071ff5..c2c425320d63a236c9814ac6925d62a1e26573b5 100644 (file)
@@ -83,12 +83,19 @@ yyerror(char *str)
        exit(1);
 }
 
+static Type *
+pop_type(void)
+{
+       Type *type = typestack->data;
+       typestack = g_list_remove(typestack,typestack->data);
+       return type;
+}
+
 static void
 push_variable(char *name, int scope, int line_no, char *postfix)
 {
        Node *var;
-       Type *type = typestack->data;
-       typestack = g_list_remove(typestack,typestack->data);
+       Type *type = pop_type();
 
        type->postfix = postfix;
        
@@ -105,8 +112,7 @@ push_function(int scope, int method, char *oid, char *id, char *onerror,
        char *c_cbuf;
        
        if(method!=INIT_METHOD && method!=CLASS_INIT_METHOD) {
-               type = typestack->data;
-               typestack = g_list_remove(typestack,typestack->data);
+               type = pop_type();
        } else {
                type = (Type *)new_type(0,g_strdup("void"),NULL);
        }
@@ -151,8 +157,7 @@ static void
 push_funcarg(char *name, char *postfix)
 {
        Node *node;
-       Type *type = typestack->data;
-       typestack = g_list_remove(typestack,typestack->data);
+       Type *type = pop_type();
 
        type->postfix = postfix;
        
@@ -280,12 +285,13 @@ variable: scope type TOKEN ';'            {
                        push_variable($<id>3,the_scope,$<line>1,$<id>4);
                                                }
        ;
-argument:      ARGUMENT argflags TOKEN TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' {
+argument:      ARGUMENT argflags argtype TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' {
                        if(strcmp($<id>5,"get")==0 &&
                           strcmp($<id>8,"set")==0) {
                                Node *node;
+                               Type *type = pop_type();
                                g_free($<id>5); g_free($<id>8);
-                               node = new_argument($<id>3,$<list>2,$<id>4,
+                               node = new_argument($<id>3,type,$<list>2,$<id>4,
                                                    ($<cbuf>7)->str,$<line>6,
                                                    ($<cbuf>10)->str,$<line>9,
                                                    $<line>1);
@@ -295,8 +301,9 @@ argument:   ARGUMENT argflags TOKEN TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' {
                        } else if(strcmp($<id>5,"set")==0 &&
                                strcmp($<id>8,"get")==0) {
                                Node *node;
+                               Type *type = pop_type();
                                g_free($<id>5); g_free($<id>8);
-                               node = new_argument($<id>3,$<list>2,$<id>4,
+                               node = new_argument($<id>3,type,$<list>2,$<id>4,
                                                    ($<cbuf>10)->str,$<line>9,
                                                    ($<cbuf>7)->str,$<line>6,
                                                    $<line>1);
@@ -313,19 +320,21 @@ argument: ARGUMENT argflags TOKEN TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' {
                                YYERROR;
                        }
                                                }
-       |       ARGUMENT argflags TOKEN TOKEN TOKEN '{' CCODE ';' {
+       |       ARGUMENT argflags argtype TOKEN TOKEN '{' CCODE ';' {
                        if(strcmp($<id>5,"get")==0) {
                                Node *node;
+                               Type *type = pop_type();
                                g_free($<id>5);
-                               node = new_argument($<id>3,$<list>2,$<id>4,
+                               node = new_argument($<id>3,type,$<list>2,$<id>4,
                                                    ($<cbuf>7)->str,$<line>6,
                                                    NULL,0, $<line>1);
                                g_string_free($<cbuf>7,FALSE);
                                class_nodes = g_list_append(class_nodes,node);
                        } else if(strcmp($<id>5,"set")==0) {
                                Node *node;
+                               Type *type = pop_type();
                                g_free($<id>5);
-                               node = new_argument($<id>3,$<list>2,$<id>4,
+                               node = new_argument($<id>3,type,$<list>2,$<id>4,
                                                    NULL,0,($<cbuf>7)->str,
                                                    $<line>6, $<line>1);
                                g_string_free($<cbuf>7,FALSE);
@@ -340,6 +349,21 @@ argument:  ARGUMENT argflags TOKEN TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' {
                        }
                                                }
        ;
+
+argtype:       TOKEN '(' TOKEN type ')'        {
+                       if(strcmp($<id>3,"type")!=0) {
+                               g_free($<id>1);
+                               g_free($<id>3);
+                               yyerror(_("parse error"));
+                               YYERROR;
+                       }
+                       $<id>$ = $<id>1;
+                                               }
+       |       TOKEN                           {
+                       $<id>$ = $<id>1;
+                       typestack = g_list_prepend(typestack,NULL);
+                                               }
+       ;
        
 argflags:      '(' flaglist ')'                { $<list>$ = $<list>2; }
        |                                       { $<list>$ = NULL; }
index d606d624d3abbb0cdce4f9415f5c52144e052c70..181b92d3d2ea73d08c393a6eee022c1807694505 100644 (file)
@@ -1,3 +1,10 @@
+/* this is a TEST file, it's VERY VERY ugly, it's just supposed to test
+   the parser of gob and somewhat test some output as well, you can
+   look in here to see a whole array of different syntax options, but
+   don't expect this to be an easy to read file */
+
+requires 0.92.1
+
 %{
 #include <stdio.h>
 /* the next line is not mandatory, but if gob finds an include in one of
@@ -7,6 +14,11 @@
 #include "gtk-weird-button.h"
 #include "gtk-weird-button-private.h"
 
+/* this is to test if the lexer won't get confused by requires inside
+   some c code
+requires 99.99.99
+*/
+
 static void jjjj(void);
 %}
 
@@ -17,6 +29,15 @@ void bubu(void);
 class Gtk:Weird:Button from Gtk:Button {
        public int i;
        argument INT i set { self->i = ARG; } get { ARG = self->i; } ;
+       argument POINTER (type GtkObject *) some_object
+               set { /* set some_object */ }
+               get { /* get some_object */
+                       ARG=NULL; };
+       argument (CONSTRUCT) LONG (type long) write_only_long
+               set { /* set write_only_long */ };
+       argument POINTER (type char *) read_only_string
+               get { /* get readonly_long */
+                       ARG = g_strdup("BLAH"); };
        private int j;
        public GtkWidget * h;
        public char *bleh;
@@ -39,6 +60,10 @@ class Gtk:Weird:Button from Gtk:Button {
        private int blah(self, Gtk:Widget * wid (check null type),
                         int h (check > 0)) onerror -1 {
                gtk_container_add(GTK_CONTAINER(self),wid);
+
+               gtk_object_set(GTK_OBJECT(self),
+                              GTK_WEIRD_BUTTON_ARG_I(99),
+                              NULL);
                return h;
        }
        signal last INT (POINTER, INT)
index 22c6a2e7061abfe016e78629b1f9c10911d868f3..414ba43cabcd3764dcd1a38e14541b3916c72130 100644 (file)
@@ -98,11 +98,12 @@ new_method(int scope, int method, Type *mtype, char *otype, GList *gtktypes, cha
 }
 
 Node *
-new_argument(char *gtktype, GList *flags, char *name, char *get, int get_line, char *set, int set_line, int line_no)
+new_argument(char *gtktype, Type *atype, GList *flags, char *name, char *get, int get_line, char *set, int set_line, int line_no)
 {
        Argument *node = (Argument *)g_new(Node,1);
        node->type = ARGUMENT_NODE;
        node->gtktype = gtktype;
+       node->atype = atype;
        node->flags = flags;
        node->name = name;
        node->get = get;
index 474579e6b96f3c5daba9245f22d289011382a5a0..814ce027825f720287460c3d7a7d0091b5f7ade8 100644 (file)
@@ -91,6 +91,7 @@ typedef struct _Argument Argument;
 struct _Argument {
        int type;
        char *gtktype;
+       Type *atype;
        GList *flags;
        char *name;
        char *get;
@@ -162,7 +163,7 @@ Node *new_type(int stars, char *name, char *postfix);
 Node *new_check(int chtype, char *number);
 Node *new_funcarg(Type *atype, char *name, GList *checks);
 Node *new_method(int scope, int method, Type *mtype, char *otype, GList *gtktypes, char *id, GList *args, char *onerror, char *cbuf,int line_no,int ccode_line, int vararg);
-Node *new_argument(char *gtktype, GList *flags, char *name, char *get, int get_line, char *set, int set_line, int line_no);
+Node *new_argument(char *gtktype, Type *atype, GList *flags, char *name, char *get, int get_line, char *set, int set_line, int line_no);
 Node *new_variable(int scope, Type *vtype, char *id,int line_no);
 
 #endif