1 /* A Bison parser, made by GNU Bison 1.875c. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
115 #define THREEDOTS 265
126 #define TYPETOKEN 276
127 #define ARRAY_DIM 277
128 #define SINGLE_CHAR 278
138 #define PROTECTED 288
139 #define CLASSWIDE 289
149 #define DEFAULT_VALUE 299
153 #define FLAGS_TYPE 303
154 #define ENUM_TYPE 304
155 #define PARAM_TYPE 305
156 #define BOXED_TYPE 306
157 #define OBJECT_TYPE 307
162 /* Copy the first part of user declarations. */
172 #include "treefuncs.h"
176 /* FIXME: add gettext support */
181 static GList *class_nodes = NULL;
184 static GList *enum_vals = NULL;
185 static GList *flag_vals = NULL;
186 static GList *error_vals = NULL;
188 static char *chunk_size = NULL;
189 static char *bonobo_object_class = NULL;
190 static GList *interfaces = NULL;
191 static GList *typestack = NULL;
192 static GList *funcargs = NULL;
193 static GList *checks = NULL;
194 static int has_self = FALSE;
195 static int vararg = FALSE;
196 static Method *last_added_method = NULL;
198 /* destructor and initializer for variables */
199 static gboolean destructor_unref = FALSE;
200 static char *destructor = NULL;
201 static int destructor_line = 0;
202 static gboolean destructor_simple = TRUE;
203 static char *initializer = NULL;
204 static int initializer_line = 0;
206 static char *onerror = NULL;
207 static char *defreturn = NULL;
209 static GList *gtktypes = NULL;
211 static Property *property = NULL;
213 /* this can be a global as we will only do one function at a time
215 static int the_scope = NO_SCOPE;
217 void free(void *ptr);
220 extern int ccode_line;
222 extern gboolean for_cpp;
232 if(strcmp(yytext,"\n")==0) {
233 out=g_strconcat("Error: ",str," before newline",NULL);
234 } else if(yytext[0]=='\0') {
235 out=g_strconcat("Error: ", str, " at end of input", NULL);
237 char *tmp = g_strdup(yytext);
238 while((p=strchr(tmp, '\n')))
241 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
245 fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
254 Type *type = typestack->data;
255 typestack = g_list_remove(typestack,typestack->data);
260 push_variable (char *name, int scope, int line_no, char *postfix)
263 Type *type = pop_type ();
265 type->postfix = postfix;
267 var = node_new (VARIABLE_NODE,
272 "destructor_unref", destructor_unref,
273 "destructor:steal", destructor,
274 "destructor_line", destructor_line,
275 "destructor_simple", destructor_simple,
276 "initializer:steal", initializer,
277 "initializer_line", initializer_line,
279 class_nodes = g_list_append(class_nodes, var);
283 push_function (int scope, int method, char *oid, char *id,
284 GString *cbuf, int line_no, int ccode_line,
285 gboolean vararg, GList *flags)
291 g_assert(scope != CLASS_SCOPE);
293 if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
294 type = (Type *)node_new (TYPE_NODE,
301 /* a complicated and ugly test to figure out if we have
302 the wrong number of types for a signal */
303 if((method == SIGNAL_FIRST_METHOD ||
304 method == SIGNAL_LAST_METHOD) &&
305 g_list_length(gtktypes) != g_list_length(funcargs) &&
306 !(g_list_length(funcargs) == 1 &&
307 g_list_length(gtktypes) == 2 &&
308 strcmp(gtktypes->next->data, "NONE")==0)) {
309 error_print(GOB_WARN, line_no,
310 _("The number of GTK arguments and "
311 "function arguments for a signal "
312 "don't seem to match"));
314 if(g_list_length(gtktypes) > 2) {
316 for(li = gtktypes->next; li; li = li->next) {
317 if(strcmp(li->data, "NONE")==0) {
318 error_print(GOB_ERROR, line_no,
319 _("NONE can only appear in an "
320 "argument list by itself"));
326 c_cbuf = p = cbuf->str;
327 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
334 node = node_new (METHOD_NODE,
339 "gtktypes:steal", gtktypes,
340 "flags:steal", flags,
342 "args:steal", funcargs,
343 "onerror:steal", onerror,
344 "defreturn:steal", defreturn,
345 "cbuf:steal", c_cbuf,
347 "ccode_line", ccode_line,
349 "unique_id", method_unique_id++,
352 last_added_method = (Method *)node;
356 /*only free segment if we haven't passed it
365 class_nodes = g_list_append(class_nodes, node);
369 free_all_global_state(void)
379 g_list_foreach(gtktypes, (GFunc)g_free, NULL);
380 g_list_free(gtktypes);
383 node_list_free (funcargs);
388 push_funcarg(char *name, char *postfix)
391 Type *type = pop_type();
393 type->postfix = postfix;
395 node = node_new (FUNCARG_NODE,
398 "checks:steal", checks,
402 funcargs = g_list_append(funcargs, node);
406 push_init_arg(char *name, int is_class)
413 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
415 tn = g_strdup(((Class *)class)->otype);
417 type = node_new (TYPE_NODE,
421 node = node_new (FUNCARG_NODE,
422 "atype:steal", (Type *)type,
425 funcargs = g_list_prepend(funcargs, node);
429 push_self(char *id, gboolean constant)
434 type = node_new (TYPE_NODE,
435 "name", ((Class *)class)->otype,
436 "pointer", constant ? "const *" : "*",
438 ch = g_list_append (ch, node_new (CHECK_NODE,
439 "chtype", NULL_CHECK,
441 ch = g_list_append (ch, node_new (CHECK_NODE,
442 "chtype", TYPE_CHECK,
444 node = node_new (FUNCARG_NODE,
445 "atype:steal", (Type *)type,
449 funcargs = g_list_prepend(funcargs, node);
453 find_var_or_die(const char *id, int line)
457 for(li = class_nodes; li != NULL; li = li->next) {
459 Node *node = li->data;
460 if(node->type != VARIABLE_NODE)
463 if(strcmp(var->id, id)==0)
467 error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
469 g_assert_not_reached();
474 set_return_value(char *type, char *val)
476 if(strcmp(type, "onerror")==0) {
482 } else if(strcmp(type, "defreturn")==0) {
493 export_accessors (const char *var_name,
505 the_type = (Type *)node_copy ((Node *)type);
507 the_type = get_tree_type (gtktype, TRUE);
509 if (the_type == NULL) {
510 error_print (GOB_ERROR, line_no,
511 _("Cannot determine type of property or argument"));
516 char *get_id = g_strdup_printf ("get_%s", var_name);
517 GString *get_cbuf = g_string_new (NULL);
518 Node *node1 = node_new (TYPE_NODE,
519 "name", the_type->name,
520 "pointer", the_type->pointer,
521 "postfix", the_type->postfix,
523 Node *node3 = node_new (TYPE_NODE,
524 "name", class->class.otype,
528 g_string_sprintf (get_cbuf,
530 "g_object_get (G_OBJECT (self), \"%s\", "
534 the_type->pointer ? the_type->pointer : "",
537 typestack = g_list_prepend (typestack, node1);
538 typestack = g_list_prepend (typestack, node3);
540 push_funcarg ("self", FALSE);
542 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
543 get_id, get_cbuf, get_lineno,
544 lineno, FALSE, NULL);
548 char *set_id = g_strdup_printf ("set_%s", var_name);
549 GString *set_cbuf = g_string_new (NULL);
550 Node *node1 = node_new (TYPE_NODE,
551 "name", the_type->name,
552 "pointer", the_type->pointer,
553 "postfix", the_type->postfix,
555 Node *node2 = node_new (TYPE_NODE,
558 Node *node3 = node_new (TYPE_NODE,
559 "name", class->class.otype,
563 g_string_sprintf (set_cbuf,
564 "\tg_object_set (G_OBJECT (self), "
565 "\"%s\", val, NULL);\n",
568 typestack = g_list_prepend (typestack, node2);
569 typestack = g_list_prepend (typestack, node1);
570 typestack = g_list_prepend (typestack, node3);
572 push_funcarg ("self", FALSE);
573 push_funcarg ("val", FALSE);
575 typestack = g_list_prepend (typestack, node2);
576 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
577 set_id, set_cbuf, set_lineno,
578 lineno, FALSE, NULL);
581 node_free ((Node *)the_type);
585 get_prop_enum_flag_cast (Property *prop)
588 if (prop->extra_gtktype == NULL ||
589 /* HACK! just in case someone made this
590 * work with 2.0.0 by using the TYPE
592 ((strstr (prop->extra_gtktype, "_TYPE_") != NULL ||
593 strstr (prop->extra_gtktype, "TYPE_") == prop->extra_gtktype) &&
594 strchr (prop->extra_gtktype, ':') == NULL)) {
595 if (prop->ptype != NULL)
596 return get_type (prop->ptype, TRUE);
598 return g_strdup ("");
600 tmp = remove_sep (prop->extra_gtktype);
601 ret = g_strdup_printf ("(%s) ", tmp);
607 property_link_and_export (Node *node)
609 Property *prop = (Property *)node;
613 char *get = NULL, *set = NULL;
616 if (prop->set != NULL ||
618 error_print (GOB_ERROR, prop->line_no,
619 _("Property linking requested, but "
620 "getters and setters exist"));
623 var = find_var_or_die (prop->name, prop->line_no);
624 if(var->scope == PRIVATE_SCOPE) {
625 root = "self->_priv";
626 } else if (var->scope == CLASS_SCOPE) {
627 root = "SELF_GET_CLASS(self)";
629 error_print (GOB_ERROR, prop->line_no,
630 _("Self aliases needed when autolinking to a classwide member"));
635 if (strcmp (prop->gtktype, "STRING") == 0) {
636 set = g_strdup_printf("{ char *old = %s->%s; "
637 "%s->%s = g_value_dup_string (VAL); g_free (old); }",
640 get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
642 } else if (strcmp (prop->gtktype, "OBJECT") == 0) {
644 if (prop->extra_gtktype != NULL) {
645 cast = remove_sep (prop->extra_gtktype);
647 cast = g_strdup ("void");
649 set = g_strdup_printf("{ GObject *___old = (GObject *)%s->%s; "
650 "%s->%s = (%s *)g_value_dup_object (VAL); "
651 "if (___old != NULL) { "
652 "g_object_unref (G_OBJECT (___old)); "
658 get = g_strdup_printf ("g_value_set_object (VAL, "
659 "(gpointer)%s->%s);",
662 } else if (strcmp (prop->gtktype, "BOXED") == 0) {
663 char *type = make_me_type (prop->extra_gtktype,
665 if (prop->extra_gtktype == NULL) {
666 error_print (GOB_ERROR, prop->line_no,
667 _("Property linking requested for BOXED, but "
668 "boxed_type not set"));
670 set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
671 "gpointer ___new = (gpointer)g_value_get_boxed (VAL); "
672 "if (___new != ___old) { "
673 "if (___old != NULL) g_boxed_free (%s, ___old); "
674 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
675 "else %s->%s = NULL;"
683 get = g_strdup_printf("g_value_set_boxed (VAL, %s->%s);",
689 const char *getcast = "";
690 const char *setcast = "";
691 char *to_free = NULL;
692 set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
693 g_strdown (set_func);
694 get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
695 g_strdown (get_func);
698 if (strcmp (prop->gtktype, "FLAGS") == 0) {
699 setcast = "(guint) ";
701 get_prop_enum_flag_cast (prop);
702 } else if (strcmp (prop->gtktype, "ENUM") == 0) {
705 get_prop_enum_flag_cast (prop);
706 } else if (strcmp (prop->gtktype, "POINTER") == 0) {
707 setcast = "(gpointer) ";
708 getcast = g_strdup_printf ("(%s%s) ",
710 prop->ptype->pointer ? prop->ptype->pointer : "");
714 set = g_strdup_printf("%s->%s = %s%s (VAL);",
718 get = g_strdup_printf("%s (VAL, %s%s->%s);",
730 "get_line", prop->line_no,
732 "set_line", prop->line_no,
737 export_accessors (prop->name,
738 prop->get != NULL, prop->get_line,
739 prop->set != NULL, prop->set_line,
750 if (strcmp (s, "BOOL") == 0) {
751 error_print (GOB_WARN, line_no,
752 _("BOOL type is deprecated, please use BOOLEAN"));
754 return g_strdup ("BOOLEAN");
761 ensure_property (void)
763 if (property == NULL)
764 property = (Property *)node_new (PROPERTY_NODE, NULL);
769 /* Enabling traces. */
774 /* Enabling verbose error messages. */
775 #ifdef YYERROR_VERBOSE
776 # undef YYERROR_VERBOSE
777 # define YYERROR_VERBOSE 1
779 # define YYERROR_VERBOSE 0
782 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
784 typedef union YYSTYPE {
791 /* Line 191 of yacc.c. */
793 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
794 # define YYSTYPE_IS_DECLARED 1
795 # define YYSTYPE_IS_TRIVIAL 1
800 /* Copy the second part of user declarations. */
803 /* Line 214 of yacc.c. */
806 #if ! defined (yyoverflow) || YYERROR_VERBOSE
812 # define YYMALLOC malloc
815 /* The parser invokes alloca or malloc; define the necessary symbols. */
817 # ifdef YYSTACK_USE_ALLOCA
818 # if YYSTACK_USE_ALLOCA
819 # define YYSTACK_ALLOC alloca
822 # if defined (alloca) || defined (_ALLOCA_H)
823 # define YYSTACK_ALLOC alloca
826 # define YYSTACK_ALLOC __builtin_alloca
831 # ifdef YYSTACK_ALLOC
832 /* Pacify GCC's `empty if-body' warning. */
833 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
835 # if defined (__STDC__) || defined (__cplusplus)
836 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
837 # define YYSIZE_T size_t
839 # define YYSTACK_ALLOC YYMALLOC
840 # define YYSTACK_FREE YYFREE
842 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
845 #if (! defined (yyoverflow) \
846 && (! defined (__cplusplus) \
847 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
849 /* A type that is properly aligned for any stack member. */
856 /* The size of the maximum gap between one aligned stack and the next. */
857 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
859 /* The size of an array large to enough to hold all stacks, each with
861 # define YYSTACK_BYTES(N) \
862 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
863 + YYSTACK_GAP_MAXIMUM)
865 /* Copy COUNT objects from FROM to TO. The source and destination do
868 # if defined (__GNUC__) && 1 < __GNUC__
869 # define YYCOPY(To, From, Count) \
870 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
872 # define YYCOPY(To, From, Count) \
875 register YYSIZE_T yyi; \
876 for (yyi = 0; yyi < (Count); yyi++) \
877 (To)[yyi] = (From)[yyi]; \
883 /* Relocate STACK from its old location to the new one. The
884 local variables YYSIZE and YYSTACKSIZE give the old and new number of
885 elements in the stack, and YYPTR gives the new location of the
886 stack. Advance YYPTR to a properly aligned location for the next
888 # define YYSTACK_RELOCATE(Stack) \
891 YYSIZE_T yynewbytes; \
892 YYCOPY (&yyptr->Stack, Stack, yysize); \
893 Stack = &yyptr->Stack; \
894 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
895 yyptr += yynewbytes / sizeof (*yyptr); \
901 #if defined (__STDC__) || defined (__cplusplus)
902 typedef signed char yysigned_char;
904 typedef short yysigned_char;
907 /* YYFINAL -- State number of the termination state. */
909 /* YYLAST -- Last index in YYTABLE. */
912 /* YYNTOKENS -- Number of terminals. */
914 /* YYNNTS -- Number of nonterminals. */
916 /* YYNRULES -- Number of rules. */
918 /* YYNRULES -- Number of states. */
919 #define YYNSTATES 398
921 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
923 #define YYMAXUTOK 307
925 #define YYTRANSLATE(YYX) \
926 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
928 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
929 static const unsigned char yytranslate[] =
931 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
932 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
933 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
934 2, 2, 2, 64, 2, 2, 2, 2, 2, 2,
935 55, 56, 61, 2, 59, 65, 2, 2, 2, 2,
936 2, 2, 2, 2, 2, 2, 2, 2, 2, 57,
937 63, 58, 62, 2, 2, 2, 2, 2, 2, 2,
938 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
939 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
940 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
941 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
942 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
943 2, 2, 2, 53, 60, 54, 2, 2, 2, 2,
944 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
945 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
946 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
947 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
948 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
949 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
950 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
951 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
952 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
953 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
954 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
955 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
956 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
957 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
958 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
959 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
960 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
961 45, 46, 47, 48, 49, 50, 51, 52
965 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
967 static const unsigned short yyprhs[] =
969 0, 0, 3, 7, 10, 13, 15, 17, 19, 21,
970 23, 25, 27, 30, 33, 36, 39, 41, 43, 45,
971 47, 52, 56, 62, 63, 69, 75, 81, 84, 86,
972 88, 91, 95, 97, 99, 101, 103, 105, 107, 109,
973 111, 114, 118, 121, 125, 128, 131, 133, 135, 136,
974 142, 149, 162, 172, 179, 183, 184, 196, 205, 211,
975 215, 216, 220, 222, 224, 229, 231, 233, 237, 241,
976 245, 249, 253, 257, 261, 265, 269, 273, 277, 281,
977 285, 289, 293, 297, 301, 303, 309, 311, 315, 316,
978 320, 322, 325, 327, 329, 331, 334, 337, 340, 344,
979 348, 351, 354, 357, 359, 362, 364, 367, 369, 371,
980 373, 375, 377, 379, 381, 383, 385, 387, 389, 391,
981 393, 396, 399, 403, 406, 408, 412, 416, 419, 421,
982 426, 430, 432, 435, 437, 448, 460, 470, 480, 489,
983 501, 510, 516, 519, 524, 525, 527, 530, 532, 534,
984 537, 540, 544, 549, 554, 556, 560, 562, 566, 568,
985 571, 575, 582, 590, 593, 595, 597, 600, 603, 607,
986 611, 615, 619, 627, 636, 640, 642, 646, 648, 656,
987 665, 669, 671, 679, 688, 692, 694, 696, 699, 701
990 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
991 static const yysigned_char yyrhs[] =
993 67, 0, -1, 69, 70, 69, -1, 70, 69, -1,
994 69, 70, -1, 70, -1, 24, -1, 27, -1, 25,
995 -1, 26, -1, 28, -1, 29, -1, 69, 68, -1,
996 69, 111, -1, 69, 114, -1, 69, 116, -1, 68,
997 -1, 111, -1, 114, -1, 116, -1, 71, 53, 73,
998 54, -1, 71, 53, 54, -1, 3, 21, 4, 21,
999 72, -1, -1, 55, 19, 19, 56, 72, -1, 55,
1000 19, 21, 56, 72, -1, 55, 19, 20, 56, 72,
1001 -1, 73, 74, -1, 74, -1, 102, -1, 19, 102,
1002 -1, 19, 21, 102, -1, 79, -1, 80, -1, 82,
1003 -1, 57, -1, 31, -1, 32, -1, 33, -1, 34,
1004 -1, 19, 19, -1, 19, 53, 24, -1, 58, 118,
1005 -1, 58, 53, 24, -1, 76, 77, -1, 77, 76,
1006 -1, 77, -1, 76, -1, -1, 75, 91, 19, 78,
1007 57, -1, 75, 91, 19, 22, 78, 57, -1, 36,
1008 89, 88, 19, 81, 19, 53, 24, 19, 53, 24,
1009 57, -1, 36, 89, 88, 19, 81, 19, 53, 24,
1010 57, -1, 36, 89, 88, 19, 81, 19, -1, 55,
1011 19, 56, -1, -1, 35, 19, 19, 83, 19, 53,
1012 24, 19, 53, 24, 57, -1, 35, 19, 19, 83,
1013 19, 53, 24, 57, -1, 35, 19, 19, 83, 57,
1014 -1, 55, 84, 56, -1, -1, 84, 59, 87, -1,
1015 87, -1, 30, -1, 19, 55, 30, 56, -1, 118,
1016 -1, 85, -1, 40, 58, 85, -1, 41, 58, 85,
1017 -1, 42, 58, 118, -1, 43, 58, 118, -1, 44,
1018 58, 86, -1, 46, 58, 90, -1, 47, 58, 91,
1019 -1, 48, 58, 21, -1, 48, 58, 19, -1, 49,
1020 58, 21, -1, 49, 58, 19, -1, 50, 58, 21,
1021 -1, 50, 58, 19, -1, 51, 58, 21, -1, 51,
1022 58, 19, -1, 52, 58, 21, -1, 52, 58, 19,
1023 -1, 19, -1, 19, 55, 19, 91, 56, -1, 19,
1024 -1, 55, 90, 56, -1, -1, 19, 60, 90, -1,
1025 19, -1, 92, 96, -1, 92, -1, 93, -1, 19,
1026 -1, 5, 19, -1, 19, 5, -1, 95, 19, -1,
1027 5, 95, 19, -1, 95, 19, 5, -1, 94, 93,
1028 -1, 21, 93, -1, 5, 93, -1, 21, -1, 21,
1029 5, -1, 94, -1, 94, 5, -1, 6, -1, 18,
1030 -1, 14, -1, 15, -1, 13, -1, 16, -1, 17,
1031 -1, 11, -1, 12, -1, 7, -1, 8, -1, 9,
1032 -1, 61, -1, 61, 5, -1, 61, 96, -1, 61,
1033 5, 96, -1, 19, 99, -1, 99, -1, 75, 19,
1034 99, -1, 19, 75, 99, -1, 75, 99, -1, 97,
1035 -1, 19, 55, 100, 56, -1, 100, 59, 19, -1,
1036 19, -1, 53, 24, -1, 57, -1, 38, 89, 98,
1037 91, 19, 55, 105, 56, 103, 101, -1, 75, 38,
1038 89, 97, 91, 19, 55, 105, 56, 103, 101, -1,
1039 37, 75, 91, 19, 55, 105, 56, 103, 101, -1,
1040 75, 37, 91, 19, 55, 105, 56, 103, 101, -1,
1041 37, 91, 19, 55, 105, 56, 103, 101, -1, 39,
1042 55, 21, 56, 91, 19, 55, 105, 56, 103, 101,
1043 -1, 75, 91, 19, 55, 105, 56, 103, 101, -1,
1044 19, 55, 19, 56, 101, -1, 19, 104, -1, 19,
1045 104, 19, 104, -1, -1, 118, -1, 53, 24, -1,
1046 6, -1, 19, -1, 19, 5, -1, 5, 19, -1,
1047 19, 59, 106, -1, 19, 5, 59, 106, -1, 5,
1048 19, 59, 106, -1, 106, -1, 107, 59, 10, -1,
1049 107, -1, 107, 59, 108, -1, 108, -1, 91, 19,
1050 -1, 91, 19, 22, -1, 91, 19, 55, 19, 109,
1051 56, -1, 91, 19, 22, 55, 19, 109, 56, -1,
1052 109, 110, -1, 110, -1, 19, -1, 62, 118, -1,
1053 63, 118, -1, 62, 58, 118, -1, 63, 58, 118,
1054 -1, 58, 58, 118, -1, 64, 58, 118, -1, 9,
1055 19, 53, 112, 54, 21, 57, -1, 9, 19, 53,
1056 112, 59, 54, 21, 57, -1, 112, 59, 113, -1,
1057 113, -1, 19, 58, 118, -1, 19, -1, 46, 19,
1058 53, 115, 54, 21, 57, -1, 46, 19, 53, 115,
1059 59, 54, 21, 57, -1, 115, 59, 19, -1, 19,
1060 -1, 45, 19, 53, 117, 54, 21, 57, -1, 45,
1061 19, 53, 117, 59, 54, 21, 57, -1, 117, 59,
1062 19, -1, 19, -1, 20, -1, 65, 20, -1, 23,
1066 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1067 static const unsigned short yyrline[] =
1069 0, 649, 649, 650, 651, 652, 655, 664, 673, 682,
1070 691, 700, 711, 712, 713, 714, 715, 716, 717, 718,
1071 721, 726, 733, 747, 748, 760, 769, 783, 784, 787,
1072 788, 797, 809, 810, 811, 812, 815, 816, 817, 818,
1073 821, 841, 865, 869, 877, 878, 879, 880, 881, 887,
1074 890, 895, 963, 1017, 1106, 1114, 1119, 1167, 1203, 1219,
1075 1220, 1223, 1224, 1227, 1228, 1240, 1241, 1244, 1250, 1256,
1076 1262, 1268, 1274, 1280, 1287, 1293, 1299, 1305, 1311, 1317,
1077 1323, 1329, 1335, 1341, 1347, 1372, 1381, 1387, 1388, 1391,
1078 1394, 1400, 1407, 1416, 1419, 1422, 1426, 1430, 1434, 1439,
1079 1447, 1451, 1456, 1460, 1463, 1467, 1470, 1475, 1476, 1477,
1080 1478, 1479, 1480, 1481, 1482, 1483, 1486, 1487, 1488, 1491,
1081 1492, 1493, 1497, 1504, 1516, 1522, 1534, 1546, 1549, 1555,
1082 1560, 1563, 1568, 1569, 1573, 1589, 1605, 1621, 1637, 1648,
1083 1654, 1664, 1687, 1698, 1717, 1723, 1724, 1730, 1731, 1742,
1084 1753, 1764, 1774, 1784, 1794, 1797, 1798, 1801, 1802, 1805,
1085 1808, 1811, 1819, 1829, 1830, 1833, 1850, 1857, 1864, 1871,
1086 1878, 1885, 1894, 1903, 1914, 1915, 1918, 1938, 1948, 1957,
1087 1968, 1971, 1976, 1985, 1996, 1999, 2005, 2006, 2010, 2011
1091 #if YYDEBUG || YYERROR_VERBOSE
1092 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1093 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1094 static const char *const yytname[] =
1096 "$end", "error", "$undefined", "CLASS", "FROM", "CONST", "VOID",
1097 "STRUCT", "UNION", "ENUM", "THREEDOTS", "SIGNED", "UNSIGNED", "LONG",
1098 "SHORT", "INT", "FLOAT", "DOUBLE", "CHAR", "TOKEN", "NUMBER",
1099 "TYPETOKEN", "ARRAY_DIM", "SINGLE_CHAR", "CCODE", "HTCODE", "PHCODE",
1100 "HCODE", "ACODE", "ATCODE", "STRING", "PUBLIC", "PRIVATE", "PROTECTED",
1101 "CLASSWIDE", "PROPERTY", "ARGUMENT", "VIRTUAL", "SIGNAL", "OVERRIDE",
1102 "NICK", "BLURB", "MAXIMUM", "MINIMUM", "DEFAULT_VALUE", "ERROR", "FLAGS",
1103 "TYPE", "FLAGS_TYPE", "ENUM_TYPE", "PARAM_TYPE", "BOXED_TYPE",
1104 "OBJECT_TYPE", "'{'", "'}'", "'('", "')'", "';'", "'='", "','", "'|'",
1105 "'*'", "'>'", "'<'", "'!'", "'-'", "$accept", "prog", "ccode", "ccodes",
1106 "class", "classdec", "classflags", "classcode", "thing", "scope",
1107 "destructor", "initializer", "varoptions", "variable", "argument",
1108 "export", "property", "param_spec", "param_spec_list", "string",
1109 "anyval", "param_spec_value", "argtype", "flags", "flaglist", "type",
1110 "specifier_list", "spec_list", "specifier", "strunionenum", "pointer",
1111 "simplesigtype", "fullsigtype", "sigtype", "tokenlist", "codenocode",
1112 "method", "returnvals", "retcode", "funcargs", "arglist", "arglist1",
1113 "arg", "checklist", "check", "enumcode", "enumvals", "enumval",
1114 "flagcode", "flagvals", "errorcode", "errorvals", "numtok", 0
1119 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1121 static const unsigned short yytoknum[] =
1123 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1124 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1125 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1126 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1127 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1128 305, 306, 307, 123, 125, 40, 41, 59, 61, 44,
1129 124, 42, 62, 60, 33, 45
1133 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1134 static const unsigned char yyr1[] =
1136 0, 66, 67, 67, 67, 67, 68, 68, 68, 68,
1137 68, 68, 69, 69, 69, 69, 69, 69, 69, 69,
1138 70, 70, 71, 72, 72, 72, 72, 73, 73, 74,
1139 74, 74, 74, 74, 74, 74, 75, 75, 75, 75,
1140 76, 76, 77, 77, 78, 78, 78, 78, 78, 79,
1141 79, 80, 80, 80, 81, 81, 82, 82, 82, 83,
1142 83, 84, 84, 85, 85, 86, 86, 87, 87, 87,
1143 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
1144 87, 87, 87, 87, 87, 88, 88, 89, 89, 90,
1145 90, 91, 91, 92, 92, 92, 92, 92, 92, 92,
1146 93, 93, 93, 93, 93, 93, 93, 94, 94, 94,
1147 94, 94, 94, 94, 94, 94, 95, 95, 95, 96,
1148 96, 96, 96, 97, 97, 98, 98, 98, 98, 99,
1149 100, 100, 101, 101, 102, 102, 102, 102, 102, 102,
1150 102, 102, 103, 103, 103, 104, 104, 105, 105, 105,
1151 105, 105, 105, 105, 105, 106, 106, 107, 107, 108,
1152 108, 108, 108, 109, 109, 110, 110, 110, 110, 110,
1153 110, 110, 111, 111, 112, 112, 113, 113, 114, 114,
1154 115, 115, 116, 116, 117, 117, 118, 118, 118, 118
1157 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1158 static const unsigned char yyr2[] =
1160 0, 2, 3, 2, 2, 1, 1, 1, 1, 1,
1161 1, 1, 2, 2, 2, 2, 1, 1, 1, 1,
1162 4, 3, 5, 0, 5, 5, 5, 2, 1, 1,
1163 2, 3, 1, 1, 1, 1, 1, 1, 1, 1,
1164 2, 3, 2, 3, 2, 2, 1, 1, 0, 5,
1165 6, 12, 9, 6, 3, 0, 11, 8, 5, 3,
1166 0, 3, 1, 1, 4, 1, 1, 3, 3, 3,
1167 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1168 3, 3, 3, 3, 1, 5, 1, 3, 0, 3,
1169 1, 2, 1, 1, 1, 2, 2, 2, 3, 3,
1170 2, 2, 2, 1, 2, 1, 2, 1, 1, 1,
1171 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1172 2, 2, 3, 2, 1, 3, 3, 2, 1, 4,
1173 3, 1, 2, 1, 10, 11, 9, 9, 8, 11,
1174 8, 5, 2, 4, 0, 1, 2, 1, 1, 2,
1175 2, 3, 4, 4, 1, 3, 1, 3, 1, 2,
1176 3, 6, 7, 2, 1, 1, 2, 2, 3, 3,
1177 3, 3, 7, 8, 3, 1, 3, 1, 7, 8,
1178 3, 1, 7, 8, 3, 1, 1, 2, 1, 1
1181 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1182 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1183 means the default is an error. */
1184 static const unsigned char yydefact[] =
1186 0, 0, 0, 6, 8, 9, 7, 10, 11, 0,
1187 0, 0, 16, 0, 5, 0, 17, 18, 19, 0,
1188 0, 0, 0, 1, 12, 4, 13, 14, 15, 3,
1189 0, 0, 0, 0, 0, 2, 0, 36, 37, 38,
1190 39, 0, 88, 0, 88, 0, 21, 35, 0, 28,
1191 0, 32, 33, 34, 29, 23, 177, 0, 175, 185,
1192 0, 181, 0, 0, 0, 0, 0, 30, 0, 0,
1193 0, 0, 107, 116, 117, 118, 114, 115, 111, 109,
1194 110, 112, 113, 108, 94, 103, 0, 0, 92, 93,
1195 105, 0, 0, 0, 20, 27, 0, 88, 0, 0,
1196 22, 0, 0, 0, 0, 0, 0, 0, 31, 0,
1197 0, 60, 90, 0, 86, 0, 0, 95, 102, 0,
1198 96, 104, 101, 0, 0, 119, 91, 106, 100, 97,
1199 0, 0, 128, 0, 124, 0, 0, 0, 48, 0,
1200 189, 186, 188, 0, 176, 0, 0, 174, 0, 184,
1201 0, 0, 180, 0, 0, 0, 0, 0, 0, 87,
1202 0, 55, 98, 0, 0, 120, 121, 99, 0, 0,
1203 0, 123, 0, 127, 0, 0, 0, 0, 0, 0,
1204 48, 0, 0, 47, 46, 0, 0, 0, 0, 187,
1205 172, 0, 182, 0, 178, 0, 0, 133, 141, 84,
1206 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1207 0, 0, 0, 62, 0, 58, 89, 0, 0, 0,
1208 0, 0, 107, 94, 0, 0, 154, 156, 158, 122,
1209 131, 0, 126, 125, 0, 0, 0, 0, 40, 0,
1210 0, 0, 0, 42, 44, 45, 49, 23, 23, 23,
1211 173, 183, 179, 132, 0, 0, 0, 0, 0, 0,
1212 0, 0, 0, 0, 0, 0, 59, 0, 0, 0,
1213 0, 53, 0, 95, 96, 0, 159, 144, 0, 129,
1214 0, 0, 0, 0, 0, 41, 50, 144, 43, 24,
1215 26, 25, 0, 63, 67, 68, 69, 70, 189, 66,
1216 71, 65, 72, 73, 75, 74, 77, 76, 79, 78,
1217 81, 80, 83, 82, 61, 0, 85, 54, 0, 144,
1218 0, 0, 151, 160, 0, 0, 0, 155, 157, 130,
1219 0, 0, 144, 0, 0, 0, 0, 57, 0, 0,
1220 153, 152, 0, 0, 0, 142, 145, 138, 144, 0,
1221 0, 0, 140, 0, 0, 0, 52, 136, 0, 165,
1222 0, 0, 0, 0, 0, 164, 146, 0, 0, 144,
1223 137, 144, 64, 0, 0, 0, 0, 0, 166, 0,
1224 167, 0, 161, 163, 143, 134, 0, 0, 56, 0,
1225 162, 170, 168, 169, 171, 139, 135, 51
1228 /* YYDEFGOTO[NTERM-NUM]. */
1229 static const short yydefgoto[] =
1231 -1, 11, 12, 13, 14, 15, 100, 48, 49, 50,
1232 183, 184, 185, 51, 52, 219, 53, 157, 212, 294,
1233 300, 213, 115, 70, 113, 224, 88, 89, 90, 91,
1234 126, 132, 133, 134, 231, 198, 54, 326, 345, 225,
1235 226, 227, 228, 364, 365, 16, 57, 58, 17, 62,
1239 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1241 #define YYPACT_NINF -317
1242 static const short yypact[] =
1244 137, 4, 45, -317, -317, -317, -317, -317, -317, 99,
1245 106, 134, -317, 137, 170, 98, -317, -317, -317, 156,
1246 124, 125, 157, -317, -317, 170, -317, -317, -317, 170,
1247 154, 181, 209, 214, 222, 170, 215, -317, -317, -317,
1248 -317, 225, 196, 310, 196, 204, -317, -317, 188, -317,
1249 276, -317, -317, -317, -317, 217, 216, 113, -317, -317,
1250 117, -317, 146, 241, 301, 267, 276, -317, 284, 292,
1251 293, 357, -317, -317, -317, -317, -317, -317, -317, -317,
1252 -317, -317, -317, -317, 325, 425, 374, 317, 299, -317,
1253 439, 318, 231, 346, -317, -317, 374, 196, 358, 365,
1254 -317, 74, 373, 76, 380, 84, 390, 90, -317, 362,
1255 409, 377, 375, 378, 392, 414, 453, -317, -317, 429,
1256 -317, 453, -317, 430, 406, 2, -317, 453, -317, 457,
1257 224, 444, -317, 374, -317, 416, 454, 456, 126, 149,
1258 -317, -317, -317, 458, -317, 419, 459, -317, 420, -317,
1259 460, 422, -317, 461, 70, 428, 258, 21, 292, -317,
1260 465, 431, -317, 432, 391, 299, -317, -317, 433, 466,
1261 470, -317, -6, -317, 471, 374, 436, -6, 374, 26,
1262 0, 391, 7, 434, 474, 437, 440, 441, 442, -317,
1263 -317, 438, -317, 443, -317, 445, 475, -317, -317, -317,
1264 446, 447, 448, 449, 450, 451, 452, 455, 462, 463,
1265 464, 467, 91, -317, 473, -317, -317, 374, 482, 484,
1266 391, 408, 468, 6, 492, 472, -317, 476, -317, -317,
1267 -317, 147, -317, -317, 477, 493, 391, 495, -317, 491,
1268 479, 478, 494, -317, -317, -317, -317, 217, 217, 217,
1269 -317, -317, -317, -317, 1, 1, 74, 74, 9, 292,
1270 374, 218, 219, 247, 248, 252, -317, 258, 499, 481,
1271 483, 480, 485, 153, 158, 374, 94, 497, 340, -317,
1272 498, 391, 487, 488, 490, -317, -317, 497, -317, -317,
1273 -317, -317, 496, -317, -317, -317, -317, -317, 496, -317,
1274 -317, -317, -317, -317, -317, -317, -317, -317, -317, -317,
1275 -317, -317, -317, -317, -317, 47, -317, -317, 503, 497,
1276 374, 374, -317, 500, 510, 27, 70, -317, -317, -317,
1277 501, 391, 497, 391, 70, 489, 505, -317, 54, 70,
1278 -317, -317, 511, 57, 507, 519, -317, -317, 497, 504,
1279 70, 506, -317, 508, 516, 512, -317, -317, 57, -317,
1280 509, 64, 66, 513, 50, -317, -317, 27, 70, 497,
1281 -317, 497, -317, 486, 522, 79, 74, 74, -317, 74,
1282 -317, 74, -317, -317, -317, -317, 70, 70, -317, 502,
1283 -317, -317, -317, -317, -317, -317, -317, -317
1286 /* YYPGOTO[NTERM-NUM]. */
1287 static const short yypgoto[] =
1289 -317, -317, 8, 82, 534, -317, -17, -317, 515, -31,
1290 364, 366, 370, -317, -317, -317, -317, -317, -317, -54,
1291 -317, 285, -317, -29, -154, -42, -317, -68, -317, -62,
1292 -109, 417, -317, -95, -317, -316, -22, -281, 186, -179,
1293 -220, -317, 278, 203, -247, 97, -317, 469, 145, -317,
1297 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1298 positive, shift that token. If negative, reduce the rule which
1299 number is the opposite. If zero, do what YYDEFACT says.
1300 If YYTABLE_NINF, syntax error. */
1301 #define YYTABLE_NINF -151
1302 static const short yytable[] =
1304 144, 87, 241, 118, 216, 66, 334, 165, 98, 119,
1305 347, 274, 86, 168, 67, 92, 166, 122, 352, 179,
1306 292, 24, 128, 357, 110, 19, 140, 141, 298, 141,
1307 142, 293, 142, 66, 370, 171, 173, 24, 339, 293,
1308 214, 272, 108, 24, 123, 238, 140, 141, 118, 169,
1309 142, 350, 385, 118, 136, 322, 229, 283, 182, 118,
1310 242, 131, -148, 125, 20, 275, 336, 368, 137, 359,
1311 395, 396, 143, 355, 143, 232, 359, 233, 215, 239,
1312 344, 243, 171, 140, 141, 140, 141, 142, 386, 142,
1313 387, 174, 143, 140, 141, 56, 29, 142, 359, 170,
1314 340, 341, 330, 149, 337, 302, 382, 35, 360, 152,
1315 26, 356, 361, 362, 363, 360, 323, 383, 21, 361,
1316 362, 363, 377, 196, 379, 22, 26, 197, 383, 143,
1317 146, 143, 26, 235, 23, 390, 237, 360, 150, 143,
1318 1, 361, 362, 363, 153, 179, 2, 266, 180, 324,
1319 267, 30, 349, 118, 351, 296, 297, 301, 27, 119,
1320 31, 3, 4, 5, 6, 7, 8, 102, 186, 187,
1321 188, 104, 103, 36, 27, 269, 105, 32, 33, 2,
1322 27, 181, 9, 10, 182, 37, 38, 39, 40, 41,
1323 42, 43, 44, 45, 3, 4, 5, 6, 7, 8,
1324 106, 295, 55, 279, 299, 107, 280, 36, 46, -150,
1325 34, 47, 320, 28, -149, 9, 10, 321, 303, 37,
1326 38, 39, 40, 41, 42, 43, 44, 45, 56, 28,
1327 289, 290, 291, 59, 63, 28, 64, 304, 306, 305,
1328 307, 61, 94, 168, 68, 47, 37, 38, 39, 40,
1329 130, 69, 43, 44, 45, 37, 38, 39, 40, 93,
1330 378, 380, 37, 38, 39, 40, 308, 310, 309, 311,
1331 65, 312, 99, 313, 101, 391, 392, 199, 393, 169,
1332 394, 71, 72, 73, 74, 75, 109, 76, 77, 78,
1333 79, 80, 81, 82, 83, 84, 65, 85, 200, 201,
1334 202, 203, 204, 111, 205, 206, 207, 208, 209, 210,
1335 211, 112, 114, 96, 97, 71, 72, 73, 74, 75,
1336 63, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1337 120, 85, 37, 38, 39, 40, 124, 129, 43, 44,
1338 45, 37, 38, 39, 40, 71, 72, 73, 74, 75,
1339 327, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1340 125, 85, 116, 72, 73, 74, 75, 135, 76, 77,
1341 78, 79, 80, 81, 82, 83, 117, 138, 85, 71,
1342 72, 73, 74, 75, 139, 76, 77, 78, 79, 80,
1343 81, 82, 83, 84, 145, 85, 221, 222, 73, 74,
1344 75, 148, 76, 77, 78, 79, 80, 81, 82, 83,
1345 223, 151, 85, 116, 72, 73, 74, 75, 154, 76,
1346 77, 78, 79, 80, 81, 82, 83, 273, 155, 85,
1347 121, 72, 156, 161, 159, 158, 76, 77, 78, 79,
1348 80, 81, 82, 83, 127, 72, 85, 160, 162, 163,
1349 76, 77, 78, 79, 80, 81, 82, 83, 116, 72,
1350 85, 164, 167, 172, 76, 77, 78, 79, 80, 81,
1351 82, 83, 175, 176, 85, 177, 190, 192, 189, 194,
1352 191, 193, 195, 181, 217, 230, 218, 220, 169, 168,
1353 234, 236, 182, 179, 246, 250, 247, 248, 249, 253,
1354 251, 270, 252, 271, 254, 255, 256, 257, 258, 259,
1355 260, 276, 282, 261, 284, 285, 325, 329, 288, 353,
1356 262, 263, 264, 315, -147, 265, 268, 338, 277, 343,
1357 358, 366, 281, 318, 287, 278, 286, 316, 367, 317,
1358 373, 319, 331, 388, 332, 333, 389, 25, 245, 244,
1359 240, 335, 314, 384, 178, 342, 328, 348, 354, 397,
1360 369, 375, 371, 95, 372, 374, 0, 376, 0, 0,
1364 static const short yycheck[] =
1366 101, 43, 181, 71, 158, 36, 287, 5, 50, 71,
1367 326, 5, 43, 19, 36, 44, 125, 85, 334, 19,
1368 19, 13, 90, 339, 66, 21, 19, 20, 19, 20,
1369 23, 30, 23, 64, 350, 130, 131, 29, 319, 30,
1370 19, 220, 64, 35, 86, 19, 19, 20, 116, 55,
1371 23, 332, 368, 121, 96, 275, 165, 236, 58, 127,
1372 53, 92, 56, 61, 19, 59, 19, 348, 97, 19,
1373 386, 387, 65, 19, 65, 170, 19, 172, 57, 53,
1374 53, 182, 177, 19, 20, 19, 20, 23, 369, 23,
1375 371, 133, 65, 19, 20, 19, 14, 23, 19, 130,
1376 320, 321, 281, 19, 57, 259, 56, 25, 58, 19,
1377 13, 57, 62, 63, 64, 58, 22, 364, 19, 62,
1378 63, 64, 58, 53, 58, 19, 29, 57, 375, 65,
1379 54, 65, 35, 175, 0, 56, 178, 58, 54, 65,
1380 3, 62, 63, 64, 54, 19, 9, 56, 22, 55,
1381 59, 53, 331, 221, 333, 256, 257, 258, 13, 221,
1382 4, 24, 25, 26, 27, 28, 29, 54, 19, 20,
1383 21, 54, 59, 19, 29, 217, 59, 53, 53, 9,
1384 35, 55, 45, 46, 58, 31, 32, 33, 34, 35,
1385 36, 37, 38, 39, 24, 25, 26, 27, 28, 29,
1386 54, 255, 21, 56, 258, 59, 59, 19, 54, 56,
1387 53, 57, 59, 13, 56, 45, 46, 59, 260, 31,
1388 32, 33, 34, 35, 36, 37, 38, 39, 19, 29,
1389 247, 248, 249, 19, 19, 35, 21, 19, 19, 21,
1390 21, 19, 54, 19, 19, 57, 31, 32, 33, 34,
1391 19, 55, 37, 38, 39, 31, 32, 33, 34, 55,
1392 361, 362, 31, 32, 33, 34, 19, 19, 21, 21,
1393 55, 19, 55, 21, 58, 376, 377, 19, 379, 55,
1394 381, 5, 6, 7, 8, 9, 19, 11, 12, 13,
1395 14, 15, 16, 17, 18, 19, 55, 21, 40, 41,
1396 42, 43, 44, 19, 46, 47, 48, 49, 50, 51,
1397 52, 19, 19, 37, 38, 5, 6, 7, 8, 9,
1398 19, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1399 5, 21, 31, 32, 33, 34, 19, 19, 37, 38,
1400 39, 31, 32, 33, 34, 5, 6, 7, 8, 9,
1401 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1402 61, 21, 5, 6, 7, 8, 9, 21, 11, 12,
1403 13, 14, 15, 16, 17, 18, 19, 19, 21, 5,
1404 6, 7, 8, 9, 19, 11, 12, 13, 14, 15,
1405 16, 17, 18, 19, 21, 21, 5, 6, 7, 8,
1406 9, 21, 11, 12, 13, 14, 15, 16, 17, 18,
1407 19, 21, 21, 5, 6, 7, 8, 9, 56, 11,
1408 12, 13, 14, 15, 16, 17, 18, 19, 19, 21,
1409 5, 6, 55, 19, 56, 60, 11, 12, 13, 14,
1410 15, 16, 17, 18, 5, 6, 21, 55, 19, 19,
1411 11, 12, 13, 14, 15, 16, 17, 18, 5, 6,
1412 21, 55, 5, 19, 11, 12, 13, 14, 15, 16,
1413 17, 18, 56, 19, 21, 19, 57, 57, 20, 57,
1414 21, 21, 21, 55, 19, 19, 55, 55, 55, 19,
1415 19, 55, 58, 19, 57, 57, 56, 56, 56, 24,
1416 57, 19, 57, 19, 58, 58, 58, 58, 58, 58,
1417 58, 19, 19, 58, 19, 24, 19, 19, 24, 30,
1418 58, 58, 58, 24, 56, 58, 53, 24, 56, 19,
1419 19, 24, 55, 53, 56, 59, 57, 56, 19, 56,
1420 24, 56, 55, 57, 56, 55, 24, 13, 184, 183,
1421 180, 55, 267, 367, 137, 55, 278, 56, 53, 57,
1422 56, 358, 56, 48, 56, 53, -1, 58, -1, -1,
1426 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1427 symbol of state STATE-NUM. */
1428 static const unsigned char yystos[] =
1430 0, 3, 9, 24, 25, 26, 27, 28, 29, 45,
1431 46, 67, 68, 69, 70, 71, 111, 114, 116, 21,
1432 19, 19, 19, 0, 68, 70, 111, 114, 116, 69,
1433 53, 4, 53, 53, 53, 69, 19, 31, 32, 33,
1434 34, 35, 36, 37, 38, 39, 54, 57, 73, 74,
1435 75, 79, 80, 82, 102, 21, 19, 112, 113, 19,
1436 117, 19, 115, 19, 21, 55, 75, 102, 19, 55,
1437 89, 5, 6, 7, 8, 9, 11, 12, 13, 14,
1438 15, 16, 17, 18, 19, 21, 75, 91, 92, 93,
1439 94, 95, 89, 55, 54, 74, 37, 38, 91, 55,
1440 72, 58, 54, 59, 54, 59, 54, 59, 102, 19,
1441 91, 19, 19, 90, 19, 88, 5, 19, 93, 95,
1442 5, 5, 93, 91, 19, 61, 96, 5, 93, 19,
1443 19, 75, 97, 98, 99, 21, 91, 89, 19, 19,
1444 19, 20, 23, 65, 118, 21, 54, 113, 21, 19,
1445 54, 21, 19, 54, 56, 19, 55, 83, 60, 56,
1446 55, 19, 19, 19, 55, 5, 96, 5, 19, 55,
1447 75, 99, 19, 99, 91, 56, 19, 19, 97, 19,
1448 22, 55, 58, 76, 77, 78, 19, 20, 21, 20,
1449 57, 21, 57, 21, 57, 21, 53, 57, 101, 19,
1450 40, 41, 42, 43, 44, 46, 47, 48, 49, 50,
1451 51, 52, 84, 87, 19, 57, 90, 19, 55, 81,
1452 55, 5, 6, 19, 91, 105, 106, 107, 108, 96,
1453 19, 100, 99, 99, 19, 91, 55, 91, 19, 53,
1454 78, 105, 53, 118, 77, 76, 57, 56, 56, 56,
1455 57, 57, 57, 24, 58, 58, 58, 58, 58, 58,
1456 58, 58, 58, 58, 58, 58, 56, 59, 53, 91,
1457 19, 19, 105, 19, 5, 59, 19, 56, 59, 56,
1458 59, 55, 19, 105, 19, 24, 57, 56, 24, 72,
1459 72, 72, 19, 30, 85, 85, 118, 118, 19, 85,
1460 86, 118, 90, 91, 19, 21, 19, 21, 19, 21,
1461 19, 21, 19, 21, 87, 24, 56, 56, 53, 56,
1462 59, 59, 106, 22, 55, 19, 103, 10, 108, 19,
1463 105, 55, 56, 55, 103, 55, 19, 57, 24, 103,
1464 106, 106, 55, 19, 53, 104, 118, 101, 56, 105,
1465 103, 105, 101, 30, 53, 19, 57, 101, 19, 19,
1466 58, 62, 63, 64, 109, 110, 24, 19, 103, 56,
1467 101, 56, 56, 24, 53, 109, 58, 58, 118, 58,
1468 118, 58, 56, 110, 104, 101, 103, 103, 57, 24,
1469 56, 118, 118, 118, 118, 101, 101, 57
1472 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1473 # define YYSIZE_T __SIZE_TYPE__
1475 #if ! defined (YYSIZE_T) && defined (size_t)
1476 # define YYSIZE_T size_t
1478 #if ! defined (YYSIZE_T)
1479 # if defined (__STDC__) || defined (__cplusplus)
1480 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1481 # define YYSIZE_T size_t
1484 #if ! defined (YYSIZE_T)
1485 # define YYSIZE_T unsigned int
1488 #define yyerrok (yyerrstatus = 0)
1489 #define yyclearin (yychar = YYEMPTY)
1490 #define YYEMPTY (-2)
1493 #define YYACCEPT goto yyacceptlab
1494 #define YYABORT goto yyabortlab
1495 #define YYERROR goto yyerrorlab
1498 /* Like YYERROR except do call yyerror. This remains here temporarily
1499 to ease the transition to the new meaning of YYERROR, for GCC.
1500 Once GCC version 2 has supplanted version 1, this can go. */
1502 #define YYFAIL goto yyerrlab
1504 #define YYRECOVERING() (!!yyerrstatus)
1506 #define YYBACKUP(Token, Value) \
1508 if (yychar == YYEMPTY && yylen == 1) \
1512 yytoken = YYTRANSLATE (yychar); \
1518 yyerror ("syntax error: cannot back up");\
1524 #define YYERRCODE 256
1526 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1529 #ifndef YYLLOC_DEFAULT
1530 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1531 ((Current).first_line = (Rhs)[1].first_line, \
1532 (Current).first_column = (Rhs)[1].first_column, \
1533 (Current).last_line = (Rhs)[N].last_line, \
1534 (Current).last_column = (Rhs)[N].last_column)
1537 /* YYLEX -- calling `yylex' with the right arguments. */
1540 # define YYLEX yylex (YYLEX_PARAM)
1542 # define YYLEX yylex ()
1545 /* Enable debugging if requested. */
1549 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1550 # define YYFPRINTF fprintf
1553 # define YYDPRINTF(Args) \
1559 # define YYDSYMPRINT(Args) \
1565 # define YYDSYMPRINTF(Title, Token, Value, Location) \
1569 YYFPRINTF (stderr, "%s ", Title); \
1570 yysymprint (stderr, \
1572 YYFPRINTF (stderr, "\n"); \
1576 /*------------------------------------------------------------------.
1577 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1579 `------------------------------------------------------------------*/
1581 #if defined (__STDC__) || defined (__cplusplus)
1583 yy_stack_print (short *bottom, short *top)
1586 yy_stack_print (bottom, top)
1591 YYFPRINTF (stderr, "Stack now");
1592 for (/* Nothing. */; bottom <= top; ++bottom)
1593 YYFPRINTF (stderr, " %d", *bottom);
1594 YYFPRINTF (stderr, "\n");
1597 # define YY_STACK_PRINT(Bottom, Top) \
1600 yy_stack_print ((Bottom), (Top)); \
1604 /*------------------------------------------------.
1605 | Report that the YYRULE is going to be reduced. |
1606 `------------------------------------------------*/
1608 #if defined (__STDC__) || defined (__cplusplus)
1610 yy_reduce_print (int yyrule)
1613 yy_reduce_print (yyrule)
1618 unsigned int yylno = yyrline[yyrule];
1619 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1621 /* Print the symbols being reduced, and their result. */
1622 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1623 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1624 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1627 # define YY_REDUCE_PRINT(Rule) \
1630 yy_reduce_print (Rule); \
1633 /* Nonzero means print parse trace. It is left uninitialized so that
1634 multiple parsers can coexist. */
1636 #else /* !YYDEBUG */
1637 # define YYDPRINTF(Args)
1638 # define YYDSYMPRINT(Args)
1639 # define YYDSYMPRINTF(Title, Token, Value, Location)
1640 # define YY_STACK_PRINT(Bottom, Top)
1641 # define YY_REDUCE_PRINT(Rule)
1642 #endif /* !YYDEBUG */
1645 /* YYINITDEPTH -- initial size of the parser's stacks. */
1647 # define YYINITDEPTH 200
1650 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1651 if the built-in stack extension method is used).
1653 Do not make this value too large; the results are undefined if
1654 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1655 evaluated with infinite-precision integer arithmetic. */
1657 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1662 # define YYMAXDEPTH 10000
1670 # if defined (__GLIBC__) && defined (_STRING_H)
1671 # define yystrlen strlen
1673 /* Return the length of YYSTR. */
1675 # if defined (__STDC__) || defined (__cplusplus)
1676 yystrlen (const char *yystr)
1682 register const char *yys = yystr;
1684 while (*yys++ != '\0')
1687 return yys - yystr - 1;
1693 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1694 # define yystpcpy stpcpy
1696 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1699 # if defined (__STDC__) || defined (__cplusplus)
1700 yystpcpy (char *yydest, const char *yysrc)
1702 yystpcpy (yydest, yysrc)
1707 register char *yyd = yydest;
1708 register const char *yys = yysrc;
1710 while ((*yyd++ = *yys++) != '\0')
1718 #endif /* !YYERROR_VERBOSE */
1723 /*--------------------------------.
1724 | Print this symbol on YYOUTPUT. |
1725 `--------------------------------*/
1727 #if defined (__STDC__) || defined (__cplusplus)
1729 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1732 yysymprint (yyoutput, yytype, yyvaluep)
1738 /* Pacify ``unused variable'' warnings. */
1741 if (yytype < YYNTOKENS)
1743 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1745 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1749 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1756 YYFPRINTF (yyoutput, ")");
1759 #endif /* ! YYDEBUG */
1760 /*-----------------------------------------------.
1761 | Release the memory associated to this symbol. |
1762 `-----------------------------------------------*/
1764 #if defined (__STDC__) || defined (__cplusplus)
1766 yydestruct (int yytype, YYSTYPE *yyvaluep)
1769 yydestruct (yytype, yyvaluep)
1774 /* Pacify ``unused variable'' warnings. */
1786 /* Prevent warnings from -Wmissing-prototypes. */
1788 #ifdef YYPARSE_PARAM
1789 # if defined (__STDC__) || defined (__cplusplus)
1790 int yyparse (void *YYPARSE_PARAM);
1794 #else /* ! YYPARSE_PARAM */
1795 #if defined (__STDC__) || defined (__cplusplus)
1800 #endif /* ! YYPARSE_PARAM */
1804 /* The lookahead symbol. */
1807 /* The semantic value of the lookahead symbol. */
1810 /* Number of syntax errors so far. */
1819 #ifdef YYPARSE_PARAM
1820 # if defined (__STDC__) || defined (__cplusplus)
1821 int yyparse (void *YYPARSE_PARAM)
1823 int yyparse (YYPARSE_PARAM)
1824 void *YYPARSE_PARAM;
1826 #else /* ! YYPARSE_PARAM */
1827 #if defined (__STDC__) || defined (__cplusplus)
1838 register int yystate;
1841 /* Number of tokens to shift before error messages enabled. */
1843 /* Lookahead token as an internal (translated) token number. */
1846 /* Three stacks and their tools:
1847 `yyss': related to states,
1848 `yyvs': related to semantic values,
1849 `yyls': related to locations.
1851 Refer to the stacks thru separate pointers, to allow yyoverflow
1852 to reallocate them elsewhere. */
1854 /* The state stack. */
1855 short yyssa[YYINITDEPTH];
1856 short *yyss = yyssa;
1857 register short *yyssp;
1859 /* The semantic value stack. */
1860 YYSTYPE yyvsa[YYINITDEPTH];
1861 YYSTYPE *yyvs = yyvsa;
1862 register YYSTYPE *yyvsp;
1866 #define YYPOPSTACK (yyvsp--, yyssp--)
1868 YYSIZE_T yystacksize = YYINITDEPTH;
1870 /* The variables used to return semantic value and location from the
1875 /* When reducing, the number of symbols on the RHS of the reduced
1879 YYDPRINTF ((stderr, "Starting parse\n"));
1884 yychar = YYEMPTY; /* Cause a token to be read. */
1886 /* Initialize stack pointers.
1887 Waste one element of value and location stack
1888 so that they stay on the same level as the state stack.
1889 The wasted elements are never initialized. */
1896 /*------------------------------------------------------------.
1897 | yynewstate -- Push a new state, which is found in yystate. |
1898 `------------------------------------------------------------*/
1900 /* In all cases, when you get here, the value and location stacks
1901 have just been pushed. so pushing a state here evens the stacks.
1908 if (yyss + yystacksize - 1 <= yyssp)
1910 /* Get the current used size of the three stacks, in elements. */
1911 YYSIZE_T yysize = yyssp - yyss + 1;
1915 /* Give user a chance to reallocate the stack. Use copies of
1916 these so that the &'s don't force the real ones into
1918 YYSTYPE *yyvs1 = yyvs;
1919 short *yyss1 = yyss;
1922 /* Each stack pointer address is followed by the size of the
1923 data in use in that stack, in bytes. This used to be a
1924 conditional around just the two extra args, but that might
1925 be undefined if yyoverflow is a macro. */
1926 yyoverflow ("parser stack overflow",
1927 &yyss1, yysize * sizeof (*yyssp),
1928 &yyvs1, yysize * sizeof (*yyvsp),
1935 #else /* no yyoverflow */
1936 # ifndef YYSTACK_RELOCATE
1939 /* Extend the stack our own way. */
1940 if (YYMAXDEPTH <= yystacksize)
1943 if (YYMAXDEPTH < yystacksize)
1944 yystacksize = YYMAXDEPTH;
1947 short *yyss1 = yyss;
1948 union yyalloc *yyptr =
1949 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1952 YYSTACK_RELOCATE (yyss);
1953 YYSTACK_RELOCATE (yyvs);
1955 # undef YYSTACK_RELOCATE
1957 YYSTACK_FREE (yyss1);
1960 #endif /* no yyoverflow */
1962 yyssp = yyss + yysize - 1;
1963 yyvsp = yyvs + yysize - 1;
1966 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1967 (unsigned long int) yystacksize));
1969 if (yyss + yystacksize - 1 <= yyssp)
1973 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1982 /* Do appropriate processing given the current state. */
1983 /* Read a lookahead token if we need one and don't already have one. */
1986 /* First try to decide what to do without reference to lookahead token. */
1988 yyn = yypact[yystate];
1989 if (yyn == YYPACT_NINF)
1992 /* Not known => get a lookahead token if don't already have one. */
1994 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1995 if (yychar == YYEMPTY)
1997 YYDPRINTF ((stderr, "Reading a token: "));
2001 if (yychar <= YYEOF)
2003 yychar = yytoken = YYEOF;
2004 YYDPRINTF ((stderr, "Now at end of input.\n"));
2008 yytoken = YYTRANSLATE (yychar);
2009 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
2012 /* If the proper action on seeing token YYTOKEN is to reduce or to
2013 detect an error, take that action. */
2015 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2020 if (yyn == 0 || yyn == YYTABLE_NINF)
2029 /* Shift the lookahead token. */
2030 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
2032 /* Discard the token being shifted unless it is eof. */
2033 if (yychar != YYEOF)
2039 /* Count tokens shifted since error; after three, turn off error
2048 /*-----------------------------------------------------------.
2049 | yydefault -- do the default action for the current state. |
2050 `-----------------------------------------------------------*/
2052 yyn = yydefact[yystate];
2058 /*-----------------------------.
2059 | yyreduce -- Do a reduction. |
2060 `-----------------------------*/
2062 /* yyn is the number of a rule to reduce with. */
2065 /* If YYLEN is nonzero, implement the default value of the action:
2068 Otherwise, the following line sets YYVAL to garbage.
2069 This behavior is undocumented and Bison
2070 users should not rely upon it. Assigning to YYVAL
2071 unconditionally makes the parser a bit smaller, and it avoids a
2072 GCC warning that YYVAL may be used uninitialized. */
2073 yyval = yyvsp[1-yylen];
2076 YY_REDUCE_PRINT (yyn);
2102 Node *node = node_new (CCODE_NODE,
2104 "cbuf:steal", (yyvsp[0].cbuf)->str,
2105 "line_no", ccode_line,
2107 nodes = g_list_append(nodes,node);
2108 g_string_free(yyvsp[0].cbuf,FALSE);
2115 Node *node = node_new (CCODE_NODE,
2117 "cbuf:steal", (yyvsp[0].cbuf)->str,
2118 "line_no", ccode_line,
2120 nodes = g_list_append(nodes,node);
2121 g_string_free(yyvsp[0].cbuf,FALSE);
2128 Node *node = node_new (CCODE_NODE,
2130 "cbuf:steal", (yyvsp[0].cbuf)->str,
2131 "line_no", ccode_line,
2133 nodes = g_list_append(nodes,node);
2134 g_string_free(yyvsp[0].cbuf,FALSE);
2141 Node *node = node_new (CCODE_NODE,
2143 "cbuf:steal", (yyvsp[0].cbuf)->str,
2144 "line_no", ccode_line,
2146 nodes = g_list_append(nodes,node);
2147 g_string_free(yyvsp[0].cbuf,FALSE);
2154 Node *node = node_new (CCODE_NODE,
2156 "cbuf:steal", (yyvsp[0].cbuf)->str,
2157 "line_no", ccode_line,
2159 nodes = g_list_append(nodes,node);
2160 g_string_free(yyvsp[0].cbuf,FALSE);
2167 Node *node = node_new (CCODE_NODE,
2169 "cbuf:steal", (yyvsp[0].cbuf)->str,
2170 "line_no", ccode_line,
2172 nodes = g_list_append(nodes,node);
2173 g_string_free(yyvsp[0].cbuf,FALSE);
2220 ((Class *)class)->nodes = class_nodes;
2222 nodes = g_list_append(nodes,class);
2229 ((Class *)class)->nodes = NULL;
2231 nodes = g_list_append(nodes,class);
2238 class = node_new (CLASS_NODE,
2239 "otype:steal", yyvsp[-3].id,
2240 "ptype:steal", yyvsp[-1].id,
2241 "bonobo_object_class:steal", bonobo_object_class,
2242 "interfaces:steal", interfaces,
2243 "chunk_size:steal", chunk_size,
2245 bonobo_object_class = NULL;
2254 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2255 g_free (chunk_size);
2256 chunk_size = g_strdup(yyvsp[-2].id);
2257 } else if(strcmp(yyvsp[-3].id,"BonoboObject") == 0) {
2258 g_free (bonobo_object_class);
2259 bonobo_object_class = g_strdup(yyvsp[-2].id);
2261 yyerror(_("parse error"));
2270 if (strcmp (yyvsp[-3].id, "interface") == 0) {
2271 interfaces = g_list_append (interfaces,
2272 g_strdup (yyvsp[-2].id));
2274 yyerror(_("parse error"));
2283 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2284 g_free (chunk_size);
2285 if(atoi(yyvsp[-2].id) != 0)
2286 chunk_size = g_strdup(yyvsp[-2].id);
2290 yyerror(_("parse error"));
2314 if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
2315 g_free (yyvsp[-1].id);
2316 yyerror (_("parse error"));
2319 g_free (yyvsp[-1].id);
2320 last_added_method->bonobo_object_func = TRUE;
2327 if (strcmp (yyvsp[-2].id, "interface") != 0) {
2328 g_free (yyvsp[-2].id);
2329 g_free (yyvsp[-1].id);
2330 yyerror (_("parse error"));
2333 g_free (yyvsp[-2].id);
2334 node_set ((Node *)last_added_method,
2335 "interface:steal", yyvsp[-1].id,
2362 { the_scope = PUBLIC_SCOPE; }
2367 { the_scope = PRIVATE_SCOPE; }
2372 { the_scope = PROTECTED_SCOPE; }
2377 { the_scope = CLASS_SCOPE; }
2383 if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
2384 g_free (yyvsp[-1].id);
2385 destructor_unref = FALSE;
2386 destructor = yyvsp[0].id;
2387 destructor_line = line_no;
2388 destructor_simple = TRUE;
2389 } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
2390 g_free (yyvsp[-1].id);
2391 destructor_unref = TRUE;
2392 destructor = yyvsp[0].id;
2393 destructor_line = line_no;
2394 destructor_simple = TRUE;
2396 g_free (yyvsp[-1].id);
2397 g_free (yyvsp[0].id);
2398 yyerror (_("parse error"));
2407 if (strcmp (yyvsp[-2].id, "destroy") == 0) {
2408 g_free(yyvsp[-2].id);
2409 destructor_unref = FALSE;
2410 destructor = (yyvsp[0].cbuf)->str;
2411 g_string_free(yyvsp[0].cbuf, FALSE);
2412 destructor_line = ccode_line;
2413 destructor_simple = FALSE;
2414 } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
2415 g_free (yyvsp[-2].id);
2416 destructor_unref = TRUE;
2417 destructor = (yyvsp[0].cbuf)->str;
2418 g_string_free (yyvsp[0].cbuf, FALSE);
2419 destructor_line = ccode_line;
2420 destructor_simple = FALSE;
2422 g_free (yyvsp[-2].id);
2423 g_string_free (yyvsp[0].cbuf, TRUE);
2424 yyerror (_("parse error"));
2433 initializer = yyvsp[0].id;
2434 initializer_line = ccode_line;
2441 initializer = (yyvsp[0].cbuf)->str;
2442 initializer_line = ccode_line;
2443 g_string_free(yyvsp[0].cbuf, FALSE);
2459 { destructor = NULL; }
2464 { initializer = NULL; }
2478 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
2485 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
2493 if(strcmp(yyvsp[-6].id,"get")==0 &&
2494 strcmp(yyvsp[-3].id,"set")==0) {
2495 Type *type = pop_type();
2496 g_free (yyvsp[-6].id);
2497 g_free (yyvsp[-3].id);
2498 node = node_new (ARGUMENT_NODE,
2499 "gtktype:steal", yyvsp[-9].id,
2500 "atype:steal", type,
2501 "flags:steal", yyvsp[-10].list,
2502 "name:steal", yyvsp[-8].id,
2503 "get:steal", (yyvsp[-4].cbuf)->str,
2504 "get_line", yyvsp[-5].line,
2505 "set:steal", (yyvsp[-1].cbuf)->str,
2506 "set_line", yyvsp[-2].line,
2507 "line_no", yyvsp[-11].line,
2510 class_nodes = g_list_append(class_nodes,node);
2512 g_string_free (yyvsp[-4].cbuf, FALSE);
2513 g_string_free (yyvsp[-1].cbuf, FALSE);
2515 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
2516 strcmp(yyvsp[-3].id,"get")==0) {
2517 Type *type = pop_type();
2518 g_free (yyvsp[-6].id);
2519 g_free (yyvsp[-3].id);
2520 node = node_new (ARGUMENT_NODE,
2521 "gtktype:steal", yyvsp[-9].id,
2522 "atype:steal", type,
2523 "flags:steal", yyvsp[-10].list,
2524 "name:steal", yyvsp[-8].id,
2525 "get:steal", (yyvsp[-1].cbuf)->str,
2526 "get_line", yyvsp[-2].line,
2527 "set:steal", (yyvsp[-4].cbuf)->str,
2528 "set_line", yyvsp[-5].line,
2529 "line_no", yyvsp[-11].line,
2531 g_string_free (yyvsp[-1].cbuf, FALSE);
2532 g_string_free (yyvsp[-4].cbuf, FALSE);
2533 class_nodes = g_list_append(class_nodes,node);
2535 g_free (yyvsp[-9].id);
2536 g_free (yyvsp[-8].id);
2537 g_free (yyvsp[-6].id);
2538 g_free (yyvsp[-3].id);
2539 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
2540 g_list_free (yyvsp[-10].list);
2541 g_string_free (yyvsp[-1].cbuf, TRUE);
2542 g_string_free (yyvsp[-4].cbuf, TRUE);
2543 yyerror (_("parse error"));
2547 if (yyvsp[-7].id != NULL) {
2548 Argument *arg = (Argument *)node;
2549 export_accessors (arg->name,
2550 arg->get != NULL, arg->get_line,
2551 arg->set != NULL, arg->set_line,
2555 g_free (yyvsp[-7].id);
2565 if(strcmp(yyvsp[-3].id, "get") == 0) {
2566 Type *type = pop_type();
2567 g_free (yyvsp[-3].id);
2568 node = node_new (ARGUMENT_NODE,
2569 "gtktype:steal", yyvsp[-6].id,
2570 "atype:steal", type,
2571 "flags:steal", yyvsp[-7].list,
2572 "name:steal", yyvsp[-5].id,
2573 "get:steal", (yyvsp[-1].cbuf)->str,
2574 "get_line", yyvsp[-2].line,
2575 "line_no", yyvsp[-8].line,
2578 g_string_free (yyvsp[-1].cbuf, FALSE);
2579 class_nodes = g_list_append(class_nodes, node);
2580 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
2581 Type *type = pop_type();
2582 g_free (yyvsp[-3].id);
2583 node = node_new (ARGUMENT_NODE,
2584 "gtktype:steal", yyvsp[-6].id,
2585 "atype:steal", type,
2586 "flags:steal", yyvsp[-7].list,
2587 "name:steal", yyvsp[-5].id,
2588 "set:steal", (yyvsp[-1].cbuf)->str,
2589 "set_line", yyvsp[-2].line,
2590 "line_no", yyvsp[-8].line,
2593 g_string_free (yyvsp[-1].cbuf, FALSE);
2594 class_nodes = g_list_append (class_nodes, node);
2596 g_free (yyvsp[-3].id);
2597 g_free (yyvsp[-6].id);
2598 g_free (yyvsp[-5].id);
2599 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
2600 g_list_free (yyvsp[-7].list);
2601 g_string_free (yyvsp[-1].cbuf, TRUE);
2602 yyerror(_("parse error"));
2606 if (yyvsp[-4].id != NULL) {
2607 Argument *arg = (Argument *)node;
2608 export_accessors (arg->name,
2609 arg->get != NULL, arg->get_line,
2610 arg->set != NULL, arg->set_line,
2614 g_free (yyvsp[-4].id);
2620 #line 1017 "parse.y"
2623 char *get, *set = NULL;
2628 if(strcmp(yyvsp[0].id, "link")!=0 &&
2629 strcmp(yyvsp[0].id, "stringlink")!=0 &&
2630 strcmp(yyvsp[0].id, "objectlink")!=0) {
2631 g_free(yyvsp[0].id);
2632 g_free(yyvsp[-3].id);
2633 g_free(yyvsp[-2].id);
2634 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2635 g_list_free(yyvsp[-4].list);
2636 yyerror(_("parse error"));
2642 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2643 if(var->scope == PRIVATE_SCOPE) {
2644 root = "self->_priv";
2645 } else if(var->scope == CLASS_SCOPE) {
2646 root = "SELF_GET_CLASS(self)";
2648 error_print(GOB_ERROR, yyvsp[-5].line,
2649 _("Self aliases needed when autolinking to a classwide member"));
2654 if(strcmp(yyvsp[0].id, "link")==0) {
2655 set = g_strdup_printf("%s->%s = ARG;",
2656 root, yyvsp[-2].id);
2657 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2658 set = g_strdup_printf("g_free (%s->%s); "
2659 "%s->%s = g_strdup (ARG);",
2661 root, yyvsp[-2].id);
2662 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2663 set = g_strdup_printf(
2665 "g_object_ref (G_OBJECT (ARG)); "
2666 "if (%s->%s != NULL) "
2667 "g_object_unref (G_OBJECT (%s->%s)); "
2671 root, yyvsp[-2].id);
2673 g_assert_not_reached();
2676 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2678 g_free (yyvsp[0].id);
2681 type = (Type *)node_copy ((Node *)var->vtype);
2683 node = node_new (ARGUMENT_NODE,
2684 "gtktype:steal", yyvsp[-3].id,
2685 "atype:steal", type,
2686 "flags:steal", yyvsp[-4].list,
2687 "name:steal", yyvsp[-2].id,
2689 "get_line", yyvsp[-5].line,
2691 "set_line", yyvsp[-5].line,
2692 "line_no", yyvsp[-5].line,
2695 if (yyvsp[-1].id != NULL) {
2696 Argument *arg = (Argument *)node;
2697 export_accessors (arg->name,
2698 arg->get != NULL, arg->get_line,
2699 arg->set != NULL, arg->set_line,
2703 g_free (yyvsp[-1].id);
2706 class_nodes = g_list_append (class_nodes, node);
2711 #line 1106 "parse.y"
2713 if (strcmp (yyvsp[-1].id, "export")!=0) {
2714 g_free (yyvsp[-1].id);
2715 yyerror (_("parse error"));
2718 yyval.id = yyvsp[-1].id;
2723 #line 1114 "parse.y"
2730 #line 1119 "parse.y"
2733 node_set ((Node *)property,
2734 "line_no", yyvsp[-10].line,
2735 "gtktype:steal", debool (yyvsp[-9].id),
2736 "name:steal", yyvsp[-8].id,
2738 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2739 strcmp (yyvsp[-3].id, "set") == 0) {
2740 node_set ((Node *)property,
2741 "get:steal", (yyvsp[-4].cbuf)->str,
2742 "get_line", yyvsp[-5].line,
2743 "set:steal", (yyvsp[-1].cbuf)->str,
2744 "set_line", yyvsp[-2].line,
2746 g_string_free (yyvsp[-4].cbuf, FALSE);
2747 g_string_free (yyvsp[-1].cbuf, FALSE);
2748 g_free (yyvsp[-6].id);
2749 g_free (yyvsp[-3].id);
2750 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2751 strcmp (yyvsp[-3].id, "get") == 0) {
2752 node_set ((Node *)property,
2753 "get:steal", (yyvsp[-1].cbuf)->str,
2754 "get_line", yyvsp[-2].line,
2755 "set:steal", (yyvsp[-4].cbuf)->str,
2756 "set_line", yyvsp[-5].line,
2758 g_string_free (yyvsp[-4].cbuf, FALSE);
2759 g_string_free (yyvsp[-1].cbuf, FALSE);
2760 g_free (yyvsp[-6].id);
2761 g_free (yyvsp[-3].id);
2763 g_string_free (yyvsp[-4].cbuf, TRUE);
2764 g_string_free (yyvsp[-1].cbuf, TRUE);
2765 g_free (yyvsp[-6].id);
2766 g_free (yyvsp[-3].id);
2767 node_free ((Node *)property);
2769 yyerror (_("parse error"));
2772 property_link_and_export ((Node *)property);
2773 if (property != NULL) {
2774 class_nodes = g_list_append (class_nodes,
2782 #line 1167 "parse.y"
2785 node_set ((Node *)property,
2786 "line_no", yyvsp[-7].line,
2787 "gtktype:steal", debool (yyvsp[-6].id),
2788 "name:steal", yyvsp[-5].id,
2790 if (strcmp (yyvsp[-3].id, "get") == 0) {
2791 node_set ((Node *)property,
2792 "get:steal", (yyvsp[-1].cbuf)->str,
2793 "get_line", yyvsp[-2].line,
2795 g_string_free (yyvsp[-1].cbuf, FALSE);
2796 g_free (yyvsp[-3].id);
2797 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2798 node_set ((Node *)property,
2799 "set:steal", (yyvsp[-1].cbuf)->str,
2800 "set_line", yyvsp[-2].line,
2802 g_string_free (yyvsp[-1].cbuf, FALSE);
2803 g_free (yyvsp[-3].id);
2805 g_string_free (yyvsp[-1].cbuf, TRUE);
2806 g_free (yyvsp[-3].id);
2807 node_free ((Node *)property);
2809 yyerror (_("parse error"));
2812 property_link_and_export ((Node *)property);
2813 if (property != NULL) {
2814 class_nodes = g_list_append (class_nodes,
2822 #line 1203 "parse.y"
2825 node_set ((Node *)property,
2826 "line_no", yyvsp[-4].line,
2827 "gtktype:steal", debool (yyvsp[-3].id),
2828 "name:steal", yyvsp[-2].id,
2830 property_link_and_export ((Node *)property);
2831 if (property != NULL) {
2832 class_nodes = g_list_append (class_nodes,
2840 #line 1219 "parse.y"
2845 #line 1220 "parse.y"
2850 #line 1223 "parse.y"
2855 #line 1224 "parse.y"
2860 #line 1227 "parse.y"
2861 { yyval.id = yyvsp[0].id; }
2865 #line 1228 "parse.y"
2867 if (strcmp (yyvsp[-3].id, "_") != 0) {
2868 g_free (yyvsp[-3].id);
2869 yyerror(_("parse error"));
2872 g_free (yyvsp[-3].id);
2873 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2874 g_free (yyvsp[-1].id);
2879 #line 1240 "parse.y"
2880 { yyval.id = yyvsp[0].id; }
2884 #line 1241 "parse.y"
2885 { yyval.id = yyvsp[0].id; }
2889 #line 1244 "parse.y"
2892 node_set ((Node *)property,
2893 "nick:steal", yyvsp[0].id,
2899 #line 1250 "parse.y"
2902 node_set ((Node *)property,
2903 "blurb:steal", yyvsp[0].id,
2909 #line 1256 "parse.y"
2912 node_set ((Node *)property,
2913 "maximum:steal", yyvsp[0].id,
2919 #line 1262 "parse.y"
2922 node_set ((Node *)property,
2923 "minimum:steal", yyvsp[0].id,
2929 #line 1268 "parse.y"
2932 node_set ((Node *)property,
2933 "default_value:steal", yyvsp[0].id,
2939 #line 1274 "parse.y"
2942 node_set ((Node *)property,
2943 "flags:steal", yyvsp[0].list,
2949 #line 1280 "parse.y"
2951 Type *type = pop_type ();
2953 node_set ((Node *)property,
2954 "ptype:steal", type,
2960 #line 1287 "parse.y"
2963 node_set ((Node *)property,
2964 "extra_gtktype:steal", yyvsp[0].id,
2970 #line 1293 "parse.y"
2973 node_set ((Node *)property,
2974 "extra_gtktype:steal", yyvsp[0].id,
2980 #line 1299 "parse.y"
2983 node_set ((Node *)property,
2984 "extra_gtktype:steal", yyvsp[0].id,
2990 #line 1305 "parse.y"
2993 node_set ((Node *)property,
2994 "extra_gtktype:steal", yyvsp[0].id,
3000 #line 1311 "parse.y"
3003 node_set ((Node *)property,
3004 "extra_gtktype:steal", yyvsp[0].id,
3010 #line 1317 "parse.y"
3013 node_set ((Node *)property,
3014 "extra_gtktype:steal", yyvsp[0].id,
3020 #line 1323 "parse.y"
3023 node_set ((Node *)property,
3024 "extra_gtktype:steal", yyvsp[0].id,
3030 #line 1329 "parse.y"
3033 node_set ((Node *)property,
3034 "extra_gtktype:steal", yyvsp[0].id,
3040 #line 1335 "parse.y"
3043 node_set ((Node *)property,
3044 "extra_gtktype:steal", yyvsp[0].id,
3050 #line 1341 "parse.y"
3053 node_set ((Node *)property,
3054 "extra_gtktype:steal", yyvsp[0].id,
3060 #line 1347 "parse.y"
3063 if (strcmp (yyvsp[0].id, "override") == 0) {
3064 g_free(yyvsp[0].id);
3065 node_set ((Node *)property,
3068 } else if (strcmp (yyvsp[0].id, "link") == 0) {
3069 g_free(yyvsp[0].id);
3070 node_set ((Node *)property,
3073 } else if (strcmp (yyvsp[0].id, "export") == 0) {
3074 g_free(yyvsp[0].id);
3075 node_set ((Node *)property,
3079 g_free(yyvsp[0].id);
3080 yyerror(_("parse error"));
3087 #line 1372 "parse.y"
3089 if(strcmp(yyvsp[-2].id,"type")!=0) {
3090 g_free(yyvsp[-4].id);
3091 g_free(yyvsp[-2].id);
3092 yyerror(_("parse error"));
3095 yyval.id = debool (yyvsp[-4].id);
3100 #line 1381 "parse.y"
3102 yyval.id = debool (yyvsp[0].id);
3103 typestack = g_list_prepend(typestack,NULL);
3108 #line 1387 "parse.y"
3109 { yyval.list = yyvsp[-1].list; }
3113 #line 1388 "parse.y"
3114 { yyval.list = NULL; }
3118 #line 1391 "parse.y"
3120 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
3125 #line 1394 "parse.y"
3127 yyval.list = g_list_append(NULL,yyvsp[0].id);
3132 #line 1400 "parse.y"
3134 Node *node = node_new (TYPE_NODE,
3135 "name:steal", yyvsp[-1].id,
3136 "pointer:steal", yyvsp[0].id,
3138 typestack = g_list_prepend(typestack,node);
3143 #line 1407 "parse.y"
3145 Node *node = node_new (TYPE_NODE,
3146 "name:steal", yyvsp[0].id,
3148 typestack = g_list_prepend(typestack,node);
3153 #line 1416 "parse.y"
3155 yyval.id = yyvsp[0].id;
3160 #line 1419 "parse.y"
3162 yyval.id = yyvsp[0].id;
3167 #line 1422 "parse.y"
3169 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
3170 g_free(yyvsp[0].id);
3175 #line 1426 "parse.y"
3177 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3178 g_free(yyvsp[-1].id);
3183 #line 1430 "parse.y"
3185 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3186 g_free(yyvsp[0].id);
3191 #line 1434 "parse.y"
3193 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
3195 g_free(yyvsp[0].id);
3200 #line 1439 "parse.y"
3202 yyval.id = g_strconcat(yyvsp[-2].id, " ",
3203 yyvsp[-1].id, " const", NULL);
3204 g_free(yyvsp[-1].id);
3209 #line 1447 "parse.y"
3211 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3212 g_free(yyvsp[0].id);
3217 #line 1451 "parse.y"
3219 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3220 g_free(yyvsp[-1].id);
3221 g_free(yyvsp[0].id);
3226 #line 1456 "parse.y"
3228 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
3229 g_free(yyvsp[0].id);
3234 #line 1460 "parse.y"
3236 yyval.id = yyvsp[0].id;
3241 #line 1463 "parse.y"
3243 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3244 g_free(yyvsp[-1].id);
3249 #line 1467 "parse.y"
3251 yyval.id = g_strdup(yyvsp[0].id);
3256 #line 1470 "parse.y"
3258 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3263 #line 1475 "parse.y"
3264 { yyval.id = "void"; }
3268 #line 1476 "parse.y"
3269 { yyval.id = "char"; }
3273 #line 1477 "parse.y"
3274 { yyval.id = "short"; }
3278 #line 1478 "parse.y"
3279 { yyval.id = "int"; }
3283 #line 1479 "parse.y"
3284 { yyval.id = "long"; }
3288 #line 1480 "parse.y"
3289 { yyval.id = "float"; }
3293 #line 1481 "parse.y"
3294 { yyval.id = "double"; }
3298 #line 1482 "parse.y"
3299 { yyval.id = "signed"; }
3303 #line 1483 "parse.y"
3304 { yyval.id = "unsigned"; }
3308 #line 1486 "parse.y"
3309 { yyval.id = "struct"; }
3313 #line 1487 "parse.y"
3314 { yyval.id = "union"; }
3318 #line 1488 "parse.y"
3319 { yyval.id = "enum"; }
3323 #line 1491 "parse.y"
3324 { yyval.id = g_strdup("*"); }
3328 #line 1492 "parse.y"
3329 { yyval.id = g_strdup("* const"); }
3333 #line 1493 "parse.y"
3335 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
3336 g_free(yyvsp[0].id);
3341 #line 1497 "parse.y"
3343 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
3344 g_free(yyvsp[0].id);
3349 #line 1504 "parse.y"
3351 if(strcmp(yyvsp[-1].id, "first")==0)
3352 yyval.sigtype = SIGNAL_FIRST_METHOD;
3353 else if(strcmp(yyvsp[-1].id, "last")==0)
3354 yyval.sigtype = SIGNAL_LAST_METHOD;
3356 yyerror(_("signal must be 'first' or 'last'"));
3357 g_free(yyvsp[-1].id);
3360 g_free(yyvsp[-1].id);
3365 #line 1516 "parse.y"
3367 yyval.sigtype = SIGNAL_LAST_METHOD;
3372 #line 1522 "parse.y"
3374 if(strcmp(yyvsp[-1].id,"first")==0)
3375 yyval.sigtype = SIGNAL_FIRST_METHOD;
3376 else if(strcmp(yyvsp[-1].id,"last")==0)
3377 yyval.sigtype = SIGNAL_LAST_METHOD;
3379 yyerror(_("signal must be 'first' or 'last'"));
3380 g_free(yyvsp[-1].id);
3383 g_free(yyvsp[-1].id);
3388 #line 1534 "parse.y"
3390 if(strcmp(yyvsp[-2].id,"first")==0)
3391 yyval.sigtype = SIGNAL_FIRST_METHOD;
3392 else if(strcmp(yyvsp[-2].id,"last")==0)
3393 yyval.sigtype = SIGNAL_LAST_METHOD;
3395 yyerror(_("signal must be 'first' or 'last'"));
3396 g_free(yyvsp[-2].id);
3399 g_free(yyvsp[-2].id);
3404 #line 1546 "parse.y"
3406 yyval.sigtype = SIGNAL_LAST_METHOD;
3411 #line 1549 "parse.y"
3413 /* the_scope was default thus public */
3414 the_scope = PUBLIC_SCOPE;
3419 #line 1555 "parse.y"
3421 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
3426 #line 1560 "parse.y"
3428 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3433 #line 1563 "parse.y"
3435 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3440 #line 1568 "parse.y"
3441 { yyval.cbuf = yyvsp[0].cbuf; }
3445 #line 1569 "parse.y"
3446 { yyval.cbuf = NULL; }
3450 #line 1573 "parse.y"
3453 yyerror(_("signal without 'self' as "
3454 "first parameter"));
3455 free_all_global_state();
3458 if(the_scope == CLASS_SCOPE) {
3459 yyerror(_("a method cannot be of class scope"));
3460 free_all_global_state();
3463 push_function(the_scope, yyvsp[-7].sigtype,NULL,
3464 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
3465 ccode_line, vararg, yyvsp[-8].list);
3470 #line 1589 "parse.y"
3473 yyerror(_("signal without 'self' as "
3474 "first parameter"));
3475 free_all_global_state();
3478 if(the_scope == CLASS_SCOPE) {
3479 yyerror(_("a method cannot be of class scope"));
3480 free_all_global_state();
3483 push_function(the_scope, yyvsp[-7].sigtype, NULL,
3484 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
3485 ccode_line, vararg, yyvsp[-8].list);
3490 #line 1605 "parse.y"
3493 yyerror(_("virtual method without 'self' as "
3494 "first parameter"));
3495 free_all_global_state();
3498 if(the_scope == CLASS_SCOPE) {
3499 yyerror(_("a method cannot be of class scope"));
3500 free_all_global_state();
3503 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3504 yyvsp[0].cbuf, yyvsp[-8].line,
3505 ccode_line, vararg, NULL);
3510 #line 1621 "parse.y"
3513 yyerror(_("virtual method without 'self' as "
3514 "first parameter"));
3515 free_all_global_state();
3518 if(the_scope == CLASS_SCOPE) {
3519 yyerror(_("a method cannot be of class scope"));
3520 free_all_global_state();
3523 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3524 yyvsp[0].cbuf, yyvsp[-7].line,
3525 ccode_line, vararg, NULL);
3530 #line 1637 "parse.y"
3533 yyerror(_("virtual method without 'self' as "
3534 "first parameter"));
3535 free_all_global_state();
3538 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
3539 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
3540 ccode_line, vararg, NULL);
3545 #line 1648 "parse.y"
3547 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3548 yyvsp[-5].id, yyvsp[0].cbuf,
3549 yyvsp[-10].line, ccode_line,
3555 #line 1654 "parse.y"
3557 if(the_scope == CLASS_SCOPE) {
3558 yyerror(_("a method cannot be of class scope"));
3559 free_all_global_state();
3562 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3563 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3569 #line 1664 "parse.y"
3571 if(strcmp(yyvsp[-4].id, "init")==0) {
3572 push_init_arg(yyvsp[-2].id,FALSE);
3573 push_function(NO_SCOPE, INIT_METHOD, NULL,
3574 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3575 ccode_line, FALSE, NULL);
3576 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3577 push_init_arg(yyvsp[-2].id,TRUE);
3578 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3579 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3580 ccode_line, FALSE, NULL);
3582 g_free(yyvsp[-4].id);
3583 g_free(yyvsp[-2].id);
3584 g_string_free(yyvsp[0].cbuf,TRUE);
3585 yyerror(_("parse error "
3586 "(untyped blocks must be init or "
3594 #line 1687 "parse.y"
3596 g_free(onerror); onerror = NULL;
3597 g_free(defreturn); defreturn = NULL;
3598 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3599 g_free(yyvsp[-1].id);
3600 g_free(yyvsp[0].id);
3601 yyerror(_("parse error"));
3604 g_free(yyvsp[-1].id);
3609 #line 1698 "parse.y"
3611 g_free(onerror); onerror = NULL;
3612 g_free(defreturn); defreturn = NULL;
3613 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3614 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3615 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3616 yyerror(_("parse error"));
3619 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3620 onerror = defreturn = NULL;
3621 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3622 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3623 yyerror(_("parse error"));
3626 g_free(yyvsp[-3].id);
3627 g_free(yyvsp[-1].id);
3632 #line 1717 "parse.y"
3634 g_free(onerror); onerror = NULL;
3635 g_free(defreturn); defreturn = NULL;
3640 #line 1723 "parse.y"
3641 { yyval.id = yyvsp[0].id; }
3645 #line 1724 "parse.y"
3647 yyval.id = (yyvsp[0].cbuf)->str;
3648 g_string_free(yyvsp[0].cbuf, FALSE);
3653 #line 1730 "parse.y"
3654 { vararg = FALSE; has_self = FALSE; }
3658 #line 1731 "parse.y"
3662 if(strcmp(yyvsp[0].id,"self")==0)
3663 push_self(yyvsp[0].id, FALSE);
3665 g_free(yyvsp[0].id);
3666 yyerror(_("parse error"));
3673 #line 1742 "parse.y"
3677 if(strcmp(yyvsp[-1].id,"self")==0)
3678 push_self(yyvsp[-1].id, TRUE);
3680 g_free(yyvsp[-1].id);
3681 yyerror(_("parse error"));
3688 #line 1753 "parse.y"
3692 if(strcmp(yyvsp[0].id,"self")==0)
3693 push_self(yyvsp[0].id, TRUE);
3695 g_free(yyvsp[0].id);
3696 yyerror(_("parse error"));
3703 #line 1764 "parse.y"
3706 if(strcmp(yyvsp[-2].id,"self")==0)
3707 push_self(yyvsp[-2].id, FALSE);
3709 g_free(yyvsp[-2].id);
3710 yyerror(_("parse error"));
3717 #line 1774 "parse.y"
3720 if(strcmp(yyvsp[-3].id,"self")==0)
3721 push_self(yyvsp[-3].id, TRUE);
3723 g_free(yyvsp[-3].id);
3724 yyerror(_("parse error"));
3731 #line 1784 "parse.y"
3734 if(strcmp(yyvsp[-2].id,"self")==0)
3735 push_self(yyvsp[-2].id, TRUE);
3737 g_free(yyvsp[-2].id);
3738 yyerror(_("parse error"));
3745 #line 1794 "parse.y"
3746 { has_self = FALSE; }
3750 #line 1797 "parse.y"
3755 #line 1798 "parse.y"
3760 #line 1801 "parse.y"
3765 #line 1802 "parse.y"
3770 #line 1805 "parse.y"
3772 push_funcarg(yyvsp[0].id,NULL);
3777 #line 1808 "parse.y"
3779 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3784 #line 1811 "parse.y"
3786 if(strcmp(yyvsp[-2].id,"check")!=0) {
3787 yyerror(_("parse error"));
3790 g_free(yyvsp[-2].id);
3791 push_funcarg(yyvsp[-4].id,NULL);
3796 #line 1819 "parse.y"
3798 if(strcmp(yyvsp[-2].id,"check")!=0) {
3799 yyerror(_("parse error"));
3802 g_free(yyvsp[-2].id);
3803 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3808 #line 1829 "parse.y"
3813 #line 1830 "parse.y"
3818 #line 1833 "parse.y"
3820 if(strcmp(yyvsp[0].id,"type")==0) {
3821 Node *node = node_new (CHECK_NODE,
3822 "chtype", TYPE_CHECK,
3824 checks = g_list_append(checks,node);
3825 } else if(strcmp(yyvsp[0].id,"null")==0) {
3826 Node *node = node_new (CHECK_NODE,
3827 "chtype", NULL_CHECK,
3829 checks = g_list_append(checks,node);
3831 yyerror(_("parse error"));
3834 g_free(yyvsp[0].id);
3839 #line 1850 "parse.y"
3841 Node *node = node_new (CHECK_NODE,
3843 "number:steal", yyvsp[0].id,
3845 checks = g_list_append(checks,node);
3850 #line 1857 "parse.y"
3852 Node *node = node_new (CHECK_NODE,
3854 "number:steal", yyvsp[0].id,
3856 checks = g_list_append(checks,node);
3861 #line 1864 "parse.y"
3863 Node *node = node_new (CHECK_NODE,
3865 "number:steal", yyvsp[0].id,
3867 checks = g_list_append(checks,node);
3872 #line 1871 "parse.y"
3874 Node *node = node_new (CHECK_NODE,
3876 "number:steal", yyvsp[0].id,
3878 checks = g_list_append(checks,node);
3883 #line 1878 "parse.y"
3885 Node *node = node_new (CHECK_NODE,
3887 "number:steal", yyvsp[0].id,
3889 checks = g_list_append(checks,node);
3894 #line 1885 "parse.y"
3896 Node *node = node_new (CHECK_NODE,
3898 "number:steal", yyvsp[0].id,
3900 checks = g_list_append(checks,node);
3905 #line 1894 "parse.y"
3907 Node *node = node_new (ENUMDEF_NODE,
3908 "etype:steal", yyvsp[-1].id,
3909 "prefix:steal", yyvsp[-5].id,
3910 "values:steal", enum_vals,
3913 nodes = g_list_append (nodes, node);
3918 #line 1903 "parse.y"
3920 Node *node = node_new (ENUMDEF_NODE,
3921 "etype:steal", yyvsp[-1].id,
3922 "prefix:steal", yyvsp[-6].id,
3923 "values:steal", enum_vals,
3926 nodes = g_list_append (nodes, node);
3931 #line 1914 "parse.y"
3936 #line 1915 "parse.y"
3941 #line 1918 "parse.y"
3944 char *num = yyvsp[0].id;
3946 /* A float value, that's a bad enum */
3947 if (num[0] >= '0' &&
3949 strchr (num, '.') != NULL) {
3950 g_free (yyvsp[-2].id);
3952 yyerror(_("parse error (enumerator value not integer constant)"));
3956 node = node_new (ENUMVALUE_NODE,
3957 "name:steal", yyvsp[-2].id,
3960 enum_vals = g_list_append (enum_vals, node);
3965 #line 1938 "parse.y"
3969 node = node_new (ENUMVALUE_NODE,
3970 "name:steal", yyvsp[0].id,
3972 enum_vals = g_list_append (enum_vals, node);
3977 #line 1948 "parse.y"
3979 Node *node = node_new (FLAGS_NODE,
3980 "ftype:steal", yyvsp[-1].id,
3981 "prefix:steal", yyvsp[-5].id,
3982 "values:steal", flag_vals,
3985 nodes = g_list_append (nodes, node);
3990 #line 1957 "parse.y"
3992 Node *node = node_new (FLAGS_NODE,
3993 "ftype:steal", yyvsp[-1].id,
3994 "prefix:steal", yyvsp[-6].id,
3995 "values:steal", flag_vals,
3998 nodes = g_list_append (nodes, node);
4003 #line 1968 "parse.y"
4005 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
4010 #line 1971 "parse.y"
4012 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
4017 #line 1976 "parse.y"
4019 Node *node = node_new (ERROR_NODE,
4020 "etype:steal", yyvsp[-1].id,
4021 "prefix:steal", yyvsp[-5].id,
4022 "values:steal", error_vals,
4025 nodes = g_list_append (nodes, node);
4030 #line 1985 "parse.y"
4032 Node *node = node_new (ERROR_NODE,
4033 "etype:steal", yyvsp[-1].id,
4034 "prefix:steal", yyvsp[-6].id,
4035 "values:steal", error_vals,
4038 nodes = g_list_append (nodes, node);
4043 #line 1996 "parse.y"
4045 error_vals = g_list_append (error_vals, yyvsp[0].id);
4050 #line 1999 "parse.y"
4052 error_vals = g_list_append (error_vals, yyvsp[0].id);
4057 #line 2005 "parse.y"
4058 { yyval.id = yyvsp[0].id; }
4062 #line 2006 "parse.y"
4064 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
4065 g_free(yyvsp[0].id);
4070 #line 2010 "parse.y"
4071 { yyval.id = yyvsp[0].id; }
4075 #line 2011 "parse.y"
4076 { yyval.id = yyvsp[0].id; }
4082 /* Line 1000 of yacc.c. */
4083 #line 4084 "parse.c"
4089 YY_STACK_PRINT (yyss, yyssp);
4094 /* Now `shift' the result of the reduction. Determine what state
4095 that goes to, based on the state we popped back to and the rule
4096 number reduced by. */
4100 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4101 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4102 yystate = yytable[yystate];
4104 yystate = yydefgoto[yyn - YYNTOKENS];
4109 /*------------------------------------.
4110 | yyerrlab -- here on detecting error |
4111 `------------------------------------*/
4113 /* If not already recovering from an error, report this error. */
4118 yyn = yypact[yystate];
4120 if (YYPACT_NINF < yyn && yyn < YYLAST)
4122 YYSIZE_T yysize = 0;
4123 int yytype = YYTRANSLATE (yychar);
4124 const char* yyprefix;
4128 /* Start YYX at -YYN if negative to avoid negative indexes in
4130 int yyxbegin = yyn < 0 ? -yyn : 0;
4132 /* Stay within bounds of both yycheck and yytname. */
4133 int yychecklim = YYLAST - yyn;
4134 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4137 yyprefix = ", expecting ";
4138 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4139 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4141 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
4149 yysize += (sizeof ("syntax error, unexpected ")
4150 + yystrlen (yytname[yytype]));
4151 yymsg = (char *) YYSTACK_ALLOC (yysize);
4154 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
4155 yyp = yystpcpy (yyp, yytname[yytype]);
4159 yyprefix = ", expecting ";
4160 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4161 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4163 yyp = yystpcpy (yyp, yyprefix);
4164 yyp = yystpcpy (yyp, yytname[yyx]);
4169 YYSTACK_FREE (yymsg);
4172 yyerror ("syntax error; also virtual memory exhausted");
4175 #endif /* YYERROR_VERBOSE */
4176 yyerror ("syntax error");
4181 if (yyerrstatus == 3)
4183 /* If just tried and failed to reuse lookahead token after an
4184 error, discard it. */
4186 if (yychar <= YYEOF)
4188 /* If at end of input, pop the error token,
4189 then the rest of the stack, then return failure. */
4190 if (yychar == YYEOF)
4196 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4197 yydestruct (yystos[*yyssp], yyvsp);
4202 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
4203 yydestruct (yytoken, &yylval);
4209 /* Else will try to reuse lookahead token after shifting the error
4214 /*---------------------------------------------------.
4215 | yyerrorlab -- error raised explicitly by YYERROR. |
4216 `---------------------------------------------------*/
4220 /* Pacify GCC when the user code never invokes YYERROR and the label
4221 yyerrorlab therefore never appears in user code. */
4232 /*-------------------------------------------------------------.
4233 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4234 `-------------------------------------------------------------*/
4236 yyerrstatus = 3; /* Each real token shifted decrements this. */
4240 yyn = yypact[yystate];
4241 if (yyn != YYPACT_NINF)
4244 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4252 /* Pop the current state because it cannot handle the error token. */
4256 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4257 yydestruct (yystos[yystate], yyvsp);
4260 YY_STACK_PRINT (yyss, yyssp);
4266 YYDPRINTF ((stderr, "Shifting error token, "));
4275 /*-------------------------------------.
4276 | yyacceptlab -- YYACCEPT comes here. |
4277 `-------------------------------------*/
4282 /*-----------------------------------.
4283 | yyabortlab -- YYABORT comes here. |
4284 `-----------------------------------*/
4290 /*----------------------------------------------.
4291 | yyoverflowlab -- parser overflow comes here. |
4292 `----------------------------------------------*/
4294 yyerror ("parser stack overflow");
4302 YYSTACK_FREE (yyss);
4308 #line 2014 "parse.y"