From b17287deb56775a49030d738d8c8c0e9cd15f9fe Mon Sep 17 00:00:00 2001 From: George Lebl Date: Sat, 26 Feb 2000 00:36:00 -0800 Subject: [PATCH] Release 0.92.4 --- ChangeLog | 41 ++ NEWS | 9 +- TODO | 8 +- configure | 2 +- configure.in | 2 +- doc/gob.1.in | 36 +- examples/gtk-button-count.gob | 4 +- examples/my-person.gob | 10 +- gob.spec | 2 +- src/ChangeLog | 5 + src/Makefile.in | 2 +- src/lexer.c | 950 +++++++++++++++++----------------- src/lexer.l | 17 + src/main.c | 338 ++++++++---- src/parse.c | 934 +++++++++++++++++---------------- src/parse.y | 72 +-- src/test.gob | 8 +- src/tree.c | 6 +- src/tree.h | 12 +- 19 files changed, 1380 insertions(+), 1078 deletions(-) create mode 100644 src/ChangeLog diff --git a/ChangeLog b/ChangeLog index 62036a7..f95e8ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +Fri Feb 25 15:21:47 2000 George Lebl + + * Release 0.92.4 + +Fri Feb 25 14:46:51 2000 George Lebl + + * src/main.c: add SELF casting macros + + * doc/gob.1.in: document the above + +Fri Feb 25 02:29:26 2000 George Lebl + + * src/main.c,src/tree.[ch],src/parse.y: public signals get + GTK_RUN_ACTION added. Plus an interface for adding additional + flags is added. + + * doc/gob.1.in: add docs for the above + +Fri Feb 25 01:37:20 2000 George Lebl + + * src/main.c: fix trailing comma on the end of the argument enum + +Sun Feb 13 23:54:53 2000 George Lebl + + * doc/gob.1.in: add doc patch from Dave Dunkin + + * doc/gob.1.in,examples/*.gob: use init(self) to be more consistent + in naming + +Sat Feb 12 14:42:15 2000 George Lebl + + * src/main.c,src/lexer.l: apply patches from Dave Dunkin + to add all and alltop ccode sections + and to add a --no-write,-n option to not actually write + any files. Also did some very cosmetic changes to code + +Mon Feb 07 23:45:04 2000 George Lebl + + * src/main.c: use the magic /*< private >*/ and /*< public >*/ + comments to distinguish public and protected data members + Mon Feb 07 03:02:48 2000 George Lebl * Release 0.92.3 diff --git a/NEWS b/NEWS index 306d9a4..ed9b415 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,13 @@ +0.92.4 + * -n flag (Dave Dunkin) + * all and alltop code sections (Dave Dunkin) + * GTK_RUN_ flags for signals + * self casting macros + * other small fixes + 0.92.3 * inline documentation support - * standard m4 autoconf macro + * standard m4 autoconf macro (thanks to Eskil Heyn Olsen) * cleanups 0.92.2 diff --git a/TODO b/TODO index 3b2a8e7..f576e1d 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,5 @@ -Somehow transfer comments from .gob to .h and .c files to make gtk-doc -possible. Alternatively make gob act as gtk-doc, or generate a gtk-doc -ready stub file. - .defs file generation -signal RUN_ flags. Auto add GTK_RUN_ACTION for public signals, but add -a way to specify other flags - +PROBABLY NOT! I'm not sure I like this any more: a connect_full function for each signal with typesafe function pointer argument and macros for the other (simpler) connect types. diff --git a/configure b/configure index 1417210..31319a1 100755 --- a/configure +++ b/configure @@ -703,7 +703,7 @@ fi PACKAGE=gob -VERSION=0.92.3 +VERSION=0.92.4 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 a116ad8..22d78a1 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/tree.h) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(gob,0.92.3) +AM_INIT_AUTOMAKE(gob,0.92.4) if test -f ../NOINST_GOB ; then DOINSTGOB= diff --git a/doc/gob.1.in b/doc/gob.1.in index 22c39f0..6717d3e 100644 --- a/doc/gob.1.in +++ b/doc/gob.1.in @@ -69,6 +69,11 @@ 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 +.TP +.B -n +.TP +.B --no-write +Do not write any output files, just check syntax of the input file. .SH TYPENAMES .PP @@ -109,9 +114,16 @@ go into the public header file. You can also put it in the 'privateheader' section (abbreviated 'ph') which will make the code go into the private header file. Sometimes you want some code (other includes) to appear before the extern "C" and the protecting define. To do this you can put them -into the 'headertop' (or 'ht') section. For example: +into the 'headertop' (or 'ht') section. You may wish to include code or +comments in all the files, which you can do by putting them into the 'all' +(or 'a') section. Similarly, code you wish to appear at the top of all +files go in the 'alltop' (or 'at') section. For example: .nf + %alltop{ + /* this will be on top of all output files */ + %} + %headertop{ /* this will be on top of the public header */ %} @@ -125,6 +137,10 @@ into the 'headertop' (or 'ht') section. For example: void somefunc(int i); %} + %a{ + /* will be included in all files */ + %} + %{ /* will be included in the C file */ void somefunc(int i) @@ -357,10 +373,10 @@ it's init or class_init. For example: .nf - init(object) { + init(self) { /* initialize the object here */ - object->a = 9; - object->b = 9; + self->a = 9; + self->b = 9; } class_init(class) { @@ -428,6 +444,11 @@ by using "protected" instead of "private". If you don't define a "first" or a "last", the default will be taken as "last". .PP +You can also add additional flags. You do this just like with the argument +flags, although this is probably very rare. These are the GTK_RUN_* flags, +and you can add them without the GTK_RUN_ prefix into a parenthesis, just +after the "signal" keyword. By default all public signals are GTK_RUN_ACTION. +.PP Override methods: .PP If you need to override some method (a signal or a virtual method @@ -489,6 +510,13 @@ will fetch a new object, so a fairly standard new method would look like: .fi .PP +Casts: +.PP +There are some standard casts defined for you. Instead of using the full +macros inside the .c file, you can use SELF, IS_SELF and SELF_CLASS. Using +these makes it easier to for example change classnames around. There is +however no self type, so if you're declaring a pointer to your object, you +still have to use the full type. .SH DEALING WITH DIFFERENT GOB VERSIONS .PP diff --git a/examples/gtk-button-count.gob b/examples/gtk-button-count.gob index 1982146..d0bf595 100644 --- a/examples/gtk-button-count.gob +++ b/examples/gtk-button-count.gob @@ -16,9 +16,9 @@ class Gtk:Button:Count from Gtk:Button { self->count = ARG; }; - init(button) + init(self) { - button->count = 0; + self->count = 0; } /** diff --git a/examples/my-person.gob b/examples/my-person.gob index 61bd6dd..f09b151 100644 --- a/examples/my-person.gob +++ b/examples/my-person.gob @@ -31,14 +31,14 @@ class My:Person from Gtk:Object { argument LONG dob get { ARG = self->dob; } set { self->dob = ARG; }; argument LONG dod get { ARG = self->dod; } set { self->dod = ARG; }; - init(person) + init(self) { - person->name = g_strdup("Nobody"); - person->dob = 0; - person->dod = 0; + self->name = g_strdup("Nobody"); + self->dob = 0; + self->dod = 0; /* initially we have no rounds in the shotgun */ - person->_priv->rounds_in_shotgun = 0; + self->_priv->rounds_in_shotgun = 0; } /* when the person gets born, sends out a signal, the caller diff --git a/gob.spec b/gob.spec index 5d88103..886cfc4 100644 --- a/gob.spec +++ b/gob.spec @@ -1,4 +1,4 @@ -%define ver 0.92.3 +%define ver 0.92.4 %define rel 1 %define prefix /usr diff --git a/src/ChangeLog b/src/ChangeLog new file mode 100644 index 0000000..b8ae80a --- /dev/null +++ b/src/ChangeLog @@ -0,0 +1,5 @@ +Mon Feb 07 23:44:44 2000 George Lebl + + * main.c: use the magic /*< private >*/ and /*< public >*/ comments + to distinguish public and protected data members + diff --git a/src/Makefile.in b/src/Makefile.in index 6dddce3..1b5733f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -118,7 +118,7 @@ LEXLIB = @LEXLIB@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in lexer.c parse.c +DIST_COMMON = ChangeLog Makefile.am Makefile.in lexer.c parse.c DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) diff --git a/src/lexer.c b/src/lexer.c index 2f0c716..c2d69fa 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -284,60 +284,60 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 85 -#define YY_END_OF_BUFFER 86 -static yyconst short int yy_acclist[422] = +#define YY_NUM_RULES 87 +#define YY_END_OF_BUFFER 88 +static yyconst short int yy_acclist[424] = { 0, - 86, 83, 85, 82, 83, 85, 1, 84, 85, 83, - 84, 85, 83, 85, 83, 85, 83, 85, 82, 83, - 85, 83, 85, 83, 85, 26, 83, 85, 1, 27, - 84, 85, 26, 83, 84, 85, 26, 83, 85, 26, - 83, 85, 47, 83, 85, 1, 48, 84, 85, 47, - 83, 84, 85, 40, 47, 83, 85, 47, 83, 85, - 47, 83, 85, 47, 83, 85, 47, 83, 85, 45, - 47, 83, 85, 46, 47, 83, 85, 47, 83, 85, - 47, 83, 85, 43, 83, 85, 1, 44, 84, 85, - 43, 83, 84, 85, 42, 43, 83, 85, 43, 83, - - 85, 43, 83, 85, 83, 85, 83, 85, 77, 83, - 85, 77, 83, 85, 77, 83, 85, 77, 83, 85, - 77, 83, 85, 79, 83, 85, 83, 85, 83, 85, - 75, 83, 85, 75, 83, 85, 83, 85, 77, 83, - 85, 77, 83, 85, 77, 83, 85, 77, 83, 85, - 77, 83, 85, 77, 83, 85, 77, 83, 85, 77, - 83, 85, 77, 83, 85, 77, 83, 85, 77, 83, - 85, 77, 83, 85, 80, 83, 85, 81, 83, 85, - 9, 83, 85, 9, 83, 84, 85, 9, 83, 85, - 9, 83, 85, 9, 83, 85, 9, 83, 85, 14, - - 83, 85, 14, 83, 84, 85, 14, 83, 85, 14, - 83, 85, 14, 83, 85, 14, 83, 85, 17, 83, - 85, 17, 83, 84, 85, 17, 83, 85, 17, 83, - 85, 21, 31, 25, 22, 39, 32, 41, 23, 77, - 76, 77, 77, 77, 77, 75, 24, 75, 75, 78, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 8, 6, - 13, 10, 12, 11, 13, 16, 15, 3, 30, 37, - 33, 35, 18, 19, 76, 77, 77, 77, 77, 66, - 75, 20, 75, 75, 77, 77, 77, 77, 77, 77, - - 61, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 11, 28, 29, 38, 34, - 36, 77, 77, 52, 77, 51, 77, 5, 77, 64, - 77, 77, 77, 56, 77, 77, 59, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 53, - 77, 7, 49, 77, 77, 65, 77, 77, 62, 77, - 77, 77, 77, 77, 77, 60, 77, 77, 77, 77, - 55, 77, 77, 77, 77, 77, 63, 77, 77, 77, - 77, 77, 67, 77, 72, 77, 57, 77, 54, 77, - 77, 77, 77, 77, 74, 77, 77, 68, 77, 77, - - 77, 71, 77, 77, 70, 77, 73, 77, 77, 58, - 77, 77, 69, 77, 77, 4, 77, 2, 2, 77, - 50 + 88, 85, 87, 84, 85, 87, 1, 86, 87, 85, + 86, 87, 85, 87, 85, 87, 85, 87, 84, 85, + 87, 85, 87, 85, 87, 26, 85, 87, 1, 27, + 86, 87, 26, 85, 86, 87, 26, 85, 87, 26, + 85, 87, 49, 85, 87, 1, 50, 86, 87, 49, + 85, 86, 87, 42, 49, 85, 87, 49, 85, 87, + 49, 85, 87, 49, 85, 87, 49, 85, 87, 47, + 49, 85, 87, 48, 49, 85, 87, 49, 85, 87, + 49, 85, 87, 45, 85, 87, 1, 46, 86, 87, + 45, 85, 86, 87, 44, 45, 85, 87, 45, 85, + + 87, 45, 85, 87, 85, 87, 85, 87, 79, 85, + 87, 79, 85, 87, 79, 85, 87, 79, 85, 87, + 79, 85, 87, 81, 85, 87, 85, 87, 85, 87, + 77, 85, 87, 77, 85, 87, 85, 87, 79, 85, + 87, 79, 85, 87, 79, 85, 87, 79, 85, 87, + 79, 85, 87, 79, 85, 87, 79, 85, 87, 79, + 85, 87, 79, 85, 87, 79, 85, 87, 79, 85, + 87, 79, 85, 87, 82, 85, 87, 83, 85, 87, + 9, 85, 87, 9, 85, 86, 87, 9, 85, 87, + 9, 85, 87, 9, 85, 87, 9, 85, 87, 14, + + 85, 87, 14, 85, 86, 87, 14, 85, 87, 14, + 85, 87, 14, 85, 87, 14, 85, 87, 17, 85, + 87, 17, 85, 86, 87, 17, 85, 87, 17, 85, + 87, 21, 33, 25, 22, 41, 34, 43, 23, 79, + 78, 79, 79, 79, 79, 77, 24, 77, 77, 80, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 8, 6, + 13, 10, 12, 11, 13, 16, 15, 3, 28, 32, + 39, 35, 37, 18, 19, 78, 79, 79, 79, 79, + 68, 77, 20, 77, 77, 79, 79, 79, 79, 79, + + 79, 63, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 11, 29, 30, 31, + 40, 36, 38, 79, 79, 54, 79, 53, 79, 5, + 79, 66, 79, 79, 79, 58, 79, 79, 61, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 55, 79, 7, 51, 79, 79, 67, 79, 79, + 64, 79, 79, 79, 79, 79, 79, 62, 79, 79, + 79, 79, 57, 79, 79, 79, 79, 79, 65, 79, + 79, 79, 79, 79, 69, 79, 74, 79, 59, 79, + 56, 79, 79, 79, 79, 79, 76, 79, 79, 70, + + 79, 79, 79, 73, 79, 79, 72, 79, 75, 79, + 79, 60, 79, 79, 71, 79, 79, 4, 79, 2, + 2, 79, 52 } ; -static yyconst short int yy_accept[362] = +static yyconst short int yy_accept[370] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, @@ -350,35 +350,35 @@ static yyconst short int yy_accept[362] = 184, 188, 191, 194, 197, 200, 203, 207, 210, 213, 216, 219, 222, 226, 229, 232, 233, 233, 233, 233, - 233, 233, 233, 233, 234, 234, 235, 235, 235, 235, - 235, 236, 236, 237, 237, 237, 238, 239, 240, 240, - 240, 241, 242, 243, 244, 245, 246, 246, 247, 248, - 248, 248, 249, 249, 249, 250, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 270, 270, 270, - 271, 271, 272, 272, 272, 272, 273, 274, 274, 276, - 277, 278, 278, 279, 279, 279, 279, 279, 280, 280, - 280, 280, 281, 281, 281, 281, 282, 283, 283, 284, - 284, 284, 285, 285, 286, 287, 288, 289, 290, 291, - - 292, 292, 292, 293, 294, 295, 295, 296, 297, 298, - 299, 300, 301, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 316, 317, 317, - 317, 317, 318, 319, 319, 319, 320, 321, 322, 322, - 323, 324, 326, 328, 328, 329, 330, 332, 333, 334, - 336, 337, 339, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 350, 352, 352, 353, 353, 353, 353, - 354, 354, 354, 354, 354, 355, 356, 358, 359, 361, - 362, 363, 364, 365, 366, 368, 369, 370, 371, 373, - 374, 375, 375, 375, 375, 375, 375, 376, 377, 379, - - 380, 381, 382, 383, 385, 387, 389, 391, 392, 393, - 393, 393, 393, 393, 393, 394, 395, 397, 398, 400, - 401, 402, 404, 404, 404, 404, 404, 404, 405, 407, - 409, 410, 412, 412, 412, 412, 412, 412, 413, 415, - 415, 415, 415, 415, 416, 416, 416, 416, 416, 417, - 418, 419, 419, 419, 421, 421, 421, 421, 421, 422, - 422 + 233, 233, 233, 233, 233, 234, 234, 235, 235, 235, + 235, 235, 236, 236, 237, 237, 237, 238, 239, 240, + 240, 240, 241, 242, 243, 244, 245, 246, 246, 247, + 248, 248, 248, 249, 249, 249, 250, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 270, 270, + 270, 271, 271, 272, 272, 272, 272, 273, 274, 274, + 276, 277, 278, 278, 279, 279, 279, 279, 279, 280, + 280, 280, 281, 281, 281, 281, 282, 282, 282, 282, + 283, 284, 284, 285, 285, 285, 286, 286, 287, 288, + + 289, 290, 291, 292, 293, 293, 293, 294, 295, 296, + 296, 297, 298, 299, 300, 301, 302, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 317, 318, 318, 318, 318, 319, 319, 320, 321, + 321, 321, 322, 323, 324, 324, 325, 326, 328, 330, + 330, 331, 332, 334, 335, 336, 338, 339, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 354, 354, 355, 355, 355, 355, 356, 356, 356, 356, + 356, 356, 357, 358, 360, 361, 363, 364, 365, 366, + 367, 368, 370, 371, 372, 373, 375, 376, 377, 377, + + 377, 377, 377, 377, 377, 378, 379, 381, 382, 383, + 384, 385, 387, 389, 391, 393, 394, 395, 395, 395, + 395, 395, 395, 396, 397, 399, 400, 402, 403, 404, + 406, 406, 406, 406, 406, 406, 407, 409, 411, 412, + 414, 414, 414, 414, 414, 414, 415, 417, 417, 417, + 417, 417, 418, 418, 418, 418, 418, 419, 420, 421, + 421, 421, 423, 423, 423, 423, 423, 424, 424 } ; static yyconst int yy_ec[256] = @@ -423,120 +423,120 @@ static yyconst int yy_meta[57] = 7, 7, 7, 7, 1, 1 } ; -static yyconst short int yy_base[382] = +static yyconst short int yy_base[390] = { 0, 0, 35, 3, 5, 82, 136, 16, 24, 192, 0, - 238, 0, 7, 49, 31, 63, 66, 77, 806, 807, - 807, 807, 807, 4, 778, 761, 44, 17, 765, 807, - 807, 807, 790, 774, 807, 807, 807, 807, 68, 11, - 773, 0, 807, 807, 77, 743, 807, 807, 807, 807, - 771, 0, 50, 0, 781, 28, 2, 47, 61, 807, - 84, 94, 96, 102, 113, 85, 89, 74, 67, 106, - 102, 105, 113, 115, 136, 109, 117, 807, 807, 807, - 807, 784, 768, 151, 167, 807, 807, 782, 766, 155, - 171, 789, 788, 168, 251, 807, 787, 760, 754, 253, - - 749, 228, 141, 807, 738, 807, 776, 130, 775, 774, - 807, 779, 807, 254, 736, 807, 807, 807, 777, 763, - 762, 761, 159, 248, 241, 244, 765, 248, 765, 771, - 284, 290, 295, 0, 300, 303, 742, 249, 291, 139, - 276, 279, 254, 296, 303, 304, 305, 307, 306, 308, - 310, 311, 313, 316, 314, 807, 335, 356, 364, 807, - 368, 807, 370, 374, 380, 807, 385, 760, 807, 807, - 807, 768, 807, 746, 719, 734, 712, 807, 711, 723, - 712, 807, 754, 753, 752, 807, 807, 757, 807, 723, - 755, 807, 741, 740, 8, 318, 330, 328, 807, 378, - - 392, 752, 807, 385, 0, 388, 365, 373, 346, 317, - 388, 323, 738, 389, 390, 391, 392, 393, 394, 397, - 319, 395, 396, 399, 398, 411, 448, 807, 732, 702, - 714, 807, 807, 697, 707, 807, 807, 807, 705, 252, - 402, 731, 730, 421, 807, 412, 729, 403, 400, 728, - 404, 727, 409, 414, 441, 422, 417, 415, 445, 446, - 420, 451, 418, 726, 466, 807, 471, 475, 713, 807, - 702, 705, 689, 685, 456, 465, 720, 469, 719, 470, - 472, 473, 474, 476, 718, 477, 478, 479, 717, 480, - 483, 710, 682, 679, 691, 691, 482, 481, 711, 484, - - 485, 489, 486, 710, 709, 708, 707, 490, 492, 692, - 216, 679, 656, 667, 493, 495, 685, 502, 637, 503, - 497, 630, 571, 544, 548, 527, 534, 522, 571, 567, - 515, 562, 552, 523, 515, 542, 537, 533, 535, 500, - 401, 548, 542, 529, 323, 301, 551, 561, 807, 552, - 807, 151, 558, 125, 29, 561, 579, 583, 807, 807, - 594, 601, 608, 615, 622, 629, 636, 643, 650, 652, - 656, 663, 670, 677, 681, 685, 692, 696, 701, 707, - 714 + 238, 0, 7, 49, 31, 63, 66, 77, 816, 817, + 817, 817, 817, 4, 788, 771, 44, 49, 775, 817, + 817, 817, 800, 784, 817, 817, 817, 817, 66, 11, + 783, 0, 817, 817, 53, 753, 817, 817, 817, 817, + 781, 0, 50, 0, 791, 47, 2, 28, 66, 817, + 86, 99, 102, 112, 116, 63, 112, 86, 89, 90, + 102, 104, 119, 108, 125, 120, 135, 817, 817, 817, + 817, 794, 778, 168, 177, 817, 817, 792, 776, 252, + 253, 799, 798, 107, 156, 817, 797, 770, 764, 259, + + 759, 120, 228, 105, 817, 748, 817, 786, 254, 785, + 784, 817, 789, 817, 265, 746, 817, 817, 817, 787, + 773, 772, 771, 145, 153, 243, 255, 775, 171, 775, + 781, 285, 290, 300, 0, 305, 308, 752, 252, 262, + 257, 136, 279, 266, 301, 290, 308, 309, 311, 310, + 312, 314, 313, 317, 316, 318, 817, 334, 335, 346, + 817, 361, 817, 366, 367, 378, 817, 382, 770, 817, + 817, 817, 778, 817, 756, 729, 735, 722, 817, 742, + 720, 817, 719, 731, 720, 817, 762, 761, 760, 817, + 817, 765, 817, 731, 763, 817, 749, 748, 8, 339, + + 334, 340, 817, 360, 389, 760, 817, 382, 0, 385, + 370, 366, 377, 326, 372, 385, 746, 386, 387, 388, + 389, 390, 391, 394, 393, 392, 401, 397, 395, 396, + 446, 817, 740, 710, 369, 817, 722, 817, 817, 705, + 715, 817, 817, 817, 713, 407, 405, 739, 738, 427, + 817, 409, 737, 415, 424, 736, 419, 735, 429, 434, + 438, 436, 440, 441, 442, 443, 444, 445, 447, 734, + 466, 817, 485, 491, 721, 817, 702, 709, 712, 696, + 692, 449, 448, 727, 457, 726, 459, 465, 468, 475, + 481, 725, 482, 484, 486, 724, 487, 488, 717, 691, + + 688, 685, 697, 697, 490, 493, 717, 492, 494, 497, + 498, 716, 715, 714, 713, 502, 499, 698, 465, 689, + 676, 687, 48, 507, 708, 508, 703, 510, 513, 692, + 687, 657, 614, 525, 531, 523, 632, 577, 518, 576, + 566, 542, 547, 549, 539, 528, 560, 551, 494, 546, + 559, 531, 386, 306, 553, 563, 817, 554, 817, 249, + 560, 270, 141, 565, 581, 585, 817, 817, 596, 603, + 610, 617, 624, 631, 638, 645, 652, 654, 658, 665, + 672, 679, 683, 687, 694, 698, 703, 709, 716 } ; -static yyconst short int yy_def[382] = +static yyconst short int yy_def[390] = { 0, - 361, 361, 362, 362, 363, 363, 364, 364, 360, 9, - 9, 11, 365, 365, 366, 366, 367, 367, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 368, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 369, 360, 370, 371, 371, 371, 371, 371, 360, - 360, 360, 360, 360, 360, 371, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 371, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 372, 360, 360, 360, - - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 373, 360, 360, 360, 360, 360, 360, 374, 375, - 371, 376, 371, 371, 371, 371, 360, 360, 360, 377, - 360, 360, 360, 378, 360, 360, 360, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 360, 360, 360, 360, 360, - 379, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 372, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 373, 360, 360, - 374, 360, 375, 376, 371, 371, 371, 371, 360, 360, - - 360, 377, 360, 360, 378, 360, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 380, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 371, - 371, 371, 371, 360, 360, 371, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, - 371, 371, 371, 371, 360, 360, 380, 360, 360, 360, - 360, 360, 360, 360, 371, 371, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, - 371, 360, 360, 360, 360, 360, 371, 371, 371, 371, - - 371, 371, 371, 371, 371, 371, 371, 371, 371, 360, - 360, 360, 360, 360, 371, 371, 371, 371, 371, 371, - 371, 371, 360, 360, 360, 360, 360, 371, 371, 371, - 371, 371, 360, 360, 360, 360, 360, 371, 371, 360, - 360, 360, 381, 371, 360, 360, 360, 381, 360, 371, - 360, 360, 360, 371, 360, 360, 360, 360, 360, 0, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360 + 369, 369, 370, 370, 371, 371, 372, 372, 368, 9, + 9, 11, 373, 373, 374, 374, 375, 375, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 376, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 377, 368, 378, 379, 379, 379, 379, 379, 368, + 368, 368, 368, 368, 368, 379, 379, 379, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 380, 368, 368, 368, + + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 381, 368, 368, 368, 368, 368, 368, 382, + 383, 379, 384, 379, 379, 379, 379, 368, 368, 368, + 385, 368, 368, 368, 386, 368, 368, 368, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, + 379, 379, 379, 379, 379, 379, 368, 368, 368, 368, + 368, 387, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 380, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 381, 368, 368, 382, 368, 383, 384, 379, 379, + + 379, 379, 368, 368, 368, 385, 368, 368, 386, 368, + 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, + 388, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 379, 379, 379, 379, 368, + 368, 379, 379, 379, 379, 379, 379, 379, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, + 368, 368, 388, 368, 368, 368, 368, 368, 368, 368, + 368, 379, 379, 379, 379, 379, 379, 379, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 379, 368, 368, + + 368, 368, 368, 368, 379, 379, 379, 379, 379, 379, + 379, 379, 379, 379, 379, 379, 379, 368, 368, 368, + 368, 368, 379, 379, 379, 379, 379, 379, 379, 379, + 368, 368, 368, 368, 368, 379, 379, 379, 379, 379, + 368, 368, 368, 368, 368, 379, 379, 368, 368, 368, + 389, 379, 368, 368, 368, 389, 368, 379, 368, 368, + 368, 379, 368, 368, 368, 368, 368, 0, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368 } ; -static yyconst short int yy_nxt[864] = +static yyconst short int yy_nxt[874] = { 0, - 360, 21, 22, 23, 21, 31, 32, 31, 32, 22, - 81, 24, 33, 96, 33, 97, 82, 122, 48, 49, - 111, 50, 112, 122, 360, 25, 48, 49, 34, 50, - 34, 240, 83, 22, 87, 26, 27, 22, 23, 27, - 88, 51, 28, 122, 124, 100, 24, 52, 100, 51, - 84, 22, 81, 84, 123, 52, 89, 102, 85, 118, - 25, 119, 122, 103, 90, 22, 87, 90, 22, 93, - 26, 104, 91, 107, 83, 94, 122, 179, 114, 22, - 93, 114, 122, 29, 36, 37, 94, 38, 89, 122, - 39, 95, 101, 40, 127, 125, 128, 128, 128, 108, - - 122, 126, 95, 129, 122, 130, 131, 41, 132, 132, - 133, 142, 131, 42, 135, 135, 135, 122, 115, 141, - 122, 122, 109, 110, 122, 136, 136, 136, 122, 139, - 122, 124, 122, 138, 140, 183, 43, 44, 36, 37, - 122, 38, 45, 46, 39, 137, 144, 40, 143, 134, - 145, 122, 157, 153, 122, 157, 163, 146, 154, 163, - 158, 41, 155, 148, 164, 147, 149, 42, 159, 160, - 170, 161, 165, 166, 122, 167, 150, 151, 156, 171, - 168, 179, 169, 209, 184, 185, 152, 195, 355, 180, + 368, 21, 22, 23, 21, 31, 32, 31, 32, 22, + 81, 24, 33, 96, 33, 97, 82, 123, 48, 49, + 112, 50, 113, 123, 368, 25, 48, 49, 34, 50, + 34, 246, 83, 22, 87, 26, 27, 22, 23, 27, + 88, 51, 28, 123, 125, 100, 24, 52, 100, 51, + 84, 22, 81, 84, 115, 52, 89, 115, 85, 119, + 25, 120, 123, 123, 90, 22, 87, 90, 22, 93, + 26, 108, 91, 124, 83, 94, 126, 336, 123, 22, + 93, 123, 102, 29, 36, 37, 94, 38, 89, 103, + 39, 95, 101, 40, 116, 104, 128, 109, 129, 129, + + 129, 123, 95, 105, 123, 123, 127, 41, 130, 171, + 131, 139, 132, 42, 133, 133, 134, 123, 172, 123, + 110, 111, 132, 123, 136, 136, 136, 123, 137, 137, + 137, 142, 144, 143, 123, 123, 43, 44, 36, 37, + 123, 38, 45, 46, 39, 183, 145, 40, 138, 146, + 123, 123, 140, 184, 125, 135, 149, 141, 171, 150, + 123, 41, 177, 147, 154, 151, 152, 42, 123, 158, + 178, 148, 158, 199, 179, 153, 155, 159, 160, 161, + 156, 162, 98, 204, 204, 204, 200, 214, 157, 183, 43, 44, 20, 21, 22, 23, 21, 20, 20, 20, 20, 20, 20, 53, 20, 20, 20, 54, 20, 20, @@ -544,98 +544,99 @@ static yyconst short int yy_nxt[864] = 55, 55, 20, 20, 20, 55, 55, 57, 55, 55, 58, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 59, 55, 55, 55, 60, 20, 61, 62, - 63, 64, 64, 170, 100, 114, 122, 100, 114, 122, - 200, 200, 200, 122, 122, 176, 324, 122, 65, 122, - 178, 66, 275, 67, 68, 69, 70, 98, 177, 71, - 72, 196, 178, 73, 74, 198, 197, 75, 207, 76, - 77, 122, 78, 79, 122, 115, 204, 204, 204, 212, - - 131, 101, 132, 132, 133, 131, 122, 133, 133, 133, - 131, 122, 135, 135, 135, 136, 136, 136, 122, 122, - 122, 122, 122, 122, 208, 122, 122, 210, 122, 122, - 211, 122, 122, 122, 122, 137, 157, 352, 122, 157, - 219, 215, 216, 122, 158, 122, 213, 214, 217, 221, - 351, 249, 218, 220, 223, 226, 251, 159, 160, 222, - 161, 122, 224, 259, 225, 159, 160, 241, 159, 159, - 160, 163, 159, 242, 163, 165, 166, 243, 167, 164, - 122, 165, 166, 168, 165, 228, 165, 166, 122, 165, - 200, 200, 200, 244, 245, 248, 244, 204, 204, 204, - - 136, 136, 136, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 246, 122, 122, 122, - 137, 247, 244, 245, 122, 244, 122, 122, 252, 122, - 122, 250, 122, 122, 346, 122, 257, 122, 253, 254, - 262, 261, 278, 256, 255, 258, 260, 264, 263, 265, - 266, 243, 265, 277, 279, 276, 122, 280, 284, 283, - 122, 122, 281, 268, 289, 285, 122, 265, 266, 291, - 265, 122, 265, 266, 282, 265, 265, 266, 286, 265, - 122, 288, 287, 297, 122, 122, 268, 122, 122, 122, - 290, 122, 122, 122, 122, 122, 122, 122, 122, 122, - - 122, 122, 298, 315, 122, 122, 299, 122, 122, 303, - 122, 304, 122, 301, 306, 300, 309, 122, 122, 305, - 345, 318, 328, 302, 308, 316, 319, 321, 336, 307, - 122, 336, 317, 332, 322, 337, 320, 122, 337, 330, - 331, 338, 343, 336, 122, 329, 336, 349, 122, 350, - 122, 339, 341, 343, 342, 342, 342, 344, 347, 349, - 342, 342, 342, 353, 353, 353, 349, 122, 356, 177, - 353, 353, 353, 357, 357, 357, 340, 122, 349, 354, - 358, 359, 122, 358, 358, 359, 122, 358, 335, 334, - 333, 357, 357, 357, 20, 20, 20, 20, 20, 20, - - 20, 30, 30, 30, 30, 30, 30, 30, 35, 35, - 35, 35, 35, 35, 35, 47, 47, 47, 47, 47, - 47, 47, 80, 80, 80, 80, 80, 80, 80, 86, - 86, 86, 86, 86, 86, 86, 92, 92, 92, 92, - 92, 92, 92, 113, 113, 122, 113, 113, 113, 113, - 117, 117, 122, 117, 117, 117, 117, 120, 120, 121, - 121, 121, 121, 172, 172, 172, 172, 172, 172, 172, - 188, 188, 188, 188, 188, 188, 188, 191, 191, 191, - 191, 191, 191, 191, 193, 193, 193, 193, 194, 194, - 194, 194, 202, 202, 202, 202, 202, 202, 202, 205, - - 122, 205, 227, 227, 327, 326, 227, 227, 267, 267, - 267, 267, 267, 267, 348, 348, 325, 348, 348, 348, - 348, 323, 122, 122, 122, 122, 122, 314, 313, 312, - 311, 310, 122, 122, 122, 122, 296, 295, 294, 293, - 292, 122, 122, 122, 122, 122, 122, 274, 273, 272, - 271, 270, 269, 122, 203, 122, 122, 192, 239, 189, - 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, - 173, 228, 206, 203, 201, 199, 122, 122, 122, 192, - 190, 189, 187, 186, 182, 181, 105, 175, 174, 173, - 170, 170, 98, 162, 98, 156, 122, 98, 116, 98, - - 98, 106, 105, 99, 98, 360, 19, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360 + 63, 64, 64, 164, 166, 167, 164, 168, 123, 187, + 100, 165, 169, 100, 170, 180, 115, 123, 65, 115, + 123, 66, 123, 67, 68, 69, 70, 123, 181, 71, + 72, 123, 182, 73, 74, 123, 363, 75, 201, 76, + 77, 211, 78, 79, 123, 212, 202, 208, 208, 208, + + 132, 213, 133, 133, 134, 123, 116, 101, 188, 189, + 132, 216, 134, 134, 134, 132, 123, 136, 136, 136, + 137, 137, 137, 123, 123, 123, 123, 123, 123, 123, + 215, 123, 123, 123, 218, 158, 160, 161, 158, 162, + 138, 123, 360, 159, 223, 219, 220, 160, 161, 123, + 160, 217, 221, 225, 123, 123, 222, 224, 227, 230, + 255, 226, 160, 161, 229, 160, 228, 164, 166, 167, + 164, 168, 204, 204, 204, 165, 169, 248, 232, 166, + 167, 123, 166, 166, 167, 123, 166, 123, 247, 249, + 250, 251, 123, 250, 208, 208, 208, 137, 137, 137, + + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 359, 253, 256, 123, 138, 257, 277, + 123, 252, 123, 179, 123, 258, 254, 282, 250, 251, + 123, 250, 270, 263, 123, 259, 260, 265, 268, 123, + 262, 261, 264, 266, 123, 269, 267, 271, 272, 123, + 271, 123, 283, 123, 249, 123, 123, 123, 123, 123, + 123, 274, 123, 123, 123, 284, 285, 271, 272, 286, + 271, 289, 123, 290, 123, 293, 305, 287, 295, 294, + 123, 291, 288, 123, 297, 306, 271, 272, 296, 271, + 123, 292, 271, 272, 307, 271, 123, 123, 298, 123, + + 274, 123, 123, 123, 308, 123, 309, 123, 123, 123, + 311, 323, 123, 123, 123, 332, 312, 123, 310, 182, + 314, 317, 123, 123, 313, 123, 344, 354, 123, 344, + 326, 316, 345, 123, 327, 345, 315, 324, 123, 329, + 325, 330, 346, 123, 351, 338, 123, 339, 328, 340, + 344, 358, 352, 344, 347, 351, 355, 337, 350, 350, + 350, 350, 350, 350, 357, 361, 361, 361, 357, 123, + 364, 353, 361, 361, 361, 123, 357, 365, 365, 365, + 357, 362, 366, 367, 349, 366, 366, 367, 181, 366, + 348, 123, 123, 365, 365, 365, 20, 20, 20, 20, + + 20, 20, 20, 30, 30, 30, 30, 30, 30, 30, + 35, 35, 35, 35, 35, 35, 35, 47, 47, 47, + 47, 47, 47, 47, 80, 80, 80, 80, 80, 80, + 80, 86, 86, 86, 86, 86, 86, 86, 92, 92, + 92, 92, 92, 92, 92, 114, 114, 123, 114, 114, + 114, 114, 118, 118, 343, 118, 118, 118, 118, 121, + 121, 122, 122, 122, 122, 173, 173, 173, 173, 173, + 173, 173, 192, 192, 192, 192, 192, 192, 192, 195, + 195, 195, 195, 195, 195, 195, 197, 197, 197, 197, + 198, 198, 198, 198, 206, 206, 206, 206, 206, 206, + + 206, 209, 342, 209, 231, 231, 341, 123, 231, 231, + 273, 273, 273, 273, 273, 273, 356, 356, 123, 356, + 356, 356, 356, 123, 335, 334, 333, 331, 123, 123, + 123, 123, 123, 322, 321, 320, 319, 178, 318, 123, + 123, 123, 123, 304, 303, 302, 301, 300, 299, 123, + 123, 123, 123, 123, 123, 281, 280, 279, 278, 276, + 275, 123, 207, 123, 123, 196, 245, 193, 244, 243, + 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, + 174, 232, 210, 207, 205, 203, 123, 123, 123, 196, + 194, 193, 191, 190, 186, 185, 106, 176, 175, 174, + + 171, 171, 98, 163, 98, 157, 123, 98, 117, 98, + 98, 107, 106, 99, 98, 368, 19, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368 } ; -static yyconst short int yy_chk[864] = +static yyconst short int yy_chk[874] = { 0, 0, 1, 1, 1, 1, 3, 3, 4, 4, 13, 13, 1, 3, 24, 4, 24, 13, 57, 7, 7, - 40, 7, 40, 195, 0, 1, 8, 8, 3, 8, - 4, 195, 13, 15, 15, 1, 2, 2, 2, 2, - 15, 7, 2, 56, 57, 27, 2, 7, 27, 8, - 14, 14, 14, 14, 56, 8, 15, 28, 14, 53, - 2, 53, 58, 28, 16, 16, 16, 16, 17, 17, - 2, 28, 16, 39, 14, 17, 59, 355, 45, 18, - 18, 45, 69, 2, 5, 5, 18, 5, 16, 68, - 5, 17, 27, 5, 61, 58, 61, 61, 61, 39, - - 66, 59, 18, 62, 67, 62, 63, 5, 63, 63, - 63, 69, 64, 5, 64, 64, 64, 71, 45, 68, - 72, 70, 39, 39, 76, 65, 65, 65, 73, 67, - 74, 67, 77, 66, 67, 108, 5, 5, 6, 6, - 354, 6, 6, 6, 6, 65, 71, 6, 70, 63, - 72, 75, 84, 76, 140, 84, 90, 73, 77, 90, - 84, 6, 77, 74, 90, 73, 74, 6, 85, 85, - 94, 85, 91, 91, 123, 91, 75, 75, 85, 94, - 91, 103, 91, 140, 108, 108, 75, 123, 352, 103, + 40, 7, 40, 199, 0, 1, 8, 8, 3, 8, + 4, 199, 13, 15, 15, 1, 2, 2, 2, 2, + 15, 7, 2, 58, 57, 27, 2, 7, 27, 8, + 14, 14, 14, 14, 45, 8, 15, 45, 14, 53, + 2, 53, 56, 323, 16, 16, 16, 16, 17, 17, + 2, 39, 16, 56, 14, 17, 58, 323, 66, 18, + 18, 59, 28, 2, 5, 5, 18, 5, 16, 28, + 5, 17, 27, 5, 45, 28, 61, 39, 61, 61, + + 61, 68, 18, 28, 69, 70, 59, 5, 62, 94, + 62, 66, 63, 5, 63, 63, 63, 71, 94, 72, + 39, 39, 64, 74, 64, 64, 64, 67, 65, 65, + 65, 68, 70, 69, 73, 76, 5, 5, 6, 6, + 75, 6, 6, 6, 6, 104, 71, 6, 65, 72, + 77, 142, 67, 104, 67, 63, 74, 67, 95, 74, + 124, 6, 102, 73, 76, 75, 75, 6, 125, 84, + 102, 73, 84, 124, 102, 75, 77, 84, 85, 85, + 77, 85, 95, 129, 129, 129, 125, 142, 85, 363, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, @@ -643,74 +644,75 @@ static yyconst short int yy_chk[864] = 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, 95, 100, 114, 125, 100, 114, 126, - 128, 128, 128, 124, 138, 102, 311, 240, 11, 143, - 311, 11, 240, 11, 11, 11, 11, 95, 102, 11, - 11, 124, 102, 11, 11, 126, 125, 11, 138, 11, - 11, 141, 11, 11, 142, 114, 131, 131, 131, 143, - - 132, 100, 132, 132, 132, 133, 139, 133, 133, 133, - 135, 144, 135, 135, 135, 136, 136, 136, 145, 146, - 147, 149, 148, 150, 139, 151, 152, 141, 153, 155, - 142, 154, 210, 196, 221, 136, 157, 346, 212, 157, - 149, 146, 147, 198, 157, 197, 144, 145, 148, 151, - 345, 210, 148, 150, 153, 155, 212, 158, 158, 152, - 158, 209, 153, 221, 154, 159, 159, 196, 159, 161, - 161, 163, 161, 197, 163, 164, 164, 198, 164, 163, - 207, 165, 165, 164, 165, 164, 167, 167, 208, 167, - 200, 200, 200, 201, 201, 209, 201, 204, 204, 204, - - 206, 206, 206, 211, 214, 215, 216, 217, 218, 219, - 222, 223, 220, 225, 224, 249, 207, 241, 248, 251, - 206, 208, 244, 244, 253, 244, 226, 246, 214, 254, - 258, 211, 257, 263, 341, 261, 219, 256, 215, 216, - 224, 223, 249, 218, 217, 220, 222, 226, 225, 227, - 227, 241, 227, 248, 251, 246, 255, 253, 257, 256, - 259, 260, 254, 227, 261, 258, 262, 265, 265, 263, - 265, 275, 267, 267, 255, 267, 268, 268, 259, 268, - 276, 260, 259, 275, 278, 280, 267, 281, 282, 283, - 262, 284, 286, 287, 288, 290, 298, 297, 291, 300, - - 301, 303, 276, 297, 302, 308, 278, 309, 315, 283, - 316, 284, 321, 281, 287, 280, 291, 318, 320, 286, - 340, 301, 315, 282, 290, 298, 302, 308, 326, 288, - 331, 326, 300, 321, 309, 327, 303, 328, 327, 318, - 320, 328, 337, 336, 344, 316, 336, 343, 338, 344, - 339, 331, 335, 337, 336, 336, 336, 338, 342, 343, - 342, 342, 342, 347, 347, 347, 348, 350, 353, 334, - 353, 353, 353, 356, 356, 356, 333, 332, 348, 350, - 357, 357, 330, 357, 358, 358, 329, 358, 325, 324, - 323, 357, 357, 357, 361, 361, 361, 361, 361, 361, - - 361, 362, 362, 362, 362, 362, 362, 362, 363, 363, - 363, 363, 363, 363, 363, 364, 364, 364, 364, 364, - 364, 364, 365, 365, 365, 365, 365, 365, 365, 366, - 366, 366, 366, 366, 366, 366, 367, 367, 367, 367, - 367, 367, 367, 368, 368, 322, 368, 368, 368, 368, - 369, 369, 319, 369, 369, 369, 369, 370, 370, 371, - 371, 371, 371, 372, 372, 372, 372, 372, 372, 372, - 373, 373, 373, 373, 373, 373, 373, 374, 374, 374, - 374, 374, 374, 374, 375, 375, 375, 375, 376, 376, - 376, 376, 377, 377, 377, 377, 377, 377, 377, 378, - - 317, 378, 379, 379, 314, 313, 379, 379, 380, 380, - 380, 380, 380, 380, 381, 381, 312, 381, 381, 381, - 381, 310, 307, 306, 305, 304, 299, 296, 295, 294, - 293, 292, 289, 285, 279, 277, 274, 273, 272, 271, - 269, 264, 252, 250, 247, 243, 242, 239, 235, 234, - 231, 230, 229, 213, 202, 194, 193, 191, 190, 188, - 185, 184, 183, 181, 180, 179, 177, 176, 175, 174, - 172, 168, 137, 130, 129, 127, 122, 121, 120, 119, - 115, 112, 110, 109, 107, 105, 101, 99, 98, 97, - 93, 92, 89, 88, 83, 82, 55, 51, 46, 41, + 11, 11, 11, 90, 91, 91, 90, 91, 126, 109, + 100, 90, 91, 100, 91, 103, 115, 139, 11, 115, + 127, 11, 141, 11, 11, 11, 11, 140, 103, 11, + 11, 144, 103, 11, 11, 362, 360, 11, 126, 11, + 11, 139, 11, 11, 143, 140, 127, 132, 132, 132, + + 133, 141, 133, 133, 133, 146, 115, 100, 109, 109, + 134, 144, 134, 134, 134, 136, 145, 136, 136, 136, + 137, 137, 137, 147, 148, 150, 149, 151, 153, 152, + 143, 155, 154, 156, 146, 158, 159, 159, 158, 159, + 137, 214, 354, 158, 150, 147, 148, 160, 160, 201, + 160, 145, 149, 152, 200, 202, 149, 151, 154, 156, + 214, 153, 162, 162, 155, 162, 154, 164, 165, 165, + 164, 165, 204, 204, 204, 164, 165, 201, 165, 166, + 166, 212, 166, 168, 168, 211, 168, 215, 200, 202, + 205, 205, 213, 205, 208, 208, 208, 210, 210, 210, + + 216, 218, 219, 220, 221, 222, 223, 226, 225, 224, + 229, 230, 228, 353, 212, 215, 227, 210, 216, 235, + 247, 211, 246, 235, 252, 218, 213, 246, 250, 250, + 254, 250, 230, 223, 257, 219, 220, 225, 228, 255, + 222, 221, 224, 226, 259, 229, 227, 231, 231, 260, + 231, 262, 252, 261, 247, 263, 264, 265, 266, 267, + 268, 231, 269, 283, 282, 254, 255, 271, 271, 257, + 271, 261, 285, 262, 287, 265, 282, 259, 266, 265, + 288, 263, 260, 289, 268, 283, 273, 273, 267, 273, + 290, 264, 274, 274, 285, 274, 291, 293, 269, 294, + + 273, 295, 297, 298, 287, 305, 288, 308, 306, 309, + 290, 305, 310, 311, 317, 319, 291, 316, 289, 319, + 294, 298, 324, 326, 293, 328, 334, 349, 329, 334, + 309, 297, 335, 339, 310, 335, 295, 306, 336, 316, + 308, 317, 336, 346, 345, 326, 352, 328, 311, 329, + 344, 352, 346, 344, 339, 345, 350, 324, 350, 350, + 350, 344, 344, 344, 351, 355, 355, 355, 356, 358, + 361, 348, 361, 361, 361, 347, 351, 364, 364, 364, + 356, 358, 365, 365, 343, 365, 366, 366, 342, 366, + 341, 340, 338, 365, 365, 365, 369, 369, 369, 369, + + 369, 369, 369, 370, 370, 370, 370, 370, 370, 370, + 371, 371, 371, 371, 371, 371, 371, 372, 372, 372, + 372, 372, 372, 372, 373, 373, 373, 373, 373, 373, + 373, 374, 374, 374, 374, 374, 374, 374, 375, 375, + 375, 375, 375, 375, 375, 376, 376, 337, 376, 376, + 376, 376, 377, 377, 333, 377, 377, 377, 377, 378, + 378, 379, 379, 379, 379, 380, 380, 380, 380, 380, + 380, 380, 381, 381, 381, 381, 381, 381, 381, 382, + 382, 382, 382, 382, 382, 382, 383, 383, 383, 383, + 384, 384, 384, 384, 385, 385, 385, 385, 385, 385, + + 385, 386, 332, 386, 387, 387, 331, 330, 387, 387, + 388, 388, 388, 388, 388, 388, 389, 389, 327, 389, + 389, 389, 389, 325, 322, 321, 320, 318, 315, 314, + 313, 312, 307, 304, 303, 302, 301, 300, 299, 296, + 292, 286, 284, 281, 280, 279, 278, 277, 275, 270, + 258, 256, 253, 249, 248, 245, 241, 240, 237, 234, + 233, 217, 206, 198, 197, 195, 194, 192, 189, 188, + 187, 185, 184, 183, 181, 180, 178, 177, 176, 175, + 173, 169, 138, 131, 130, 128, 123, 122, 121, 120, + 116, 113, 111, 110, 108, 106, 101, 99, 98, 97, - 34, 33, 29, 26, 25, 19, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - 360, 360, 360 + 93, 92, 89, 88, 83, 82, 55, 51, 46, 41, + 34, 33, 29, 26, 25, 19, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 368, 368 } ; static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; @@ -828,7 +830,7 @@ add_gtk_doc_func(void) #define GTK_DOC_LINE 8 -#line 832 "lex.yy.c" +#line 834 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -985,7 +987,7 @@ YY_DECL #line 95 "lexer.l" -#line 989 "lex.yy.c" +#line 991 "lex.yy.c" if ( yy_init ) { @@ -1034,14 +1036,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 >= 361 ) + if ( yy_current_state >= 369 ) 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] != 807 ); + while ( yy_base[yy_current_state] != 817 ); yy_find_action: yy_current_state = *--yy_state_ptr; @@ -1314,7 +1316,7 @@ YY_RULE_SETUP BEGIN(C_CODE); parenth_depth = 1; class_after_c = FALSE; - code_type = HTCODE; + code_type = ACODE; clear_cbuf(); ccode_line = line_no; } @@ -1326,26 +1328,50 @@ YY_RULE_SETUP BEGIN(C_CODE); parenth_depth = 1; class_after_c = FALSE; - code_type = PHCODE; + code_type = ATCODE; clear_cbuf(); ccode_line = line_no; } YY_BREAK case 30: YY_RULE_SETUP -#line 220 "lexer.l" +#line 221 "lexer.l" { BEGIN(C_CODE); parenth_depth = 1; class_after_c = FALSE; - code_type = HCODE; + code_type = HTCODE; clear_cbuf(); ccode_line = line_no; } YY_BREAK case 31: YY_RULE_SETUP -#line 228 "lexer.l" +#line 229 "lexer.l" +{ + BEGIN(C_CODE); + parenth_depth = 1; + class_after_c = FALSE; + code_type = PHCODE; + clear_cbuf(); + ccode_line = line_no; + } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 237 "lexer.l" +{ + BEGIN(C_CODE); + parenth_depth = 1; + class_after_c = FALSE; + code_type = HCODE; + clear_cbuf(); + ccode_line = line_no; + } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 245 "lexer.l" { BEGIN(C_CODE); parenth_depth = 1; @@ -1357,9 +1383,9 @@ YY_RULE_SETUP look_for_includes=1; } YY_BREAK -case 32: +case 34: YY_RULE_SETUP -#line 238 "lexer.l" +#line 255 "lexer.l" { BEGIN(INITIAL); yylval.cbuf = cbuf; @@ -1369,83 +1395,83 @@ YY_RULE_SETUP return code_type; } YY_BREAK -case 33: -YY_RULE_SETUP -#line 247 "lexer.l" -{ add_to_cbuf(yytext); } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 248 "lexer.l" -{ add_to_cbuf(yytext); } - YY_BREAK case 35: YY_RULE_SETUP -#line 249 "lexer.l" +#line 264 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 36: YY_RULE_SETUP -#line 250 "lexer.l" +#line 265 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 37: YY_RULE_SETUP -#line 251 "lexer.l" +#line 266 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 38: YY_RULE_SETUP -#line 252 "lexer.l" +#line 267 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 39: YY_RULE_SETUP -#line 254 "lexer.l" +#line 268 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 40: YY_RULE_SETUP -#line 255 "lexer.l" +#line 269 "lexer.l" +{ add_to_cbuf(yytext); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 271 "lexer.l" +{ add_to_cbuf(yytext); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 272 "lexer.l" { BEGIN(C_CODE_STRING); add_to_cbuf(yytext); } YY_BREAK -case 41: +case 43: YY_RULE_SETUP -#line 259 "lexer.l" +#line 276 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK -case 42: +case 44: YY_RULE_SETUP -#line 260 "lexer.l" +#line 277 "lexer.l" { BEGIN(C_CODE); add_to_cbuf(yytext); } YY_BREAK -case 43: +case 45: YY_RULE_SETUP -#line 264 "lexer.l" +#line 281 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK -case 44: +case 46: YY_RULE_SETUP -#line 265 "lexer.l" +#line 282 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK -case 45: +case 47: YY_RULE_SETUP -#line 267 "lexer.l" +#line 284 "lexer.l" { parenth_depth++; add_to_cbuf(yytext); } YY_BREAK -case 46: +case 48: YY_RULE_SETUP -#line 271 "lexer.l" +#line 288 "lexer.l" { parenth_depth--; if(parenth_depth<0) { @@ -1459,19 +1485,19 @@ YY_RULE_SETUP add_to_cbuf(yytext); } YY_BREAK -case 47: +case 49: YY_RULE_SETUP -#line 284 "lexer.l" +#line 301 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK -case 48: +case 50: YY_RULE_SETUP -#line 285 "lexer.l" +#line 302 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK -case 49: +case 51: YY_RULE_SETUP -#line 287 "lexer.l" +#line 304 "lexer.l" { static int found_classes = 0; look_for_includes = 2; @@ -1486,12 +1512,12 @@ YY_RULE_SETUP return CLASS; } YY_BREAK -case 50: +case 52: *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 301 "lexer.l" +#line 318 "lexer.l" { int maj = 0,min = 0,pl = 0; int rmaj = 0,rmin = 0,rpl = 0; @@ -1516,9 +1542,9 @@ YY_RULE_SETUP } } YY_BREAK -case 51: +case 53: YY_RULE_SETUP -#line 325 "lexer.l" +#line 342 "lexer.l" { if(for_cpp) { char *s; @@ -1531,164 +1557,164 @@ YY_RULE_SETUP REJECT; } YY_BREAK -case 52: +case 54: YY_RULE_SETUP -#line 337 "lexer.l" +#line 354 "lexer.l" {return FROM;} YY_BREAK -case 53: +case 55: YY_RULE_SETUP -#line 339 "lexer.l" +#line 356 "lexer.l" {return VOID;} YY_BREAK -case 54: +case 56: YY_RULE_SETUP -#line 340 "lexer.l" +#line 357 "lexer.l" {return STRUCT;} YY_BREAK -case 55: +case 57: YY_RULE_SETUP -#line 341 "lexer.l" +#line 358 "lexer.l" {return UNION;} YY_BREAK -case 56: +case 58: YY_RULE_SETUP -#line 342 "lexer.l" +#line 359 "lexer.l" {return ENUM;} YY_BREAK -case 57: +case 59: YY_RULE_SETUP -#line 343 "lexer.l" +#line 360 "lexer.l" {return SIGNED;} YY_BREAK -case 58: +case 60: YY_RULE_SETUP -#line 344 "lexer.l" +#line 361 "lexer.l" {return UNSIGNED;} YY_BREAK -case 59: +case 61: YY_RULE_SETUP -#line 345 "lexer.l" +#line 362 "lexer.l" {return LONG;} YY_BREAK -case 60: +case 62: YY_RULE_SETUP -#line 346 "lexer.l" +#line 363 "lexer.l" {return SHORT;} YY_BREAK -case 61: +case 63: YY_RULE_SETUP -#line 347 "lexer.l" +#line 364 "lexer.l" {return INT;} YY_BREAK -case 62: +case 64: YY_RULE_SETUP -#line 348 "lexer.l" +#line 365 "lexer.l" {return FLOAT;} YY_BREAK -case 63: +case 65: YY_RULE_SETUP -#line 349 "lexer.l" +#line 366 "lexer.l" {return DOUBLE;} YY_BREAK -case 64: +case 66: YY_RULE_SETUP -#line 350 "lexer.l" +#line 367 "lexer.l" {return CHAR;} YY_BREAK -case 65: +case 67: YY_RULE_SETUP -#line 351 "lexer.l" +#line 368 "lexer.l" {return CONST;} YY_BREAK -case 66: +case 68: YY_RULE_SETUP -#line 353 "lexer.l" +#line 370 "lexer.l" {return THREEDOTS;} YY_BREAK -case 67: +case 69: YY_RULE_SETUP -#line 355 "lexer.l" +#line 372 "lexer.l" {yylval.line = line_no; return PUBLIC;} YY_BREAK -case 68: +case 70: YY_RULE_SETUP -#line 356 "lexer.l" +#line 373 "lexer.l" {yylval.line = line_no; return PRIVATE;} YY_BREAK -case 69: +case 71: YY_RULE_SETUP -#line 357 "lexer.l" +#line 374 "lexer.l" {yylval.line = line_no; return PROTECTED;} YY_BREAK -case 70: +case 72: YY_RULE_SETUP -#line 358 "lexer.l" +#line 375 "lexer.l" {yylval.line = line_no; return ARGUMENT;} YY_BREAK -case 71: +case 73: YY_RULE_SETUP -#line 359 "lexer.l" +#line 376 "lexer.l" {yylval.line = line_no; return VIRTUAL;} YY_BREAK -case 72: +case 74: YY_RULE_SETUP -#line 360 "lexer.l" +#line 377 "lexer.l" {yylval.line = line_no; return SIGNAL;} YY_BREAK -case 73: +case 75: YY_RULE_SETUP -#line 361 "lexer.l" +#line 378 "lexer.l" {yylval.line = line_no; return OVERRIDE;} YY_BREAK -case 74: +case 76: YY_RULE_SETUP -#line 362 "lexer.l" +#line 379 "lexer.l" {return ONERROR;} YY_BREAK -case 75: +case 77: YY_RULE_SETUP -#line 363 "lexer.l" +#line 380 "lexer.l" { yylval.id = g_strdup(yytext); return NUMBER; } YY_BREAK -case 76: +case 78: YY_RULE_SETUP -#line 367 "lexer.l" +#line 384 "lexer.l" { yylval.id = g_strdup(yytext); return TYPETOKEN; } YY_BREAK -case 77: +case 79: YY_RULE_SETUP -#line 371 "lexer.l" +#line 388 "lexer.l" { yylval.id = g_strdup(yytext); return TOKEN; } YY_BREAK -case 78: +case 80: YY_RULE_SETUP -#line 376 "lexer.l" +#line 393 "lexer.l" { yylval.id = g_strdup(yytext); return ARRAY_DIM; } YY_BREAK -case 79: +case 81: YY_RULE_SETUP -#line 381 "lexer.l" +#line 398 "lexer.l" { BEGIN(CLASS_CODE_I); return '{'; } YY_BREAK -case 80: +case 82: YY_RULE_SETUP -#line 385 "lexer.l" +#line 402 "lexer.l" { BEGIN(C_CODE); parenth_depth=1; @@ -1699,38 +1725,38 @@ YY_RULE_SETUP return '{'; } YY_BREAK -case 81: +case 83: YY_RULE_SETUP -#line 394 "lexer.l" +#line 411 "lexer.l" { BEGIN(INITIAL); return '}'; } YY_BREAK -case 82: +case 84: YY_RULE_SETUP -#line 399 "lexer.l" +#line 416 "lexer.l" ; /*ignore*/ YY_BREAK -case 83: +case 85: YY_RULE_SETUP -#line 401 "lexer.l" +#line 418 "lexer.l" { yylval.line = line_no; return yytext[0]; } YY_BREAK -case 84: +case 86: YY_RULE_SETUP -#line 406 "lexer.l" +#line 423 "lexer.l" ; /*ignore*/ YY_BREAK -case 85: +case 87: YY_RULE_SETUP -#line 407 "lexer.l" +#line 424 "lexer.l" ECHO; YY_BREAK -#line 1734 "lex.yy.c" +#line 1760 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(C_CODE): @@ -2028,7 +2054,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 >= 361 ) + if ( yy_current_state >= 369 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2058,11 +2084,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 >= 361 ) + if ( yy_current_state >= 369 ) 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 == 360); + yy_is_jam = (yy_current_state == 368); if ( ! yy_is_jam ) *yy_state_ptr++ = yy_current_state; @@ -2620,4 +2646,4 @@ int main() return 0; } #endif -#line 407 "lexer.l" +#line 424 "lexer.l" diff --git a/src/lexer.l b/src/lexer.l index 68bafd0..ddbd951 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -201,6 +201,23 @@ add_gtk_doc_func(void) if(before_comment == C_CODE) add_to_cbuf(yytext); } +^\%(a|all)\{ { + BEGIN(C_CODE); + parenth_depth = 1; + class_after_c = FALSE; + code_type = ACODE; + clear_cbuf(); + ccode_line = line_no; + } +^\%(at|alltop)\{ { + BEGIN(C_CODE); + parenth_depth = 1; + class_after_c = FALSE; + code_type = ATCODE; + clear_cbuf(); + ccode_line = line_no; + } + ^\%(ht|headertop)\{ { BEGIN(C_CODE); parenth_depth = 1; diff --git a/src/main.c b/src/main.c index d5d299e..dedf432 100644 --- a/src/main.c +++ b/src/main.c @@ -71,6 +71,7 @@ static gboolean made_aliases = FALSE; /* if we made any shorthand aliases FILE *out = NULL; FILE *outh = NULL; FILE *outph = NULL; +FILE *devnull = NULL; gboolean no_touch_headers = FALSE; gboolean for_cpp = FALSE; @@ -81,24 +82,25 @@ gboolean got_error = FALSE; gboolean always_private_header = FALSE; gboolean no_private_header = FALSE; gboolean no_extern_c = FALSE; +gboolean no_write = FALSE; static void make_bases(void) { - filebase = replace_sep(((Class *)class)->otype,'-'); + filebase = replace_sep(((Class *)class)->otype, '-'); g_strdown(filebase); - funcbase = replace_sep(((Class *)class)->otype,'_'); + funcbase = replace_sep(((Class *)class)->otype, '_'); g_strdown(funcbase); - pfuncbase = replace_sep(((Class *)class)->ptype,'_'); + pfuncbase = replace_sep(((Class *)class)->ptype, '_'); g_strdown(pfuncbase); - macrobase = replace_sep(((Class *)class)->otype,'_'); + macrobase = replace_sep(((Class *)class)->otype, '_'); g_strup(macrobase); - macrois = make_pre_macro(((Class *)class)->otype,"IS"); - macrotype = make_pre_macro(((Class *)class)->otype,"TYPE"); + macrois = make_pre_macro(((Class *)class)->otype, "IS"); + macrotype = make_pre_macro(((Class *)class)->otype, "TYPE"); typebase = remove_sep(((Class *)class)->otype); @@ -130,11 +132,11 @@ get_type(Type *t, gboolean postfix_to_stars) } g_string_append_c(gs,' '); - for(i=0;i<(t->stars+extra);i++) - g_string_append_c(gs,'*'); + for(i=0; i<(t->stars+extra); i++) + g_string_append_c(gs, '*'); s = gs->str; - g_string_free(gs,FALSE); + g_string_free(gs, FALSE); return s; } @@ -164,8 +166,8 @@ print_type(FILE *fp, Type *t, gboolean postfix_to_stars) { char *s; - s = get_type(t,postfix_to_stars); - out_printf(fp,"%s",s); + s = get_type(t, postfix_to_stars); + out_printf(fp, "%s", s); g_free(s); } @@ -179,37 +181,37 @@ print_method(FILE *fp, char *typeprefix, char *nameprefix, { GList *li; - out_printf(fp,"%s",typeprefix); - print_type(fp,m->mtype,TRUE); + out_printf(fp, "%s", typeprefix); + print_type(fp, m->mtype, TRUE); if(no_funcbase) - out_printf(fp,"%s%s%s%s(", - nameprefix,subnameprefix,m->id,namepostfix); + out_printf(fp, "%s%s%s%s(", + nameprefix, subnameprefix, m->id, namepostfix); else out_printf(fp,"%s%s_%s%s%s(", - nameprefix,funcbase,subnameprefix,m->id, + nameprefix, funcbase, subnameprefix, m->id, namepostfix); if(m->args) { - for(li=m->args;li;li=g_list_next(li)) { + for(li=m->args; li; li=g_list_next(li)) { FuncArg *arg = li->data; - print_type(fp,arg->atype,FALSE); + print_type(fp, arg->atype, FALSE); if(li->next) - out_printf(fp,"%s%s,%s",arg->name, + out_printf(fp, "%s%s,%s", arg->name, arg->atype->postfix? arg->atype->postfix:"", one_arg_per_line?"\n\t\t\t\t\t":" "); else - out_printf(fp,"%s%s",arg->name, + out_printf(fp, "%s%s", arg->name, arg->atype->postfix? arg->atype->postfix:""); } if(m->vararg) - out_printf(fp,",%s...", + out_printf(fp, ",%s...", one_arg_per_line?"\n\t\t\t\t\t":" "); } else { - out_printf(fp,"void"); + out_printf(fp, "void"); } - out_printf(fp,")%s",postfix); + out_printf(fp, ")%s", postfix); } @@ -247,7 +249,7 @@ make_method_nongnu_aliases(Class *c) { GList *li; - for(li=c->nodes;li;li=g_list_next(li)) { + for(li=c->nodes; li; li=g_list_next(li)) { Node *node = li->data; if(node->type == METHOD_NODE) { Method *m = (Method *)node; @@ -258,11 +260,12 @@ make_method_nongnu_aliases(Class *c) continue; /* in C++ mode don't alias new */ - if(for_cpp && strcmp(m->id,"new")==0) + if(for_cpp && strcmp(m->id, "new")==0) continue; - print_method(out,"static ","(* ","",") ","",m,FALSE,TRUE); - out_printf(out," = %s_%s;\n",funcbase,m->id); + print_method(out, "static ", "(* ", "", ") ", "", + m, FALSE, TRUE); + out_printf(out, " = %s_%s;\n", funcbase, m->id); made_aliases = TRUE; } @@ -465,18 +468,18 @@ make_inits(Class *cl) } if(!got_class_init) { node = new_method(NO_SCOPE, CLASS_INIT_METHOD, - (Type *)new_type(0,g_strdup("void"),NULL), - NULL,NULL,g_strdup("class_init"), - make_func_arg(cl->otype,TRUE,g_strdup("c")), - NULL, NULL,0,0,FALSE); + (Type *)new_type(0, g_strdup("void"),NULL), + NULL, NULL, NULL, g_strdup("class_init"), + make_func_arg(cl->otype, TRUE, g_strdup("c")), + NULL, NULL, 0, 0, FALSE); cl->nodes = g_list_prepend(cl->nodes,node); } if(!got_init) { node = new_method(NO_SCOPE, INIT_METHOD, - (Type *)new_type(0,g_strdup("void"),NULL), - NULL,NULL,g_strdup("init"), - make_func_arg(cl->otype,FALSE,g_strdup("o")), - NULL, NULL,0,0,FALSE); + (Type *)new_type(0, g_strdup("void"),NULL), + NULL, NULL, NULL, g_strdup("init"), + make_func_arg(cl->otype, FALSE, g_strdup("o")), + NULL, NULL, 0, 0, FALSE); cl->nodes = g_list_prepend(cl->nodes,node); } } @@ -492,16 +495,14 @@ make_finalize(Class *cl) if(n->type == METHOD_NODE) { Method *m = (Method *)n; if(m->method == OVERRIDE_METHOD && - strcmp(m->id,"finalize")==0) { - if(strcmp(m->otype,"Gtk:Object")==0) { + strcmp(m->id, "finalize")==0) { + if(strcmp(m->otype, "Gtk:Object")==0) { got_finalize = TRUE; break; - } else { - print_error(FALSE,"finalize method override " - "of class other then Gtk:Object", - m->line_no); } - + print_error(FALSE,"finalize method override " + "of class other then Gtk:Object", + m->line_no); } } } @@ -509,7 +510,7 @@ make_finalize(Class *cl) node = new_method(NO_SCOPE, OVERRIDE_METHOD, (Type *)new_type(0,g_strdup("void"),NULL), g_strdup("Gtk:Object"), - NULL,g_strdup("finalize"), + NULL, NULL, g_strdup("finalize"), make_func_arg("Gtk:Object",FALSE,g_strdup("o")), NULL, g_strdup("PARENT_HANDLER (o);\n"), @@ -666,18 +667,18 @@ add_enums(Class *c) out_printf(out,"\tLAST_SIGNAL\n};\n\n"); } if(arguments>0) { - out_printf(out,"enum {\n\tARG_0,\n"); + out_printf(out,"enum {\n\tARG_0"); for(li=c->nodes;li;li=g_list_next(li)) { Node *n = li->data; if(n->type == ARGUMENT_NODE) { Argument *a = (Argument *)n; char *s = g_strdup(a->name); g_strup(s); - out_printf(out,"\tARG_%s,\n",s); + out_printf(out,",\n\tARG_%s",s); g_free(s); } } - out_printf(out, "};\n\n"); + out_printf(out, "\n};\n\n"); } if(signals>0) @@ -753,6 +754,58 @@ add_overrides(Class *c, char *oname, gboolean did_gtk_obj) g_hash_table_destroy(done); } +static char * +make_run_signal_flags(Method *m, gboolean last) +{ + GList *li; + GString *gs; + char *flags[] = { + "FIRST", + "LAST", + "BOTH", + "NO_RECURSE", + "ACTION", + "NO_HOOKS", + NULL + }; + + gs = g_string_new(NULL); + + if(last) + g_string_assign(gs, "GTK_RUN_LAST"); + else + g_string_assign(gs, "GTK_RUN_FIRST"); + + if(m->scope == PUBLIC_SCOPE) + g_string_append(gs, " | GTK_RUN_ACTION"); + + for(li = m->flags; li; li = li->next) { + char *flag = li->data; + int i; + for(i=0;flags[i];i++) { + if(strcmp(flags[i],flag)==0) + break; + } + /* if we haven't found it in our list */ + if(!flags[i]) { + char *s; + s = g_strdup_printf("Unknown flag '%s' used, " + "perhaps it was misspelled", + flag); + print_error(TRUE, s, m->line_no); + g_free(s); + } + g_string_sprintfa(gs, " | GTK_RUN_%s",flag); + } + + { + char *ret = gs->str; + g_string_free(gs, FALSE); + return ret; + } +} + + static void add_signals(Class *c) { @@ -761,46 +814,46 @@ add_signals(Class *c) out_printf(out,"\n"); for(li=c->nodes;li;li=g_list_next(li)) { Node *n = li->data; - char *mar; - char *sig; - int is_none; - int last = FALSE; + char *mar, *sig, *flags; + gboolean is_none, last = FALSE; Method *m = (Method *)n; + if(n->type != METHOD_NODE || (m->method != SIGNAL_FIRST_METHOD && m->method != SIGNAL_LAST_METHOD)) continue; - if(m->method == SIGNAL_FIRST_METHOD) last = FALSE; else last = TRUE; - if(g_hash_table_lookup(marsh,m)) + if(g_hash_table_lookup(marsh, m)) mar = g_strconcat("___marshal_", (char *)g_hash_table_lookup(marsh,m), NULL); else mar = g_strdup("gtk_signal_default_marshaller"); - is_none = (strcmp(m->gtktypes->next->data,"NONE")==0); + is_none = (strcmp(m->gtktypes->next->data, "NONE")==0); sig = g_strdup(m->id); g_strup(sig); + flags = make_run_signal_flags(m, last); out_printf(out,"\tobject_signals[%s_SIGNAL] =\n" "\t\tgtk_signal_new (\"%s\",\n" - "\t\t\tGTK_RUN_%s,\n" + "\t\t\%s,\n" "\t\t\tgtk_object_class->type,\n" "\t\t\tGTK_SIGNAL_OFFSET (%sClass, %s),\n" "\t\t\t%s,\n" "\t\t\tGTK_TYPE_%s, %d", sig,m->id, - last?"LAST":"FIRST", + flags, typebase,m->id,mar,(char *)m->gtktypes->data, is_none?0:g_list_length(m->gtktypes->next)); g_free(mar); g_free(sig); + g_free(flags); if(!is_none) { GList *l; @@ -1382,19 +1435,30 @@ open_files(void) outfileph = NULL; - out = fopen(outfile,"w"); - if(!out) { - g_error("Cannot open outfile: %s",outfile); - } - outh = fopen(outfileh,"w"); - if(!outh) { - g_error("Cannot open outfile: %s",outfileh); - } - if(outfileph) { - outph = fopen(outfileph,"w"); - if(!outph) { + if(no_write) { + devnull = fopen("/dev/null","w"); + if(!devnull) { + g_error("Cannot open null device",NULL); + } + out = devnull; + outh = devnull; + if(outfileph) + outph = devnull; + } else { + out = fopen(outfile,"w"); + if(!out) { + g_error("Cannot open outfile: %s",outfile); + } + outh = fopen(outfileh,"w"); + if(!outh) { g_error("Cannot open outfile: %s",outfileh); } + if(outfileph) { + outph = fopen(outfileph,"w"); + if(!outph) { + g_error("Cannot open outfile: %s",outfileh); + } + } } } @@ -1501,6 +1565,22 @@ print_ccode_block(CCode *cc) fp = outh; out_printf(fp,"\n"); break; + case AT_CCODE: + /* AT code is printed exactly like normal 'all' + code but is printed before */ + case A_CCODE: + if(outph) { + out_printf(outph,"\n"); + out_printf(outph,"%s\n",cc->cbuf); + out_addline_infile(outph,cc->line_no); + out_addline_outfile(outph); + } + out_printf(outh,"\n"); + out_printf(outh,"%s\n",cc->cbuf); + fp = out; + out_printf(fp,"\n"); + out_addline_infile(fp,cc->line_no); + break; default: case C_CCODE: fp = out; @@ -1518,6 +1598,8 @@ print_ccode_block(CCode *cc) } out_printf(fp,"%s\n",cc->cbuf); if(cc->cctype == C_CCODE || + cc->cctype == A_CCODE || + cc->cctype == AT_CCODE || cc->cctype == PH_CCODE) out_addline_outfile(fp); } @@ -1527,6 +1609,7 @@ print_class_block(Class *c) { GList *l; char *s; + gboolean printed_private = FALSE; out_printf(out,"/* utility types we may need */\n"); out_printf(out,"typedef struct { " @@ -1553,6 +1636,11 @@ print_class_block(Class *c) "GTK_CHECK_TYPE((obj), %s_get_type ())\n\n", macrois,funcbase); + out_printf(out, "\n/* self casting macros */\n"); + out_printf(out, "#define SELF(x) %s(x)\n", macrobase); + out_printf(out, "#define IS_SELF(x) %s(x)\n", macrois); + out_printf(out, "#define SELF_CLASS(x) %s_CLASS(x)\n\n", macrobase); + if(privates>0) { out_printf(outh, "\n/* Private structure type */\n"); out_printf(outh,"typedef struct _%sPrivate %sPrivate;\n", @@ -1572,22 +1660,36 @@ print_class_block(Class *c) out_printf(outh,"struct _%s {\n\t%s __parent__;\n", typebase,ptypebase); for(l=c->nodes;l;l=g_list_next(l)) { + static gboolean printed_public = FALSE; Node *n = l->data; Variable *v = (Variable *)n; if(n->type == VARIABLE_NODE && - v->scope == PUBLIC_SCOPE) + v->scope == PUBLIC_SCOPE) { + if(!printed_public) { + out_printf(outh,"\t/*< public >*/\n"); + printed_public = TRUE; + } put_variable((Variable *)n,outh); + } } /* put protecteds always AFTER publics */ for(l=c->nodes;l;l=g_list_next(l)) { Node *n = l->data; Variable *v = (Variable *)n; if(n->type == VARIABLE_NODE && - v->scope == PROTECTED_SCOPE) + v->scope == PROTECTED_SCOPE) { + if(!printed_private) { + out_printf(outh,"\t/*< private >*/\n"); + printed_private = TRUE; + } put_variable((Variable *)n,outh); + } } - if(privates>0) + if(privates>0) { + if(!printed_private) + out_printf(outh,"\t/*< private >*/\n"); out_printf(outh,"\t%sPrivate *_priv;\n",typebase); + } out_printf(outh,"};\n"); if(privates>0) { @@ -1740,9 +1842,9 @@ print_version_macros(void) 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); + 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); } static void @@ -1836,6 +1938,22 @@ print_header_postfixes(void) } } +static void +print_all_top(void) +{ + GList *li; + + /* print the AT_CCODE blocks */ + for(li=nodes;li;li=g_list_next(li)) { + Node *node = li->data; + if(node->type == CCODE_NODE) { + CCode *cc = (CCode *)node; + if(cc->cctype==AT_CCODE) + print_ccode_block((CCode *)node); + } + } +} + static void print_header_top(void) { @@ -1862,12 +1980,14 @@ generate_outfiles(void) print_file_comments(); + print_all_top(); + print_header_top(); print_header_prefixes(); print_version_macros(); - + print_includes(); for(li=nodes;li;li=g_list_next(li)) { @@ -1906,7 +2026,9 @@ print_help(void) "\t--no-private-header Don't create a private header, " "put private\n" "\t structure and protected " - "prototypes inside c file\n"); + "prototypes inside c file\n" + "\t--no-write,-n Don't write output files, just " + "check syntax\n"); } static void @@ -1922,7 +2044,7 @@ parse_options(int argc, char *argv[]) if(no_opts || argv[i][0]!='-') { /*must be a file*/ if(got_file) { - fprintf(stderr,"Specify only one file!\n"); + fprintf(stderr, "Specify only one file!\n"); print_help(); exit(1); } @@ -1932,50 +2054,55 @@ parse_options(int argc, char *argv[]) print_help(); exit(0); } else if(strcmp(argv[i],"--version")==0) { - fprintf(stderr,"Gob version %s\n",VERSION); + fprintf(stderr, "Gob version %s\n", VERSION); exit(0); - } else if(strcmp(argv[i],"--exit-on-warn")==0) { + } else if(strcmp(argv[i], "--exit-on-warn")==0) { exit_on_warn = TRUE; - } else if(strcmp(argv[i],"--no-exit-on-warn")==0) { + } else if(strcmp(argv[i], "--no-exit-on-warn")==0) { exit_on_warn = FALSE; - } else if(strcmp(argv[i],"--for-cpp")==0) { + } else if(strcmp(argv[i], "--for-cpp")==0) { for_cpp = TRUE; - } else if(strcmp(argv[i],"--no-touch-headers")==0) { + } else if(strcmp(argv[i], "--no-touch-headers")==0) { no_touch_headers = TRUE; - } else if(strcmp(argv[i],"--always-private-header")==0) { + } else if(strcmp(argv[i], "--always-private-header")==0) { no_private_header = FALSE; always_private_header = TRUE; - } else if(strcmp(argv[i],"--no-private-header")==0) { + } 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) { + } else if(strcmp(argv[i], "--no-gnu")==0) { no_gnu = TRUE; - } else if(strcmp(argv[i],"--no-extern-c")==0) { + } else if(strcmp(argv[i], "--no-extern-c")==0) { no_extern_c = TRUE; - } else if(strcmp(argv[i],"--")==0) { + } else if(strcmp(argv[i], "--no-write")==0) { + no_write = TRUE; + } else if(strcmp(argv[i], "--")==0) { /*further arguments are files*/ no_opts = TRUE; - } else if(strncmp(argv[i],"--",2)==0) { + } else if(strncmp(argv[i], "--",2)==0) { /*unknown long option*/ - fprintf(stderr,"Unknown option '%s'!\n",argv[i]); + fprintf(stderr, "Unknown option '%s'!\n", argv[i]); print_help(); exit(1); } else { /*by now we know we have a string starting with - which is a short option string*/ char *p = argv[i]+1; - for(p=argv[i]+1;*p;p++) { + for(p=argv[i]+1; *p; p++) { switch(*p) { case 'w': exit_on_warn=TRUE; break; + case 'n': + no_write = TRUE; + break; case 'h': case '?': print_help(); exit(0); default: fprintf(stderr, - "Unknown option '%c'!\n",*p); + "Unknown option '%c'!\n", *p); print_help(); exit(1); } @@ -1988,15 +2115,16 @@ parse_options(int argc, char *argv[]) static void compare_and_move_header(void) { - char *hfnew = g_strconcat("#gob#",filebase,".h#gob#",NULL); - char *hf = g_strconcat(filebase,".h",NULL); + char *hfnew = g_strconcat("#gob#", filebase, ".h#gob#", NULL); + char *hf = g_strconcat(filebase, ".h", NULL); struct stat s; if(stat(hf,&s)==0) { char *s; - s = g_strdup_printf("cmp '%s' '%s' > /dev/null",hf,hfnew); + s = g_strdup_printf("cmp '%s' '%s' > /dev/null", hf, hfnew); if(system(s)==0) { if(unlink(hfnew)!=0) - print_error(FALSE,"Can't remove new header file",0); + print_error(FALSE, + "Can't remove new header file", 0); g_free(hfnew); g_free(hf); g_free(s); @@ -2004,10 +2132,10 @@ compare_and_move_header(void) } g_free(s); if(unlink(hf)!=0) - print_error(FALSE,"Can't remove old header file",0); + print_error(FALSE, "Can't remove old header file", 0); } if(rename(hfnew,hf)!=0) - print_error(FALSE,"Can't rename new header file",0); + print_error(FALSE, "Can't rename new header file", 0); g_free(hfnew); g_free(hf); } @@ -2015,12 +2143,12 @@ compare_and_move_header(void) int main(int argc, char *argv[]) { - parse_options(argc,argv); + parse_options(argc, argv); if(filename) { - yyin = fopen(filename,"r"); + yyin = fopen(filename, "r"); if(!yyin) { - fprintf(stderr,"Error: can't open file '%s'\n", + fprintf(stderr, "Error: can't open file '%s'\n", filename); exit(1); } @@ -2031,7 +2159,7 @@ main(int argc, char *argv[]) if(yyparse()!=0) g_error("Parsing errors, quitting"); if(!class) - print_error(FALSE," no class defined",0); + print_error(FALSE, " no class defined", 0); exit_on_error = FALSE; @@ -2065,10 +2193,16 @@ main(int argc, char *argv[]) generate_outfiles(); - fclose(out); - fclose(outh); + if(devnull) + fclose(devnull); + else { + fclose(out); + fclose(outh); + if(outph) + fclose(outph); + } - if(no_touch_headers) + if(no_touch_headers && !no_write) compare_and_move_header(); return 0; diff --git a/src/parse.c b/src/parse.c index 8aa1e4b..b70b550 100644 --- a/src/parse.c +++ b/src/parse.c @@ -29,13 +29,15 @@ #define HTCODE 279 #define PHCODE 280 #define HCODE 281 -#define PUBLIC 282 -#define PRIVATE 283 -#define PROTECTED 284 -#define ARGUMENT 285 -#define VIRTUAL 286 -#define SIGNAL 287 -#define OVERRIDE 288 +#define ACODE 282 +#define ATCODE 283 +#define PUBLIC 284 +#define PRIVATE 285 +#define PROTECTED 286 +#define ARGUMENT 287 +#define VIRTUAL 288 +#define SIGNAL 289 +#define OVERRIDE 290 #line 21 "parse.y" @@ -124,7 +126,8 @@ push_variable(char *name, int scope, int line_no, char *postfix) static void push_function(int scope, int method, char *oid, char *id, char *onerror, - GString *cbuf,int line_no, int ccode_line, int vararg) + GString *cbuf, int line_no, int ccode_line, gboolean vararg, + GList *flags) { Node *node; Type *type; @@ -158,8 +161,9 @@ push_function(int scope, int method, char *oid, char *id, char *onerror, } else c_cbuf = NULL; - node = new_method(scope,method,type,oid,gtktypes,id,funcargs, - onerror,c_cbuf,line_no,ccode_line,vararg); + node = new_method(scope, method, type, oid, gtktypes, flags, + id, funcargs, onerror, c_cbuf, line_no, + ccode_line, vararg); if(cbuf) g_string_free(cbuf, @@ -217,7 +221,7 @@ push_self(char *id) } -#line 201 "parse.y" +#line 203 "parse.y" typedef union { char *id; GString *cbuf; @@ -239,26 +243,26 @@ typedef union { -#define YYFINAL 221 +#define YYFINAL 225 #define YYFLAG -32768 -#define YYNTBASE 48 +#define YYNTBASE 50 -#define YYTRANSLATE(x) ((unsigned)(x) <= 288 ? yytranslate[x] : 80) +#define YYTRANSLATE(x) ((unsigned)(x) <= 290 ? yytranslate[x] : 82) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 46, 2, 2, 2, 2, 2, 2, 38, - 39, 41, 2, 42, 47, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 37, 44, - 45, 43, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 48, 2, 2, 2, 2, 2, 2, 40, + 41, 43, 2, 44, 49, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 39, 46, + 47, 45, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 35, 40, 36, 2, 2, 2, 2, 2, + 2, 2, 37, 42, 38, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -274,80 +278,80 @@ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34 + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 }; #if YYDEBUG != 0 static const short yyprhs[] = { 0, - 0, 4, 7, 10, 12, 14, 16, 18, 20, 23, - 25, 30, 34, 39, 42, 45, 48, 50, 52, 54, - 56, 58, 60, 65, 71, 83, 92, 98, 100, 104, - 105, 109, 111, 113, 116, 118, 121, 124, 127, 129, - 132, 135, 137, 139, 141, 143, 146, 148, 150, 153, - 155, 158, 160, 162, 164, 166, 168, 171, 173, 176, - 178, 182, 186, 189, 191, 196, 200, 202, 205, 207, - 217, 228, 238, 248, 257, 269, 278, 284, 287, 291, - 292, 294, 296, 300, 302, 306, 308, 312, 314, 317, - 321, 328, 336, 339, 341, 343, 346, 349, 353, 357, - 361, 365, 367, 370 + 0, 4, 7, 10, 12, 14, 16, 18, 20, 22, + 24, 27, 29, 34, 38, 43, 46, 49, 52, 54, + 56, 58, 60, 62, 64, 69, 75, 87, 96, 102, + 104, 108, 109, 113, 115, 117, 120, 122, 125, 128, + 131, 133, 136, 139, 141, 143, 145, 147, 150, 152, + 154, 157, 159, 162, 164, 166, 168, 170, 172, 175, + 177, 180, 182, 186, 190, 193, 195, 200, 204, 206, + 209, 211, 222, 234, 244, 254, 263, 275, 284, 290, + 293, 297, 298, 300, 302, 306, 308, 312, 314, 318, + 320, 323, 327, 334, 342, 345, 347, 349, 352, 355, + 359, 363, 367, 371, 373, 376 }; -static const short yyrhs[] = { 50, - 51, 50, 0, 51, 50, 0, 50, 51, 0, 51, - 0, 24, 0, 27, 0, 25, 0, 26, 0, 50, - 49, 0, 49, 0, 52, 35, 53, 36, 0, 52, - 35, 36, 0, 3, 22, 4, 22, 0, 53, 71, - 0, 53, 55, 0, 53, 56, 0, 71, 0, 55, - 0, 56, 0, 28, 0, 29, 0, 30, 0, 54, - 60, 20, 37, 0, 54, 60, 20, 23, 37, 0, - 31, 58, 57, 20, 20, 35, 24, 20, 35, 24, - 37, 0, 31, 58, 57, 20, 20, 35, 24, 37, - 0, 20, 38, 20, 60, 39, 0, 20, 0, 38, - 59, 39, 0, 0, 20, 40, 59, 0, 20, 0, - 61, 0, 5, 61, 0, 62, 0, 62, 65, 0, - 12, 63, 0, 11, 63, 0, 63, 0, 12, 18, - 0, 11, 18, 0, 18, 0, 17, 0, 16, 0, - 20, 0, 64, 20, 0, 22, 0, 6, 0, 13, - 15, 0, 13, 0, 14, 15, 0, 14, 0, 15, - 0, 9, 0, 8, 0, 7, 0, 41, 65, 0, - 41, 0, 20, 68, 0, 68, 0, 54, 20, 68, - 0, 20, 54, 68, 0, 54, 68, 0, 66, 0, - 20, 38, 69, 39, 0, 69, 42, 20, 0, 20, - 0, 35, 24, 0, 37, 0, 33, 67, 60, 20, - 38, 73, 39, 72, 70, 0, 54, 33, 66, 60, - 20, 38, 73, 39, 72, 70, 0, 32, 54, 60, - 20, 38, 73, 39, 72, 70, 0, 54, 32, 60, - 20, 38, 73, 39, 72, 70, 0, 32, 60, 20, - 38, 73, 39, 72, 70, 0, 34, 38, 22, 39, - 60, 20, 38, 73, 39, 72, 70, 0, 54, 60, - 20, 38, 73, 39, 72, 70, 0, 20, 38, 20, - 39, 70, 0, 19, 79, 0, 19, 35, 24, 0, - 0, 6, 0, 20, 0, 20, 42, 74, 0, 74, - 0, 75, 42, 10, 0, 75, 0, 75, 42, 76, - 0, 76, 0, 60, 20, 0, 60, 20, 23, 0, - 60, 20, 38, 20, 77, 39, 0, 60, 20, 23, - 38, 20, 77, 39, 0, 77, 78, 0, 78, 0, - 20, 0, 43, 79, 0, 44, 79, 0, 43, 45, - 79, 0, 44, 45, 79, 0, 45, 45, 79, 0, - 46, 45, 79, 0, 21, 0, 47, 21, 0, 20, - 0 +static const short yyrhs[] = { 52, + 53, 52, 0, 53, 52, 0, 52, 53, 0, 53, + 0, 24, 0, 27, 0, 25, 0, 26, 0, 28, + 0, 29, 0, 52, 51, 0, 51, 0, 54, 37, + 55, 38, 0, 54, 37, 38, 0, 3, 22, 4, + 22, 0, 55, 73, 0, 55, 57, 0, 55, 58, + 0, 73, 0, 57, 0, 58, 0, 30, 0, 31, + 0, 32, 0, 56, 62, 20, 39, 0, 56, 62, + 20, 23, 39, 0, 33, 60, 59, 20, 20, 37, + 24, 20, 37, 24, 39, 0, 33, 60, 59, 20, + 20, 37, 24, 39, 0, 20, 40, 20, 62, 41, + 0, 20, 0, 40, 61, 41, 0, 0, 20, 42, + 61, 0, 20, 0, 63, 0, 5, 63, 0, 64, + 0, 64, 67, 0, 12, 65, 0, 11, 65, 0, + 65, 0, 12, 18, 0, 11, 18, 0, 18, 0, + 17, 0, 16, 0, 20, 0, 66, 20, 0, 22, + 0, 6, 0, 13, 15, 0, 13, 0, 14, 15, + 0, 14, 0, 15, 0, 9, 0, 8, 0, 7, + 0, 43, 67, 0, 43, 0, 20, 70, 0, 70, + 0, 56, 20, 70, 0, 20, 56, 70, 0, 56, + 70, 0, 68, 0, 20, 40, 71, 41, 0, 71, + 44, 20, 0, 20, 0, 37, 24, 0, 39, 0, + 35, 60, 69, 62, 20, 40, 75, 41, 74, 72, + 0, 56, 35, 60, 68, 62, 20, 40, 75, 41, + 74, 72, 0, 34, 56, 62, 20, 40, 75, 41, + 74, 72, 0, 56, 34, 62, 20, 40, 75, 41, + 74, 72, 0, 34, 62, 20, 40, 75, 41, 74, + 72, 0, 36, 40, 22, 41, 62, 20, 40, 75, + 41, 74, 72, 0, 56, 62, 20, 40, 75, 41, + 74, 72, 0, 20, 40, 20, 41, 72, 0, 19, + 81, 0, 19, 37, 24, 0, 0, 6, 0, 20, + 0, 20, 44, 76, 0, 76, 0, 77, 44, 10, + 0, 77, 0, 77, 44, 78, 0, 78, 0, 62, + 20, 0, 62, 20, 23, 0, 62, 20, 40, 20, + 79, 41, 0, 62, 20, 23, 40, 20, 79, 41, + 0, 79, 80, 0, 80, 0, 20, 0, 45, 81, + 0, 46, 81, 0, 45, 47, 81, 0, 46, 47, + 81, 0, 47, 47, 81, 0, 48, 47, 81, 0, + 21, 0, 49, 21, 0, 20, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, - 220, 221, 222, 223, 226, 232, 238, 244, 252, 253, - 256, 261, 268, 273, 274, 275, 276, 277, 278, 281, - 282, 283, 286, 289, 293, 328, 358, 367, 373, 374, - 377, 380, 386, 387, 395, 399, 406, 409, 412, 415, - 418, 421, 424, 427, 430, 433, 437, 440, 445, 448, - 451, 454, 457, 462, 465, 468, 473, 474, 478, 490, - 496, 508, 520, 523, 529, 534, 537, 542, 543, 547, - 557, 567, 577, 587, 597, 603, 608, 629, 630, 634, - 637, 638, 649, 659, 662, 663, 666, 667, 670, 673, - 676, 684, 694, 695, 698, 711, 715, 719, 723, 727, - 731, 737, 738, 742 + 222, 223, 224, 225, 228, 234, 240, 246, 252, 258, + 266, 267, 270, 275, 282, 287, 288, 289, 290, 291, + 292, 295, 296, 297, 300, 303, 307, 342, 372, 381, + 387, 388, 391, 394, 400, 401, 409, 413, 420, 423, + 426, 429, 432, 435, 438, 441, 444, 447, 451, 454, + 459, 462, 465, 468, 471, 476, 479, 482, 487, 488, + 492, 504, 510, 522, 534, 537, 543, 548, 551, 556, + 557, 561, 571, 581, 591, 601, 611, 617, 622, 643, + 644, 648, 651, 652, 663, 673, 676, 677, 680, 681, + 684, 687, 690, 698, 708, 709, 712, 725, 729, 733, + 737, 741, 745, 751, 752, 756 }; #endif @@ -357,188 +361,184 @@ static const short yyrline[] = { 0, static const char * const yytname[] = { "$","error","$undefined.","CLASS", "FROM","CONST","VOID","STRUCT","UNION","ENUM","THREEDOTS","SIGNED","UNSIGNED", "LONG","SHORT","INT","FLOAT","DOUBLE","CHAR","ONERROR","TOKEN","NUMBER","TYPETOKEN", -"ARRAY_DIM","CCODE","HTCODE","PHCODE","HCODE","PUBLIC","PRIVATE","PROTECTED", -"ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE","'{'","'}'","';'","'('","')'","'|'", -"'*'","','","'>'","'<'","'='","'!'","'-'","prog","ccode","ccodes","class","classdec", -"classcode","scope","variable","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 +"ARRAY_DIM","CCODE","HTCODE","PHCODE","HCODE","ACODE","ATCODE","PUBLIC","PRIVATE", +"PROTECTED","ARGUMENT","VIRTUAL","SIGNAL","OVERRIDE","'{'","'}'","';'","'('", +"')'","'|'","'*'","','","'>'","'<'","'='","'!'","'-'","prog","ccode","ccodes", +"class","classdec","classcode","scope","variable","argument","argtype","flags", +"flaglist","type","type1","type2","integer","tspecifier","stars","simplesigtype", +"fullsigtype","sigtype","tokenlist","codenocode","method","onerror","funcargs", +"arglist","arglist1","arg","checklist","check","numtok", NULL }; #endif static const short yyr1[] = { 0, - 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, - 51, 51, 52, 53, 53, 53, 53, 53, 53, 54, - 54, 54, 55, 55, 56, 56, 57, 57, 58, 58, - 59, 59, 60, 60, 61, 61, 62, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, - 63, 63, 63, 64, 64, 64, 65, 65, 66, 66, - 67, 67, 67, 67, 68, 69, 69, 70, 70, 71, - 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, - 73, 73, 73, 73, 74, 74, 75, 75, 76, 76, - 76, 76, 77, 77, 78, 78, 78, 78, 78, 78, - 78, 79, 79, 79 + 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, + 52, 52, 53, 53, 54, 55, 55, 55, 55, 55, + 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, + 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 65, 65, 65, 65, 65, 66, 66, 66, 67, 67, + 68, 68, 69, 69, 69, 69, 70, 71, 71, 72, + 72, 73, 73, 73, 73, 73, 73, 73, 73, 74, + 74, 74, 75, 75, 75, 75, 76, 76, 77, 77, + 78, 78, 78, 78, 79, 79, 80, 80, 80, 80, + 80, 80, 80, 81, 81, 81 }; static const short yyr2[] = { 0, - 3, 2, 2, 1, 1, 1, 1, 1, 2, 1, - 4, 3, 4, 2, 2, 2, 1, 1, 1, 1, - 1, 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 + 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 2, 1, 4, 3, 4, 2, 2, 2, 1, 1, + 1, 1, 1, 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, 10, 11, 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, 5, 7, 8, 6, 10, 0, 4, 0, 0, - 9, 3, 2, 0, 0, 1, 0, 20, 21, 22, - 30, 0, 0, 0, 12, 0, 0, 18, 19, 17, - 13, 0, 0, 0, 0, 48, 56, 55, 54, 0, - 0, 50, 52, 53, 44, 43, 42, 45, 47, 0, - 0, 33, 35, 39, 0, 0, 0, 64, 0, 60, - 0, 11, 15, 16, 14, 0, 0, 0, 0, 32, - 0, 28, 0, 34, 41, 38, 40, 37, 49, 51, - 0, 0, 58, 36, 46, 0, 0, 0, 59, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 0, 0, 57, 67, 0, 62, 61, 0, - 0, 0, 0, 0, 23, 0, 0, 69, 77, 31, - 0, 0, 0, 48, 45, 0, 0, 84, 86, 88, - 65, 0, 0, 0, 0, 0, 24, 0, 68, 0, - 0, 0, 0, 89, 80, 0, 66, 0, 0, 0, - 0, 80, 27, 0, 80, 83, 90, 0, 0, 0, - 85, 87, 80, 0, 80, 0, 0, 0, 26, 0, - 0, 0, 104, 102, 0, 0, 78, 74, 0, 0, - 0, 80, 76, 0, 72, 0, 95, 0, 0, 0, - 0, 0, 94, 79, 103, 70, 80, 73, 0, 0, - 0, 0, 96, 0, 97, 0, 0, 91, 93, 0, - 71, 25, 92, 98, 99, 100, 101, 75, 0, 0, - 0 + 0, 5, 7, 8, 6, 9, 10, 12, 0, 4, + 0, 0, 11, 3, 2, 0, 0, 1, 0, 22, + 23, 24, 32, 0, 32, 0, 14, 0, 0, 20, + 21, 19, 15, 0, 0, 0, 0, 50, 58, 57, + 56, 0, 0, 52, 54, 55, 46, 45, 44, 47, + 49, 0, 0, 35, 37, 41, 0, 0, 0, 13, + 17, 18, 16, 0, 32, 0, 0, 34, 0, 30, + 0, 36, 43, 40, 42, 39, 51, 53, 0, 0, + 60, 38, 48, 0, 0, 66, 0, 62, 0, 0, + 0, 0, 0, 0, 31, 0, 0, 0, 0, 59, + 0, 0, 0, 61, 0, 65, 0, 0, 0, 0, + 0, 0, 25, 0, 0, 71, 79, 33, 0, 0, + 0, 50, 47, 0, 0, 86, 88, 90, 69, 0, + 64, 63, 0, 0, 0, 0, 26, 0, 70, 0, + 0, 0, 0, 91, 82, 0, 67, 0, 0, 0, + 0, 0, 82, 29, 0, 82, 85, 92, 0, 0, + 0, 87, 89, 68, 0, 0, 82, 0, 0, 0, + 28, 0, 0, 0, 106, 104, 0, 0, 80, 76, + 82, 0, 0, 0, 78, 0, 74, 0, 97, 0, + 0, 0, 0, 0, 96, 81, 105, 0, 82, 75, + 82, 0, 0, 0, 98, 0, 99, 0, 0, 93, + 95, 72, 0, 0, 27, 94, 100, 101, 102, 103, + 77, 73, 0, 0, 0 }; -static const short yydefgoto[] = { 219, - 6, 7, 8, 9, 26, 27, 28, 29, 73, 34, - 71, 126, 52, 53, 54, 55, 84, 58, 59, 60, - 107, 119, 30, 160, 127, 128, 129, 130, 192, 193, - 177 +static const short yydefgoto[] = { 223, + 8, 9, 10, 11, 28, 29, 30, 31, 71, 36, + 69, 124, 54, 55, 56, 57, 82, 86, 87, 88, + 130, 117, 32, 161, 125, 126, 127, 128, 194, 195, + 179 }; -static const short yypact[] = { 21, - -12,-32768,-32768,-32768,-32768,-32768, 21, 238, 0, 39, --32768, 238, 238, 202, 41, 238, 84,-32768,-32768,-32768, - 100, 112, 117, 101,-32768, 217, 53,-32768,-32768,-32768, --32768, 74, 81, 123, 203,-32768,-32768,-32768,-32768, 226, - 241, 129, 133,-32768,-32768,-32768,-32768,-32768,-32768, 168, - 130,-32768, 111,-32768, 149, 1, 151,-32768, 168,-32768, - 156,-32768,-32768,-32768,-32768, 168, 167, 169, 157, 165, - 174, 188, 187,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 208, 191, 111,-32768,-32768, 204, 223, 237,-32768, -6, --32768, 240, 227, 247, -6, 168, 55, 96, 81,-32768, - 248, 249, 232, 186,-32768,-32768, -30,-32768,-32768, 233, - 168, 234, 253, 239,-32768, 186, 250,-32768,-32768,-32768, - 168, 242, 186, 236, 185, 258, 243,-32768, 244,-32768, --32768, 259, 186, 260, 186, 246,-32768, 251,-32768, 252, - 257, 254, 168, 64, 264, 150,-32768, 255, 261, 256, - 186, 264,-32768, -4, 264,-32768, 262, 265, 56, 96, --32768,-32768, 264, 186, 264, 263, 96, 266,-32768, 96, - 267, 52,-32768,-32768, 268, 275,-32768,-32768, 96, 269, - 96, 264,-32768, 273,-32768, 52,-32768, 35, 63, 270, - 271, 61,-32768,-32768,-32768,-32768, 264,-32768, 96, 272, - 70, 6,-32768, 6,-32768, 6, 6,-32768,-32768, 96, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 288, 289, --32768 +static const short yypact[] = { 136, + 4,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 136, 119, + 32, 10,-32768, 119, 119, 146, 67, 119, 40,-32768, +-32768,-32768, 57, 120, 57, 68,-32768, 155, 59,-32768, +-32768,-32768,-32768, 78, 95, 96, 242,-32768,-32768,-32768, +-32768, 252, 258, 115, 126,-32768,-32768,-32768,-32768,-32768, +-32768, 207, 129,-32768, 113,-32768, 137, 70, 151,-32768, +-32768,-32768,-32768, 207, 57, 138, 133, 141, 167, 152, + 190,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 197, 186, + 113,-32768,-32768, 2, 208,-32768, 207,-32768, 194, 224, + 226, -19, 131, 95,-32768, 232, 241, 223, 225,-32768, + 228, 249, 254,-32768, -4,-32768, 255, 207, 237, -4, + 207, 239,-32768, 225, 256,-32768,-32768,-32768, 207, 244, + 225, 238, 47, 262, 243,-32768, 245,-32768,-32768, 66, +-32768,-32768, 246, 263, 225, 265,-32768, 247,-32768, 250, + 266, 251, 207, 7, 268, 189,-32768, 273, 225, 257, + 253, 259, 268,-32768, -1, 268,-32768, 260, 275, -10, + 131,-32768,-32768,-32768, 261, 225, 268, 225, 131, 264, +-32768, 131, 276, 76,-32768,-32768, 274, 282,-32768,-32768, + 268, 267, 131, 269,-32768, 280,-32768, 76,-32768, 62, + 65, 270, 271, 58,-32768,-32768,-32768, 131, 268,-32768, + 268, 272, 72, -8,-32768, -8,-32768, -8, -8,-32768, +-32768,-32768, 131, 131,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 305, 306,-32768 }; static const short yypgoto[] = {-32768, - 245, 30, 291,-32768,-32768, -20, 277, 278,-32768,-32768, - 206, -22, 276,-32768, 71,-32768, 224, 274,-32768, -38, --32768, -159, 280, -148, -110, 170,-32768, 164, 126, -113, - -53 + 37, 145, 298,-32768,-32768, -23, 281, 284,-32768, -17, + 219, -24, 277,-32768, 15,-32768, 234, 229,-32768, -60, +-32768, -154, 288, -150, -112, 176,-32768, 175, 134, -141, + -37 }; -#define YYLAST 341 - - -static const short yytable[] = { 51, - 178, 50, 57, 167, 68, 138, 170, 183, 131, 10, - 185, 132, 142, 86, 179, 168, 181, 89, 91, 196, - 86, 198, 148, 1, 150, 173, 174, 81, 18, 19, - 20, 87, 169, 199, 14, 88, 92, 13, 87, 211, - 166, 16, 15, 94, 2, 3, 4, 5, 210, 108, - 218, 109, 176, 180, 173, 174, 89, 35, 36, 37, - 38, 39, 31, 40, 41, 42, 43, 44, 45, 46, - 47, 187, 48, 113, 49, 173, 174, 114, 209, 202, - 187, 176, 173, 174, 66, 67, 157, 209, 134, 187, - 175, 115, 116, 69, 188, 189, 190, 191, 140, 208, - 70, 158, 176, 188, 189, 190, 191, 204, 213, 176, - 76, 78, 188, 189, 190, 191, 35, 36, 37, 38, - 39, 32, 40, 41, 42, 43, 44, 45, 46, 47, - 117, 48, 118, 49, 203, 205, 56, 33, 61, 18, - 19, 20, 72, 79, 18, 19, 20, 80, 214, 82, - 215, 83, 216, 217, 35, 36, 37, 38, 39, 161, - 40, 41, 42, 43, 44, 45, 46, 47, 85, 48, - 90, 49, 35, 36, 37, 38, 39, 93, 40, 41, - 42, 43, 44, 45, 46, 47, 95, 48, 97, 49, - 35, 124, 37, 38, 39, 98, 40, 41, 42, 43, - 44, 45, 46, 47, 99, 125, 102, 49, 36, 37, - 38, 39, 100, 40, 41, 42, 43, 44, 45, 46, - 47, 17, 48, -82, 49, 101, 143, 103, 104, 18, - 19, 20, 21, 22, 23, 24, 17, 25, 42, 43, - 44, 87, 106, 75, 18, 19, 20, 21, 22, 23, - 24, 11, 62, 42, 43, 44, 86, 11, 77, 110, - 11, 2, 3, 4, 5, 111, 112, 121, 122, 123, - 133, 135, 136, 139, -81, 137, 141, 144, 147, 149, - 154, 145, 159, 151, 172, 146, 186, 220, 221, 152, - 153, 194, 155, 163, 165, 195, 200, 12, 164, 171, - 184, 182, 63, 64, 120, 65, 105, 197, 212, 162, - 74, 201, 156, 0, 206, 207, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 96 +#define YYLAST 322 + + +static const short yytable[] = { 53, + 52, 138, 169, 112, 66, 172, 180, 58, 142, 175, + 176, 175, 176, 17, 185, 101, 183, 187, 170, 113, + 114, 101, 151, 104, 106, 12, 177, 79, 200, 158, + 198, 20, 21, 22, 85, 102, 165, 171, 178, 90, + 178, 102, 131, 212, 132, 13, 159, 91, 213, 104, + 214, 13, 211, 182, 13, 184, 74, 76, 221, 222, + 103, 211, 107, 37, 38, 39, 40, 41, 16, 42, + 43, 44, 45, 46, 47, 48, 49, 189, 50, 34, + 51, 175, 176, 134, 175, 176, 136, -84, 33, 84, + 143, 189, 64, 65, 140, 189, 35, 67, 210, 20, + 21, 22, 190, 191, 192, 193, 147, 59, 204, 148, + 178, 206, 216, 178, 68, 70, 190, 191, 192, 193, + 190, 191, 192, 193, 37, 38, 39, 40, 41, 77, + 42, 43, 44, 45, 46, 47, 48, 49, 1, 50, + 78, 51, 2, 3, 4, 5, 6, 7, 80, 20, + 21, 22, 205, 207, 15, 81, 83, 92, 18, 2, + 3, 4, 5, 6, 7, 19, 217, 115, 218, 116, + 219, 220, 89, 93, 19, 20, 21, 22, 23, 24, + 25, 26, 94, 27, 20, 21, 22, 23, 24, 25, + 26, 96, 60, 37, 38, 39, 40, 41, 162, 42, + 43, 44, 45, 46, 47, 48, 49, 95, 50, 97, + 51, 37, 38, 39, 40, 41, 98, 42, 43, 44, + 45, 46, 47, 48, 49, 99, 50, 105, 51, 37, + 122, 39, 40, 41, 108, 42, 43, 44, 45, 46, + 47, 48, 49, 109, 123, 110, 51, 38, 39, 40, + 41, 119, 42, 43, 44, 45, 46, 47, 48, 49, + 120, 50, 121, 51, 44, 45, 46, 102, 129, 73, + 44, 45, 46, 101, 133, 75, 135, 137, -83, 139, + 141, 144, 150, 145, 152, 149, 160, 153, 146, 155, + 154, 156, 164, 167, 174, 188, 166, 196, 168, 173, + 186, 181, 197, 202, 224, 225, 14, 199, 61, 201, + 215, 62, 118, 72, 100, 63, 208, 209, 157, 111, + 163, 203 }; -static const short yycheck[] = { 22, - 160, 22, 23, 152, 27, 116, 155, 167, 39, 22, - 170, 42, 123, 20, 163, 20, 165, 56, 57, 179, - 20, 181, 133, 3, 135, 20, 21, 50, 28, 29, - 30, 38, 37, 182, 35, 56, 59, 8, 38, 199, - 151, 12, 4, 66, 24, 25, 26, 27, 197, 88, - 210, 90, 47, 164, 20, 21, 95, 5, 6, 7, - 8, 9, 22, 11, 12, 13, 14, 15, 16, 17, - 18, 20, 20, 96, 22, 20, 21, 23, 192, 45, - 20, 47, 20, 21, 32, 33, 23, 201, 111, 20, - 35, 37, 38, 20, 43, 44, 45, 46, 121, 39, - 20, 38, 47, 43, 44, 45, 46, 45, 39, 47, - 40, 41, 43, 44, 45, 46, 5, 6, 7, 8, - 9, 38, 11, 12, 13, 14, 15, 16, 17, 18, - 35, 20, 37, 22, 188, 189, 20, 38, 38, 28, - 29, 30, 20, 15, 28, 29, 30, 15, 202, 20, - 204, 41, 206, 207, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 20, 20, - 20, 22, 5, 6, 7, 8, 9, 22, 11, 12, - 13, 14, 15, 16, 17, 18, 20, 20, 20, 22, - 5, 6, 7, 8, 9, 39, 11, 12, 13, 14, - 15, 16, 17, 18, 40, 20, 20, 22, 6, 7, - 8, 9, 39, 11, 12, 13, 14, 15, 16, 17, - 18, 20, 20, 39, 22, 38, 42, 20, 38, 28, - 29, 30, 31, 32, 33, 34, 20, 36, 13, 14, - 15, 38, 20, 18, 28, 29, 30, 31, 32, 33, - 34, 7, 36, 13, 14, 15, 20, 13, 18, 20, - 16, 24, 25, 26, 27, 39, 20, 20, 20, 38, - 38, 38, 20, 24, 39, 37, 35, 20, 20, 20, - 24, 39, 19, 38, 20, 42, 20, 0, 0, 39, - 39, 24, 39, 39, 39, 21, 24, 7, 38, 38, - 35, 39, 26, 26, 99, 26, 83, 39, 37, 146, - 35, 186, 143, -1, 45, 45, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 67 +static const short yycheck[] = { 24, + 24, 114, 153, 23, 29, 156, 161, 25, 121, 20, + 21, 20, 21, 4, 169, 20, 167, 172, 20, 39, + 40, 20, 135, 84, 85, 22, 37, 52, 183, 23, + 181, 30, 31, 32, 58, 40, 149, 39, 49, 64, + 49, 40, 103, 198, 105, 9, 40, 65, 199, 110, + 201, 15, 194, 166, 18, 168, 42, 43, 213, 214, + 84, 203, 87, 5, 6, 7, 8, 9, 37, 11, + 12, 13, 14, 15, 16, 17, 18, 20, 20, 40, + 22, 20, 21, 108, 20, 21, 111, 41, 22, 20, + 44, 20, 34, 35, 119, 20, 40, 20, 41, 30, + 31, 32, 45, 46, 47, 48, 41, 40, 47, 44, + 49, 47, 41, 49, 20, 20, 45, 46, 47, 48, + 45, 46, 47, 48, 5, 6, 7, 8, 9, 15, + 11, 12, 13, 14, 15, 16, 17, 18, 3, 20, + 15, 22, 24, 25, 26, 27, 28, 29, 20, 30, + 31, 32, 190, 191, 10, 43, 20, 20, 14, 24, + 25, 26, 27, 28, 29, 20, 204, 37, 206, 39, + 208, 209, 22, 41, 20, 30, 31, 32, 33, 34, + 35, 36, 42, 38, 30, 31, 32, 33, 34, 35, + 36, 40, 38, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 41, 20, 20, + 22, 5, 6, 7, 8, 9, 20, 11, 12, 13, + 14, 15, 16, 17, 18, 40, 20, 20, 22, 5, + 6, 7, 8, 9, 41, 11, 12, 13, 14, 15, + 16, 17, 18, 20, 20, 20, 22, 6, 7, 8, + 9, 20, 11, 12, 13, 14, 15, 16, 17, 18, + 20, 20, 40, 22, 13, 14, 15, 40, 20, 18, + 13, 14, 15, 20, 20, 18, 40, 39, 41, 24, + 37, 20, 20, 41, 20, 40, 19, 41, 44, 24, + 41, 41, 20, 41, 20, 20, 40, 24, 40, 40, + 37, 41, 21, 24, 0, 0, 9, 41, 28, 41, + 39, 28, 94, 37, 81, 28, 47, 47, 143, 91, + 146, 188 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/lib/bison.simple" @@ -1084,23 +1084,23 @@ yyreduce: switch (yyn) { case 1: -#line 220 "parse.y" +#line 222 "parse.y" { ; ; break;} case 2: -#line 221 "parse.y" +#line 223 "parse.y" { ; ; break;} case 3: -#line 222 "parse.y" +#line 224 "parse.y" { ; ; break;} case 4: -#line 223 "parse.y" +#line 225 "parse.y" { ; ; break;} case 5: -#line 226 "parse.y" +#line 228 "parse.y" { Node *node = new_ccode(C_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1109,7 +1109,7 @@ case 5: ; break;} case 6: -#line 232 "parse.y" +#line 234 "parse.y" { Node *node = new_ccode(H_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1118,7 +1118,7 @@ case 6: ; break;} case 7: -#line 238 "parse.y" +#line 240 "parse.y" { Node *node = new_ccode(HT_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1127,7 +1127,7 @@ case 7: ; break;} case 8: -#line 244 "parse.y" +#line 246 "parse.y" { Node *node = new_ccode(PH_CCODE,(yyvsp[0].cbuf)->str, ccode_line); @@ -1137,84 +1137,102 @@ case 8: break;} case 9: #line 252 "parse.y" -{ ; ; +{ + Node *node = new_ccode(A_CCODE,(yyvsp[0].cbuf)->str, + ccode_line); + nodes = g_list_append(nodes,node); + g_string_free(yyvsp[0].cbuf,FALSE); + ; break;} case 10: -#line 253 "parse.y" -{ ; ; +#line 258 "parse.y" +{ + Node *node = new_ccode(AT_CCODE,(yyvsp[0].cbuf)->str, + ccode_line); + nodes = g_list_append(nodes,node); + g_string_free(yyvsp[0].cbuf,FALSE); + ; break;} case 11: -#line 256 "parse.y" +#line 266 "parse.y" +{ ; ; + break;} +case 12: +#line 267 "parse.y" +{ ; ; + break;} +case 13: +#line 270 "parse.y" { ((Class *)class)->nodes = class_nodes; class_nodes = NULL; nodes = g_list_append(nodes,class); ; break;} -case 12: -#line 261 "parse.y" +case 14: +#line 275 "parse.y" { ((Class *)class)->nodes = NULL; class_nodes = NULL; nodes = g_list_append(nodes,class); ; break;} -case 13: -#line 268 "parse.y" +case 15: +#line 282 "parse.y" { class = new_class(yyvsp[-2].id,yyvsp[0].id,NULL); ; break;} -case 14: -#line 273 "parse.y" -{ ; ; - break;} -case 15: -#line 274 "parse.y" -{ ; ; - break;} case 16: -#line 275 "parse.y" +#line 287 "parse.y" { ; ; break;} case 17: -#line 276 "parse.y" +#line 288 "parse.y" { ; ; break;} case 18: -#line 277 "parse.y" +#line 289 "parse.y" { ; ; break;} case 19: -#line 278 "parse.y" +#line 290 "parse.y" { ; ; break;} case 20: -#line 281 "parse.y" -{ the_scope = PUBLIC_SCOPE; ; +#line 291 "parse.y" +{ ; ; break;} case 21: -#line 282 "parse.y" -{ the_scope = PRIVATE_SCOPE; ; +#line 292 "parse.y" +{ ; ; break;} case 22: -#line 283 "parse.y" -{ the_scope = PROTECTED_SCOPE; ; +#line 295 "parse.y" +{ the_scope = PUBLIC_SCOPE; ; break;} case 23: -#line 286 "parse.y" +#line 296 "parse.y" +{ the_scope = PRIVATE_SCOPE; ; + break;} +case 24: +#line 297 "parse.y" +{ the_scope = PROTECTED_SCOPE; ; + break;} +case 25: +#line 300 "parse.y" { push_variable(yyvsp[-1].id,the_scope,yyvsp[-3].line,NULL); ; break;} -case 24: -#line 289 "parse.y" +case 26: +#line 303 "parse.y" { push_variable(yyvsp[-2].id,the_scope,yyvsp[-4].line,yyvsp[-1].id); ; break;} -case 25: -#line 293 "parse.y" +case 27: +#line 307 "parse.y" { if(strcmp(yyvsp[-6].id,"get")==0 && strcmp(yyvsp[-3].id,"set")==0) { @@ -1251,8 +1269,8 @@ case 25: } ; break;} -case 26: -#line 328 "parse.y" +case 28: +#line 342 "parse.y" { if(strcmp(yyvsp[-3].id,"get")==0) { Node *node; @@ -1282,8 +1300,8 @@ case 26: } ; break;} -case 27: -#line 358 "parse.y" +case 29: +#line 372 "parse.y" { if(strcmp(yyvsp[-2].id,"type")!=0) { g_free(yyvsp[-4].id); @@ -1294,39 +1312,39 @@ case 27: yyval.id = yyvsp[-4].id; ; break;} -case 28: -#line 367 "parse.y" +case 30: +#line 381 "parse.y" { yyval.id = yyvsp[0].id; typestack = g_list_prepend(typestack,NULL); ; break;} -case 29: -#line 373 "parse.y" +case 31: +#line 387 "parse.y" { yyval.list = yyvsp[-1].list; ; break;} -case 30: -#line 374 "parse.y" +case 32: +#line 388 "parse.y" { yyval.list = NULL; ; break;} -case 31: -#line 377 "parse.y" +case 33: +#line 391 "parse.y" { yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id); ; break;} -case 32: -#line 380 "parse.y" +case 34: +#line 394 "parse.y" { yyval.list = g_list_append(NULL,yyvsp[0].id); ; break;} -case 33: -#line 386 "parse.y" +case 35: +#line 400 "parse.y" { ; ; break;} -case 34: -#line 387 "parse.y" +case 36: +#line 401 "parse.y" { Type *type = typestack->data; char *oldname = type->name; @@ -1334,152 +1352,152 @@ case 34: g_free(oldname); ; break;} -case 35: -#line 395 "parse.y" +case 37: +#line 409 "parse.y" { Node *node = new_type(0,yyvsp[0].id,NULL); typestack = g_list_prepend(typestack,node); ; break;} -case 36: -#line 399 "parse.y" +case 38: +#line 413 "parse.y" { Node *node = new_type(stars,yyvsp[-1].id,NULL); stars = 0; typestack = g_list_prepend(typestack,node); ; break;} -case 37: -#line 406 "parse.y" +case 39: +#line 420 "parse.y" { yyval.id = g_strconcat("unsigned ",yyvsp[0].id,NULL); ; break;} -case 38: -#line 409 "parse.y" +case 40: +#line 423 "parse.y" { yyval.id = g_strconcat("signed ",yyvsp[0].id,NULL); ; break;} -case 39: -#line 412 "parse.y" +case 41: +#line 426 "parse.y" { yyval.id = g_strdup(yyvsp[0].id); ; break;} -case 40: -#line 415 "parse.y" +case 42: +#line 429 "parse.y" { yyval.id = g_strdup("unsigned char"); ; break;} -case 41: -#line 418 "parse.y" +case 43: +#line 432 "parse.y" { yyval.id = g_strdup("signed char"); ; break;} -case 42: -#line 421 "parse.y" +case 44: +#line 435 "parse.y" { yyval.id = g_strdup("char"); ; break;} -case 43: -#line 424 "parse.y" +case 45: +#line 438 "parse.y" { yyval.id = g_strdup("double"); ; break;} -case 44: -#line 427 "parse.y" +case 46: +#line 441 "parse.y" { yyval.id = g_strdup("float"); ; break;} -case 45: -#line 430 "parse.y" +case 47: +#line 444 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 46: -#line 433 "parse.y" +case 48: +#line 447 "parse.y" { yyval.id = g_strconcat(yyvsp[-1].id,yyvsp[0].id,NULL); g_free(yyvsp[0].id); ; break;} -case 47: -#line 437 "parse.y" +case 49: +#line 451 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 48: -#line 440 "parse.y" +case 50: +#line 454 "parse.y" { yyval.id = g_strdup("void"); ; break;} -case 49: -#line 445 "parse.y" +case 51: +#line 459 "parse.y" { yyval.id = "long int"; ; break;} -case 50: -#line 448 "parse.y" +case 52: +#line 462 "parse.y" { yyval.id = "long"; ; break;} -case 51: -#line 451 "parse.y" +case 53: +#line 465 "parse.y" { yyval.id = "short int"; ; break;} -case 52: -#line 454 "parse.y" +case 54: +#line 468 "parse.y" { yyval.id = "short"; ; break;} -case 53: -#line 457 "parse.y" +case 55: +#line 471 "parse.y" { yyval.id = "int"; ; break;} -case 54: -#line 462 "parse.y" +case 56: +#line 476 "parse.y" { yyval.id = "enum "; ; break;} -case 55: -#line 465 "parse.y" +case 57: +#line 479 "parse.y" { yyval.id = "union "; ; break;} -case 56: -#line 468 "parse.y" +case 58: +#line 482 "parse.y" { yyval.id = "struct "; ; break;} -case 57: -#line 473 "parse.y" +case 59: +#line 487 "parse.y" { stars++; ; break;} -case 58: -#line 474 "parse.y" +case 60: +#line 488 "parse.y" { stars++; ; break;} -case 59: -#line 478 "parse.y" +case 61: +#line 492 "parse.y" { if(strcmp(yyvsp[-1].id,"first")==0) yyval.sigtype = SIGNAL_FIRST_METHOD; @@ -1493,14 +1511,14 @@ case 59: g_free(yyvsp[-1].id); ; break;} -case 60: -#line 490 "parse.y" +case 62: +#line 504 "parse.y" { yyval.sigtype = SIGNAL_LAST_METHOD; ; break;} -case 61: -#line 496 "parse.y" +case 63: +#line 510 "parse.y" { if(strcmp(yyvsp[-1].id,"first")==0) yyval.sigtype = SIGNAL_FIRST_METHOD; @@ -1514,8 +1532,8 @@ case 61: g_free(yyvsp[-1].id); ; break;} -case 62: -#line 508 "parse.y" +case 64: +#line 522 "parse.y" { if(strcmp(yyvsp[-2].id,"first")==0) yyval.sigtype = SIGNAL_FIRST_METHOD; @@ -1529,47 +1547,47 @@ case 62: g_free(yyvsp[-2].id); ; break;} -case 63: -#line 520 "parse.y" +case 65: +#line 534 "parse.y" { yyval.sigtype = SIGNAL_LAST_METHOD; ; break;} -case 64: -#line 523 "parse.y" +case 66: +#line 537 "parse.y" { /* the_scope was default thus public */ the_scope = PUBLIC_SCOPE; ; break;} -case 65: -#line 529 "parse.y" +case 67: +#line 543 "parse.y" { gtktypes = g_list_prepend(gtktypes,yyvsp[-3].id); ; break;} -case 66: -#line 534 "parse.y" +case 68: +#line 548 "parse.y" { gtktypes = g_list_append(gtktypes,yyvsp[0].id); ; break;} -case 67: -#line 537 "parse.y" +case 69: +#line 551 "parse.y" { gtktypes = g_list_append(gtktypes,yyvsp[0].id); ; break;} -case 68: -#line 542 "parse.y" +case 70: +#line 556 "parse.y" { yyval.cbuf = yyvsp[0].cbuf; ; break;} -case 69: -#line 543 "parse.y" +case 71: +#line 557 "parse.y" { yyval.cbuf = NULL; ; break;} -case 70: -#line 547 "parse.y" +case 72: +#line 561 "parse.y" { if(!has_self) { yyerror(_("signal without 'self' as " @@ -1577,25 +1595,25 @@ case 70: YYERROR; } push_function(the_scope, yyvsp[-7].sigtype,NULL, - yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line, - ccode_line,vararg); + yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-9].line, + ccode_line, vararg, yyvsp[-8].list); ; break;} -case 71: -#line 557 "parse.y" +case 73: +#line 571 "parse.y" { if(!has_self) { yyerror(_("signal without 'self' as " "first parameter")); YYERROR; } - push_function(the_scope, yyvsp[-7].sigtype,NULL, - yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line, - ccode_line,vararg); + push_function(the_scope, yyvsp[-7].sigtype, NULL, + yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-9].line, + ccode_line, vararg, yyvsp[-8].list); ; break;} -case 72: -#line 567 "parse.y" +case 74: +#line 581 "parse.y" { if(!has_self) { yyerror(_("virtual method without 'self' as " @@ -1603,12 +1621,12 @@ case 72: YYERROR; } push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id, - yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-8].line, - ccode_line,vararg); + yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-8].line, + ccode_line, vararg, NULL); ; break;} -case 73: -#line 577 "parse.y" +case 75: +#line 591 "parse.y" { if(!has_self) { yyerror(_("virtual method without 'self' as " @@ -1616,12 +1634,12 @@ case 73: YYERROR; } push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id, - yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line, - ccode_line,vararg); + yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-7].line, + ccode_line, vararg, NULL); ; break;} -case 74: -#line 587 "parse.y" +case 76: +#line 601 "parse.y" { if(!has_self) { yyerror(_("virtual method without 'self' as " @@ -1629,40 +1647,40 @@ case 74: YYERROR; } push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL, - yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line, - ccode_line,vararg); + yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-7].line, + ccode_line, vararg, NULL); ; break;} -case 75: -#line 597 "parse.y" +case 77: +#line 611 "parse.y" { push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id, yyvsp[-5].id, yyvsp[-1].id, yyvsp[0].cbuf, - yyvsp[-10].line,ccode_line, - vararg); + yyvsp[-10].line, ccode_line, + vararg, NULL); ; break;} -case 76: -#line 603 "parse.y" +case 78: +#line 617 "parse.y" { push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id, - yyvsp[-1].id, yyvsp[0].cbuf,yyvsp[-7].line,ccode_line, - vararg); + yyvsp[-1].id, yyvsp[0].cbuf, yyvsp[-7].line, ccode_line, + vararg, NULL); ; break;} -case 77: -#line 608 "parse.y" +case 79: +#line 622 "parse.y" { if(strcmp(yyvsp[-4].id,"init")==0) { push_init_arg(yyvsp[-2].id,FALSE); push_function(NO_SCOPE, INIT_METHOD, NULL, - yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line, - ccode_line,FALSE); + yyvsp[-4].id, NULL, yyvsp[0].cbuf, yyvsp[-3].line, + ccode_line, FALSE, NULL); } else if(strcmp(yyvsp[-4].id,"class_init")==0) { push_init_arg(yyvsp[-2].id,TRUE); push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL, - yyvsp[-4].id, NULL, yyvsp[0].cbuf,yyvsp[-3].line, - ccode_line,FALSE); + yyvsp[-4].id, NULL, yyvsp[0].cbuf, yyvsp[-3].line, + ccode_line, FALSE, NULL); } else { g_free(yyvsp[-4].id); g_free(yyvsp[-2].id); @@ -1672,27 +1690,27 @@ case 77: } ; break;} -case 78: -#line 629 "parse.y" +case 80: +#line 643 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 79: -#line 630 "parse.y" +case 81: +#line 644 "parse.y" { yyval.id = (yyvsp[0].cbuf)->str; g_string_free(yyvsp[0].cbuf,FALSE); ; break;} -case 80: -#line 634 "parse.y" +case 82: +#line 648 "parse.y" { yyval.id = NULL; ; break;} -case 81: -#line 637 "parse.y" +case 83: +#line 651 "parse.y" { vararg = FALSE; has_self = FALSE; ; break;} -case 82: -#line 638 "parse.y" +case 84: +#line 652 "parse.y" { vararg = FALSE; has_self = TRUE; @@ -1705,8 +1723,8 @@ case 82: } ; break;} -case 83: -#line 649 "parse.y" +case 85: +#line 663 "parse.y" { has_self = TRUE; if(strcmp(yyvsp[-2].id,"self")==0) @@ -1718,40 +1736,40 @@ case 83: } ; break;} -case 84: -#line 659 "parse.y" +case 86: +#line 673 "parse.y" { has_self = FALSE; ; break;} -case 85: -#line 662 "parse.y" +case 87: +#line 676 "parse.y" { vararg = TRUE; ; break;} -case 86: -#line 663 "parse.y" +case 88: +#line 677 "parse.y" { vararg = FALSE; ; break;} -case 87: -#line 666 "parse.y" +case 89: +#line 680 "parse.y" { ; ; break;} -case 88: -#line 667 "parse.y" +case 90: +#line 681 "parse.y" { ; ; break;} -case 89: -#line 670 "parse.y" +case 91: +#line 684 "parse.y" { push_funcarg(yyvsp[0].id,NULL); ; break;} -case 90: -#line 673 "parse.y" +case 92: +#line 687 "parse.y" { push_funcarg(yyvsp[-1].id,yyvsp[0].id); ; break;} -case 91: -#line 676 "parse.y" +case 93: +#line 690 "parse.y" { if(strcmp(yyvsp[-2].id,"check")!=0) { yyerror(_("parse error")); @@ -1761,8 +1779,8 @@ case 91: push_funcarg(yyvsp[-4].id,NULL); ; break;} -case 92: -#line 684 "parse.y" +case 94: +#line 698 "parse.y" { if(strcmp(yyvsp[-2].id,"check")!=0) { yyerror(_("parse error")); @@ -1772,16 +1790,16 @@ case 92: push_funcarg(yyvsp[-5].id,yyvsp[-4].id); ; break;} -case 93: -#line 694 "parse.y" +case 95: +#line 708 "parse.y" { ; ; break;} -case 94: -#line 695 "parse.y" +case 96: +#line 709 "parse.y" { ; ; break;} -case 95: -#line 698 "parse.y" +case 97: +#line 712 "parse.y" { if(strcmp(yyvsp[0].id,"type")==0) { Node *node = new_check(TYPE_CHECK,NULL); @@ -1796,61 +1814,61 @@ case 95: g_free(yyvsp[0].id); ; break;} -case 96: -#line 711 "parse.y" +case 98: +#line 725 "parse.y" { Node *node = new_check(GT_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 97: -#line 715 "parse.y" +case 99: +#line 729 "parse.y" { Node *node = new_check(LT_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 98: -#line 719 "parse.y" +case 100: +#line 733 "parse.y" { Node *node = new_check(GE_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 99: -#line 723 "parse.y" +case 101: +#line 737 "parse.y" { Node *node = new_check(LE_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 100: -#line 727 "parse.y" +case 102: +#line 741 "parse.y" { Node *node = new_check(EQ_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 101: -#line 731 "parse.y" +case 103: +#line 745 "parse.y" { Node *node = new_check(NE_CHECK,yyvsp[0].id); checks = g_list_append(checks,node); ; break;} -case 102: -#line 737 "parse.y" +case 104: +#line 751 "parse.y" { yyval.id = yyvsp[0].id; ; break;} -case 103: -#line 738 "parse.y" +case 105: +#line 752 "parse.y" { yyval.id = g_strconcat("-",yyvsp[0].id,NULL); g_free(yyvsp[0].id); ; break;} -case 104: -#line 742 "parse.y" +case 106: +#line 756 "parse.y" { yyval.id = yyvsp[0].id; ; break;} } @@ -2075,5 +2093,5 @@ yyerrhandle: } return 1; } -#line 745 "parse.y" +#line 759 "parse.y" diff --git a/src/parse.y b/src/parse.y index a6892e9..63f0a7a 100644 --- a/src/parse.y +++ b/src/parse.y @@ -104,7 +104,8 @@ push_variable(char *name, int scope, int line_no, char *postfix) static void push_function(int scope, int method, char *oid, char *id, char *onerror, - GString *cbuf,int line_no, int ccode_line, int vararg) + GString *cbuf, int line_no, int ccode_line, gboolean vararg, + GList *flags) { Node *node; Type *type; @@ -138,8 +139,9 @@ push_function(int scope, int method, char *oid, char *id, char *onerror, } else c_cbuf = NULL; - node = new_method(scope,method,type,oid,gtktypes,id,funcargs, - onerror,c_cbuf,line_no,ccode_line,vararg); + node = new_method(scope, method, type, oid, gtktypes, flags, + id, funcargs, onerror, c_cbuf, line_no, + ccode_line, vararg); if(cbuf) g_string_free(cbuf, @@ -212,7 +214,7 @@ push_self(char *id) %token ONERROR %token TOKEN NUMBER TYPETOKEN ARRAY_DIM -%token CCODE HTCODE PHCODE HCODE +%token CCODE HTCODE PHCODE HCODE ACODE ATCODE %token PUBLIC PRIVATE PROTECTED ARGUMENT VIRTUAL SIGNAL OVERRIDE %% @@ -247,6 +249,18 @@ ccode: CCODE { nodes = g_list_append(nodes,node); g_string_free($1,FALSE); } + | ACODE { + Node *node = new_ccode(A_CCODE,($1)->str, + ccode_line); + nodes = g_list_append(nodes,node); + g_string_free($1,FALSE); + } + | ATCODE { + Node *node = new_ccode(AT_CCODE,($1)->str, + ccode_line); + nodes = g_list_append(nodes,node); + g_string_free($1,FALSE); + } ; ccodes: ccodes ccode { ; } @@ -290,7 +304,7 @@ variable: scope type TOKEN ';' { push_variable($3,the_scope,$1,$4); } ; -argument: ARGUMENT argflags argtype TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' { +argument: ARGUMENT flags argtype TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' { if(strcmp($5,"get")==0 && strcmp($8,"set")==0) { Node *node; @@ -325,7 +339,7 @@ argument: ARGUMENT argflags argtype TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' { YYERROR; } } - | ARGUMENT argflags argtype TOKEN TOKEN '{' CCODE ';' { + | ARGUMENT flags argtype TOKEN TOKEN '{' CCODE ';' { if(strcmp($5,"get")==0) { Node *node; Type *type = pop_type(); @@ -370,7 +384,7 @@ argtype: TOKEN '(' TOKEN type ')' { } ; -argflags: '(' flaglist ')' { $$ = $2; } +flags: '(' flaglist ')' { $$ = $2; } | { $$ = NULL; } ; @@ -544,25 +558,25 @@ codenocode: '{' CCODE { $$ = $2; } ; /*here CCODE will include the ending '}' */ -method: SIGNAL fullsigtype type TOKEN '(' funcargs ')' onerror codenocode { +method: SIGNAL flags fullsigtype type TOKEN '(' funcargs ')' onerror codenocode { if(!has_self) { yyerror(_("signal without 'self' as " "first parameter")); YYERROR; } - push_function(the_scope, $2,NULL, - $4, $8, $9,$1, - ccode_line,vararg); + push_function(the_scope, $3,NULL, + $5, $9, $10,$1, + ccode_line, vararg, $2); } - | scope SIGNAL simplesigtype type TOKEN '(' funcargs ')' onerror codenocode { + | scope SIGNAL flags simplesigtype type TOKEN '(' funcargs ')' onerror codenocode { if(!has_self) { yyerror(_("signal without 'self' as " "first parameter")); YYERROR; } - push_function(the_scope, $3,NULL, - $5, $9, $10,$2, - ccode_line,vararg); + push_function(the_scope, $4, NULL, + $6, $10, $11, $2, + ccode_line, vararg, $3); } | VIRTUAL scope type TOKEN '(' funcargs ')' onerror codenocode { if(!has_self) { @@ -571,8 +585,8 @@ method: SIGNAL fullsigtype type TOKEN '(' funcargs ')' onerror codenocode { YYERROR; } push_function(the_scope, VIRTUAL_METHOD, NULL, $4, - $8, $9,$1, - ccode_line,vararg); + $8, $9, $1, + ccode_line, vararg, NULL); } | scope VIRTUAL type TOKEN '(' funcargs ')' onerror codenocode { if(!has_self) { @@ -581,8 +595,8 @@ method: SIGNAL fullsigtype type TOKEN '(' funcargs ')' onerror codenocode { YYERROR; } push_function(the_scope, VIRTUAL_METHOD, NULL, $4, - $8, $9,$2, - ccode_line,vararg); + $8, $9, $2, + ccode_line, vararg, NULL); } | VIRTUAL type TOKEN '(' funcargs ')' onerror codenocode { if(!has_self) { @@ -591,31 +605,31 @@ method: SIGNAL fullsigtype type TOKEN '(' funcargs ')' onerror codenocode { YYERROR; } push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL, - $3, $7, $8,$1, - ccode_line,vararg); + $3, $7, $8, $1, + ccode_line, vararg, NULL); } | OVERRIDE '(' TYPETOKEN ')' type TOKEN '(' funcargs ')' onerror codenocode { push_function(NO_SCOPE, OVERRIDE_METHOD, $3, $6, $10, $11, - $1,ccode_line, - vararg); + $1, ccode_line, + vararg, NULL); } | scope type TOKEN '(' funcargs ')' onerror codenocode { push_function(the_scope, REGULAR_METHOD, NULL, $3, - $7, $8,$1,ccode_line, - vararg); + $7, $8, $1, ccode_line, + vararg, NULL); } | TOKEN '(' TOKEN ')' codenocode { if(strcmp($1,"init")==0) { push_init_arg($3,FALSE); push_function(NO_SCOPE, INIT_METHOD, NULL, - $1, NULL, $5,$2, - ccode_line,FALSE); + $1, NULL, $5, $2, + ccode_line, FALSE, NULL); } else if(strcmp($1,"class_init")==0) { push_init_arg($3,TRUE); push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL, - $1, NULL, $5,$2, - ccode_line,FALSE); + $1, NULL, $5, $2, + ccode_line, FALSE, NULL); } else { g_free($1); g_free($3); diff --git a/src/test.gob b/src/test.gob index a8a05b2..e805824 100644 --- a/src/test.gob +++ b/src/test.gob @@ -79,7 +79,7 @@ class Gtk:Weird:Button from Gtk:Button { GtkWidget *ret; ret = GTK_WIDGET (GET_NEW); - GTK_WEIRD_BUTTON(ret)->_priv->j = j; + SELF(ret)->_priv->j = j; return ret; } @@ -252,6 +252,12 @@ class Gtk:Weird:Button from Gtk:Button { { /* ugh, testing casting */ } + + public signal (NO_HOOKS) last INT (INT) + int testflags(self, int w (check > 0)) { + /*foo*/ + return w; + } } %{ diff --git a/src/tree.c b/src/tree.c index d695b45..b92f771 100644 --- a/src/tree.c +++ b/src/tree.c @@ -78,7 +78,10 @@ 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, gboolean vararg) +new_method(int scope, int method, Type *mtype, char *otype, + GList *gtktypes, GList *flags, char *id, GList *args, + char *onerror, char *cbuf, int line_no, int ccode_line, + gboolean vararg) { Method *node = (Method *)g_new(Node,1); node->type = METHOD_NODE; @@ -87,6 +90,7 @@ new_method(int scope, int method, Type *mtype, char *otype, GList *gtktypes, cha node->mtype = mtype; node->otype = otype; node->gtktypes = gtktypes; + node->flags = flags; node->id = id; node->args = args; node->onerror = onerror; diff --git a/src/tree.h b/src/tree.h index 9d85329..9d3638f 100644 --- a/src/tree.h +++ b/src/tree.h @@ -37,6 +37,8 @@ enum { /* for ccode type */ enum { + A_CCODE, + AT_CCODE, C_CCODE, H_CCODE, HT_CCODE, @@ -136,6 +138,7 @@ struct _Method { Type *mtype; char *otype; /*for override methods*/ GList *gtktypes; /*GTK types for a signal*/ + GList *flags; /* GTK_RUN_* flags for a signal */ char *id; GList *args; char *onerror; @@ -170,8 +173,13 @@ Node *new_class(char *otype, char *ptype, GList *nodes); 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, gboolean vararg); -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_method(int scope, int method, Type *mtype, char *otype, + GList *gtktypes, GList *flags, char *id, GList *args, + char *onerror, char *cbuf, int line_no, int ccode_line, + gboolean vararg); +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 -- 2.43.0