From 2753ff6cefbe916211d543f1029879e2a075d111 Mon Sep 17 00:00:00 2001 From: George Lebl Date: Sun, 1 Jul 2001 02:59:00 -0800 Subject: [PATCH] Release 1.0.10 --- ChangeLog | 65 +++ NEWS | 6 + configure | 2 +- configure.in | 2 +- doc/Makefile.am | 5 +- doc/Makefile.in | 5 +- doc/gob.1.in | 15 +- doc/makehtml.pl | 82 +++ examples/my-person.gob | 6 +- gob.spec | 81 +-- gob.spec.in | 81 +-- src/Makefile.am | 2 +- src/Makefile.in | 2 +- src/main.c | 3 +- src/parse.c | 1152 ++++++++++++++++++++++------------------ src/parse.h | 44 ++ src/parse.y | 229 ++++++-- src/util.c | 1 + 18 files changed, 1131 insertions(+), 652 deletions(-) create mode 100755 doc/makehtml.pl create mode 100644 src/parse.h diff --git a/ChangeLog b/ChangeLog index f2247b8..eb13eb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,68 @@ +Sat Jun 30 15:39:27 2001 George Lebl + + * Release 1.0.10 + +Sat Jun 30 14:57:37 2001 George Lebl + + * doc/gob.1.in: add documentation for (export) + +Tue Jun 26 15:54:08 2001 George Lebl + + * src/Makefile.am: add built sources to EXTRA_DIST + +2001-06-24 Mark Brown + + * src/main.c: Default to PRIVATE_HEADER_ONDEMAND rather than + PRIVATE_HEADER_ALWAYS as per documentation. + + * doc/gob.1.in: Fix cut & paste error in object_{get,set} + examples. + +Sat Jun 09 13:38:53 2001 George Lebl + + * src/parse.y: was freeing the wrong token + +2001-06-03 Eskil Heyn Olsen + + * configure.in: + binged version to 1.0.10 because of the export keyword + + * examples/my-person.gob: + Fixed some comments + + * examples/test-export.gob: + File that tests the (export) keyword. + + * src/parse.y: + Added a (export) keyword to argument, so gob will + autodefine the my_object_[get|set]_var functions. + +Sun May 13 02:33:15 2001 George Lebl + + * src/main.c: remove GET_NEW_VARG as it only works in gcc and + add TYPE_SELF macro + +Sun May 13 02:02:47 2001 George Lebl + + * src/util.c: patch from Frederic Crozat + to fix warning + +2001-04-27 Eskil Heyn Olsen + + * src/main.c: (print_class_block): + add a GET_NEW_VARG def (ala GET_NEW) which takes + ``"...", val'' gtk_object_new args. + +Sun Apr 22 03:22:48 2001 George Lebl + + * doc/makehtml.pl: make output nicer + +Sun Apr 22 03:03:05 2001 George Lebl + + * doc/makehtml.pl, doc/Makefile.am: groff kind of sucks at + making html, so this is my own very dumb convertor that probably + only properly works on this one man file + Sat Apr 21 20:37:40 2001 George Lebl * Release 1.0.9 diff --git a/NEWS b/NEWS index a5bb98f..9f874f9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +1.0.10 + * (export) flag for arguments to export get/set public methods (Eskil) + * private header by default ondemand as documented (Mark Brown) + * TYPE_SELF macro + * Various minor fixes (Eskil, Frederic Crozat, Mark Brown) + 1.0.9 * add direct support for BonoboXObject * fix objectlink refcounting problem (Eric Kidd) diff --git a/configure b/configure index 8d8b81d..84f9a48 100755 --- a/configure +++ b/configure @@ -703,7 +703,7 @@ fi PACKAGE=gob -VERSION=1.0.9 +VERSION=1.0.10 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; } diff --git a/configure.in b/configure.in index 90a53a7..339608c 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.2) AC_INIT(src/treefuncs.h) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(gob,1.0.9) +AM_INIT_AUTOMAKE(gob,1.0.10) dnl dnl An utter hack to allow embedding of gob inside other packages. diff --git a/doc/Makefile.am b/doc/Makefile.am index ffe8556..225139e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,7 @@ man_MANS = gob.1 SUBDIRS = -EXTRA_DIST = gob.1.in +EXTRA_DIST = gob.1.in makehtml.pl + +html: + perl $(top_srcdir)/doc/makehtml.pl < $(top_srcdir)/doc/gob.1 > $(top_builddir)/doc/gob.1.html diff --git a/doc/Makefile.in b/doc/Makefile.in index ce6de43..1f0237b 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -80,7 +80,7 @@ YACC = @YACC@ man_MANS = gob.1 SUBDIRS = -EXTRA_DIST = gob.1.in +EXTRA_DIST = gob.1.in makehtml.pl mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = gob.1 @@ -329,6 +329,9 @@ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean +html: + perl $(top_srcdir)/doc/makehtml.pl < $(top_srcdir)/doc/gob.1 > $(top_builddir)/doc/gob.1.html + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/doc/gob.1.in b/doc/gob.1.in index 518e358..d2efcf7 100644 --- a/doc/gob.1.in +++ b/doc/gob.1.in @@ -391,7 +391,7 @@ And for getting, you would use: .nf int height; - gtk_object_set (GTK_OBJECT (object), + gtk_object_get (GTK_OBJECT (object), MY_OBJECT_GET_ARG_HEIGHT (&height), NULL); @@ -481,6 +481,19 @@ For objectlink, just a pointer is returned on get, if you wish to keep it around you should call gtk_object_ref on it. For stringlink, get makes a copy of the string which you should free after use. This is the behaviour since 1.0.2. .PP +You can also automatically export get and set methods for each of the arguments +by appending '(export)' flag before the get and set statements. For example: +.nf + + public int foo; + argument INT (type int) foo (export) + get { ARG = self->foo; } + set { self->foo = ARG; }; + +.fi +Will export public methods get_foo(self) and set_foo(self, int foo) for you +automatically. Note that this behaviour is new in 1.0.10. +.PP Methods: .PP There is a whole array of possible methods. The three normal, diff --git a/doc/makehtml.pl b/doc/makehtml.pl new file mode 100755 index 0000000..8b14c5d --- /dev/null +++ b/doc/makehtml.pl @@ -0,0 +1,82 @@ +#!/usr/bin/perl +$printbr = 1; +$printtable = 0; +while (<>) { + s/&/&/g; + s/\/>/g; + if ($printtable == 1) { + $printtable = 2; + } elsif ($printtable == 2) { + $printtable = 3; + print ""; + } + + #hack, we're inside .nf so highlight comments and + # other such stuff + if ($printbr == 0) { + s/\/\*/\/\*/g; + s/\*\//\*\/<\/FONT>/g; + } + + if (/^\.\\"/) { + # comment ignore + } elsif (/^\.TH .*\"([^"]*)\"/) { + # must be at the front + print "$1 Manual page\n"; + print "\n"; + print "

$1 Manual page

\n"; + } elsif (/^\.SH (.*)$/) { + if ($printtable == 3) { + $printtable = 0; + print "\n"; + } + print "

$1

\n"; + } elsif (/^\.PP/) { + if ($printtable == 3) { + $printtable = 0; + print "\n"; + } + print "

\n"; + } elsif (/^\.B (.*)$/) { + print "$1\n"; + } elsif (/^\.I (.*)$/) { + print "$1\n"; + } elsif (/^\.nf/) { + if ($printtable == 3) { + $printtable = 0; + print "\n"; + } + print "
\n";
+		$printbr = 0;
+	} elsif (/^\.fi/) {
+		print "
\n"; + print "
\n"; + $printbr = 1; + } elsif (/^[ ]*$/) { + if ($printtable == 3) { + $printtable = 0; + print "\n"; + } + if ($printbr) { + print "
\n"; + } else { + print "\n"; + } + } elsif (/^\.TP/) { + if ($printtable == 3) { + $printtable = 1; + print "\n"; + } else { + $printtable = 1; + print "\n
"; + } + } else { + s/\\fB([^\\]*)\\fR/\1<\/B>/gm; + s/\\fI([^\\]*)\\fR/\1<\/I>/gm; + s/\\(.)/\1>/g; + print; + } +} + +print "\n"; diff --git a/examples/my-person.gob b/examples/my-person.gob index cad0672..d895a62 100644 --- a/examples/my-person.gob +++ b/examples/my-person.gob @@ -16,14 +16,14 @@ class My:Person from Gtk:Object { public long dod; /* date of death as a time_t */ private int rounds_in_shotgun; /* number of rounds in our shotgun */ - + argument POINTER (type char *) name get { - /* note that strdup handles NULL correctly */ + /* note that g_strdup handles NULL correctly */ ARG = g_strdup(self->name); } set { - /* note that strdup handles NULL correctly */ + /* note that g_free and g_strdup handles NULL correctly */ g_free(self->name); self->name = g_strdup(ARG); }; diff --git a/gob.spec b/gob.spec index f6a7b33..dcf1b47 100644 --- a/gob.spec +++ b/gob.spec @@ -1,48 +1,48 @@ -%define ver 1.0.9 -%define rel 1 -%define prefix /usr - -Summary: GOB, The GTK+ Object Builder -Name: gob -Version: %ver -Release: %rel -Copyright: GPL -Group: Development/Tools -Source: gob-%{ver}.tar.gz -Url: http://www.5z.com/jirka/linux.html#gob -BuildRoot: /var/tmp/gob-%{ver}-root -Prefix: %prefix +Summary: GOB, The GTK+ Object Builder +Name: gob +Version: 1.0.10 +Release: 1 +Copyright: GPL +Group: Development/Tools +Source: %{name}-%{version}.tar.gz +Url: http://www.5z.com/jirka/linux.html#gob +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Packager: Gnome Packaging Project %description GOB is a simple preprocessor for making GTK+ objects. It makes objects from a single file which has inline C code so that you don't have to edit the generated files. Syntax is somewhat inspired by java and yacc. -%changelog -* Tue Feb 7 2000 George Lebl -- added %{prefix}/share/aclocal/* to %files -* Tue Dec 14 1999 George Lebl -- added the examples dir to the %doc -* Mon Aug 16 1999 George Lebl -- added gob.spec.in file - %prep %setup %build -./configure --prefix=%prefix +CFLAGS="$RPM_OPT_FLAGS" ./configure \ + --prefix=%{_prefix} \ + --sysconfdir=%{_sysconfdir} \ + --bindir=%{_bindir} \ + --libdir=%{_libdir} \ + --includedir=%{_includedir} \ + --datadir=%{_datadir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} %{_target_platform} + -if [ "$SMP" != "" ]; then - (make "MAKE=make -k -j $SMP"; exit 0) - make -else - make -fi +make %install rm -rf $RPM_BUILD_ROOT -make prefix=$RPM_BUILD_ROOT%{prefix} install +make prefix=$RPM_BUILD_ROOT%{_prefix} \ + sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + datadir=$RPM_BUILD_ROOT%{_datadir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} \ + infodir=$RPM_BUILD_ROOT%{_infodir} install + %clean rm -rf $RPM_BUILD_ROOT @@ -53,6 +53,21 @@ rm -rf $RPM_BUILD_ROOT %doc README AUTHORS COPYING NEWS TODO ChangeLog %doc examples -%{prefix}/bin/* -%{prefix}/man/man1/* -%{prefix}/share/aclocal/* +%{_bindir}/* +%{_mandir}/man1/* +%{_datadir}/aclocal/* + + +%changelog +* Wed Jun 27 2001 Spider +- remake in style of gpp +- Get clean out path's and the rest. blah. + +* Tue Feb 7 2000 George Lebl +- added %{prefix}/share/aclocal/* to %files + +* Tue Dec 14 1999 George Lebl +- added the examples dir to the %doc + +* Mon Aug 16 1999 George Lebl +- added gob.spec.in file diff --git a/gob.spec.in b/gob.spec.in index c4ed4e7..e86c351 100644 --- a/gob.spec.in +++ b/gob.spec.in @@ -1,48 +1,48 @@ -%define ver @VERSION@ -%define rel SNAP -%define prefix /usr - -Summary: GOB, The GTK+ Object Builder -Name: gob -Version: %ver -Release: %rel -Copyright: GPL -Group: Development/Tools -Source: gob-%{ver}.tar.gz -Url: http://www.5z.com/jirka/linux.html#gob -BuildRoot: /var/tmp/gob-%{ver}-root -Prefix: %prefix +Summary: GOB, The GTK+ Object Builder +Name: gob +Version: @VERSION@ +Release: SNAP +Copyright: GPL +Group: Development/Tools +Source: %{name}-%{version}.tar.gz +Url: http://www.5z.com/jirka/linux.html#gob +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Packager: Gnome Packaging Project %description GOB is a simple preprocessor for making GTK+ objects. It makes objects from a single file which has inline C code so that you don't have to edit the generated files. Syntax is somewhat inspired by java and yacc. -%changelog -* Tue Feb 7 2000 George Lebl -- added %{prefix}/share/aclocal/* to %files -* Tue Dec 14 1999 George Lebl -- added the examples dir to the %doc -* Mon Aug 16 1999 George Lebl -- added gob.spec.in file - %prep %setup %build -./configure --prefix=%prefix +CFLAGS="$RPM_OPT_FLAGS" ./configure \ + --prefix=%{_prefix} \ + --sysconfdir=%{_sysconfdir} \ + --bindir=%{_bindir} \ + --libdir=%{_libdir} \ + --includedir=%{_includedir} \ + --datadir=%{_datadir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} %{_target_platform} + -if [ "$SMP" != "" ]; then - (make "MAKE=make -k -j $SMP"; exit 0) - make -else - make -fi +make %install rm -rf $RPM_BUILD_ROOT -make prefix=$RPM_BUILD_ROOT%{prefix} install +make prefix=$RPM_BUILD_ROOT%{_prefix} \ + sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + datadir=$RPM_BUILD_ROOT%{_datadir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} \ + infodir=$RPM_BUILD_ROOT%{_infodir} install + %clean rm -rf $RPM_BUILD_ROOT @@ -53,6 +53,21 @@ rm -rf $RPM_BUILD_ROOT %doc README AUTHORS COPYING NEWS TODO ChangeLog %doc examples -%{prefix}/bin/* -%{prefix}/man/man1/* -%{prefix}/share/aclocal/* +%{_bindir}/* +%{_mandir}/man1/* +%{_datadir}/aclocal/* + + +%changelog +* Wed Jun 27 2001 Spider +- remake in style of gpp +- Get clean out path's and the rest. blah. + +* Tue Feb 7 2000 George Lebl +- added %{prefix}/share/aclocal/* to %files + +* Tue Dec 14 1999 George Lebl +- added the examples dir to the %doc + +* Mon Aug 16 1999 George Lebl +- added gob.spec.in file diff --git a/src/Makefile.am b/src/Makefile.am index ffe9113..160b3af 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,7 +36,7 @@ gob_LDADD = \ CLEANFILES += $(BUILT_SOURCES) gtk-weird-button.* gtk-weird-button-private.h -EXTRA_DIST = test.gob generate_treefuncs.pl treefuncs.def +EXTRA_DIST = $(BUILT_SOURCES) test.gob generate_treefuncs.pl treefuncs.def parse.h parse.c: parse.y $(YACC) $(YFLAGS) $< diff --git a/src/Makefile.in b/src/Makefile.in index d4e16e4..a337f81 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -102,7 +102,7 @@ gob_LDADD = -lm $(GLIB_LIBS) @LEXLIB@ CLEANFILES = $(BUILT_SOURCES) gtk-weird-button.* gtk-weird-button-private.h -EXTRA_DIST = test.gob generate_treefuncs.pl treefuncs.def +EXTRA_DIST = $(BUILT_SOURCES) test.gob generate_treefuncs.pl treefuncs.def mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = diff --git a/src/main.c b/src/main.c index f601757..0cdd6ff 100644 --- a/src/main.c +++ b/src/main.c @@ -94,7 +94,7 @@ gboolean no_gnu = FALSE; gboolean exit_on_warn = FALSE; gboolean exit_on_error = TRUE; gboolean got_error = FALSE; -gint private_header = PRIVATE_HEADER_ALWAYS; +gint private_header = PRIVATE_HEADER_ONDEMAND; gboolean no_extern_c = FALSE; gboolean no_write = FALSE; gboolean no_lines = FALSE; @@ -2249,6 +2249,7 @@ print_class_block(Class *c) out_printf(out, "#define SELF(x) %s(x)\n", macrobase); out_printf(out, "#define SELF_CONST(x) %s_CONST(x)\n", macrobase); out_printf(out, "#define IS_SELF(x) %s(x)\n", macrois); + out_printf(out, "#define TYPE_SELF %s\n", macrotype); out_printf(out, "#define SELF_CLASS(x) %s_CLASS(x)\n\n", macrobase); out_printf(out, "#define SELF_GET_CLASS(x) %s_GET_CLASS(x)\n\n", diff --git a/src/parse.c b/src/parse.c index 420897c..2d9d349 100644 --- a/src/parse.c +++ b/src/parse.c @@ -315,8 +315,65 @@ set_return_value(char *type, char *val) return FALSE; } +static void +export_accessors (char *var_name, + GString *get_cbuf, + int get_lineno, + GString *set_cbuf, + int set_lineno, + Type *type, + int lineno) +{ + if (get_cbuf) { + char *get_id = g_strdup_printf ("get_%s", var_name); + GString *get_cbuf_copy = g_string_new (get_cbuf->str); + char *tmp; + Node *node1 = new_type (type->name, type->pointer, type->postfix); + Node *node3 = new_type (class->class.otype, "*", NULL); + + tmp = g_strdup_printf ("\t%s%s ARG;\n", + type->name, + type->pointer ? type->pointer : ""); + get_cbuf_copy = g_string_prepend (get_cbuf_copy, tmp); + g_free (tmp); + + tmp = g_strdup_printf ("\n\t\treturn ARG;\n"); + get_cbuf_copy = g_string_append (get_cbuf_copy, tmp); + g_free (tmp); + + typestack = g_list_prepend (typestack, node1); + typestack = g_list_prepend (typestack, node3); + + push_funcarg ("self", FALSE); + + push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL, + get_id, get_cbuf_copy, get_lineno, + lineno, FALSE, NULL); + } + + if (set_cbuf) { + char *set_id = g_strdup_printf ("set_%s", var_name); + GString *set_cbuf_copy = g_string_new (set_cbuf->str); + Node *node1 = new_type (type->name, type->pointer, type->postfix); + Node *node2 = new_type ("void", NULL, NULL); + Node *node3 = new_type (class->class.otype, "*", NULL); + + typestack = g_list_prepend (typestack, node2); + typestack = g_list_prepend (typestack, node1); + typestack = g_list_prepend (typestack, node3); + + push_funcarg ("self", FALSE); + push_funcarg ("ARG", FALSE); + + typestack = g_list_prepend (typestack, node2); + push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL, + set_id, set_cbuf_copy, set_lineno, + lineno, FALSE, NULL); + } +} -#line 298 "parse.y" + +#line 355 "parse.y" typedef union { char *id; GString *cbuf; @@ -338,11 +395,11 @@ typedef union { -#define YYFINAL 270 +#define YYFINAL 274 #define YYFLAG -32768 #define YYNTBASE 50 -#define YYTRANSLATE(x) ((unsigned)(x) <= 290 ? yytranslate[x] : 88) +#define YYTRANSLATE(x) ((unsigned)(x) <= 290 ? yytranslate[x] : 89) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -382,16 +439,16 @@ static const short yyprhs[] = { 0, 24, 27, 29, 34, 38, 44, 45, 51, 57, 60, 62, 64, 67, 69, 71, 73, 75, 77, 79, 81, 84, 88, 91, 95, 98, 101, 103, 105, 106, 112, - 119, 131, 140, 146, 152, 154, 158, 159, 163, 165, - 168, 170, 172, 174, 177, 180, 183, 187, 191, 194, - 197, 200, 202, 205, 207, 210, 212, 214, 216, 218, - 220, 222, 224, 226, 228, 230, 232, 234, 236, 239, - 242, 246, 249, 251, 255, 259, 262, 264, 269, 273, - 275, 278, 280, 291, 303, 313, 323, 332, 344, 353, - 359, 362, 367, 368, 370, 373, 375, 377, 380, 383, - 387, 392, 397, 399, 403, 405, 409, 411, 414, 418, - 425, 433, 436, 438, 440, 443, 446, 450, 454, 458, - 462, 464, 467 + 119, 132, 142, 149, 153, 154, 160, 162, 166, 167, + 171, 173, 176, 178, 180, 182, 185, 188, 191, 195, + 199, 202, 205, 208, 210, 213, 215, 218, 220, 222, + 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, + 244, 247, 250, 254, 257, 259, 263, 267, 270, 272, + 277, 281, 283, 286, 288, 299, 311, 321, 331, 340, + 352, 361, 367, 370, 375, 376, 378, 381, 383, 385, + 388, 391, 395, 400, 405, 407, 411, 413, 417, 419, + 422, 426, 433, 441, 444, 446, 448, 451, 454, 458, + 462, 466, 470, 472, 475 }; static const short yyrhs[] = { 52, @@ -401,67 +458,68 @@ static const short yyrhs[] = { 52, 56, 38, 0, 54, 37, 38, 0, 3, 21, 4, 21, 55, 0, 0, 39, 19, 19, 40, 55, 0, 39, 19, 20, 40, 55, 0, 56, 57, 0, 57, - 0, 78, 0, 19, 78, 0, 62, 0, 63, 0, + 0, 79, 0, 19, 79, 0, 62, 0, 63, 0, 41, 0, 29, 0, 30, 0, 31, 0, 32, 0, - 19, 19, 0, 19, 37, 23, 0, 42, 87, 0, + 19, 19, 0, 19, 37, 23, 0, 42, 88, 0, 42, 37, 23, 0, 59, 60, 0, 60, 59, 0, - 60, 0, 59, 0, 0, 58, 67, 19, 61, 41, - 0, 58, 67, 19, 22, 61, 41, 0, 33, 65, - 64, 19, 19, 37, 23, 19, 37, 23, 41, 0, - 33, 65, 64, 19, 19, 37, 23, 41, 0, 33, - 65, 64, 19, 19, 0, 19, 39, 19, 67, 40, - 0, 19, 0, 39, 66, 40, 0, 0, 19, 43, - 66, 0, 19, 0, 68, 72, 0, 68, 0, 69, - 0, 19, 0, 5, 19, 0, 19, 5, 0, 71, - 19, 0, 5, 71, 19, 0, 71, 19, 5, 0, - 70, 69, 0, 21, 69, 0, 5, 69, 0, 21, - 0, 21, 5, 0, 70, 0, 70, 5, 0, 6, - 0, 18, 0, 14, 0, 15, 0, 13, 0, 16, - 0, 17, 0, 11, 0, 12, 0, 7, 0, 8, - 0, 9, 0, 44, 0, 44, 5, 0, 44, 72, - 0, 44, 5, 72, 0, 19, 75, 0, 75, 0, - 58, 19, 75, 0, 19, 58, 75, 0, 58, 75, - 0, 73, 0, 19, 39, 76, 40, 0, 76, 45, - 19, 0, 19, 0, 37, 23, 0, 41, 0, 35, - 65, 74, 67, 19, 39, 81, 40, 79, 77, 0, - 58, 35, 65, 73, 67, 19, 39, 81, 40, 79, - 77, 0, 34, 58, 67, 19, 39, 81, 40, 79, - 77, 0, 58, 34, 67, 19, 39, 81, 40, 79, - 77, 0, 34, 67, 19, 39, 81, 40, 79, 77, - 0, 36, 39, 21, 40, 67, 19, 39, 81, 40, - 79, 77, 0, 58, 67, 19, 39, 81, 40, 79, - 77, 0, 19, 39, 19, 40, 77, 0, 19, 80, - 0, 19, 80, 19, 80, 0, 0, 87, 0, 37, - 23, 0, 6, 0, 19, 0, 19, 5, 0, 5, - 19, 0, 19, 45, 82, 0, 19, 5, 45, 82, - 0, 5, 19, 45, 82, 0, 82, 0, 83, 45, - 10, 0, 83, 0, 83, 45, 84, 0, 84, 0, - 67, 19, 0, 67, 19, 22, 0, 67, 19, 39, - 19, 85, 40, 0, 67, 19, 22, 39, 19, 85, - 40, 0, 85, 86, 0, 86, 0, 19, 0, 46, - 87, 0, 47, 87, 0, 46, 42, 87, 0, 47, - 42, 87, 0, 42, 42, 87, 0, 48, 42, 87, - 0, 20, 0, 49, 20, 0, 19, 0 + 60, 0, 59, 0, 0, 58, 68, 19, 61, 41, + 0, 58, 68, 19, 22, 61, 41, 0, 33, 66, + 65, 19, 64, 19, 37, 23, 19, 37, 23, 41, + 0, 33, 66, 65, 19, 64, 19, 37, 23, 41, + 0, 33, 66, 65, 19, 64, 19, 0, 39, 19, + 40, 0, 0, 19, 39, 19, 68, 40, 0, 19, + 0, 39, 67, 40, 0, 0, 19, 43, 67, 0, + 19, 0, 69, 73, 0, 69, 0, 70, 0, 19, + 0, 5, 19, 0, 19, 5, 0, 72, 19, 0, + 5, 72, 19, 0, 72, 19, 5, 0, 71, 70, + 0, 21, 70, 0, 5, 70, 0, 21, 0, 21, + 5, 0, 71, 0, 71, 5, 0, 6, 0, 18, + 0, 14, 0, 15, 0, 13, 0, 16, 0, 17, + 0, 11, 0, 12, 0, 7, 0, 8, 0, 9, + 0, 44, 0, 44, 5, 0, 44, 73, 0, 44, + 5, 73, 0, 19, 76, 0, 76, 0, 58, 19, + 76, 0, 19, 58, 76, 0, 58, 76, 0, 74, + 0, 19, 39, 77, 40, 0, 77, 45, 19, 0, + 19, 0, 37, 23, 0, 41, 0, 35, 66, 75, + 68, 19, 39, 82, 40, 80, 78, 0, 58, 35, + 66, 74, 68, 19, 39, 82, 40, 80, 78, 0, + 34, 58, 68, 19, 39, 82, 40, 80, 78, 0, + 58, 34, 68, 19, 39, 82, 40, 80, 78, 0, + 34, 68, 19, 39, 82, 40, 80, 78, 0, 36, + 39, 21, 40, 68, 19, 39, 82, 40, 80, 78, + 0, 58, 68, 19, 39, 82, 40, 80, 78, 0, + 19, 39, 19, 40, 78, 0, 19, 81, 0, 19, + 81, 19, 81, 0, 0, 88, 0, 37, 23, 0, + 6, 0, 19, 0, 19, 5, 0, 5, 19, 0, + 19, 45, 83, 0, 19, 5, 45, 83, 0, 5, + 19, 45, 83, 0, 83, 0, 84, 45, 10, 0, + 84, 0, 84, 45, 85, 0, 85, 0, 68, 19, + 0, 68, 19, 22, 0, 68, 19, 39, 19, 86, + 40, 0, 68, 19, 22, 39, 19, 86, 40, 0, + 86, 87, 0, 87, 0, 19, 0, 46, 88, 0, + 47, 88, 0, 46, 42, 88, 0, 47, 42, 88, + 0, 42, 42, 88, 0, 48, 42, 88, 0, 20, + 0, 49, 20, 0, 19, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, - 316, 317, 318, 319, 322, 328, 334, 340, 346, 352, - 360, 361, 364, 369, 376, 382, 383, 395, 409, 410, - 413, 414, 422, 423, 424, 427, 428, 429, 430, 433, - 446, 462, 466, 474, 475, 476, 477, 478, 484, 487, - 491, 527, 556, 628, 637, 643, 644, 647, 650, 656, - 660, 667, 670, 673, 677, 681, 685, 690, 698, 702, - 707, 711, 714, 718, 721, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 737, 738, 739, 742, 743, 744, - 748, 755, 767, 773, 785, 797, 800, 806, 811, 814, - 819, 820, 824, 840, 856, 872, 888, 899, 905, 915, - 938, 949, 968, 974, 975, 981, 982, 993, 1004, 1015, - 1025, 1035, 1045, 1048, 1049, 1052, 1053, 1056, 1059, 1062, - 1070, 1080, 1081, 1084, 1097, 1101, 1105, 1109, 1113, 1117, - 1123, 1124, 1128 + 373, 374, 375, 376, 379, 385, 391, 397, 403, 409, + 417, 418, 421, 426, 433, 439, 440, 452, 466, 467, + 470, 471, 479, 480, 481, 484, 485, 486, 487, 490, + 503, 519, 523, 531, 532, 533, 534, 535, 541, 544, + 549, 600, 648, 731, 739, 741, 750, 756, 757, 760, + 763, 769, 773, 780, 783, 786, 790, 794, 798, 803, + 811, 815, 820, 824, 827, 831, 834, 839, 840, 841, + 842, 843, 844, 845, 846, 847, 850, 851, 852, 855, + 856, 857, 861, 868, 880, 886, 898, 910, 913, 919, + 924, 927, 932, 933, 937, 953, 969, 985, 1001, 1012, + 1018, 1028, 1051, 1062, 1081, 1087, 1088, 1094, 1095, 1106, + 1117, 1128, 1138, 1148, 1158, 1161, 1162, 1165, 1166, 1169, + 1172, 1175, 1183, 1193, 1194, 1197, 1210, 1214, 1218, 1222, + 1226, 1230, 1236, 1237, 1241 }; #endif @@ -475,10 +533,10 @@ static const char * const yytname[] = { "$","error","$undefined.","CLASS", "CLASSWIDE","ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE","'{'","'}'","'('","')'", "';'","'='","'|'","'*'","','","'>'","'<'","'!'","'-'","prog","ccode","ccodes", "class","classdec","classflags","classcode","thing","scope","destructor","initializer", -"varoptions","variable","argument","argtype","flags","flaglist","type","specifier_list", -"spec_list","specifier","strunionenum","pointer","simplesigtype","fullsigtype", -"sigtype","tokenlist","codenocode","method","returnvals","retcode","funcargs", -"arglist","arglist1","arg","checklist","check","numtok", NULL +"varoptions","variable","argument","export","argtype","flags","flaglist","type", +"specifier_list","spec_list","specifier","strunionenum","pointer","simplesigtype", +"fullsigtype","sigtype","tokenlist","codenocode","method","returnvals","retcode", +"funcargs","arglist","arglist1","arg","checklist","check","numtok", NULL }; #endif @@ -488,15 +546,15 @@ static const short yyr1[] = { 0, 57, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 60, 60, 61, 61, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 66, 66, 67, - 67, 68, 68, 68, 68, 68, 68, 68, 69, 69, - 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 71, 71, 71, 72, 72, 72, - 72, 73, 73, 74, 74, 74, 74, 75, 76, 76, - 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, - 79, 79, 79, 80, 80, 81, 81, 81, 81, 81, - 81, 81, 81, 82, 82, 83, 83, 84, 84, 84, - 84, 85, 85, 86, 86, 86, 86, 86, 86, 86, - 87, 87, 87 + 67, 68, 68, 69, 69, 69, 69, 69, 69, 69, + 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, + 71, 71, 71, 71, 71, 71, 72, 72, 72, 73, + 73, 73, 73, 74, 74, 75, 75, 75, 75, 76, + 77, 77, 78, 78, 79, 79, 79, 79, 79, 79, + 79, 79, 80, 80, 80, 81, 81, 82, 82, 82, + 82, 82, 82, 82, 82, 83, 83, 84, 84, 85, + 85, 85, 85, 86, 86, 87, 87, 87, 87, 87, + 87, 87, 88, 88, 88 }; static const short yyr2[] = { 0, @@ -504,188 +562,188 @@ static const short yyr2[] = { 0, 2, 1, 4, 3, 5, 0, 5, 5, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 3, 2, 2, 1, 1, 0, 5, 6, - 11, 8, 5, 5, 1, 3, 0, 3, 1, 2, - 1, 1, 1, 2, 2, 2, 3, 3, 2, 2, - 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 3, 2, 1, 3, 3, 2, 1, 4, 3, 1, - 2, 1, 10, 11, 9, 9, 8, 11, 8, 5, - 2, 4, 0, 1, 2, 1, 1, 2, 2, 3, - 4, 4, 1, 3, 1, 3, 1, 2, 3, 6, - 7, 2, 1, 1, 2, 2, 3, 3, 3, 3, - 1, 2, 1 + 12, 9, 6, 3, 0, 5, 1, 3, 0, 3, + 1, 2, 1, 1, 1, 2, 2, 2, 3, 3, + 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 3, 2, 1, 3, 3, 2, 1, 4, + 3, 1, 2, 1, 10, 11, 9, 9, 8, 11, + 8, 5, 2, 4, 0, 1, 2, 1, 1, 2, + 2, 3, 4, 4, 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, 5, 7, 8, 6, 9, 10, 12, 0, 4, 0, 0, 11, 3, 2, 0, 0, 1, 0, 26, - 27, 28, 29, 47, 0, 47, 0, 14, 25, 0, + 27, 28, 29, 49, 0, 49, 0, 14, 25, 0, 20, 0, 23, 24, 21, 16, 0, 0, 0, 22, - 0, 0, 0, 66, 75, 76, 77, 73, 74, 70, - 68, 69, 71, 72, 67, 53, 62, 0, 0, 51, - 52, 64, 0, 0, 0, 13, 19, 0, 47, 0, - 0, 15, 0, 0, 49, 0, 45, 0, 0, 54, - 61, 0, 55, 63, 60, 0, 0, 78, 50, 65, - 59, 56, 0, 0, 87, 0, 83, 0, 0, 0, - 38, 0, 0, 0, 0, 46, 0, 0, 57, 0, - 0, 79, 80, 58, 0, 0, 0, 82, 0, 86, + 0, 0, 0, 68, 77, 78, 79, 75, 76, 72, + 70, 71, 73, 74, 69, 55, 64, 0, 0, 53, + 54, 66, 0, 0, 0, 13, 19, 0, 49, 0, + 0, 15, 0, 0, 51, 0, 47, 0, 0, 56, + 63, 0, 57, 65, 62, 0, 0, 80, 52, 67, + 61, 58, 0, 0, 89, 0, 85, 0, 0, 0, + 38, 0, 0, 0, 0, 48, 0, 45, 59, 0, + 0, 81, 82, 60, 0, 0, 0, 84, 0, 88, 0, 0, 0, 0, 0, 0, 38, 0, 0, 37, - 36, 0, 0, 0, 0, 92, 100, 48, 0, 43, - 0, 0, 66, 53, 0, 0, 113, 115, 117, 81, - 90, 0, 85, 84, 0, 0, 0, 0, 30, 0, - 0, 0, 133, 131, 0, 0, 32, 34, 35, 39, - 16, 16, 91, 0, 0, 0, 54, 55, 0, 118, - 103, 0, 88, 0, 0, 0, 0, 0, 31, 40, - 103, 33, 132, 17, 18, 44, 0, 103, 0, 0, - 110, 119, 0, 0, 0, 114, 116, 89, 0, 0, - 103, 0, 0, 0, 42, 0, 112, 111, 0, 0, - 0, 101, 104, 97, 103, 0, 0, 0, 99, 0, - 95, 0, 124, 0, 0, 0, 0, 0, 123, 105, - 0, 0, 103, 96, 103, 0, 0, 0, 0, 125, - 0, 126, 0, 120, 122, 102, 93, 0, 0, 41, - 121, 129, 127, 128, 130, 98, 94, 0, 0, 0 + 36, 0, 0, 0, 0, 94, 102, 50, 0, 0, + 0, 0, 0, 68, 55, 0, 0, 115, 117, 119, + 83, 92, 0, 87, 86, 0, 0, 0, 0, 30, + 0, 0, 0, 135, 133, 0, 0, 32, 34, 35, + 39, 16, 16, 93, 0, 0, 43, 0, 56, 57, + 0, 120, 105, 0, 90, 0, 0, 0, 0, 0, + 31, 40, 105, 33, 134, 17, 18, 46, 44, 0, + 105, 0, 0, 112, 121, 0, 0, 0, 116, 118, + 91, 0, 0, 105, 0, 0, 0, 0, 114, 113, + 0, 0, 0, 103, 106, 99, 105, 0, 0, 0, + 101, 0, 42, 97, 0, 126, 0, 0, 0, 0, + 0, 125, 107, 0, 0, 105, 98, 105, 0, 0, + 0, 0, 127, 0, 128, 0, 122, 124, 104, 95, + 0, 0, 0, 123, 131, 129, 130, 132, 100, 96, + 41, 0, 0, 0 }; -static const short yydefgoto[] = { 268, +static const short yydefgoto[] = { 272, 8, 9, 10, 11, 72, 30, 31, 32, 130, 131, - 132, 33, 34, 78, 42, 76, 145, 60, 61, 62, - 63, 89, 95, 96, 97, 152, 137, 35, 205, 222, - 146, 147, 148, 149, 238, 239, 223 + 132, 33, 34, 141, 78, 42, 76, 146, 60, 61, + 62, 63, 89, 95, 96, 97, 153, 137, 35, 208, + 224, 147, 148, 149, 150, 241, 242, 225 }; -static const short yypact[] = { 172, - -4,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 172, 370, - -5, 93,-32768, 370, 370, 173, 87, 370, 209,-32768, --32768,-32768,-32768, 72, 155, 72, 84,-32768,-32768, 191, --32768, 120,-32768,-32768,-32768, 104, 107, 128, 120,-32768, - 132, 133, 275,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 151, 343, 292, 146, 135, --32768, 357, 158, 159, 160,-32768,-32768, 292, 72, 161, - 163,-32768, 143, 174, 169, 154, 162, 194, 371,-32768, --32768, 196,-32768, 371,-32768, 197, 178, 16,-32768, 371, --32768, 213, 223, 200,-32768, 292,-32768, 190, 212, 214, - 52, 11, 41, 195, 132,-32768, 216, 217,-32768, 198, - 309, 135,-32768,-32768, 207, 228, 230,-32768, 61,-32768, - 232, 292, 218, 61, 292, 68, 7, 309, 9, 219, - 239, 237, 220, 245, 272,-32768,-32768,-32768, 292, 265, - 309, 326, 279, 17, 293, 289,-32768, 291,-32768,-32768, --32768, -20,-32768,-32768, 307, 331, 309, 332,-32768, 329, - 312, 325,-32768,-32768, 344, 346,-32768,-32768,-32768,-32768, - 104, 104,-32768, 339, 358, 340, 64, 100, 292, -6, - 372, 258,-32768, 380, 309, 351, 360, 362,-32768,-32768, - 372,-32768,-32768,-32768,-32768,-32768, 45, 372, 292, 292, --32768, 363, 384, 28, 41,-32768,-32768,-32768, 364, 309, - 372, 309, 41, 368,-32768, 41,-32768,-32768, 387, 111, - 385, 388,-32768,-32768, 372, 369, 41, 373,-32768, 389, --32768, 111,-32768, 374, 34, 50, 375, 70,-32768,-32768, - 28, 41, 372,-32768, 372, 377, 102, 18, 18,-32768, - 18,-32768, 18,-32768,-32768,-32768,-32768, 41, 41,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 410, 411,-32768 +static const short yypact[] = { 175, + 34,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 175, 236, + 47, 104,-32768, 236, 236, 176, 96, 236, 212,-32768, +-32768,-32768,-32768, 107, 158, 107, 109,-32768,-32768, 194, +-32768, 123,-32768,-32768,-32768, 110, 111, 124, 123,-32768, + 135, 136, 278,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 154, 346, 295, 149, 138, +-32768, 360, 161, 162, 163,-32768,-32768, 295, 107, 164, + 166,-32768, 146, 177, 172, 157, 165, 197, 374,-32768, +-32768, 199,-32768, 374,-32768, 200, 181, 2,-32768, 374, +-32768, 216, 226, 203,-32768, 295,-32768, 193, 215, 217, + 57, 74, 37, 198, 135,-32768, 219, 201,-32768, 210, + 312, 138,-32768,-32768, 211, 220, 233,-32768, -2,-32768, + 234, 295, 242, -2, 295, -8, -6, 312, 38, 246, + 235, 257, 265, 275, 299,-32768,-32768,-32768, 295, 313, + 320, 312, 329, 309, 5, 334, 314,-32768, 310,-32768, +-32768,-32768, -20,-32768,-32768, 317, 349, 312, 350,-32768, + 347, 341, 343,-32768,-32768, 361, 373,-32768,-32768,-32768, +-32768, 110, 110,-32768, 354, 356, 362, 357, -18, 81, + 295, 61, 379, 261,-32768, 381, 312, 363, 364, 366, +-32768,-32768, 379,-32768,-32768,-32768,-32768,-32768,-32768, 378, + 379, 295, 295,-32768, 367, 384, 40, 37,-32768,-32768, +-32768, 368, 312, 379, 312, 37, 29, 37,-32768,-32768, + 388, 114, 386, 391,-32768,-32768, 379, 371, 37, 372, +-32768, 376,-32768,-32768, 114,-32768, 375, 46, 62, 377, + 72,-32768,-32768, 40, 37, 379,-32768, 379, 392, 105, + 48, 48,-32768, 48,-32768, 48,-32768,-32768,-32768,-32768, + 37, 37, 380,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 414, 416,-32768 }; static const short yypgoto[] = {-32768, - 241, 71, 405,-32768, -58,-32768, 390, -14, 284, 294, - 295,-32768,-32768,-32768, -17, 314, -24,-32768, -39,-32768, - -40, -76, 321,-32768, -51,-32768, -203, 404, -184, 184, - -122, -104,-32768, 244, 199, -154, -129 + 98, 14, 409,-32768, -67,-32768, 390, -13, 291, 293, + 297,-32768,-32768,-32768,-32768, -22, 321, -24,-32768, -41, +-32768, -40, -79, 325,-32768, -63,-32768, -176, 408, -175, + 184, -123, -140,-32768, 245, 195, -227, -129 }; -#define YYLAST 431 - - -static const short yytable[] = { 167, - 59, 224, 82, 81, 39, 162, 213, 70, 64, 229, - 58, 113, 231, 216, 74, 202, 12, 85, 176, 183, - 112, 178, 91, 244, 184, 126, 227, 163, 164, 133, - 134, 16, 203, 86, 187, 150, 163, 164, 257, 81, - 242, 118, 120, 99, 81, 165, 163, 164, 129, 94, - 81, 100, 163, 164, 266, 267, -107, 166, 258, 88, - 259, 179, 209, 214, 221, 153, 166, 154, 163, 164, - 126, 121, 118, 127, 201, 249, 166, 135, 117, 115, - 15, 136, 166, 255, 18, 215, 159, 226, 233, 228, - 128, 251, 255, 129, 217, 218, 17, 156, 166, 116, - 158, 82, 81, -109, 160, 250, 252, 36, 199, 254, - 41, 234, 194, 195, 174, 235, 236, 237, 262, 263, - 233, 264, 65, 265, 43, 44, 45, 46, 47, 233, - 48, 49, 50, 51, 52, 53, 54, 55, 56, -108, - 57, 261, 71, 234, 200, 38, 73, 235, 236, 237, - 75, 77, 234, 68, 69, 83, 235, 236, 237, 43, - 44, 45, 46, 47, 87, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 1, 57, 92, 93, 88, 101, - 98, 102, 103, 20, 21, 22, 23, 20, 21, 22, - 23, 19, 104, 106, 2, 3, 4, 5, 6, 7, - 107, 20, 21, 22, 23, 24, 25, 26, 27, 19, - 28, 105, 108, 29, 109, 110, 111, 114, 119, 20, - 21, 22, 23, 24, 25, 26, 27, 37, 66, 122, - 123, 29, 124, 128, 139, 140, 141, 20, 21, 22, - 23, 115, 25, 26, 27, 116, 151, 38, 115, 13, - 155, 20, 21, 22, 23, 13, 157, 126, 13, 171, - 129, 116, 43, 44, 45, 46, 47, 206, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 170, 57, 79, +#define YYLAST 430 + + +static const short yytable[] = { 168, + 59, 81, 82, 64, 163, 39, 112, 70, 113, 180, + 160, 58, 126, 258, 74, 85, 115, 216, 178, 185, + 91, -111, 258, 15, 186, 218, 202, 18, 161, 118, + 120, 226, 151, 86, 189, 129, 116, 81, 229, 231, + 204, 234, 81, 99, -109, 88, 100, 232, 81, 181, + 94, 245, 247, 154, 12, 155, 164, 165, 164, 165, + 118, 219, 220, 212, 164, 165, 164, 165, 260, 233, + 261, 121, 262, 135, 166, 126, 223, 136, 127, 117, + 164, 165, 205, 16, 269, 270, 167, 252, 167, 228, + 236, 230, 133, 134, 167, 128, 167, 157, 129, 206, + 159, 81, 82, 254, 196, 197, 13, 17, 253, 255, + 167, 257, 13, 237, 175, 13, 36, 238, 239, 240, + -110, 265, 266, 236, 267, 203, 268, 43, 44, 45, + 46, 47, 236, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 73, 57, 264, 41, 237, 65, 71, 38, + 238, 239, 240, 75, 77, 237, 68, 69, 83, 238, + 239, 240, 43, 44, 45, 46, 47, 87, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 1, 57, 92, + 93, 88, 101, 98, 102, 103, 20, 21, 22, 23, + 20, 21, 22, 23, 19, 104, 106, 2, 3, 4, + 5, 6, 7, 107, 20, 21, 22, 23, 24, 25, + 26, 27, 19, 28, 105, 108, 29, 109, 110, 111, + 114, 119, 20, 21, 22, 23, 24, 25, 26, 27, + 37, 66, 122, 123, 29, 124, 128, 139, 152, 140, + 20, 21, 22, 23, 115, 25, 26, 27, 142, 116, + 38, 115, 156, 126, 20, 21, 22, 23, 2, 3, + 4, 5, 6, 7, 116, 43, 44, 45, 46, 47, + 209, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 158, 57, 79, 44, 45, 46, 47, 129, 48, 49, + 50, 51, 52, 53, 54, 55, 80, 171, 57, 43, 44, 45, 46, 47, 172, 48, 49, 50, 51, 52, - 53, 54, 55, 80, 173, 57, 43, 44, 45, 46, - 47, 175, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 180, 57, 142, 143, 45, 46, 47, -106, 48, - 49, 50, 51, 52, 53, 54, 55, 144, 181, 57, - 79, 44, 45, 46, 47, 182, 48, 49, 50, 51, - 52, 53, 54, 55, 177, 185, 57, 84, 44, 186, - 188, 189, 190, 48, 49, 50, 51, 52, 53, 54, - 55, 90, 44, 57, 191, 193, 192, 48, 49, 50, - 51, 52, 53, 54, 55, 79, 44, 57, 196, 198, - 197, 48, 49, 50, 51, 52, 53, 54, 55, 210, - 204, 57, 2, 3, 4, 5, 6, 7, 208, 211, - 212, 219, 220, 225, 230, 232, 241, 240, 243, 269, - 270, 246, 245, 14, 169, 248, 253, 260, 138, 67, - 125, 161, 40, 168, 256, 207, 0, 0, 0, 0, - 247 + 53, 54, 55, 56, 173, 57, 143, 144, 45, 46, + 47, 174, 48, 49, 50, 51, 52, 53, 54, 55, + 145, 176, 57, 79, 44, 45, 46, 47, 177, 48, + 49, 50, 51, 52, 53, 54, 55, 179, -108, 57, + 84, 44, 182, 183, 184, 187, 48, 49, 50, 51, + 52, 53, 54, 55, 90, 44, 57, 188, 190, 191, + 48, 49, 50, 51, 52, 53, 54, 55, 79, 44, + 57, 192, 193, 194, 48, 49, 50, 51, 52, 53, + 54, 55, 195, 198, 57, 199, 201, 207, 200, 211, + 217, 213, 222, 214, 215, 221, 235, 227, 243, 244, + 246, 248, 249, 273, 263, 274, 251, 14, 256, 67, + 271, 170, 169, 162, 125, 138, 40, 259, 210, 250 }; static const short yycheck[] = { 129, - 25, 205, 43, 43, 19, 128, 191, 32, 26, 213, - 25, 88, 216, 198, 39, 22, 21, 57, 141, 40, - 5, 5, 62, 227, 45, 19, 211, 19, 20, 19, - 20, 37, 39, 58, 157, 112, 19, 20, 242, 79, - 225, 93, 94, 68, 84, 37, 19, 20, 42, 64, - 90, 69, 19, 20, 258, 259, 40, 49, 243, 44, - 245, 45, 185, 19, 37, 117, 49, 119, 19, 20, - 19, 96, 124, 22, 179, 42, 49, 37, 93, 19, - 10, 41, 49, 238, 14, 41, 19, 210, 19, 212, - 39, 42, 247, 42, 199, 200, 4, 122, 49, 39, - 125, 142, 142, 40, 37, 235, 236, 21, 45, 40, - 39, 42, 171, 172, 139, 46, 47, 48, 248, 249, - 19, 251, 39, 253, 5, 6, 7, 8, 9, 19, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 40, - 21, 40, 39, 42, 45, 39, 19, 46, 47, 48, - 19, 19, 42, 34, 35, 5, 46, 47, 48, 5, - 6, 7, 8, 9, 19, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 3, 21, 19, 19, 44, 19, - 21, 19, 40, 29, 30, 31, 32, 29, 30, 31, - 32, 19, 19, 40, 23, 24, 25, 26, 27, 28, - 39, 29, 30, 31, 32, 33, 34, 35, 36, 19, - 38, 43, 19, 41, 19, 19, 39, 5, 19, 29, - 30, 31, 32, 33, 34, 35, 36, 19, 38, 40, - 19, 41, 19, 39, 19, 19, 39, 29, 30, 31, - 32, 19, 34, 35, 36, 39, 19, 39, 19, 9, - 19, 29, 30, 31, 32, 15, 39, 19, 18, 40, - 42, 39, 5, 6, 7, 8, 9, 10, 11, 12, + 25, 43, 43, 26, 128, 19, 5, 32, 88, 5, + 19, 25, 19, 241, 39, 57, 19, 193, 142, 40, + 62, 40, 250, 10, 45, 201, 45, 14, 37, 93, + 94, 208, 112, 58, 158, 42, 39, 79, 214, 216, + 181, 218, 84, 68, 40, 44, 69, 19, 90, 45, + 64, 227, 229, 117, 21, 119, 19, 20, 19, 20, + 124, 202, 203, 187, 19, 20, 19, 20, 245, 41, + 246, 96, 248, 37, 37, 19, 37, 41, 22, 93, + 19, 20, 22, 37, 261, 262, 49, 42, 49, 213, + 19, 215, 19, 20, 49, 39, 49, 122, 42, 39, + 125, 143, 143, 42, 172, 173, 9, 4, 238, 239, + 49, 40, 15, 42, 139, 18, 21, 46, 47, 48, + 40, 251, 252, 19, 254, 45, 256, 5, 6, 7, + 8, 9, 19, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 19, 21, 40, 39, 42, 39, 39, 39, + 46, 47, 48, 19, 19, 42, 34, 35, 5, 46, + 47, 48, 5, 6, 7, 8, 9, 19, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 3, 21, 19, + 19, 44, 19, 21, 19, 40, 29, 30, 31, 32, + 29, 30, 31, 32, 19, 19, 40, 23, 24, 25, + 26, 27, 28, 39, 29, 30, 31, 32, 33, 34, + 35, 36, 19, 38, 43, 19, 41, 19, 19, 39, + 5, 19, 29, 30, 31, 32, 33, 34, 35, 36, + 19, 38, 40, 19, 41, 19, 39, 19, 19, 39, + 29, 30, 31, 32, 19, 34, 35, 36, 39, 39, + 39, 19, 19, 19, 29, 30, 31, 32, 23, 24, + 25, 26, 27, 28, 39, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 39, 21, 5, 6, 7, 8, 9, 42, 11, 12, 13, 14, 15, 16, 17, 18, 19, 41, 21, 5, 6, 7, 8, 9, 40, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 23, 21, 5, 6, 7, 8, - 9, 37, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 19, 21, 5, 6, 7, 8, 9, 40, 11, + 16, 17, 18, 19, 40, 21, 5, 6, 7, 8, + 9, 23, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 19, 21, 5, 6, 7, 8, 9, 19, 11, 12, 13, 14, 15, 16, 17, 18, 19, 40, 21, - 5, 6, 7, 8, 9, 45, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 39, 21, 5, 6, 19, - 19, 23, 41, 11, 12, 13, 14, 15, 16, 17, - 18, 5, 6, 21, 40, 20, 23, 11, 12, 13, - 14, 15, 16, 17, 18, 5, 6, 21, 40, 40, - 23, 11, 12, 13, 14, 15, 16, 17, 18, 39, - 19, 21, 23, 24, 25, 26, 27, 28, 19, 40, - 39, 39, 19, 40, 37, 19, 19, 23, 40, 0, - 0, 23, 40, 9, 131, 42, 42, 41, 105, 30, - 100, 127, 19, 130, 241, 182, -1, -1, -1, -1, - 232 + 5, 6, 19, 40, 45, 39, 11, 12, 13, 14, + 15, 16, 17, 18, 5, 6, 21, 19, 19, 23, + 11, 12, 13, 14, 15, 16, 17, 18, 5, 6, + 21, 41, 40, 23, 11, 12, 13, 14, 15, 16, + 17, 18, 20, 40, 21, 40, 40, 19, 37, 19, + 23, 39, 19, 40, 39, 39, 19, 40, 23, 19, + 40, 40, 37, 0, 23, 0, 42, 9, 42, 30, + 41, 131, 130, 127, 100, 105, 19, 244, 184, 235 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/lib/bison.simple" @@ -1231,23 +1289,23 @@ yyreduce: switch (yyn) { case 1: -#line 316 "parse.y" +#line 373 "parse.y" { ; ; break;} case 2: -#line 317 "parse.y" +#line 374 "parse.y" { ; ; break;} case 3: -#line 318 "parse.y" +#line 375 "parse.y" { ; ; break;} case 4: -#line 319 "parse.y" +#line 376 "parse.y" { ; ; break;} case 5: -#line 322 "parse.y" +#line 379 "parse.y" { Node *node = new_ccode(C_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1256,7 +1314,7 @@ case 5: ; break;} case 6: -#line 328 "parse.y" +#line 385 "parse.y" { Node *node = new_ccode(H_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1265,7 +1323,7 @@ case 6: ; break;} case 7: -#line 334 "parse.y" +#line 391 "parse.y" { Node *node = new_ccode(HT_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1274,7 +1332,7 @@ case 7: ; break;} case 8: -#line 340 "parse.y" +#line 397 "parse.y" { Node *node = new_ccode(PH_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1283,7 +1341,7 @@ case 8: ; break;} case 9: -#line 346 "parse.y" +#line 403 "parse.y" { Node *node = new_ccode(A_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1292,7 +1350,7 @@ case 9: ; break;} case 10: -#line 352 "parse.y" +#line 409 "parse.y" { Node *node = new_ccode(AT_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1301,15 +1359,15 @@ case 10: ; break;} case 11: -#line 360 "parse.y" +#line 417 "parse.y" { ; ; break;} case 12: -#line 361 "parse.y" +#line 418 "parse.y" { ; ; break;} case 13: -#line 364 "parse.y" +#line 421 "parse.y" { ((Class *)class)->nodes = class_nodes; class_nodes = NULL; @@ -1317,7 +1375,7 @@ case 13: ; break;} case 14: -#line 369 "parse.y" +#line 426 "parse.y" { ((Class *)class)->nodes = NULL; class_nodes = NULL; @@ -1325,14 +1383,14 @@ case 14: ; break;} case 15: -#line 376 "parse.y" +#line 433 "parse.y" { class = new_class (yyvsp[-3].id, yyvsp[-1].id, bonobo_x_class, chunk_size, NULL); ; break;} case 17: -#line 383 "parse.y" +#line 440 "parse.y" { if(strcmp(yyvsp[-3].id,"chunks") == 0) { g_free (chunk_size); @@ -1347,7 +1405,7 @@ case 17: ; break;} case 18: -#line 395 "parse.y" +#line 452 "parse.y" { if(strcmp(yyvsp[-3].id,"chunks") == 0) { g_free (chunk_size); @@ -1362,19 +1420,19 @@ case 18: ; break;} case 19: -#line 409 "parse.y" +#line 466 "parse.y" { ; ; break;} case 20: -#line 410 "parse.y" +#line 467 "parse.y" { ; ; break;} case 21: -#line 413 "parse.y" +#line 470 "parse.y" { ; ; break;} case 22: -#line 414 "parse.y" +#line 471 "parse.y" { if (strcmp (yyvsp[-1].id, "BonoboX") != 0) { g_free(yyvsp[-1].id); @@ -1385,35 +1443,35 @@ case 22: ; break;} case 23: -#line 422 "parse.y" +#line 479 "parse.y" { ; ; break;} case 24: -#line 423 "parse.y" +#line 480 "parse.y" { ; ; break;} case 25: -#line 424 "parse.y" +#line 481 "parse.y" { ; ; break;} case 26: -#line 427 "parse.y" +#line 484 "parse.y" { the_scope = PUBLIC_SCOPE; ; break;} case 27: -#line 428 "parse.y" +#line 485 "parse.y" { the_scope = PRIVATE_SCOPE; ; break;} case 28: -#line 429 "parse.y" +#line 486 "parse.y" { the_scope = PROTECTED_SCOPE; ; break;} case 29: -#line 430 "parse.y" +#line 487 "parse.y" { the_scope = CLASS_SCOPE; ; break;} case 30: -#line 433 "parse.y" +#line 490 "parse.y" { if(strcmp(yyvsp[-1].id, "destroywith")==0) { g_free(yyvsp[-1].id); @@ -1429,7 +1487,7 @@ case 30: ; break;} case 31: -#line 446 "parse.y" +#line 503 "parse.y" { if(strcmp(yyvsp[-2].id, "destroy")==0) { g_free(yyvsp[-2].id); @@ -1446,14 +1504,14 @@ case 31: ; break;} case 32: -#line 462 "parse.y" +#line 519 "parse.y" { initializer = yyvsp[0].id; initializer_line = ccode_line; ; break;} case 33: -#line 466 "parse.y" +#line 523 "parse.y" { initializer = (yyvsp[0].cbuf)->str; initializer_line = ccode_line; @@ -1461,113 +1519,147 @@ case 33: ; break;} case 34: -#line 474 "parse.y" +#line 531 "parse.y" { ; ; break;} case 35: -#line 475 "parse.y" +#line 532 "parse.y" { ; ; break;} case 36: -#line 476 "parse.y" +#line 533 "parse.y" { destructor = NULL; ; break;} case 37: -#line 477 "parse.y" +#line 534 "parse.y" { initializer = NULL; ; break;} case 38: -#line 478 "parse.y" +#line 535 "parse.y" { destructor = NULL; initializer = NULL; ; break;} case 39: -#line 484 "parse.y" +#line 541 "parse.y" { push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL); ; break;} case 40: -#line 487 "parse.y" +#line 544 "parse.y" { push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id); ; break;} case 41: -#line 491 "parse.y" +#line 549 "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,type,yyvsp[-9].list,yyvsp[-7].id, - (yyvsp[-4].cbuf)->str,yyvsp[-5].line, - (yyvsp[-1].cbuf)->str,yyvsp[-2].line, - yyvsp[-10].line); - g_string_free(yyvsp[-4].cbuf,FALSE); - g_string_free(yyvsp[-1].cbuf,FALSE); + g_free (yyvsp[-6].id); + g_free (yyvsp[-3].id); + node = new_argument (yyvsp[-9].id, type, yyvsp[-10].list, yyvsp[-8].id, + (yyvsp[-4].cbuf)->str, yyvsp[-5].line, + (yyvsp[-1].cbuf)->str,yyvsp[-2].line, + yyvsp[-11].line); + class_nodes = g_list_append(class_nodes,node); + + if (yyvsp[-7].id) { + export_accessors (yyvsp[-8].id, + yyvsp[-4].cbuf, yyvsp[-5].line, + yyvsp[-1].cbuf, yyvsp[-2].line, + type, + yyvsp[-11].line); + } + + g_string_free (yyvsp[-4].cbuf, FALSE); + g_string_free (yyvsp[-1].cbuf, FALSE); + } 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,type,yyvsp[-9].list,yyvsp[-7].id, - (yyvsp[-1].cbuf)->str,yyvsp[-2].line, - (yyvsp[-4].cbuf)->str,yyvsp[-5].line, - yyvsp[-10].line); - g_string_free(yyvsp[-1].cbuf,FALSE); - g_string_free(yyvsp[-4].cbuf,FALSE); + g_free (yyvsp[-6].id); + g_free (yyvsp[-3].id); + node = new_argument (yyvsp[-9].id, type, yyvsp[-10].list, yyvsp[-8].id, + (yyvsp[-1].cbuf)->str,yyvsp[-2].line, + (yyvsp[-4].cbuf)->str,yyvsp[-5].line, + yyvsp[-11].line); + g_string_free (yyvsp[-1].cbuf, FALSE); + g_string_free (yyvsp[-4].cbuf, FALSE); class_nodes = g_list_append(class_nodes,node); } else { - g_free(yyvsp[-8].id); g_free(yyvsp[-7].id); - g_free(yyvsp[-6].id); g_free(yyvsp[-3].id); - g_list_foreach(yyvsp[-9].list,(GFunc)g_free,NULL); - g_list_free(yyvsp[-9].list); - g_string_free(yyvsp[-1].cbuf,TRUE); - g_string_free(yyvsp[-4].cbuf,TRUE); - yyerror(_("parse error")); + g_free (yyvsp[-9].id); + g_free (yyvsp[-8].id); + g_free (yyvsp[-6].id); + g_free (yyvsp[-3].id); + g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL); + g_list_free (yyvsp[-10].list); + g_string_free (yyvsp[-1].cbuf, TRUE); + g_string_free (yyvsp[-4].cbuf, TRUE); + yyerror (_("parse error")); YYERROR; } ; break;} case 42: -#line 527 "parse.y" +#line 600 "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, 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); + g_free (yyvsp[-3].id); + node = new_argument (yyvsp[-6].id, type, yyvsp[-7].list, yyvsp[-5].id, + (yyvsp[-1].cbuf)->str, yyvsp[-2].line, + NULL, 0, + yyvsp[-8].line); + if (yyvsp[-4].id) { + export_accessors (yyvsp[-5].id, + yyvsp[-1].cbuf, yyvsp[-2].line, + NULL, 0, + type, + yyvsp[-8].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, 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); - class_nodes = g_list_append(class_nodes, node); + g_free (yyvsp[-3].id); + node = new_argument (yyvsp[-6].id, type, yyvsp[-7].list, yyvsp[-5].id, + NULL, 0, + (yyvsp[-1].cbuf)->str, yyvsp[-2].line, + yyvsp[-8].line); + if (yyvsp[-4].id) { + export_accessors (yyvsp[-5].id, + NULL, 0, + yyvsp[-1].cbuf, yyvsp[-2].line, + type, + yyvsp[-8].line); + } + + g_string_free (yyvsp[-1].cbuf, FALSE); + class_nodes = g_list_append (class_nodes, node); } else { - g_free(yyvsp[-3].id); g_free(yyvsp[-5].id); - g_free(yyvsp[-4].id); - g_list_foreach(yyvsp[-6].list, (GFunc)g_free, NULL); - g_list_free(yyvsp[-6].list); - g_string_free(yyvsp[-1].cbuf, TRUE); + g_free (yyvsp[-3].id); + g_free (yyvsp[-6].id); + g_free (yyvsp[-5].id); + g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL); + g_list_free (yyvsp[-7].list); + g_string_free (yyvsp[-1].cbuf, TRUE); yyerror(_("parse error")); YYERROR; } ; break;} case 43: -#line 556 "parse.y" +#line 648 "parse.y" { Node *node; char *get, *set = NULL; @@ -1576,71 +1668,97 @@ case 43: char *root; if(strcmp(yyvsp[0].id, "link")!=0 && - strcmp(yyvsp[0].id, "stringlink")!=0 && + strcmp(yyvsp[0].id, "stringlink")!=0 && strcmp(yyvsp[0].id, "objectlink")!=0) { - g_free(yyvsp[0].id); g_free(yyvsp[-2].id); - g_free(yyvsp[-1].id); - g_list_foreach(yyvsp[-3].list,(GFunc)g_free,NULL); - g_list_free(yyvsp[-3].list); + g_free(yyvsp[0].id); + g_free(yyvsp[-3].id); + g_free(yyvsp[-2].id); + g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL); + g_list_free(yyvsp[-4].list); yyerror(_("parse error")); YYERROR; } type = pop_type(); - var = find_var_or_die(yyvsp[-1].id, yyvsp[-4].line); + var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line); if(var->scope == PRIVATE_SCOPE) root = "self->_priv"; else if(var->scope == CLASS_SCOPE) { root = "SELF_GET_CLASS(self)"; if(no_self_alias) - error_print(GOB_ERROR, yyvsp[-4].line, + error_print(GOB_ERROR, yyvsp[-5].line, _("Self aliases needed when autolinking to a classwide member")); } else root = "self"; if(strcmp(yyvsp[0].id, "link")==0) { set = g_strdup_printf("%s->%s = ARG;", - root, yyvsp[-1].id); - } else if(strcmp(yyvsp[0].id, "stringlink")==0) { + root, yyvsp[-2].id); + } else if(strcmp (yyvsp[0].id, "stringlink")==0) { set = g_strdup_printf("g_free(%s->%s); " "%s->%s = g_strdup(ARG);", - root, yyvsp[-1].id, - root, yyvsp[-1].id); - } else if(strcmp(yyvsp[0].id, "objectlink")==0) { + root, yyvsp[-2].id, + root, yyvsp[-2].id); + } else if(strcmp (yyvsp[0].id, "objectlink")==0) { set = g_strdup_printf( "if (ARG != NULL) " "gtk_object_ref (GTK_OBJECT (ARG)); " "if (%s->%s != NULL) " "gtk_object_unref (GTK_OBJECT (%s->%s)); " "%s->%s = ARG;", - root, yyvsp[-1].id, - root, yyvsp[-1].id, - root, yyvsp[-1].id); + root, yyvsp[-2].id, + root, yyvsp[-2].id, + root, yyvsp[-2].id); } else { g_assert_not_reached(); } - if(strcmp(yyvsp[0].id, "stringlink")==0) { - get = g_strdup_printf("ARG = g_strdup(%s->%s);", root, yyvsp[-1].id); + if(strcmp (yyvsp[0].id, "stringlink")==0) { + get = g_strdup_printf("ARG = g_strdup(%s->%s);", root, yyvsp[-2].id); } else /* For everything else, get is just straight assignment */ - get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-1].id); + get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id); - g_free(yyvsp[0].id); + g_free (yyvsp[0].id); if(!type) type = copy_type(var->vtype); - node = new_argument(yyvsp[-2].id, type, yyvsp[-3].list, - yyvsp[-1].id, get, yyvsp[-4].line, - set, yyvsp[-4].line, yyvsp[-4].line); + node = new_argument (yyvsp[-3].id, type, yyvsp[-4].list, + yyvsp[-2].id, + get, yyvsp[-5].line, + set, yyvsp[-5].line, + yyvsp[-5].line); + if (yyvsp[-1].id) { + export_accessors (yyvsp[-2].id, + g_string_new (get), yyvsp[-5].line, + g_string_new (set), yyvsp[-5].line, + type, + yyvsp[-5].line); + } + class_nodes = g_list_append(class_nodes,node); ; break;} case 44: -#line 628 "parse.y" +#line 731 "parse.y" +{ + if (strcmp (yyvsp[-1].id, "export")!=0) { + g_free (yyvsp[-1].id); + yyerror (_("parse error")); + YYERROR; + } + yyval.id = yyvsp[-1].id; + ; + break;} +case 45: +#line 739 "parse.y" +{ yyval.id = NULL; ; + break;} +case 46: +#line 741 "parse.y" { if(strcmp(yyvsp[-2].id,"type")!=0) { g_free(yyvsp[-4].id); @@ -1651,215 +1769,215 @@ case 44: yyval.id = yyvsp[-4].id; ; break;} -case 45: -#line 637 "parse.y" +case 47: +#line 750 "parse.y" { yyval.id = yyvsp[0].id; typestack = g_list_prepend(typestack,NULL); ; break;} -case 46: -#line 643 "parse.y" +case 48: +#line 756 "parse.y" { yyval.list = yyvsp[-1].list; ; break;} -case 47: -#line 644 "parse.y" +case 49: +#line 757 "parse.y" { yyval.list = NULL; ; break;} -case 48: -#line 647 "parse.y" +case 50: +#line 760 "parse.y" { yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id); ; break;} -case 49: -#line 650 "parse.y" +case 51: +#line 763 "parse.y" { yyval.list = g_list_append(NULL,yyvsp[0].id); ; break;} -case 50: -#line 656 "parse.y" +case 52: +#line 769 "parse.y" { Node *node = new_type(yyvsp[-1].id, yyvsp[0].id, NULL); typestack = g_list_prepend(typestack,node); ; break;} -case 51: -#line 660 "parse.y" +case 53: +#line 773 "parse.y" { Node *node = new_type(yyvsp[0].id, NULL, NULL); typestack = g_list_prepend(typestack,node); ; break;} -case 52: -#line 667 "parse.y" +case 54: +#line 780 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 53: -#line 670 "parse.y" +case 55: +#line 783 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 54: -#line 673 "parse.y" +case 56: +#line 786 "parse.y" { yyval.id = g_strconcat("const ", yyvsp[0].id, NULL); g_free(yyvsp[0].id); ; break;} -case 55: -#line 677 "parse.y" +case 57: +#line 790 "parse.y" { yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL); g_free(yyvsp[-1].id); ; break;} -case 56: -#line 681 "parse.y" +case 58: +#line 794 "parse.y" { yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL); g_free(yyvsp[0].id); ; break;} -case 57: -#line 685 "parse.y" +case 59: +#line 798 "parse.y" { yyval.id = g_strconcat("const ", yyvsp[-1].id, " ", yyvsp[0].id, NULL); g_free(yyvsp[0].id); ; break;} -case 58: -#line 690 "parse.y" +case 60: +#line 803 "parse.y" { yyval.id = g_strconcat(yyvsp[-2].id, " ", yyvsp[-1].id, " const", NULL); g_free(yyvsp[-1].id); ; break;} -case 59: -#line 698 "parse.y" +case 61: +#line 811 "parse.y" { yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL); g_free(yyvsp[0].id); ; break;} -case 60: -#line 702 "parse.y" +case 62: +#line 815 "parse.y" { yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL); g_free(yyvsp[-1].id); g_free(yyvsp[0].id); ; break;} -case 61: -#line 707 "parse.y" +case 63: +#line 820 "parse.y" { yyval.id = g_strconcat("const ", yyvsp[0].id, NULL); g_free(yyvsp[0].id); ; break;} -case 62: -#line 711 "parse.y" +case 64: +#line 824 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 63: -#line 714 "parse.y" +case 65: +#line 827 "parse.y" { yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL); g_free(yyvsp[-1].id); ; break;} -case 64: -#line 718 "parse.y" +case 66: +#line 831 "parse.y" { yyval.id = g_strdup(yyvsp[0].id); ; break;} -case 65: -#line 721 "parse.y" +case 67: +#line 834 "parse.y" { yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL); ; break;} -case 66: -#line 726 "parse.y" +case 68: +#line 839 "parse.y" { yyval.id = "void"; ; break;} -case 67: -#line 727 "parse.y" +case 69: +#line 840 "parse.y" { yyval.id = "char"; ; break;} -case 68: -#line 728 "parse.y" +case 70: +#line 841 "parse.y" { yyval.id = "short"; ; break;} -case 69: -#line 729 "parse.y" +case 71: +#line 842 "parse.y" { yyval.id = "int"; ; break;} -case 70: -#line 730 "parse.y" +case 72: +#line 843 "parse.y" { yyval.id = "long"; ; break;} -case 71: -#line 731 "parse.y" +case 73: +#line 844 "parse.y" { yyval.id = "float"; ; break;} -case 72: -#line 732 "parse.y" +case 74: +#line 845 "parse.y" { yyval.id = "double"; ; break;} -case 73: -#line 733 "parse.y" +case 75: +#line 846 "parse.y" { yyval.id = "signed"; ; break;} -case 74: -#line 734 "parse.y" +case 76: +#line 847 "parse.y" { yyval.id = "unsigned"; ; break;} -case 75: -#line 737 "parse.y" +case 77: +#line 850 "parse.y" { yyval.id = "struct"; ; break;} -case 76: -#line 738 "parse.y" +case 78: +#line 851 "parse.y" { yyval.id = "union"; ; break;} -case 77: -#line 739 "parse.y" +case 79: +#line 852 "parse.y" { yyval.id = "enum"; ; break;} -case 78: -#line 742 "parse.y" +case 80: +#line 855 "parse.y" { yyval.id = g_strdup("*"); ; break;} -case 79: -#line 743 "parse.y" +case 81: +#line 856 "parse.y" { yyval.id = g_strdup("* const"); ; break;} -case 80: -#line 744 "parse.y" +case 82: +#line 857 "parse.y" { yyval.id = g_strconcat("*", yyvsp[0].id, NULL); g_free(yyvsp[0].id); ; break;} -case 81: -#line 748 "parse.y" +case 83: +#line 861 "parse.y" { yyval.id = g_strconcat("* const", yyvsp[0].id, NULL); g_free(yyvsp[0].id); ; break;} -case 82: -#line 755 "parse.y" +case 84: +#line 868 "parse.y" { if(strcmp(yyvsp[-1].id, "first")==0) yyval.sigtype = SIGNAL_FIRST_METHOD; @@ -1873,14 +1991,14 @@ case 82: g_free(yyvsp[-1].id); ; break;} -case 83: -#line 767 "parse.y" +case 85: +#line 880 "parse.y" { yyval.sigtype = SIGNAL_LAST_METHOD; ; break;} -case 84: -#line 773 "parse.y" +case 86: +#line 886 "parse.y" { if(strcmp(yyvsp[-1].id,"first")==0) yyval.sigtype = SIGNAL_FIRST_METHOD; @@ -1894,8 +2012,8 @@ case 84: g_free(yyvsp[-1].id); ; break;} -case 85: -#line 785 "parse.y" +case 87: +#line 898 "parse.y" { if(strcmp(yyvsp[-2].id,"first")==0) yyval.sigtype = SIGNAL_FIRST_METHOD; @@ -1909,47 +2027,47 @@ case 85: g_free(yyvsp[-2].id); ; break;} -case 86: -#line 797 "parse.y" +case 88: +#line 910 "parse.y" { yyval.sigtype = SIGNAL_LAST_METHOD; ; break;} -case 87: -#line 800 "parse.y" +case 89: +#line 913 "parse.y" { /* the_scope was default thus public */ the_scope = PUBLIC_SCOPE; ; break;} -case 88: -#line 806 "parse.y" +case 90: +#line 919 "parse.y" { gtktypes = g_list_prepend(gtktypes, yyvsp[-3].id); ; break;} -case 89: -#line 811 "parse.y" +case 91: +#line 924 "parse.y" { gtktypes = g_list_append(gtktypes, yyvsp[0].id); ; break;} -case 90: -#line 814 "parse.y" +case 92: +#line 927 "parse.y" { gtktypes = g_list_append(gtktypes, yyvsp[0].id); ; break;} -case 91: -#line 819 "parse.y" +case 93: +#line 932 "parse.y" { yyval.cbuf = yyvsp[0].cbuf; ; break;} -case 92: -#line 820 "parse.y" +case 94: +#line 933 "parse.y" { yyval.cbuf = NULL; ; break;} -case 93: -#line 824 "parse.y" +case 95: +#line 937 "parse.y" { if(!has_self) { yyerror(_("signal without 'self' as " @@ -1967,8 +2085,8 @@ case 93: ccode_line, vararg, yyvsp[-8].list); ; break;} -case 94: -#line 840 "parse.y" +case 96: +#line 953 "parse.y" { if(!has_self) { yyerror(_("signal without 'self' as " @@ -1986,8 +2104,8 @@ case 94: ccode_line, vararg, yyvsp[-8].list); ; break;} -case 95: -#line 856 "parse.y" +case 97: +#line 969 "parse.y" { if(!has_self) { yyerror(_("virtual method without 'self' as " @@ -2005,8 +2123,8 @@ case 95: ccode_line, vararg, NULL); ; break;} -case 96: -#line 872 "parse.y" +case 98: +#line 985 "parse.y" { if(!has_self) { yyerror(_("virtual method without 'self' as " @@ -2024,8 +2142,8 @@ case 96: ccode_line, vararg, NULL); ; break;} -case 97: -#line 888 "parse.y" +case 99: +#line 1001 "parse.y" { if(!has_self) { yyerror(_("virtual method without 'self' as " @@ -2038,8 +2156,8 @@ case 97: ccode_line, vararg, NULL); ; break;} -case 98: -#line 899 "parse.y" +case 100: +#line 1012 "parse.y" { push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id, yyvsp[-5].id, yyvsp[0].cbuf, @@ -2047,8 +2165,8 @@ case 98: vararg, NULL); ; break;} -case 99: -#line 905 "parse.y" +case 101: +#line 1018 "parse.y" { if(the_scope == CLASS_SCOPE) { yyerror(_("a method cannot be of class scope")); @@ -2060,8 +2178,8 @@ case 99: vararg, NULL); ; break;} -case 100: -#line 915 "parse.y" +case 102: +#line 1028 "parse.y" { if(strcmp(yyvsp[-4].id, "init")==0) { push_init_arg(yyvsp[-2].id,FALSE); @@ -2084,8 +2202,8 @@ case 100: } ; break;} -case 101: -#line 938 "parse.y" +case 103: +#line 1051 "parse.y" { g_free(onerror); onerror = NULL; g_free(defreturn); defreturn = NULL; @@ -2098,8 +2216,8 @@ case 101: g_free(yyvsp[-1].id); ; break;} -case 102: -#line 949 "parse.y" +case 104: +#line 1062 "parse.y" { g_free(onerror); onerror = NULL; g_free(defreturn); defreturn = NULL; @@ -2120,30 +2238,30 @@ case 102: g_free(yyvsp[-1].id); ; break;} -case 103: -#line 968 "parse.y" +case 105: +#line 1081 "parse.y" { g_free(onerror); onerror = NULL; g_free(defreturn); defreturn = NULL; ; break;} -case 104: -#line 974 "parse.y" +case 106: +#line 1087 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 105: -#line 975 "parse.y" +case 107: +#line 1088 "parse.y" { yyval.id = (yyvsp[1].cbuf)->str; g_string_free(yyvsp[1].cbuf, FALSE); ; break;} -case 106: -#line 981 "parse.y" +case 108: +#line 1094 "parse.y" { vararg = FALSE; has_self = FALSE; ; break;} -case 107: -#line 982 "parse.y" +case 109: +#line 1095 "parse.y" { vararg = FALSE; has_self = TRUE; @@ -2156,8 +2274,8 @@ case 107: } ; break;} -case 108: -#line 993 "parse.y" +case 110: +#line 1106 "parse.y" { vararg = FALSE; has_self = TRUE; @@ -2170,8 +2288,8 @@ case 108: } ; break;} -case 109: -#line 1004 "parse.y" +case 111: +#line 1117 "parse.y" { vararg = FALSE; has_self = TRUE; @@ -2184,8 +2302,8 @@ case 109: } ; break;} -case 110: -#line 1015 "parse.y" +case 112: +#line 1128 "parse.y" { has_self = TRUE; if(strcmp(yyvsp[-2].id,"self")==0) @@ -2197,8 +2315,8 @@ case 110: } ; break;} -case 111: -#line 1025 "parse.y" +case 113: +#line 1138 "parse.y" { has_self = TRUE; if(strcmp(yyvsp[-3].id,"self")==0) @@ -2210,8 +2328,8 @@ case 111: } ; break;} -case 112: -#line 1035 "parse.y" +case 114: +#line 1148 "parse.y" { has_self = TRUE; if(strcmp(yyvsp[-2].id,"self")==0) @@ -2223,40 +2341,40 @@ case 112: } ; break;} -case 113: -#line 1045 "parse.y" +case 115: +#line 1158 "parse.y" { has_self = FALSE; ; break;} -case 114: -#line 1048 "parse.y" +case 116: +#line 1161 "parse.y" { vararg = TRUE; ; break;} -case 115: -#line 1049 "parse.y" +case 117: +#line 1162 "parse.y" { vararg = FALSE; ; break;} -case 116: -#line 1052 "parse.y" +case 118: +#line 1165 "parse.y" { ; ; break;} -case 117: -#line 1053 "parse.y" +case 119: +#line 1166 "parse.y" { ; ; break;} -case 118: -#line 1056 "parse.y" +case 120: +#line 1169 "parse.y" { push_funcarg(yyvsp[0].id,NULL); ; break;} -case 119: -#line 1059 "parse.y" +case 121: +#line 1172 "parse.y" { push_funcarg(yyvsp[-1].id,yyvsp[0].id); ; break;} -case 120: -#line 1062 "parse.y" +case 122: +#line 1175 "parse.y" { if(strcmp(yyvsp[-2].id,"check")!=0) { yyerror(_("parse error")); @@ -2266,8 +2384,8 @@ case 120: push_funcarg(yyvsp[-4].id,NULL); ; break;} -case 121: -#line 1070 "parse.y" +case 123: +#line 1183 "parse.y" { if(strcmp(yyvsp[-2].id,"check")!=0) { yyerror(_("parse error")); @@ -2277,16 +2395,16 @@ case 121: push_funcarg(yyvsp[-5].id,yyvsp[-4].id); ; break;} -case 122: -#line 1080 "parse.y" +case 124: +#line 1193 "parse.y" { ; ; break;} -case 123: -#line 1081 "parse.y" +case 125: +#line 1194 "parse.y" { ; ; break;} -case 124: -#line 1084 "parse.y" +case 126: +#line 1197 "parse.y" { if(strcmp(yyvsp[0].id,"type")==0) { Node *node = new_check(TYPE_CHECK,NULL); @@ -2301,61 +2419,61 @@ case 124: g_free(yyvsp[0].id); ; break;} -case 125: -#line 1097 "parse.y" +case 127: +#line 1210 "parse.y" { Node *node = new_check(GT_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 126: -#line 1101 "parse.y" +case 128: +#line 1214 "parse.y" { Node *node = new_check(LT_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 127: -#line 1105 "parse.y" +case 129: +#line 1218 "parse.y" { Node *node = new_check(GE_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 128: -#line 1109 "parse.y" +case 130: +#line 1222 "parse.y" { Node *node = new_check(LE_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 129: -#line 1113 "parse.y" +case 131: +#line 1226 "parse.y" { Node *node = new_check(EQ_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 130: -#line 1117 "parse.y" +case 132: +#line 1230 "parse.y" { Node *node = new_check(NE_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 131: -#line 1123 "parse.y" +case 133: +#line 1236 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 132: -#line 1124 "parse.y" +case 134: +#line 1237 "parse.y" { yyval.id = g_strconcat("-",yyvsp[0].id,NULL); g_free(yyvsp[0].id); ; break;} -case 133: -#line 1128 "parse.y" +case 135: +#line 1241 "parse.y" { yyval.id = yyvsp[0].id; ; break;} } @@ -2580,5 +2698,5 @@ yyerrhandle: } return 1; } -#line 1131 "parse.y" +#line 1244 "parse.y" diff --git a/src/parse.h b/src/parse.h new file mode 100644 index 0000000..091b572 --- /dev/null +++ b/src/parse.h @@ -0,0 +1,44 @@ +typedef union { + char *id; + GString *cbuf; + GList *list; + int line; + int sigtype; +} YYSTYPE; +#define CLASS 257 +#define FROM 258 +#define CONST 259 +#define VOID 260 +#define STRUCT 261 +#define UNION 262 +#define ENUM 263 +#define THREEDOTS 264 +#define SIGNED 265 +#define UNSIGNED 266 +#define LONG 267 +#define SHORT 268 +#define INT 269 +#define FLOAT 270 +#define DOUBLE 271 +#define CHAR 272 +#define TOKEN 273 +#define NUMBER 274 +#define TYPETOKEN 275 +#define ARRAY_DIM 276 +#define CCODE 277 +#define HTCODE 278 +#define PHCODE 279 +#define HCODE 280 +#define ACODE 281 +#define ATCODE 282 +#define PUBLIC 283 +#define PRIVATE 284 +#define PROTECTED 285 +#define CLASSWIDE 286 +#define ARGUMENT 287 +#define VIRTUAL 288 +#define SIGNAL 289 +#define OVERRIDE 290 + + +extern YYSTYPE yylval; diff --git a/src/parse.y b/src/parse.y index 47fdcf2..09a871e 100644 --- a/src/parse.y +++ b/src/parse.y @@ -293,6 +293,63 @@ set_return_value(char *type, char *val) return FALSE; } +static void +export_accessors (char *var_name, + GString *get_cbuf, + int get_lineno, + GString *set_cbuf, + int set_lineno, + Type *type, + int lineno) +{ + if (get_cbuf) { + char *get_id = g_strdup_printf ("get_%s", var_name); + GString *get_cbuf_copy = g_string_new (get_cbuf->str); + char *tmp; + Node *node1 = new_type (type->name, type->pointer, type->postfix); + Node *node3 = new_type (class->class.otype, "*", NULL); + + tmp = g_strdup_printf ("\t%s%s ARG;\n", + type->name, + type->pointer ? type->pointer : ""); + get_cbuf_copy = g_string_prepend (get_cbuf_copy, tmp); + g_free (tmp); + + tmp = g_strdup_printf ("\n\t\treturn ARG;\n"); + get_cbuf_copy = g_string_append (get_cbuf_copy, tmp); + g_free (tmp); + + typestack = g_list_prepend (typestack, node1); + typestack = g_list_prepend (typestack, node3); + + push_funcarg ("self", FALSE); + + push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL, + get_id, get_cbuf_copy, get_lineno, + lineno, FALSE, NULL); + } + + if (set_cbuf) { + char *set_id = g_strdup_printf ("set_%s", var_name); + GString *set_cbuf_copy = g_string_new (set_cbuf->str); + Node *node1 = new_type (type->name, type->pointer, type->postfix); + Node *node2 = new_type ("void", NULL, NULL); + Node *node3 = new_type (class->class.otype, "*", NULL); + + typestack = g_list_prepend (typestack, node2); + typestack = g_list_prepend (typestack, node1); + typestack = g_list_prepend (typestack, node3); + + push_funcarg ("self", FALSE); + push_funcarg ("ARG", FALSE); + + typestack = g_list_prepend (typestack, node2); + push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL, + set_id, set_cbuf_copy, set_lineno, + lineno, FALSE, NULL); + } +} + %} %union { @@ -488,82 +545,118 @@ variable: scope type TOKEN varoptions ';' { push_variable($3, the_scope, $1, $4); } ; -argument: ARGUMENT flags argtype TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' { - if(strcmp($5,"get")==0 && - strcmp($8,"set")==0) { + +argument: ARGUMENT flags argtype TOKEN export TOKEN '{' CCODE TOKEN '{' CCODE ';' { + if(strcmp($6,"get")==0 && + strcmp($9,"set")==0) { Node *node; Type *type = pop_type(); - g_free($5); g_free($8); - node = new_argument($3,type,$2,$4, - ($7)->str,$6, - ($10)->str,$9, - $1); - g_string_free($7,FALSE); - g_string_free($10,FALSE); + g_free ($6); + g_free ($9); + node = new_argument ($3, type, $2, $4, + ($8)->str, $7, + ($11)->str,$10, + $1); + class_nodes = g_list_append(class_nodes,node); - } else if(strcmp($5,"set")==0 && - strcmp($8,"get")==0) { + + if ($5) { + export_accessors ($4, + $8, $7, + $11, $10, + type, + $1); + } + + g_string_free ($8, FALSE); + g_string_free ($11, FALSE); + + } else if(strcmp($6,"set")==0 && + strcmp($9,"get")==0) { Node *node; Type *type = pop_type(); - g_free($5); g_free($8); - node = new_argument($3,type,$2,$4, - ($10)->str,$9, - ($7)->str,$6, - $1); - g_string_free($10,FALSE); - g_string_free($7,FALSE); + g_free ($6); + g_free ($9); + node = new_argument ($3, type, $2, $4, + ($11)->str,$10, + ($8)->str,$7, + $1); + g_string_free ($11, FALSE); + g_string_free ($8, FALSE); class_nodes = g_list_append(class_nodes,node); } else { - g_free($3); g_free($4); - g_free($5); g_free($8); - g_list_foreach($2,(GFunc)g_free,NULL); - g_list_free($2); - g_string_free($10,TRUE); - g_string_free($7,TRUE); - yyerror(_("parse error")); + g_free ($3); + g_free ($4); + g_free ($6); + g_free ($9); + g_list_foreach ($2, (GFunc)g_free, NULL); + g_list_free ($2); + g_string_free ($11, TRUE); + g_string_free ($8, TRUE); + yyerror (_("parse error")); YYERROR; } } - | ARGUMENT flags argtype TOKEN TOKEN '{' CCODE ';' { - if(strcmp($5, "get") == 0) { + | ARGUMENT flags argtype TOKEN export TOKEN '{' CCODE ';' { + if(strcmp($6, "get") == 0) { Node *node; Type *type = pop_type(); - g_free($5); - node = new_argument($3, type, $2, $4, - ($7)->str, $6, - NULL, 0, $1); - g_string_free($7, FALSE); + g_free ($6); + node = new_argument ($3, type, $2, $4, + ($8)->str, $7, + NULL, 0, + $1); + if ($5) { + export_accessors ($4, + $8, $7, + NULL, 0, + type, + $1); + } + + g_string_free ($8, FALSE); class_nodes = g_list_append(class_nodes, node); - } else if(strcmp($5, "set") == 0) { + } else if(strcmp($6, "set") == 0) { Node *node; Type *type = pop_type(); - g_free($5); - node = new_argument($3, type, $2, $4, - NULL, 0, ($7)->str, - $6, $1); - g_string_free($7, FALSE); - class_nodes = g_list_append(class_nodes, node); + g_free ($6); + node = new_argument ($3, type, $2, $4, + NULL, 0, + ($8)->str, $7, + $1); + if ($5) { + export_accessors ($4, + NULL, 0, + $8, $7, + type, + $1); + } + + g_string_free ($8, FALSE); + class_nodes = g_list_append (class_nodes, node); } else { - g_free($5); g_free($3); - g_free($4); - g_list_foreach($2, (GFunc)g_free, NULL); - g_list_free($2); - g_string_free($7, TRUE); + g_free ($6); + g_free ($3); + g_free ($4); + g_list_foreach ($2, (GFunc)g_free, NULL); + g_list_free ($2); + g_string_free ($8, TRUE); yyerror(_("parse error")); YYERROR; } } - | ARGUMENT flags argtype TOKEN TOKEN { + | ARGUMENT flags argtype TOKEN export TOKEN { Node *node; char *get, *set = NULL; Variable *var; Type *type; char *root; - if(strcmp($5, "link")!=0 && - strcmp($5, "stringlink")!=0 && - strcmp($5, "objectlink")!=0) { - g_free($5); g_free($3); + if(strcmp($6, "link")!=0 && + strcmp($6, "stringlink")!=0 && + strcmp($6, "objectlink")!=0) { + g_free($6); + g_free($3); g_free($4); g_list_foreach($2,(GFunc)g_free,NULL); g_list_free($2); @@ -584,15 +677,15 @@ argument: ARGUMENT flags argtype TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' { } else root = "self"; - if(strcmp($5, "link")==0) { + if(strcmp($6, "link")==0) { set = g_strdup_printf("%s->%s = ARG;", root, $4); - } else if(strcmp($5, "stringlink")==0) { + } else if(strcmp ($6, "stringlink")==0) { set = g_strdup_printf("g_free(%s->%s); " "%s->%s = g_strdup(ARG);", root, $4, root, $4); - } else if(strcmp($5, "objectlink")==0) { + } else if(strcmp ($6, "objectlink")==0) { set = g_strdup_printf( "if (ARG != NULL) " "gtk_object_ref (GTK_OBJECT (ARG)); " @@ -606,25 +699,45 @@ argument: ARGUMENT flags argtype TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' { g_assert_not_reached(); } - if(strcmp($5, "stringlink")==0) { + if(strcmp ($6, "stringlink")==0) { get = g_strdup_printf("ARG = g_strdup(%s->%s);", root, $4); } else /* For everything else, get is just straight assignment */ get = g_strdup_printf("ARG = %s->%s;", root, $4); - g_free($5); + g_free ($6); if(!type) type = copy_type(var->vtype); - node = new_argument($3, type, $2, - $4, get, $1, - set, $1, $1); + node = new_argument ($3, type, $2, + $4, + get, $1, + set, $1, + $1); + if ($5) { + export_accessors ($4, + g_string_new (get), $1, + g_string_new (set), $1, + type, + $1); + } + class_nodes = g_list_append(class_nodes,node); } ; +export: '(' TOKEN ')' { + if (strcmp ($2, "export")!=0) { + g_free ($2); + yyerror (_("parse error")); + YYERROR; + } + $$ = $2; + } + | { $$ = NULL; } + argtype: TOKEN '(' TOKEN type ')' { if(strcmp($3,"type")!=0) { g_free($1); diff --git a/src/util.c b/src/util.c index acc112e..2455132 100644 --- a/src/util.c +++ b/src/util.c @@ -21,6 +21,7 @@ */ #include "config.h" +#include #include #include #include -- 2.43.2