From 5b42e9400440d86723a27747b2191ab8cd59c2ee Mon Sep 17 00:00:00 2001 From: George Lebl Date: Mon, 27 Mar 2000 22:23:00 -0800 Subject: [PATCH] Release 0.93.1 --- ChangeLog | 29 ++ NEWS | 5 + configure | 2 +- configure.in | 2 +- gob.m4 | 4 +- gob.spec | 2 +- src/ChangeLog | 5 - src/Makefile.in | 6 +- src/checks.c | 23 +- src/lexer.c | 800 ++++++++++++++++++++++++------------------------ src/lexer.l | 9 +- src/main.c | 155 ++++++---- src/parse.c | 14 +- src/parse.y | 14 +- src/tree.h | 2 +- src/util.c | 142 ++++++--- src/util.h | 11 +- 17 files changed, 691 insertions(+), 534 deletions(-) delete mode 100644 src/ChangeLog diff --git a/ChangeLog b/ChangeLog index 7a85c7d..6ca25a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +Mon Mar 27 12:04:22 2000 George Lebl + + * src/util.[ch], src/main.c: figure out if we really need the special + types, also make a hash for the gtk types instead of linear + searching it all the time. + + * src/{lexer.c,checks.c,main.c}: minor fixes and cleanups + +2000-03-21 Eskil Heyn Olsen + + * gob.m4: do not default GOB to no when not found (did that make + sense ?) + And better error message. + +Mon Mar 20 14:35:35 2000 George Lebl + + * src/lexer.l: handle single word typenames with an empty namespace + +Sun Mar 05 02:23:04 2000 George Lebl + + * src/main.c: add #lines around setting default handlers + + * src/parse.y: fix line number for 'destroywith' destructors + +Sat Mar 04 15:33:18 2000 George Lebl + + * src/checks.c: duplicate name test for arguments and signals is + case insensitive now as those could cause trouble + Mon Feb 28 02:45:27 2000 George Lebl * Release 0.93.0 diff --git a/NEWS b/NEWS index 8d1df7b..51d740a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +0.93.1 + * accept 1 word types + * gob.m4 improvements (Eskil) + * minor fixes, and improvements + 0.93.0 * data member initialization * pointer data member destruction diff --git a/configure b/configure index dc43560..10b91e4 100755 --- a/configure +++ b/configure @@ -703,7 +703,7 @@ fi PACKAGE=gob -VERSION=0.93.0 +VERSION=0.93.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } diff --git a/configure.in b/configure.in index 96aa7c9..5a5d851 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.93.0) +AM_INIT_AUTOMAKE(gob,0.93.1) if test -f ../NOINST_GOB ; then DOINSTGOB= diff --git a/gob.m4 b/gob.m4 index 25c45d4..7a86c9b 100644 --- a/gob.m4 +++ b/gob.m4 @@ -5,7 +5,7 @@ dnl AC_DEFUN([GOB_HOOK],[ - AC_PATH_PROG(GOB,gob,no) + AC_PATH_PROG(GOB,gob) if test ! x$GOB = x; then if test ! x$1 = x; then AC_MSG_CHECKING(for gob >= $1) @@ -49,7 +49,7 @@ AC_DEFUN([GOB_HOOK],[ AC_SUBST(GOB) $2 else - AC_MSG_ERROR("Cannot find gob") + AC_MSG_ERROR([Cannot find GOB, check http://www.5z.com/jirka/gob.html]) $3 fi ]) diff --git a/gob.spec b/gob.spec index ad82660..5d339ca 100644 --- a/gob.spec +++ b/gob.spec @@ -1,4 +1,4 @@ -%define ver 0.93.0 +%define ver 0.93.1 %define rel 1 %define prefix /usr diff --git a/src/ChangeLog b/src/ChangeLog deleted file mode 100644 index b8ae80a..0000000 --- a/src/ChangeLog +++ /dev/null @@ -1,5 +0,0 @@ -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 1b5733f..3b197de 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 = ChangeLog Makefile.am Makefile.in lexer.c parse.c +DIST_COMMON = Makefile.am Makefile.in lexer.c parse.c DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -319,12 +319,12 @@ distdir: $(DISTFILES) fi; \ done checks.o: checks.c ../config.h tree.h main.h util.h checks.h -lexer.o: lexer.c ../config.h parse.h main.h util.h +lexer.o: lexer.c ../config.h tree.h parse.h main.h util.h main.o: main.c ../config.h tree.h parse.h out.h util.h checks.h main.h out.o: out.c main.h out.h parse.o: parse.c ../config.h tree.h main.h util.h tree.o: tree.c ../config.h tree.h -util.o: util.c ../config.h main.h util.h +util.o: util.c ../config.h tree.h main.h util.h info-am: info: info-recursive diff --git a/src/checks.c b/src/checks.c index 80602d1..f2bb058 100644 --- a/src/checks.c +++ b/src/checks.c @@ -146,10 +146,11 @@ check_duplicate_named(Class *c,Node *node,char *id, int line_no) continue; if(n==node || line_no>=nline_no || - strcmp(nid,id)!=0) + g_strcasecmp(nid,id)!=0) continue; s = g_strdup_printf("named symbol (argument or signal) '%s' " - "redefined, first defined on line %d", + "redefined, first defined on line %d " + "(case insensitive)", id,line_no); print_error(FALSE,s,nline_no); } @@ -242,14 +243,14 @@ check_firstarg(Class *c) void check_nonvoidempty(Class *c) { - GList *l; - for(l=c->nodes;l;l=g_list_next(l)) { - Node *n = l->data; + GList *li; + for(li=c->nodes; li; li=g_list_next(li)) { + Node *n = li->data; if(n->type == METHOD_NODE) { Method *m = (Method *)n; if(m->method != REGULAR_METHOD) continue; - if(!(strcmp(m->mtype->name,"void")==0 && + if(!(strcmp(m->mtype->name, "void")==0 && m->mtype->stars == 0) && !m->cbuf) { print_error(TRUE, @@ -271,9 +272,9 @@ check_nonvoidempty(Class *c) void check_signal_args(Class *c) { - GList *l; - for(l=c->nodes;l;l=g_list_next(l)) { - Node *n = l->data; + GList *li; + for(li=c->nodes; li; li=g_list_next(li)) { + Node *n = li->data; if(n->type == METHOD_NODE) { Method *m = (Method *)n; GList *l; @@ -283,7 +284,7 @@ check_signal_args(Class *c) for(l=m->gtktypes;l;l=l->next) { char *s; - if(get_cast(l->data,FALSE)) + if(get_cast(l->data, FALSE)) continue; s = g_strdup_printf("Unknown GTK+ type '%s' " "among signal types", @@ -304,7 +305,7 @@ check_argument_types(Class *c) if(n->type == ARGUMENT_NODE) { Argument *a = (Argument *)n; char *s; - if(get_cast(a->gtktype,FALSE)) + if(get_cast(a->gtktype, FALSE)) continue; s = g_strdup_printf("Unknown GTK+ type '%s' " "as argument type", diff --git a/src/lexer.c b/src/lexer.c index c2d69fa..824d2e8 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 87 -#define YY_END_OF_BUFFER 88 -static yyconst short int yy_acclist[424] = +#define YY_NUM_RULES 88 +#define YY_END_OF_BUFFER 89 +static yyconst short int yy_acclist[428] = { 0, - 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 + 89, 86, 88, 85, 86, 88, 1, 87, 88, 86, + 87, 88, 86, 88, 86, 88, 86, 88, 85, 86, + 88, 86, 88, 86, 88, 26, 86, 88, 1, 27, + 87, 88, 26, 86, 87, 88, 26, 86, 88, 26, + 86, 88, 49, 86, 88, 1, 50, 87, 88, 49, + 86, 87, 88, 42, 49, 86, 88, 49, 86, 88, + 49, 86, 88, 49, 86, 88, 49, 86, 88, 47, + 49, 86, 88, 48, 49, 86, 88, 49, 86, 88, + 49, 86, 88, 45, 86, 88, 1, 46, 87, 88, + 45, 86, 87, 88, 44, 45, 86, 88, 45, 86, + + 88, 45, 86, 88, 86, 88, 86, 88, 80, 86, + 88, 80, 86, 88, 80, 86, 88, 80, 86, 88, + 80, 86, 88, 82, 86, 88, 86, 88, 86, 88, + 77, 86, 88, 77, 86, 88, 86, 88, 80, 86, + 88, 80, 86, 88, 80, 86, 88, 80, 86, 88, + 80, 86, 88, 80, 86, 88, 80, 86, 88, 80, + 86, 88, 80, 86, 88, 80, 86, 88, 80, 86, + 88, 80, 86, 88, 83, 86, 88, 84, 86, 88, + 9, 86, 88, 9, 86, 87, 88, 9, 86, 88, + 9, 86, 88, 9, 86, 88, 9, 86, 88, 14, + + 86, 88, 14, 86, 87, 88, 14, 86, 88, 14, + 86, 88, 14, 86, 88, 14, 86, 88, 17, 86, + 88, 17, 86, 87, 88, 17, 86, 88, 17, 86, + 88, 21, 33, 25, 22, 41, 34, 43, 23, 79, + 80, 78, 80, 80, 80, 80, 77, 24, 77, 77, + 81, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 8, + 6, 13, 10, 12, 11, 13, 16, 15, 3, 28, + 32, 39, 35, 37, 18, 19, 79, 79, 78, 80, + 80, 80, 80, 68, 77, 20, 77, 77, 80, 80, + + 80, 80, 80, 80, 63, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 11, + 29, 30, 31, 40, 36, 38, 79, 80, 80, 54, + 80, 53, 80, 5, 80, 66, 80, 80, 80, 58, + 80, 80, 61, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 55, 80, 7, 51, 80, + 80, 67, 80, 80, 64, 80, 80, 80, 80, 80, + 80, 62, 80, 80, 80, 80, 57, 80, 80, 80, + 80, 80, 65, 80, 80, 80, 80, 80, 69, 80, + 74, 80, 59, 80, 56, 80, 80, 80, 80, 80, + + 76, 80, 80, 70, 80, 80, 80, 73, 80, 80, + 72, 80, 75, 80, 80, 60, 80, 80, 71, 80, + 80, 4, 80, 2, 2, 80, 52 } ; -static yyconst short int yy_accept[370] = +static yyconst short int yy_accept[372] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, @@ -352,33 +352,34 @@ static yyconst short int yy_accept[370] = 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 + 240, 241, 242, 243, 244, 245, 246, 247, 247, 248, + 249, 249, 249, 250, 250, 250, 251, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 271, 271, + 271, 272, 272, 273, 273, 273, 273, 274, 275, 275, + 277, 278, 279, 279, 280, 280, 280, 280, 280, 281, + 281, 281, 282, 282, 282, 282, 283, 283, 283, 283, + 284, 285, 285, 286, 286, 286, 287, 288, 289, 290, + + 291, 292, 293, 294, 295, 296, 296, 296, 297, 298, + 299, 299, 300, 301, 302, 303, 304, 305, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 320, 321, 321, 321, 321, 322, 322, 323, + 324, 324, 324, 325, 326, 327, 327, 328, 329, 330, + 332, 334, 334, 335, 336, 338, 339, 340, 342, 343, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 358, 358, 359, 359, 359, 359, 360, 360, + 360, 360, 360, 360, 361, 362, 364, 365, 367, 368, + 369, 370, 371, 372, 374, 375, 376, 377, 379, 380, + + 381, 381, 381, 381, 381, 381, 381, 382, 383, 385, + 386, 387, 388, 389, 391, 393, 395, 397, 398, 399, + 399, 399, 399, 399, 399, 400, 401, 403, 404, 406, + 407, 408, 410, 410, 410, 410, 410, 410, 411, 413, + 415, 416, 418, 418, 418, 418, 418, 418, 419, 421, + 421, 421, 421, 421, 422, 422, 422, 422, 422, 423, + 424, 425, 425, 425, 427, 427, 427, 427, 427, 428, + 428 } ; static yyconst int yy_ec[256] = @@ -423,108 +424,112 @@ static yyconst int yy_meta[57] = 7, 7, 7, 7, 1, 1 } ; -static yyconst short int yy_base[390] = +static yyconst short int yy_base[393] = { 0, 0, 35, 3, 5, 82, 136, 16, 24, 192, 0, - 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, + 238, 0, 7, 49, 31, 63, 66, 77, 822, 823, + 823, 823, 823, 4, 794, 777, 44, 49, 781, 823, + 823, 823, 806, 790, 823, 823, 823, 823, 66, 11, + 789, 0, 823, 823, 53, 759, 823, 823, 823, 823, + 787, 0, 50, 0, 797, 47, 2, 28, 66, 823, 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, + 102, 104, 119, 108, 125, 120, 135, 823, 823, 823, + 823, 800, 784, 168, 177, 823, 823, 798, 782, 252, + 253, 805, 804, 107, 156, 823, 803, 776, 770, 259, + + 765, 120, 228, 105, 823, 754, 823, 792, 254, 791, + 790, 823, 795, 823, 265, 752, 823, 823, 823, 793, + 779, 778, 777, 145, 153, 243, 255, 781, 171, 781, + 787, 285, 290, 300, 0, 305, 308, 758, 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 + 312, 314, 313, 317, 316, 318, 823, 334, 335, 346, + 823, 361, 823, 366, 367, 378, 823, 382, 776, 823, + 823, 823, 784, 823, 762, 735, 741, 728, 823, 748, + 726, 823, 725, 737, 726, 823, 768, 767, 766, 823, + 823, 771, 823, 737, 769, 823, 755, 754, 753, 8, + + 339, 334, 340, 823, 360, 389, 765, 823, 382, 0, + 385, 370, 366, 377, 326, 372, 385, 751, 386, 387, + 388, 389, 390, 391, 394, 393, 392, 401, 397, 395, + 396, 446, 823, 745, 715, 369, 823, 727, 823, 823, + 710, 720, 823, 823, 823, 718, 744, 407, 405, 743, + 742, 427, 823, 409, 741, 415, 424, 740, 419, 739, + 429, 434, 438, 436, 440, 441, 442, 443, 444, 445, + 447, 738, 466, 823, 485, 491, 725, 823, 706, 713, + 716, 700, 696, 449, 448, 731, 457, 730, 459, 465, + 468, 475, 481, 729, 482, 484, 486, 728, 487, 488, + + 721, 695, 692, 689, 701, 701, 490, 493, 721, 492, + 494, 497, 498, 720, 719, 718, 717, 502, 499, 702, + 465, 693, 680, 691, 48, 507, 712, 508, 707, 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, 823, 554, + 823, 249, 560, 270, 141, 565, 581, 585, 823, 823, + 596, 603, 610, 617, 624, 631, 638, 645, 652, 654, + 658, 665, 672, 679, 683, 687, 694, 698, 703, 707, + 713, 720 + } ; -static yyconst short int yy_def[390] = +static yyconst short int yy_def[393] = { 0, - 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 + 371, 371, 372, 372, 373, 373, 374, 374, 370, 9, + 9, 11, 375, 375, 376, 376, 377, 377, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 378, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 379, 370, 380, 381, 381, 381, 381, 381, 370, + 370, 370, 370, 370, 370, 381, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 382, 370, 370, 370, + + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 383, 370, 370, 370, 370, 370, 370, 384, + 385, 381, 386, 381, 381, 381, 381, 370, 370, 370, + 387, 370, 370, 370, 388, 370, 370, 370, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 370, 370, 370, 370, + 370, 389, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 382, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 383, 370, 370, 384, 370, 385, 390, 386, 381, + + 381, 381, 381, 370, 370, 370, 387, 370, 370, 388, + 370, 381, 381, 381, 381, 381, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, + 381, 391, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 390, 381, 381, 381, + 381, 370, 370, 381, 381, 381, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, + 381, 381, 370, 370, 391, 370, 370, 370, 370, 370, + 370, 370, 370, 381, 381, 381, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, + + 370, 370, 370, 370, 370, 370, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, 381, 370, + 370, 370, 370, 370, 381, 381, 381, 381, 381, 381, + 381, 381, 370, 370, 370, 370, 370, 381, 381, 381, + 381, 381, 370, 370, 370, 370, 370, 381, 381, 370, + 370, 370, 392, 381, 370, 370, 370, 392, 370, 381, + 370, 370, 370, 381, 370, 370, 370, 370, 370, 0, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370 + } ; -static yyconst short int yy_nxt[874] = +static yyconst short int yy_nxt[880] = { 0, - 368, 21, 22, 23, 21, 31, 32, 31, 32, 22, + 370, 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, + 112, 50, 113, 123, 370, 25, 48, 49, 34, 50, + 34, 248, 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, + 26, 108, 91, 124, 83, 94, 126, 338, 123, 22, 93, 123, 102, 29, 36, 37, 94, 38, 89, 103, 39, 95, 101, 40, 116, 104, 128, 109, 129, 129, @@ -535,8 +540,8 @@ static yyconst short int yy_nxt[874] = 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, + 178, 148, 158, 200, 179, 153, 155, 159, 160, 161, + 156, 162, 98, 205, 205, 205, 201, 215, 157, 183, 43, 44, 20, 21, 22, 23, 21, 20, 20, 20, 20, 20, 20, 53, 20, 20, 20, 54, 20, 20, @@ -547,84 +552,84 @@ static yyconst short int yy_nxt[874] = 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, + 72, 123, 182, 73, 74, 123, 365, 75, 202, 76, + 77, 212, 78, 79, 123, 213, 203, 209, 209, 209, - 132, 213, 133, 133, 134, 123, 116, 101, 188, 189, - 132, 216, 134, 134, 134, 132, 123, 136, 136, 136, + 132, 214, 133, 133, 134, 123, 116, 101, 188, 189, + 132, 217, 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, + 216, 123, 123, 123, 219, 158, 160, 161, 158, 162, + 138, 123, 362, 159, 224, 220, 221, 160, 161, 123, + 160, 218, 222, 226, 123, 123, 223, 225, 228, 231, + 257, 227, 160, 161, 230, 160, 229, 164, 166, 167, + 164, 168, 205, 205, 205, 165, 169, 250, 233, 166, + 167, 123, 166, 166, 167, 123, 166, 123, 249, 251, + 252, 253, 123, 252, 209, 209, 209, 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, + 123, 123, 123, 361, 255, 258, 123, 138, 259, 279, + 123, 254, 123, 179, 123, 260, 256, 284, 252, 253, + 123, 252, 272, 265, 123, 261, 262, 267, 270, 123, + 264, 263, 266, 268, 123, 271, 269, 273, 274, 123, + 273, 123, 285, 123, 251, 123, 123, 123, 123, 123, + 123, 276, 123, 123, 123, 286, 287, 273, 274, 288, + 273, 291, 123, 292, 123, 295, 307, 289, 297, 296, + 123, 293, 290, 123, 299, 308, 273, 274, 298, 273, + 123, 294, 273, 274, 309, 273, 123, 123, 300, 123, + + 276, 123, 123, 123, 310, 123, 311, 123, 123, 123, + 313, 325, 123, 123, 123, 334, 314, 123, 312, 182, + 316, 319, 123, 123, 315, 123, 346, 356, 123, 346, + 328, 318, 347, 123, 329, 347, 317, 326, 123, 331, + 327, 332, 348, 123, 353, 340, 123, 341, 330, 342, + 346, 360, 354, 346, 349, 353, 357, 339, 352, 352, + 352, 352, 352, 352, 359, 363, 363, 363, 359, 123, + 366, 355, 363, 363, 363, 123, 359, 367, 367, 367, + 359, 364, 368, 369, 351, 368, 368, 369, 181, 368, + 350, 123, 123, 367, 367, 367, 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, + 114, 114, 118, 118, 345, 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 + 199, 199, 199, 199, 207, 207, 207, 207, 207, 207, + + 207, 210, 344, 210, 232, 232, 343, 123, 232, 232, + 247, 247, 247, 247, 275, 275, 275, 275, 275, 275, + 358, 358, 123, 358, 358, 358, 358, 123, 337, 336, + 335, 333, 123, 123, 123, 123, 123, 324, 323, 322, + 321, 178, 320, 123, 123, 123, 123, 306, 305, 304, + 303, 302, 301, 123, 123, 123, 123, 123, 123, 198, + 283, 282, 281, 280, 278, 277, 123, 208, 123, 198, + 198, 196, 246, 193, 245, 244, 243, 242, 241, 240, + 239, 238, 237, 236, 235, 234, 174, 233, 211, 208, + 206, 204, 123, 123, 198, 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, 370, 19, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370 } ; -static yyconst short int yy_chk[874] = +static yyconst short int yy_chk[880] = { 0, 0, 1, 1, 1, 1, 3, 3, 4, 4, 13, 13, 1, 3, 24, 4, 24, 13, 57, 7, 7, - 40, 7, 40, 199, 0, 1, 8, 8, 3, 8, - 4, 199, 13, 15, 15, 1, 2, 2, 2, 2, + 40, 7, 40, 200, 0, 1, 8, 8, 3, 8, + 4, 200, 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, + 2, 53, 56, 325, 16, 16, 16, 16, 17, 17, + 2, 39, 16, 56, 14, 17, 58, 325, 66, 18, 18, 59, 28, 2, 5, 5, 18, 5, 16, 28, 5, 17, 27, 5, 45, 28, 61, 39, 61, 61, @@ -636,7 +641,7 @@ static yyconst short int yy_chk[874] = 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, + 77, 85, 95, 129, 129, 129, 125, 142, 85, 365, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, @@ -647,72 +652,72 @@ static yyconst short int yy_chk[874] = 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, 144, 103, 11, 11, 364, 362, 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, - - 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 + 137, 215, 356, 158, 150, 147, 148, 160, 160, 202, + 160, 145, 149, 152, 201, 203, 149, 151, 154, 156, + 215, 153, 162, 162, 155, 162, 154, 164, 165, 165, + 164, 165, 205, 205, 205, 164, 165, 202, 165, 166, + 166, 213, 166, 168, 168, 212, 168, 216, 201, 203, + 206, 206, 214, 206, 209, 209, 209, 211, 211, 211, + + 217, 219, 220, 221, 222, 223, 224, 227, 226, 225, + 230, 231, 229, 355, 213, 216, 228, 211, 217, 236, + 249, 212, 248, 236, 254, 219, 214, 248, 252, 252, + 256, 252, 231, 224, 259, 220, 221, 226, 229, 257, + 223, 222, 225, 227, 261, 230, 228, 232, 232, 262, + 232, 264, 254, 263, 249, 265, 266, 267, 268, 269, + 270, 232, 271, 285, 284, 256, 257, 273, 273, 259, + 273, 263, 287, 264, 289, 267, 284, 261, 268, 267, + 290, 265, 262, 291, 270, 285, 275, 275, 269, 275, + 292, 266, 276, 276, 287, 276, 293, 295, 271, 296, + + 275, 297, 299, 300, 289, 307, 290, 310, 308, 311, + 292, 307, 312, 313, 319, 321, 293, 318, 291, 321, + 296, 300, 326, 328, 295, 330, 336, 351, 331, 336, + 311, 299, 337, 341, 312, 337, 297, 308, 338, 318, + 310, 319, 338, 348, 347, 328, 354, 330, 313, 331, + 346, 354, 348, 346, 341, 347, 352, 326, 352, 352, + 352, 346, 346, 346, 353, 357, 357, 357, 358, 360, + 363, 350, 363, 363, 363, 349, 353, 366, 366, 366, + 358, 360, 367, 367, 345, 367, 368, 368, 344, 368, + 343, 342, 340, 367, 367, 367, 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, 376, 376, 376, 376, 376, 377, 377, + 377, 377, 377, 377, 377, 378, 378, 339, 378, 378, + 378, 378, 379, 379, 335, 379, 379, 379, 379, 380, + 380, 381, 381, 381, 381, 382, 382, 382, 382, 382, + 382, 382, 383, 383, 383, 383, 383, 383, 383, 384, + 384, 384, 384, 384, 384, 384, 385, 385, 385, 385, + 386, 386, 386, 386, 387, 387, 387, 387, 387, 387, + + 387, 388, 334, 388, 389, 389, 333, 332, 389, 389, + 390, 390, 390, 390, 391, 391, 391, 391, 391, 391, + 392, 392, 329, 392, 392, 392, 392, 327, 324, 323, + 322, 320, 317, 316, 315, 314, 309, 306, 305, 304, + 303, 302, 301, 298, 294, 288, 286, 283, 282, 281, + 280, 279, 277, 272, 260, 258, 255, 251, 250, 247, + 246, 242, 241, 238, 235, 234, 218, 207, 199, 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, 93, 92, 89, 88, + 83, 82, 55, 51, 46, 41, 34, 33, 29, 26, + 25, 19, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 370, 370, 370, 370 } ; static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; @@ -757,6 +762,7 @@ char *yytext; #include #include +#include "tree.h" #include "parse.h" #include "main.h" #include "util.h" @@ -830,7 +836,7 @@ add_gtk_doc_func(void) #define GTK_DOC_LINE 8 -#line 834 "lex.yy.c" +#line 840 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -984,10 +990,10 @@ YY_DECL register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 95 "lexer.l" +#line 96 "lexer.l" -#line 991 "lex.yy.c" +#line 997 "lex.yy.c" if ( yy_init ) { @@ -1036,14 +1042,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 >= 369 ) + if ( yy_current_state >= 371 ) 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] != 817 ); + while ( yy_base[yy_current_state] != 823 ); yy_find_action: yy_current_state = *--yy_state_ptr; @@ -1074,12 +1080,12 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 97 "lexer.l" +#line 98 "lexer.l" { line_no++; REJECT; } YY_BREAK case 2: YY_RULE_SETUP -#line 99 "lexer.l" +#line 100 "lexer.l" { fprintf(stderr,"You are a bad bad person!\n"); REJECT; } YY_BREAK case 3: @@ -1087,12 +1093,12 @@ case 3: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 101 "lexer.l" +#line 102 "lexer.l" { ; /*comment, ignore*/ } YY_BREAK case 4: YY_RULE_SETUP -#line 102 "lexer.l" +#line 103 "lexer.l" { if(look_for_includes==1) { char *p; @@ -1115,7 +1121,7 @@ case 5: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 119 "lexer.l" +#line 120 "lexer.l" { /* eat out gtk doc stuff */ BEGIN(GTK_DOC_BEFORE_NAME); @@ -1127,7 +1133,7 @@ case 6: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 124 "lexer.l" +#line 125 "lexer.l" { /* empty doc lines */ ; @@ -1138,7 +1144,7 @@ case 7: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 128 "lexer.l" +#line 129 "lexer.l" { char *p; BEGIN(GTK_DOC); @@ -1152,14 +1158,14 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 138 "lexer.l" +#line 139 "lexer.l" { BEGIN(CLASS_CODE_I); } YY_BREAK case 9: YY_RULE_SETUP -#line 141 "lexer.l" +#line 142 "lexer.l" { BEGIN(COMMENT); before_comment = CLASS_CODE_I; @@ -1170,7 +1176,7 @@ case 10: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 145 "lexer.l" +#line 146 "lexer.l" { /* empty doc lines */ add_to_cbuf(" *\n"); @@ -1178,7 +1184,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 149 "lexer.l" +#line 150 "lexer.l" { BEGIN(CLASS_CODE_I); add_gtk_doc_func(); @@ -1186,7 +1192,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 153 "lexer.l" +#line 154 "lexer.l" { fflush(stdout); add_to_cbuf(" * "); @@ -1195,14 +1201,14 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 158 "lexer.l" +#line 159 "lexer.l" { BEGIN(CLASS_CODE_I); } YY_BREAK case 14: YY_RULE_SETUP -#line 161 "lexer.l" +#line 162 "lexer.l" { BEGIN(COMMENT); before_comment = CLASS_CODE_I; @@ -1210,7 +1216,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 165 "lexer.l" +#line 166 "lexer.l" { BEGIN(CLASS_CODE_I); add_to_cbuf("\n"); @@ -1222,7 +1228,7 @@ case 16: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 170 "lexer.l" +#line 171 "lexer.l" { BEGIN(GTK_DOC); add_to_cbuf(yytext); @@ -1231,7 +1237,7 @@ YY_RULE_SETUP YY_BREAK case 17: YY_RULE_SETUP -#line 175 "lexer.l" +#line 176 "lexer.l" { fflush(stdout); add_to_cbuf(yytext); @@ -1242,7 +1248,7 @@ case 18: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 180 "lexer.l" +#line 181 "lexer.l" { add_to_cbuf(yytext); /*comment, ignore*/ } YY_BREAK case 19: @@ -1250,7 +1256,7 @@ case 19: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 181 "lexer.l" +#line 182 "lexer.l" { ; /*comment, ignore*/ } YY_BREAK case 20: @@ -1258,17 +1264,17 @@ case 20: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 182 "lexer.l" +#line 183 "lexer.l" { ; /*comment, ignore*/ } YY_BREAK case 21: YY_RULE_SETUP -#line 183 "lexer.l" +#line 184 "lexer.l" {BEGIN(COMMENT); before_comment = INITIAL; } YY_BREAK case 22: YY_RULE_SETUP -#line 184 "lexer.l" +#line 185 "lexer.l" { add_to_cbuf(yytext); BEGIN(COMMENT); @@ -1277,17 +1283,17 @@ YY_RULE_SETUP YY_BREAK case 23: YY_RULE_SETUP -#line 189 "lexer.l" +#line 190 "lexer.l" {BEGIN(COMMENT); before_comment = CLASS_CODE; } YY_BREAK case 24: YY_RULE_SETUP -#line 190 "lexer.l" +#line 191 "lexer.l" {BEGIN(COMMENT); before_comment = CLASS_CODE_I; } YY_BREAK case 25: YY_RULE_SETUP -#line 191 "lexer.l" +#line 192 "lexer.l" { if(before_comment == C_CODE) add_to_cbuf(yytext); BEGIN(before_comment); @@ -1295,7 +1301,7 @@ YY_RULE_SETUP YY_BREAK case 26: YY_RULE_SETUP -#line 195 "lexer.l" +#line 196 "lexer.l" { /* comment, ignore */ if(before_comment == C_CODE) add_to_cbuf(yytext); @@ -1303,7 +1309,7 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 199 "lexer.l" +#line 200 "lexer.l" { /* comment, ignore */ if(before_comment == C_CODE) add_to_cbuf(yytext); @@ -1311,7 +1317,7 @@ YY_RULE_SETUP YY_BREAK case 28: YY_RULE_SETUP -#line 204 "lexer.l" +#line 205 "lexer.l" { BEGIN(C_CODE); parenth_depth = 1; @@ -1323,7 +1329,7 @@ YY_RULE_SETUP YY_BREAK case 29: YY_RULE_SETUP -#line 212 "lexer.l" +#line 213 "lexer.l" { BEGIN(C_CODE); parenth_depth = 1; @@ -1335,7 +1341,7 @@ YY_RULE_SETUP YY_BREAK case 30: YY_RULE_SETUP -#line 221 "lexer.l" +#line 222 "lexer.l" { BEGIN(C_CODE); parenth_depth = 1; @@ -1347,7 +1353,7 @@ YY_RULE_SETUP YY_BREAK case 31: YY_RULE_SETUP -#line 229 "lexer.l" +#line 230 "lexer.l" { BEGIN(C_CODE); parenth_depth = 1; @@ -1359,7 +1365,7 @@ YY_RULE_SETUP YY_BREAK case 32: YY_RULE_SETUP -#line 237 "lexer.l" +#line 238 "lexer.l" { BEGIN(C_CODE); parenth_depth = 1; @@ -1371,7 +1377,7 @@ YY_RULE_SETUP YY_BREAK case 33: YY_RULE_SETUP -#line 245 "lexer.l" +#line 246 "lexer.l" { BEGIN(C_CODE); parenth_depth = 1; @@ -1385,7 +1391,7 @@ YY_RULE_SETUP YY_BREAK case 34: YY_RULE_SETUP -#line 255 "lexer.l" +#line 256 "lexer.l" { BEGIN(INITIAL); yylval.cbuf = cbuf; @@ -1397,42 +1403,42 @@ YY_RULE_SETUP YY_BREAK case 35: YY_RULE_SETUP -#line 264 "lexer.l" +#line 265 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 36: YY_RULE_SETUP -#line 265 "lexer.l" +#line 266 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 37: YY_RULE_SETUP -#line 266 "lexer.l" +#line 267 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 38: YY_RULE_SETUP -#line 267 "lexer.l" +#line 268 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 39: YY_RULE_SETUP -#line 268 "lexer.l" +#line 269 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 40: YY_RULE_SETUP -#line 269 "lexer.l" +#line 270 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 41: YY_RULE_SETUP -#line 271 "lexer.l" +#line 272 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 42: YY_RULE_SETUP -#line 272 "lexer.l" +#line 273 "lexer.l" { BEGIN(C_CODE_STRING); add_to_cbuf(yytext); @@ -1440,12 +1446,12 @@ YY_RULE_SETUP YY_BREAK case 43: YY_RULE_SETUP -#line 276 "lexer.l" +#line 277 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 44: YY_RULE_SETUP -#line 277 "lexer.l" +#line 278 "lexer.l" { BEGIN(C_CODE); add_to_cbuf(yytext); @@ -1453,17 +1459,17 @@ YY_RULE_SETUP YY_BREAK case 45: YY_RULE_SETUP -#line 281 "lexer.l" +#line 282 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 46: YY_RULE_SETUP -#line 282 "lexer.l" +#line 283 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 47: YY_RULE_SETUP -#line 284 "lexer.l" +#line 285 "lexer.l" { parenth_depth++; add_to_cbuf(yytext); @@ -1471,7 +1477,7 @@ YY_RULE_SETUP YY_BREAK case 48: YY_RULE_SETUP -#line 288 "lexer.l" +#line 289 "lexer.l" { parenth_depth--; if(parenth_depth<0) { @@ -1487,17 +1493,17 @@ YY_RULE_SETUP YY_BREAK case 49: YY_RULE_SETUP -#line 301 "lexer.l" +#line 302 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 50: YY_RULE_SETUP -#line 302 "lexer.l" +#line 303 "lexer.l" { add_to_cbuf(yytext); } YY_BREAK case 51: YY_RULE_SETUP -#line 304 "lexer.l" +#line 305 "lexer.l" { static int found_classes = 0; look_for_includes = 2; @@ -1517,7 +1523,7 @@ case 52: yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 318 "lexer.l" +#line 319 "lexer.l" { int maj = 0,min = 0,pl = 0; int rmaj = 0,rmin = 0,rpl = 0; @@ -1544,7 +1550,7 @@ YY_RULE_SETUP YY_BREAK case 53: YY_RULE_SETUP -#line 342 "lexer.l" +#line 343 "lexer.l" { if(for_cpp) { char *s; @@ -1559,122 +1565,122 @@ YY_RULE_SETUP YY_BREAK case 54: YY_RULE_SETUP -#line 354 "lexer.l" +#line 355 "lexer.l" {return FROM;} YY_BREAK case 55: YY_RULE_SETUP -#line 356 "lexer.l" +#line 357 "lexer.l" {return VOID;} YY_BREAK case 56: YY_RULE_SETUP -#line 357 "lexer.l" +#line 358 "lexer.l" {return STRUCT;} YY_BREAK case 57: YY_RULE_SETUP -#line 358 "lexer.l" +#line 359 "lexer.l" {return UNION;} YY_BREAK case 58: YY_RULE_SETUP -#line 359 "lexer.l" +#line 360 "lexer.l" {return ENUM;} YY_BREAK case 59: YY_RULE_SETUP -#line 360 "lexer.l" +#line 361 "lexer.l" {return SIGNED;} YY_BREAK case 60: YY_RULE_SETUP -#line 361 "lexer.l" +#line 362 "lexer.l" {return UNSIGNED;} YY_BREAK case 61: YY_RULE_SETUP -#line 362 "lexer.l" +#line 363 "lexer.l" {return LONG;} YY_BREAK case 62: YY_RULE_SETUP -#line 363 "lexer.l" +#line 364 "lexer.l" {return SHORT;} YY_BREAK case 63: YY_RULE_SETUP -#line 364 "lexer.l" +#line 365 "lexer.l" {return INT;} YY_BREAK case 64: YY_RULE_SETUP -#line 365 "lexer.l" +#line 366 "lexer.l" {return FLOAT;} YY_BREAK case 65: YY_RULE_SETUP -#line 366 "lexer.l" +#line 367 "lexer.l" {return DOUBLE;} YY_BREAK case 66: YY_RULE_SETUP -#line 367 "lexer.l" +#line 368 "lexer.l" {return CHAR;} YY_BREAK case 67: YY_RULE_SETUP -#line 368 "lexer.l" +#line 369 "lexer.l" {return CONST;} YY_BREAK case 68: YY_RULE_SETUP -#line 370 "lexer.l" +#line 371 "lexer.l" {return THREEDOTS;} YY_BREAK case 69: YY_RULE_SETUP -#line 372 "lexer.l" +#line 373 "lexer.l" {yylval.line = line_no; return PUBLIC;} YY_BREAK case 70: YY_RULE_SETUP -#line 373 "lexer.l" +#line 374 "lexer.l" {yylval.line = line_no; return PRIVATE;} YY_BREAK case 71: YY_RULE_SETUP -#line 374 "lexer.l" +#line 375 "lexer.l" {yylval.line = line_no; return PROTECTED;} YY_BREAK case 72: YY_RULE_SETUP -#line 375 "lexer.l" +#line 376 "lexer.l" {yylval.line = line_no; return ARGUMENT;} YY_BREAK case 73: YY_RULE_SETUP -#line 376 "lexer.l" +#line 377 "lexer.l" {yylval.line = line_no; return VIRTUAL;} YY_BREAK case 74: YY_RULE_SETUP -#line 377 "lexer.l" +#line 378 "lexer.l" {yylval.line = line_no; return SIGNAL;} YY_BREAK case 75: YY_RULE_SETUP -#line 378 "lexer.l" +#line 379 "lexer.l" {yylval.line = line_no; return OVERRIDE;} YY_BREAK case 76: YY_RULE_SETUP -#line 379 "lexer.l" +#line 380 "lexer.l" {return ONERROR;} YY_BREAK case 77: YY_RULE_SETUP -#line 380 "lexer.l" +#line 381 "lexer.l" { yylval.id = g_strdup(yytext); return NUMBER; @@ -1682,39 +1688,49 @@ YY_RULE_SETUP YY_BREAK case 78: YY_RULE_SETUP -#line 384 "lexer.l" +#line 385 "lexer.l" { + /* this one is for a classname with a namespace */ yylval.id = g_strdup(yytext); return TYPETOKEN; } YY_BREAK case 79: YY_RULE_SETUP -#line 388 "lexer.l" +#line 390 "lexer.l" { + /* this is for a classname with an empty namespace */ yylval.id = g_strdup(yytext); - return TOKEN; + return TYPETOKEN; } YY_BREAK case 80: YY_RULE_SETUP -#line 393 "lexer.l" +#line 395 "lexer.l" { yylval.id = g_strdup(yytext); - return ARRAY_DIM; + return TOKEN; } YY_BREAK case 81: YY_RULE_SETUP -#line 398 "lexer.l" +#line 400 "lexer.l" +{ + yylval.id = g_strdup(yytext); + return ARRAY_DIM; + } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 405 "lexer.l" { BEGIN(CLASS_CODE_I); return '{'; } YY_BREAK -case 82: +case 83: YY_RULE_SETUP -#line 402 "lexer.l" +#line 409 "lexer.l" { BEGIN(C_CODE); parenth_depth=1; @@ -1725,38 +1741,38 @@ YY_RULE_SETUP return '{'; } YY_BREAK -case 83: +case 84: YY_RULE_SETUP -#line 411 "lexer.l" +#line 418 "lexer.l" { BEGIN(INITIAL); return '}'; } YY_BREAK -case 84: +case 85: YY_RULE_SETUP -#line 416 "lexer.l" +#line 423 "lexer.l" ; /*ignore*/ YY_BREAK -case 85: +case 86: YY_RULE_SETUP -#line 418 "lexer.l" +#line 425 "lexer.l" { yylval.line = line_no; return yytext[0]; } YY_BREAK -case 86: +case 87: YY_RULE_SETUP -#line 423 "lexer.l" +#line 430 "lexer.l" ; /*ignore*/ YY_BREAK -case 87: +case 88: YY_RULE_SETUP -#line 424 "lexer.l" +#line 431 "lexer.l" ECHO; YY_BREAK -#line 1760 "lex.yy.c" +#line 1776 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(C_CODE): @@ -2054,7 +2070,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 >= 369 ) + if ( yy_current_state >= 371 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2084,11 +2100,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 >= 369 ) + if ( yy_current_state >= 371 ) 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 == 368); + yy_is_jam = (yy_current_state == 370); if ( ! yy_is_jam ) *yy_state_ptr++ = yy_current_state; @@ -2646,4 +2662,4 @@ int main() return 0; } #endif -#line 424 "lexer.l" +#line 431 "lexer.l" diff --git a/src/lexer.l b/src/lexer.l index ddbd951..14f6990 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -24,6 +24,7 @@ #include #include +#include "tree.h" #include "parse.h" #include "main.h" #include "util.h" @@ -381,7 +382,13 @@ class { yylval.id = g_strdup(yytext); return NUMBER; } -:?[A-Za-z_][A-Za-z0-9_]*(:[A-Za-z0-9_]*)+ { +[A-Za-z_][A-Za-z0-9_]*(:[A-Za-z0-9_]*)+ { + /* this one is for a classname with a namespace */ + yylval.id = g_strdup(yytext); + return TYPETOKEN; + } +:[A-Za-z_][A-Za-z0-9_]*(:[A-Za-z0-9_]*)* { + /* this is for a classname with an empty namespace */ yylval.id = g_strdup(yytext); return TYPETOKEN; } diff --git a/src/main.c b/src/main.c index 226e821..a84d0db 100644 --- a/src/main.c +++ b/src/main.c @@ -70,6 +70,10 @@ static gboolean made_aliases = FALSE; /* if we made any shorthand aliases and need the REALLY UGLY HACK to avoid warnings */ +/* the special variable types we need to define */ +static gboolean special_array[SPECIAL_LAST] = {0}; +static gboolean any_special = FALSE; + FILE *out = NULL; FILE *outh = NULL; FILE *outph = NULL; @@ -122,7 +126,6 @@ get_type(Type *t, gboolean postfix_to_stars) gs = g_string_new(s); g_free(s); - extra = 0; if(postfix_to_stars) { char *p; @@ -133,7 +136,7 @@ get_type(Type *t, gboolean postfix_to_stars) for(p=t->postfix; p && *p; p++) if(*p == '[') extra++; } - g_string_append_c(gs,' '); + g_string_append_c(gs, ' '); for(i=0; i<(t->stars+extra); i++) g_string_append_c(gs, '*'); @@ -190,7 +193,7 @@ print_method(FILE *fp, char *typeprefix, char *nameprefix, out_printf(fp, "%s%s%s%s(", nameprefix, subnameprefix, m->id, namepostfix); else - out_printf(fp,"%s%s_%s%s%s(", + out_printf(fp, "%s%s_%s%s%s(", nameprefix, funcbase, subnameprefix, m->id, namepostfix); @@ -594,7 +597,7 @@ print_signal_marsal_args(Method *m) else { out_printf(out, ",\n\t\t(%s)" "GTK_VALUE_%s(args[%d])", - get_cast(li->data,FALSE), + get_cast(li->data, FALSE), (char *)li->data,i); } } @@ -637,10 +640,10 @@ add_signal_prots(Method *m) /* we know that we'll know all the gtktypes (so get_cast can't fail) */ out_printf(out,"\ntypedef %s (*___%s) (%s *, ", - get_cast(m->gtktypes->data,FALSE),s, typebase); + get_cast(m->gtktypes->data, FALSE), s, typebase); for(li=m->gtktypes->next;li;li=g_list_next(li)) - out_printf(out,"%s, ",get_cast(li->data,FALSE)); + out_printf(out, "%s, ", get_cast(li->data, FALSE)); out_printf(out,"gpointer);\n"); out_printf(out,"\nstatic void\n" @@ -897,6 +900,7 @@ static void set_def_handlers(Class *c, char *oname) { GList *li; + gboolean set_line = FALSE; out_printf(out,"\n"); for(li=c->nodes;li;li=g_list_next(li)) { @@ -909,26 +913,35 @@ set_def_handlers(Class *c, char *oname) m->method != OVERRIDE_METHOD)) continue; + if(m->line_no > 0 && m->cbuf) { + out_addline_infile(out, m->line_no); + set_line = TRUE; + } else if(set_line) { + out_addline_outfile(out); + set_line = FALSE; + } if(m->method == OVERRIDE_METHOD) { char *s; - s = replace_sep(m->otype,'_'); + s = replace_sep(m->otype, '_'); g_strdown(s); if(m->cbuf) out_printf(out,"\t%s_class->%s = %s_%s;\n", - s,m->id,funcbase,m->id); + s, m->id, funcbase, m->id); else out_printf(out,"\t%s_class->%s = NULL;\n", - s,m->id); + s, m->id); } else { if(m->cbuf) out_printf(out,"\t%s->%s = ___real_%s_%s;\n", - oname,m->id,funcbase,m->id); + oname, m->id, funcbase, m->id); else out_printf(out,"\t%s->%s = NULL;\n", - oname,m->id); + oname, m->id); } } + if(set_line) + out_addline_outfile(out); } static void @@ -1377,7 +1390,7 @@ put_signal_args(Method *m) li && ali; li=li->next, ali=ali->next) { FuncArg *fa = li->data; - const char *cast = get_cast(ali->data,FALSE); + const char *cast = get_cast(ali->data, FALSE); /* we should have already proved before that the we know all the types */ g_assert(cast); @@ -1569,38 +1582,35 @@ open_files(void) if(no_touch_headers) outfileh = g_strconcat("#gob#",filebase,".h#gob#",NULL); else - outfileh = g_strconcat(filebase,".h",NULL); + outfileh = g_strconcat(filebase, ".h", NULL); - if((privates>0 || protecteds>0 || always_private_header) && + if((privates > 0 || protecteds > 0 || always_private_header) && !no_private_header) - outfileph = g_strconcat(filebase,"-private.h",NULL); + outfileph = g_strconcat(filebase, "-private.h", NULL); else outfileph = NULL; if(no_write) { - devnull = fopen("/dev/null","w"); - if(!devnull) { - g_error("Cannot open null device",NULL); - } + devnull = fopen("/dev/null", "w"); + if(!devnull) + g_error("Cannot open null device"); out = devnull; outh = devnull; if(outfileph) outph = devnull; } else { - out = fopen(outfile,"w"); + 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); + 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); - } + outph = fopen(outfileph, "w"); + if(!outph) + g_error("Cannot open outfile: %s", outfileh); } } } @@ -1616,12 +1626,15 @@ put_argument_nongnu_wrappers(Class *c) for(li=c->nodes;li;li=g_list_next(li)) { Node *n = li->data; Argument *a = (Argument *)n; - char *s; + char *aname; char *cast; + if(n->type != ARGUMENT_NODE) continue; - s = g_strdup(a->name); - g_strup(s); + + aname = g_strdup(a->name); + g_strup(aname); + if(a->atype) cast = get_type(a->atype, TRUE); else @@ -1631,23 +1644,23 @@ put_argument_nongnu_wrappers(Class *c) if(a->set) out_printf(outh, "#define %s_ARG_%s(arg) \t" "\"%s\",(%s)(arg)\n", - macrobase, s, a->name, cast); + macrobase, aname, a->name, cast); if(a->get) out_printf(outh, "#define %s_GET_ARG_%s(arg)\t" "\"%s\",(%s*)(arg)\n", - macrobase, s, a->name, cast); + macrobase, aname, a->name, cast); } else { if(a->set) out_printf(outh, "#define %s_ARG_%s(arg) \t" "\"%s\",(arg)\n", - macrobase, s, a->name); + macrobase, aname, a->name); if(a->get) out_printf(outh, "#define %s_GET_ARG_%s(arg)\t" "\"%s\",(arg)\n", - macrobase, s, a->name); + macrobase, aname, a->name); } g_free(cast); - g_free(s); + g_free(aname); } } @@ -1671,7 +1684,7 @@ put_argument_gnu_wrappers(Class *c) if(a->atype) cast = get_type(a->atype,TRUE); else - cast = g_strdup(get_cast(a->gtktype,TRUE)); + cast = g_strdup(get_cast(a->gtktype, TRUE)); if(cast) { if(a->set) out_printf(outh, "#define %s_ARG_%s(arg) \t" @@ -1706,40 +1719,40 @@ print_ccode_block(CCode *cc) code but is printed before */ case H_CCODE: fp = outh; - out_printf(fp,"\n"); + 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_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); + out_printf(outh, "\n"); + out_printf(outh, "%s\n", cc->cbuf); fp = out; - out_printf(fp,"\n"); - out_addline_infile(fp,cc->line_no); + out_printf(fp, "\n"); + out_addline_infile(fp, cc->line_no); break; default: case C_CCODE: fp = out; out_printf(fp,"\n"); - out_addline_infile(fp,cc->line_no); + out_addline_infile(fp, cc->line_no); break; case PH_CCODE: if(outph) fp = outph; else fp = out; - out_printf(fp,"\n"); - out_addline_infile(fp,cc->line_no); + out_printf(fp, "\n"); + out_addline_infile(fp, cc->line_no); break; } - out_printf(fp,"%s\n",cc->cbuf); + out_printf(fp, "%s\n", cc->cbuf); if(cc->cctype == C_CCODE || cc->cctype == A_CCODE || cc->cctype == AT_CCODE || @@ -1754,14 +1767,23 @@ print_class_block(Class *c) char *s; gboolean printed_private = FALSE; - out_printf(out,"/* utility types we may need */\n"); - out_printf(out,"typedef struct { " - "gpointer a; gpointer b; " - "} ___twopointertype;\n"); - out_printf(out,"typedef struct { " - "gpointer a; gpointer b; " - "gpointer c; " - "} ___threepointertype;\n"); + if(any_special) { + out_printf(out, "/* utility types we may need */\n"); + if(special_array[SPECIAL_2POINTER]) + out_printf(out, "typedef struct { " + "gpointer a; gpointer b; " + "} ___twopointertype;\n"); + if(special_array[SPECIAL_3POINTER]) + out_printf(out, "typedef struct { " + "gpointer a; gpointer b; " + "gpointer c; " + "} ___threepointertype;\n"); + if(special_array[SPECIAL_INT_POINTER]) + out_printf(out, "typedef struct { " + "gint a; gpointer b; " + "} ___intpointertype;\n"); + out_printf(out, "\n"); + } out_printf(outh, "\n/*\n" " * Type checking and casting macros\n" @@ -1779,7 +1801,7 @@ 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, "/* 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); @@ -1973,9 +1995,8 @@ print_class_block(Class *c) for(l=c->nodes;l;l=g_list_next(l)) { Node *n = l->data; - if(n->type == METHOD_NODE) { + if(n->type == METHOD_NODE) put_method((Method *)n); - } } add_bad_hack_to_avoid_unused_warnings(c); @@ -1984,8 +2005,8 @@ print_class_block(Class *c) static void print_version_macros(void) { - int major=0,minor=0,pl=0; - sscanf(VERSION,"%d.%d.%d",&major,&minor,&pl); + 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); @@ -2000,9 +2021,9 @@ print_file_comments(void) out_printf(outh, "/* Generated by GOB (v%s)" " (do not edit directly) */\n\n", VERSION); if(outph) - out_printf(outph,"/* Generated by GOB (v%s)" + out_printf(outph, "/* Generated by GOB (v%s)" " (do not edit directly) */\n\n", VERSION); - out_printf(out,"/* Generated by GOB (v%s) on %s" + out_printf(out, "/* Generated by GOB (v%s) on %s" " (do not edit directly) */\n\n", VERSION, ctime(&curtime)); } @@ -2024,7 +2045,7 @@ print_includes(void) /* if we are creating a private header see if it was included */ if(outph) { p = g_strconcat(filebase, "-private.h", NULL); - if(!g_list_find_custom(include_files,p,(GCompareFunc)strcmp)) { + if(!g_list_find_custom(include_files, p, (GCompareFunc)strcmp)) { out_printf(out,"#include \"%s-private.h\"\n\n", filebase); if(found_header) @@ -2340,6 +2361,8 @@ main(int argc, char *argv[]) if(got_error) exit(1); + any_special = setup_special_array((Class *)class, special_array); + open_files(); generate_outfiles(); diff --git a/src/parse.c b/src/parse.c index 4e7592d..3eeb82b 100644 --- a/src/parse.c +++ b/src/parse.c @@ -95,17 +95,17 @@ yyerror(char *str) if(strcmp(yytext,"\n")==0) { out=g_strconcat("Error: ",str," before newline",NULL); } else if(yytext[0]=='\0') { - out=g_strconcat("Error: ",str," at end of input",NULL); + out=g_strconcat("Error: ", str, " at end of input", NULL); } else { char *tmp = g_strdup(yytext); - while((p=strchr(tmp,'\n'))) + while((p=strchr(tmp, '\n'))) *p='.'; - out=g_strconcat("Error: ",str," before '",tmp,"'",NULL); + out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL); g_free(tmp); } - fprintf(stderr,"%s:%d: %s\n",filename,line_no,out); + fprintf(stderr, "%s:%d: %s\n", filename, line_no, out); g_free(out); exit(1); @@ -159,7 +159,7 @@ push_function(int scope, int method, char *oid, char *id, char *onerror, strcmp(gtktypes->next->data,"NONE")==0)) { print_error(TRUE, _("The number of GTK arguments and " "function arguments for a signal " - "don't seem to match"),line_no); + "don't seem to match"), line_no); } if(cbuf) { char *p; @@ -1272,7 +1272,7 @@ case 25: if(strcmp(yyvsp[-1].id, "destroywith")==0) { g_free(yyvsp[-1].id); destructor = yyvsp[0].id; - destructor_line = ccode_line; + destructor_line = line_no; destructor_simple = TRUE; } else { g_free(yyvsp[-1].id); @@ -1422,7 +1422,7 @@ case 38: #line 456 "parse.y" { Node *node; - char *get, *set; + char *get, *set = NULL; Variable *var; Type *type; char *root; diff --git a/src/parse.y b/src/parse.y index d0b56fe..e204c62 100644 --- a/src/parse.y +++ b/src/parse.y @@ -73,17 +73,17 @@ yyerror(char *str) if(strcmp(yytext,"\n")==0) { out=g_strconcat("Error: ",str," before newline",NULL); } else if(yytext[0]=='\0') { - out=g_strconcat("Error: ",str," at end of input",NULL); + out=g_strconcat("Error: ", str, " at end of input", NULL); } else { char *tmp = g_strdup(yytext); - while((p=strchr(tmp,'\n'))) + while((p=strchr(tmp, '\n'))) *p='.'; - out=g_strconcat("Error: ",str," before '",tmp,"'",NULL); + out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL); g_free(tmp); } - fprintf(stderr,"%s:%d: %s\n",filename,line_no,out); + fprintf(stderr, "%s:%d: %s\n", filename, line_no, out); g_free(out); exit(1); @@ -137,7 +137,7 @@ push_function(int scope, int method, char *oid, char *id, char *onerror, strcmp(gtktypes->next->data,"NONE")==0)) { print_error(TRUE, _("The number of GTK arguments and " "function arguments for a signal " - "don't seem to match"),line_no); + "don't seem to match"), line_no); } if(cbuf) { char *p; @@ -336,7 +336,7 @@ destructor: TOKEN TOKEN { if(strcmp($1, "destroywith")==0) { g_free($1); destructor = $2; - destructor_line = ccode_line; + destructor_line = line_no; destructor_simple = TRUE; } else { g_free($1); @@ -455,7 +455,7 @@ argument: ARGUMENT flags argtype TOKEN TOKEN '{' CCODE TOKEN '{' CCODE ';' { } | ARGUMENT flags argtype TOKEN TOKEN { Node *node; - char *get, *set; + char *get, *set = NULL; Variable *var; Type *type; char *root; diff --git a/src/tree.h b/src/tree.h index 66d1819..91fae23 100644 --- a/src/tree.h +++ b/src/tree.h @@ -116,7 +116,7 @@ enum { NO_SCOPE, PUBLIC_SCOPE, PRIVATE_SCOPE, - PROTECTED_SCOPE, + PROTECTED_SCOPE }; /* method type */ diff --git a/src/util.c b/src/util.c index 2eda8b0..a6cff4e 100644 --- a/src/util.c +++ b/src/util.c @@ -24,12 +24,13 @@ #include #include +#include "tree.h" #include "main.h" #include "util.h" void -print_error(int is_warn, char *error,int line) +print_error(gboolean is_warn, char *error, int line) { char *w; if(is_warn) @@ -39,9 +40,9 @@ print_error(int is_warn, char *error,int line) got_error = TRUE; } if(line>0) - fprintf(stderr,"%s:%d: %s %s\n",filename,line,w,error); + fprintf(stderr, "%s:%d: %s %s\n", filename, line, w, error); else - fprintf(stderr,"%s: %s %s\n",filename,w,error); + fprintf(stderr, "%s: %s %s\n", filename, w, error); if((!is_warn || exit_on_warn) && exit_on_error) exit(1); } @@ -120,48 +121,119 @@ make_pre_macro(char *base, char *pre) /* here we will find out how inconsistent gtk really is :) */ /* the commented out types mean that these types don't actually exist. so we "emulate them" with an equivalent */ -const struct { +typedef struct _OurGtkType OurGtkType; +struct _OurGtkType { gboolean simple; char *gtkname; char *typename; -} our_gtk_type_table[] = { - { TRUE, "NONE", "void " }, - { TRUE, "CHAR", "gchar " }, - { TRUE, "UCHAR", "guchar " }, - { TRUE, "BOOL", "gboolean " }, - { TRUE, "INT", "gint " }, - { TRUE, "UINT", "guint " }, - { TRUE, "LONG", "glong " }, - { TRUE, "ULONG", "gulong " }, - { TRUE, "FLOAT", "gfloat " }, - { TRUE, "DOUBLE", "gdouble " }, - { TRUE, "STRING", /*"GtkString"*/"gchar *" }, - { TRUE, "ENUM", /*"GtkEnum"*/"gint " }, - { TRUE, "FLAGS", /*"GtkFlags"*/"guint " }, - { TRUE, "BOXED", /*"GtkBoxed"*/"gpointer " }, - { TRUE, "POINTER", "gpointer " }, - { TRUE, "OBJECT", "GtkObject *" }, - { FALSE, "SIGNAL", /*"GtkSignal"*/"___twopointertype " }, - { FALSE, "ARGS", /*"GtkArgs"*/"___twopointertype " }, - { FALSE, "CALLBACK", /*"GtkCallback"*/"___threepointertype " }, - { FALSE, "C_CALLBACK", /*"GtkCCallback"*/"___twopointertype " }, - { FALSE, "FOREIGN", /*"GtkForeign"*/"___twopointertype " }, + int special; +}; +const OurGtkType our_gtk_type_table[] = { + { TRUE, "NONE", "void ", -1 }, + { TRUE, "CHAR", "gchar ", -1 }, + { TRUE, "UCHAR", "guchar ", -1 }, + { TRUE, "BOOL", "gboolean ", -1 }, + { TRUE, "INT", "gint ", -1 }, + { TRUE, "UINT", "guint ", -1 }, + { TRUE, "LONG", "glong ", -1 }, + { TRUE, "ULONG", "gulong ", -1 }, + { TRUE, "FLOAT", "gfloat ", -1 }, + { TRUE, "DOUBLE", "gdouble ", -1 }, + { TRUE, "STRING", /*"GtkString"*/"gchar *", -1 }, + { TRUE, "ENUM", /*"GtkEnum"*/"gint ", -1 }, + { TRUE, "FLAGS", /*"GtkFlags"*/"guint ", -1 }, + { TRUE, "BOXED", /*"GtkBoxed"*/"gpointer ", -1 }, + { TRUE, "POINTER", "gpointer ", -1 }, + { TRUE, "OBJECT", "GtkObject *", -1 }, + { FALSE, "SIGNAL", /*"GtkSignal"*/"___twopointertype ", + SPECIAL_2POINTER }, + { FALSE, "ARGS", /*"GtkArgs"*/"___intpointertype ", + SPECIAL_INT_POINTER }, + { FALSE, "CALLBACK", /*"GtkCallback"*/"___threepointertype ", + SPECIAL_3POINTER }, + { FALSE, "C_CALLBACK", /*"GtkCCallback"*/"___twopointertype ", + SPECIAL_2POINTER }, + { FALSE, "FOREIGN", /*"GtkForeign"*/"___twopointertype ", + SPECIAL_2POINTER }, { FALSE, NULL, NULL } }; +static GHashTable *type_hash = NULL; + +static void +init_type_hash(void) +{ + int i; + + if(type_hash) return; + + type_hash = g_hash_table_new(g_str_hash, g_str_equal); + + for(i=0; our_gtk_type_table[i].gtkname; i++) + g_hash_table_insert(type_hash, + our_gtk_type_table[i].gtkname, + (gpointer)&our_gtk_type_table[i]); +} + const char * get_cast(char *type, gboolean simple_only) { - int i; - for(i=0;our_gtk_type_table[i].gtkname;i++) { - if(strcmp(our_gtk_type_table[i].gtkname,type)==0) { - if(simple_only && - !our_gtk_type_table[i].simple) - return NULL; - return our_gtk_type_table[i].typename; - } + OurGtkType *gtype; + + init_type_hash(); + + gtype = g_hash_table_lookup(type_hash, type); + + if(!gtype || + (simple_only && + !gtype->simple)) + return NULL; + + return gtype->typename; +} + +static void +mask_special_array(char *type, gboolean *special_array, gboolean *any_special) +{ + OurGtkType *gtype; + + init_type_hash(); + + gtype = g_hash_table_lookup(type_hash, type); + + if(gtype && gtype->special >= 0) { + special_array[gtype->special] = TRUE; + *any_special = TRUE; } - return NULL; } +gboolean +setup_special_array(Class *c, gboolean *special_array) +{ + GList *li; + gboolean any_special = FALSE; + + memset(special_array, 0, sizeof(gboolean)*SPECIAL_LAST); + + for(li=c->nodes; li; li=g_list_next(li)) { + Node *n = li->data; + if(n->type == METHOD_NODE) { + Method *m = (Method *)n; + GList *l; + if(m->method != SIGNAL_LAST_METHOD && + m->method != SIGNAL_FIRST_METHOD) + continue; + + for(l=m->gtktypes; l; l=l->next) + mask_special_array(l->data, special_array, + &any_special); + } else if(n->type == ARGUMENT_NODE) { + Argument *a = (Argument *)n; + mask_special_array(a->gtktype, special_array, + &any_special); + } + } + + return any_special; +} diff --git a/src/util.h b/src/util.h index 9d0d0cb..8e84318 100644 --- a/src/util.h +++ b/src/util.h @@ -23,7 +23,7 @@ #define _UTIL_H_ /* print an error, or warning (if 'is_warn') referring to 'line' */ -void print_error(int is_warn, char *error, int line); +void print_error(gboolean is_warn, char *error, int line); /* remove the : separator from a typename */ char * remove_sep(char *base); @@ -41,5 +41,14 @@ char * make_pre_macro(char *base, char *pre); /* get a name usable for a cast from a GTK+ type (without GTK_TYPE_)*/ const char * get_cast(char *type, gboolean simple_only); +enum { + SPECIAL_2POINTER, + SPECIAL_3POINTER, + SPECIAL_INT_POINTER, + SPECIAL_LAST +}; +/* returns TRUE if there are any special types at all */ +gboolean setup_special_array(Class *c, gboolean *special_array); + #endif -- 2.43.0