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);
709 set = g_strdup_printf("%s->%s = %s%s (VAL);",
713 get = g_strdup_printf("%s (VAL, %s%s->%s);",
725 "get_line", prop->line_no,
727 "set_line", prop->line_no,
732 export_accessors (prop->name,
733 prop->get != NULL, prop->get_line,
734 prop->set != NULL, prop->set_line,
745 if (strcmp (s, "BOOL") == 0) {
746 error_print (GOB_WARN, line_no,
747 _("BOOL type is deprecated, please use BOOLEAN"));
749 return g_strdup ("BOOLEAN");
756 ensure_property (void)
758 if (property == NULL)
759 property = (Property *)node_new (PROPERTY_NODE, NULL);
764 /* Enabling traces. */
769 /* Enabling verbose error messages. */
770 #ifdef YYERROR_VERBOSE
771 # undef YYERROR_VERBOSE
772 # define YYERROR_VERBOSE 1
774 # define YYERROR_VERBOSE 0
777 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
779 typedef union YYSTYPE {
786 /* Line 191 of yacc.c. */
788 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
789 # define YYSTYPE_IS_DECLARED 1
790 # define YYSTYPE_IS_TRIVIAL 1
795 /* Copy the second part of user declarations. */
798 /* Line 214 of yacc.c. */
801 #if ! defined (yyoverflow) || YYERROR_VERBOSE
807 # define YYMALLOC malloc
810 /* The parser invokes alloca or malloc; define the necessary symbols. */
812 # ifdef YYSTACK_USE_ALLOCA
813 # if YYSTACK_USE_ALLOCA
814 # define YYSTACK_ALLOC alloca
817 # if defined (alloca) || defined (_ALLOCA_H)
818 # define YYSTACK_ALLOC alloca
821 # define YYSTACK_ALLOC __builtin_alloca
826 # ifdef YYSTACK_ALLOC
827 /* Pacify GCC's `empty if-body' warning. */
828 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
830 # if defined (__STDC__) || defined (__cplusplus)
831 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
832 # define YYSIZE_T size_t
834 # define YYSTACK_ALLOC YYMALLOC
835 # define YYSTACK_FREE YYFREE
837 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
840 #if (! defined (yyoverflow) \
841 && (! defined (__cplusplus) \
842 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
844 /* A type that is properly aligned for any stack member. */
851 /* The size of the maximum gap between one aligned stack and the next. */
852 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
854 /* The size of an array large to enough to hold all stacks, each with
856 # define YYSTACK_BYTES(N) \
857 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
858 + YYSTACK_GAP_MAXIMUM)
860 /* Copy COUNT objects from FROM to TO. The source and destination do
863 # if defined (__GNUC__) && 1 < __GNUC__
864 # define YYCOPY(To, From, Count) \
865 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
867 # define YYCOPY(To, From, Count) \
870 register YYSIZE_T yyi; \
871 for (yyi = 0; yyi < (Count); yyi++) \
872 (To)[yyi] = (From)[yyi]; \
878 /* Relocate STACK from its old location to the new one. The
879 local variables YYSIZE and YYSTACKSIZE give the old and new number of
880 elements in the stack, and YYPTR gives the new location of the
881 stack. Advance YYPTR to a properly aligned location for the next
883 # define YYSTACK_RELOCATE(Stack) \
886 YYSIZE_T yynewbytes; \
887 YYCOPY (&yyptr->Stack, Stack, yysize); \
888 Stack = &yyptr->Stack; \
889 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
890 yyptr += yynewbytes / sizeof (*yyptr); \
896 #if defined (__STDC__) || defined (__cplusplus)
897 typedef signed char yysigned_char;
899 typedef short yysigned_char;
902 /* YYFINAL -- State number of the termination state. */
904 /* YYLAST -- Last index in YYTABLE. */
907 /* YYNTOKENS -- Number of terminals. */
909 /* YYNNTS -- Number of nonterminals. */
911 /* YYNRULES -- Number of rules. */
913 /* YYNRULES -- Number of states. */
914 #define YYNSTATES 398
916 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
918 #define YYMAXUTOK 307
920 #define YYTRANSLATE(YYX) \
921 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
923 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
924 static const unsigned char yytranslate[] =
926 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
927 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
928 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
929 2, 2, 2, 64, 2, 2, 2, 2, 2, 2,
930 55, 56, 61, 2, 59, 65, 2, 2, 2, 2,
931 2, 2, 2, 2, 2, 2, 2, 2, 2, 57,
932 63, 58, 62, 2, 2, 2, 2, 2, 2, 2,
933 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
934 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
935 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
936 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
937 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
938 2, 2, 2, 53, 60, 54, 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, 2, 2, 2, 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, 1, 2, 3, 4,
952 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
953 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
954 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
955 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
956 45, 46, 47, 48, 49, 50, 51, 52
960 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
962 static const unsigned short yyprhs[] =
964 0, 0, 3, 7, 10, 13, 15, 17, 19, 21,
965 23, 25, 27, 30, 33, 36, 39, 41, 43, 45,
966 47, 52, 56, 62, 63, 69, 75, 81, 84, 86,
967 88, 91, 95, 97, 99, 101, 103, 105, 107, 109,
968 111, 114, 118, 121, 125, 128, 131, 133, 135, 136,
969 142, 149, 162, 172, 179, 183, 184, 196, 205, 211,
970 215, 216, 220, 222, 224, 229, 231, 233, 237, 241,
971 245, 249, 253, 257, 261, 265, 269, 273, 277, 281,
972 285, 289, 293, 297, 301, 303, 309, 311, 315, 316,
973 320, 322, 325, 327, 329, 331, 334, 337, 340, 344,
974 348, 351, 354, 357, 359, 362, 364, 367, 369, 371,
975 373, 375, 377, 379, 381, 383, 385, 387, 389, 391,
976 393, 396, 399, 403, 406, 408, 412, 416, 419, 421,
977 426, 430, 432, 435, 437, 448, 460, 470, 480, 489,
978 501, 510, 516, 519, 524, 525, 527, 530, 532, 534,
979 537, 540, 544, 549, 554, 556, 560, 562, 566, 568,
980 571, 575, 582, 590, 593, 595, 597, 600, 603, 607,
981 611, 615, 619, 627, 636, 640, 642, 646, 648, 656,
982 665, 669, 671, 679, 688, 692, 694, 696, 699, 701
985 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
986 static const yysigned_char yyrhs[] =
988 67, 0, -1, 69, 70, 69, -1, 70, 69, -1,
989 69, 70, -1, 70, -1, 24, -1, 27, -1, 25,
990 -1, 26, -1, 28, -1, 29, -1, 69, 68, -1,
991 69, 111, -1, 69, 114, -1, 69, 116, -1, 68,
992 -1, 111, -1, 114, -1, 116, -1, 71, 53, 73,
993 54, -1, 71, 53, 54, -1, 3, 21, 4, 21,
994 72, -1, -1, 55, 19, 19, 56, 72, -1, 55,
995 19, 21, 56, 72, -1, 55, 19, 20, 56, 72,
996 -1, 73, 74, -1, 74, -1, 102, -1, 19, 102,
997 -1, 19, 21, 102, -1, 79, -1, 80, -1, 82,
998 -1, 57, -1, 31, -1, 32, -1, 33, -1, 34,
999 -1, 19, 19, -1, 19, 53, 24, -1, 58, 118,
1000 -1, 58, 53, 24, -1, 76, 77, -1, 77, 76,
1001 -1, 77, -1, 76, -1, -1, 75, 91, 19, 78,
1002 57, -1, 75, 91, 19, 22, 78, 57, -1, 36,
1003 89, 88, 19, 81, 19, 53, 24, 19, 53, 24,
1004 57, -1, 36, 89, 88, 19, 81, 19, 53, 24,
1005 57, -1, 36, 89, 88, 19, 81, 19, -1, 55,
1006 19, 56, -1, -1, 35, 19, 19, 83, 19, 53,
1007 24, 19, 53, 24, 57, -1, 35, 19, 19, 83,
1008 19, 53, 24, 57, -1, 35, 19, 19, 83, 57,
1009 -1, 55, 84, 56, -1, -1, 84, 59, 87, -1,
1010 87, -1, 30, -1, 19, 55, 30, 56, -1, 118,
1011 -1, 85, -1, 40, 58, 85, -1, 41, 58, 85,
1012 -1, 42, 58, 118, -1, 43, 58, 118, -1, 44,
1013 58, 86, -1, 46, 58, 90, -1, 47, 58, 91,
1014 -1, 48, 58, 21, -1, 48, 58, 19, -1, 49,
1015 58, 21, -1, 49, 58, 19, -1, 50, 58, 21,
1016 -1, 50, 58, 19, -1, 51, 58, 21, -1, 51,
1017 58, 19, -1, 52, 58, 21, -1, 52, 58, 19,
1018 -1, 19, -1, 19, 55, 19, 91, 56, -1, 19,
1019 -1, 55, 90, 56, -1, -1, 19, 60, 90, -1,
1020 19, -1, 92, 96, -1, 92, -1, 93, -1, 19,
1021 -1, 5, 19, -1, 19, 5, -1, 95, 19, -1,
1022 5, 95, 19, -1, 95, 19, 5, -1, 94, 93,
1023 -1, 21, 93, -1, 5, 93, -1, 21, -1, 21,
1024 5, -1, 94, -1, 94, 5, -1, 6, -1, 18,
1025 -1, 14, -1, 15, -1, 13, -1, 16, -1, 17,
1026 -1, 11, -1, 12, -1, 7, -1, 8, -1, 9,
1027 -1, 61, -1, 61, 5, -1, 61, 96, -1, 61,
1028 5, 96, -1, 19, 99, -1, 99, -1, 75, 19,
1029 99, -1, 19, 75, 99, -1, 75, 99, -1, 97,
1030 -1, 19, 55, 100, 56, -1, 100, 59, 19, -1,
1031 19, -1, 53, 24, -1, 57, -1, 38, 89, 98,
1032 91, 19, 55, 105, 56, 103, 101, -1, 75, 38,
1033 89, 97, 91, 19, 55, 105, 56, 103, 101, -1,
1034 37, 75, 91, 19, 55, 105, 56, 103, 101, -1,
1035 75, 37, 91, 19, 55, 105, 56, 103, 101, -1,
1036 37, 91, 19, 55, 105, 56, 103, 101, -1, 39,
1037 55, 21, 56, 91, 19, 55, 105, 56, 103, 101,
1038 -1, 75, 91, 19, 55, 105, 56, 103, 101, -1,
1039 19, 55, 19, 56, 101, -1, 19, 104, -1, 19,
1040 104, 19, 104, -1, -1, 118, -1, 53, 24, -1,
1041 6, -1, 19, -1, 19, 5, -1, 5, 19, -1,
1042 19, 59, 106, -1, 19, 5, 59, 106, -1, 5,
1043 19, 59, 106, -1, 106, -1, 107, 59, 10, -1,
1044 107, -1, 107, 59, 108, -1, 108, -1, 91, 19,
1045 -1, 91, 19, 22, -1, 91, 19, 55, 19, 109,
1046 56, -1, 91, 19, 22, 55, 19, 109, 56, -1,
1047 109, 110, -1, 110, -1, 19, -1, 62, 118, -1,
1048 63, 118, -1, 62, 58, 118, -1, 63, 58, 118,
1049 -1, 58, 58, 118, -1, 64, 58, 118, -1, 9,
1050 19, 53, 112, 54, 21, 57, -1, 9, 19, 53,
1051 112, 59, 54, 21, 57, -1, 112, 59, 113, -1,
1052 113, -1, 19, 58, 118, -1, 19, -1, 46, 19,
1053 53, 115, 54, 21, 57, -1, 46, 19, 53, 115,
1054 59, 54, 21, 57, -1, 115, 59, 19, -1, 19,
1055 -1, 45, 19, 53, 117, 54, 21, 57, -1, 45,
1056 19, 53, 117, 59, 54, 21, 57, -1, 117, 59,
1057 19, -1, 19, -1, 20, -1, 65, 20, -1, 23,
1061 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1062 static const unsigned short yyrline[] =
1064 0, 644, 644, 645, 646, 647, 650, 659, 668, 677,
1065 686, 695, 706, 707, 708, 709, 710, 711, 712, 713,
1066 716, 721, 728, 742, 743, 755, 764, 778, 779, 782,
1067 783, 792, 804, 805, 806, 807, 810, 811, 812, 813,
1068 816, 836, 860, 864, 872, 873, 874, 875, 876, 882,
1069 885, 890, 958, 1012, 1101, 1109, 1114, 1162, 1198, 1214,
1070 1215, 1218, 1219, 1222, 1223, 1235, 1236, 1239, 1245, 1251,
1071 1257, 1263, 1269, 1275, 1282, 1288, 1294, 1300, 1306, 1312,
1072 1318, 1324, 1330, 1336, 1342, 1362, 1371, 1377, 1378, 1381,
1073 1384, 1390, 1397, 1406, 1409, 1412, 1416, 1420, 1424, 1429,
1074 1437, 1441, 1446, 1450, 1453, 1457, 1460, 1465, 1466, 1467,
1075 1468, 1469, 1470, 1471, 1472, 1473, 1476, 1477, 1478, 1481,
1076 1482, 1483, 1487, 1494, 1506, 1512, 1524, 1536, 1539, 1545,
1077 1550, 1553, 1558, 1559, 1563, 1579, 1595, 1611, 1627, 1638,
1078 1644, 1654, 1677, 1688, 1707, 1713, 1714, 1720, 1721, 1732,
1079 1743, 1754, 1764, 1774, 1784, 1787, 1788, 1791, 1792, 1795,
1080 1798, 1801, 1809, 1819, 1820, 1823, 1840, 1847, 1854, 1861,
1081 1868, 1875, 1884, 1893, 1904, 1905, 1908, 1928, 1938, 1947,
1082 1958, 1961, 1966, 1975, 1986, 1989, 1995, 1996, 2000, 2001
1086 #if YYDEBUG || YYERROR_VERBOSE
1087 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1088 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1089 static const char *const yytname[] =
1091 "$end", "error", "$undefined", "CLASS", "FROM", "CONST", "VOID",
1092 "STRUCT", "UNION", "ENUM", "THREEDOTS", "SIGNED", "UNSIGNED", "LONG",
1093 "SHORT", "INT", "FLOAT", "DOUBLE", "CHAR", "TOKEN", "NUMBER",
1094 "TYPETOKEN", "ARRAY_DIM", "SINGLE_CHAR", "CCODE", "HTCODE", "PHCODE",
1095 "HCODE", "ACODE", "ATCODE", "STRING", "PUBLIC", "PRIVATE", "PROTECTED",
1096 "CLASSWIDE", "PROPERTY", "ARGUMENT", "VIRTUAL", "SIGNAL", "OVERRIDE",
1097 "NICK", "BLURB", "MAXIMUM", "MINIMUM", "DEFAULT_VALUE", "ERROR", "FLAGS",
1098 "TYPE", "FLAGS_TYPE", "ENUM_TYPE", "PARAM_TYPE", "BOXED_TYPE",
1099 "OBJECT_TYPE", "'{'", "'}'", "'('", "')'", "';'", "'='", "','", "'|'",
1100 "'*'", "'>'", "'<'", "'!'", "'-'", "$accept", "prog", "ccode", "ccodes",
1101 "class", "classdec", "classflags", "classcode", "thing", "scope",
1102 "destructor", "initializer", "varoptions", "variable", "argument",
1103 "export", "property", "param_spec", "param_spec_list", "string",
1104 "anyval", "param_spec_value", "argtype", "flags", "flaglist", "type",
1105 "specifier_list", "spec_list", "specifier", "strunionenum", "pointer",
1106 "simplesigtype", "fullsigtype", "sigtype", "tokenlist", "codenocode",
1107 "method", "returnvals", "retcode", "funcargs", "arglist", "arglist1",
1108 "arg", "checklist", "check", "enumcode", "enumvals", "enumval",
1109 "flagcode", "flagvals", "errorcode", "errorvals", "numtok", 0
1114 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1116 static const unsigned short yytoknum[] =
1118 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1119 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1120 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1121 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1122 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1123 305, 306, 307, 123, 125, 40, 41, 59, 61, 44,
1124 124, 42, 62, 60, 33, 45
1128 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1129 static const unsigned char yyr1[] =
1131 0, 66, 67, 67, 67, 67, 68, 68, 68, 68,
1132 68, 68, 69, 69, 69, 69, 69, 69, 69, 69,
1133 70, 70, 71, 72, 72, 72, 72, 73, 73, 74,
1134 74, 74, 74, 74, 74, 74, 75, 75, 75, 75,
1135 76, 76, 77, 77, 78, 78, 78, 78, 78, 79,
1136 79, 80, 80, 80, 81, 81, 82, 82, 82, 83,
1137 83, 84, 84, 85, 85, 86, 86, 87, 87, 87,
1138 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
1139 87, 87, 87, 87, 87, 88, 88, 89, 89, 90,
1140 90, 91, 91, 92, 92, 92, 92, 92, 92, 92,
1141 93, 93, 93, 93, 93, 93, 93, 94, 94, 94,
1142 94, 94, 94, 94, 94, 94, 95, 95, 95, 96,
1143 96, 96, 96, 97, 97, 98, 98, 98, 98, 99,
1144 100, 100, 101, 101, 102, 102, 102, 102, 102, 102,
1145 102, 102, 103, 103, 103, 104, 104, 105, 105, 105,
1146 105, 105, 105, 105, 105, 106, 106, 107, 107, 108,
1147 108, 108, 108, 109, 109, 110, 110, 110, 110, 110,
1148 110, 110, 111, 111, 112, 112, 113, 113, 114, 114,
1149 115, 115, 116, 116, 117, 117, 118, 118, 118, 118
1152 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1153 static const unsigned char yyr2[] =
1155 0, 2, 3, 2, 2, 1, 1, 1, 1, 1,
1156 1, 1, 2, 2, 2, 2, 1, 1, 1, 1,
1157 4, 3, 5, 0, 5, 5, 5, 2, 1, 1,
1158 2, 3, 1, 1, 1, 1, 1, 1, 1, 1,
1159 2, 3, 2, 3, 2, 2, 1, 1, 0, 5,
1160 6, 12, 9, 6, 3, 0, 11, 8, 5, 3,
1161 0, 3, 1, 1, 4, 1, 1, 3, 3, 3,
1162 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1163 3, 3, 3, 3, 1, 5, 1, 3, 0, 3,
1164 1, 2, 1, 1, 1, 2, 2, 2, 3, 3,
1165 2, 2, 2, 1, 2, 1, 2, 1, 1, 1,
1166 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1167 2, 2, 3, 2, 1, 3, 3, 2, 1, 4,
1168 3, 1, 2, 1, 10, 11, 9, 9, 8, 11,
1169 8, 5, 2, 4, 0, 1, 2, 1, 1, 2,
1170 2, 3, 4, 4, 1, 3, 1, 3, 1, 2,
1171 3, 6, 7, 2, 1, 1, 2, 2, 3, 3,
1172 3, 3, 7, 8, 3, 1, 3, 1, 7, 8,
1173 3, 1, 7, 8, 3, 1, 1, 2, 1, 1
1176 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1177 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1178 means the default is an error. */
1179 static const unsigned char yydefact[] =
1181 0, 0, 0, 6, 8, 9, 7, 10, 11, 0,
1182 0, 0, 16, 0, 5, 0, 17, 18, 19, 0,
1183 0, 0, 0, 1, 12, 4, 13, 14, 15, 3,
1184 0, 0, 0, 0, 0, 2, 0, 36, 37, 38,
1185 39, 0, 88, 0, 88, 0, 21, 35, 0, 28,
1186 0, 32, 33, 34, 29, 23, 177, 0, 175, 185,
1187 0, 181, 0, 0, 0, 0, 0, 30, 0, 0,
1188 0, 0, 107, 116, 117, 118, 114, 115, 111, 109,
1189 110, 112, 113, 108, 94, 103, 0, 0, 92, 93,
1190 105, 0, 0, 0, 20, 27, 0, 88, 0, 0,
1191 22, 0, 0, 0, 0, 0, 0, 0, 31, 0,
1192 0, 60, 90, 0, 86, 0, 0, 95, 102, 0,
1193 96, 104, 101, 0, 0, 119, 91, 106, 100, 97,
1194 0, 0, 128, 0, 124, 0, 0, 0, 48, 0,
1195 189, 186, 188, 0, 176, 0, 0, 174, 0, 184,
1196 0, 0, 180, 0, 0, 0, 0, 0, 0, 87,
1197 0, 55, 98, 0, 0, 120, 121, 99, 0, 0,
1198 0, 123, 0, 127, 0, 0, 0, 0, 0, 0,
1199 48, 0, 0, 47, 46, 0, 0, 0, 0, 187,
1200 172, 0, 182, 0, 178, 0, 0, 133, 141, 84,
1201 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1202 0, 0, 0, 62, 0, 58, 89, 0, 0, 0,
1203 0, 0, 107, 94, 0, 0, 154, 156, 158, 122,
1204 131, 0, 126, 125, 0, 0, 0, 0, 40, 0,
1205 0, 0, 0, 42, 44, 45, 49, 23, 23, 23,
1206 173, 183, 179, 132, 0, 0, 0, 0, 0, 0,
1207 0, 0, 0, 0, 0, 0, 59, 0, 0, 0,
1208 0, 53, 0, 95, 96, 0, 159, 144, 0, 129,
1209 0, 0, 0, 0, 0, 41, 50, 144, 43, 24,
1210 26, 25, 0, 63, 67, 68, 69, 70, 189, 66,
1211 71, 65, 72, 73, 75, 74, 77, 76, 79, 78,
1212 81, 80, 83, 82, 61, 0, 85, 54, 0, 144,
1213 0, 0, 151, 160, 0, 0, 0, 155, 157, 130,
1214 0, 0, 144, 0, 0, 0, 0, 57, 0, 0,
1215 153, 152, 0, 0, 0, 142, 145, 138, 144, 0,
1216 0, 0, 140, 0, 0, 0, 52, 136, 0, 165,
1217 0, 0, 0, 0, 0, 164, 146, 0, 0, 144,
1218 137, 144, 64, 0, 0, 0, 0, 0, 166, 0,
1219 167, 0, 161, 163, 143, 134, 0, 0, 56, 0,
1220 162, 170, 168, 169, 171, 139, 135, 51
1223 /* YYDEFGOTO[NTERM-NUM]. */
1224 static const short yydefgoto[] =
1226 -1, 11, 12, 13, 14, 15, 100, 48, 49, 50,
1227 183, 184, 185, 51, 52, 219, 53, 157, 212, 294,
1228 300, 213, 115, 70, 113, 224, 88, 89, 90, 91,
1229 126, 132, 133, 134, 231, 198, 54, 326, 345, 225,
1230 226, 227, 228, 364, 365, 16, 57, 58, 17, 62,
1234 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1236 #define YYPACT_NINF -317
1237 static const short yypact[] =
1239 137, 4, 45, -317, -317, -317, -317, -317, -317, 99,
1240 106, 134, -317, 137, 170, 98, -317, -317, -317, 156,
1241 124, 125, 157, -317, -317, 170, -317, -317, -317, 170,
1242 154, 181, 209, 214, 222, 170, 215, -317, -317, -317,
1243 -317, 225, 196, 310, 196, 204, -317, -317, 188, -317,
1244 276, -317, -317, -317, -317, 217, 216, 113, -317, -317,
1245 117, -317, 146, 241, 301, 267, 276, -317, 284, 292,
1246 293, 357, -317, -317, -317, -317, -317, -317, -317, -317,
1247 -317, -317, -317, -317, 325, 425, 374, 317, 299, -317,
1248 439, 318, 231, 346, -317, -317, 374, 196, 358, 365,
1249 -317, 74, 373, 76, 380, 84, 390, 90, -317, 362,
1250 409, 377, 375, 378, 392, 414, 453, -317, -317, 429,
1251 -317, 453, -317, 430, 406, 2, -317, 453, -317, 457,
1252 224, 444, -317, 374, -317, 416, 454, 456, 126, 149,
1253 -317, -317, -317, 458, -317, 419, 459, -317, 420, -317,
1254 460, 422, -317, 461, 70, 428, 258, 21, 292, -317,
1255 465, 431, -317, 432, 391, 299, -317, -317, 433, 466,
1256 470, -317, -6, -317, 471, 374, 436, -6, 374, 26,
1257 0, 391, 7, 434, 474, 437, 440, 441, 442, -317,
1258 -317, 438, -317, 443, -317, 445, 475, -317, -317, -317,
1259 446, 447, 448, 449, 450, 451, 452, 455, 462, 463,
1260 464, 467, 91, -317, 473, -317, -317, 374, 482, 484,
1261 391, 408, 468, 6, 492, 472, -317, 476, -317, -317,
1262 -317, 147, -317, -317, 477, 493, 391, 495, -317, 491,
1263 479, 478, 494, -317, -317, -317, -317, 217, 217, 217,
1264 -317, -317, -317, -317, 1, 1, 74, 74, 9, 292,
1265 374, 218, 219, 247, 248, 252, -317, 258, 499, 481,
1266 483, 480, 485, 153, 158, 374, 94, 497, 340, -317,
1267 498, 391, 487, 488, 490, -317, -317, 497, -317, -317,
1268 -317, -317, 496, -317, -317, -317, -317, -317, 496, -317,
1269 -317, -317, -317, -317, -317, -317, -317, -317, -317, -317,
1270 -317, -317, -317, -317, -317, 47, -317, -317, 503, 497,
1271 374, 374, -317, 500, 510, 27, 70, -317, -317, -317,
1272 501, 391, 497, 391, 70, 489, 505, -317, 54, 70,
1273 -317, -317, 511, 57, 507, 519, -317, -317, 497, 504,
1274 70, 506, -317, 508, 516, 512, -317, -317, 57, -317,
1275 509, 64, 66, 513, 50, -317, -317, 27, 70, 497,
1276 -317, 497, -317, 486, 522, 79, 74, 74, -317, 74,
1277 -317, 74, -317, -317, -317, -317, 70, 70, -317, 502,
1278 -317, -317, -317, -317, -317, -317, -317, -317
1281 /* YYPGOTO[NTERM-NUM]. */
1282 static const short yypgoto[] =
1284 -317, -317, 8, 82, 534, -317, -17, -317, 515, -31,
1285 364, 366, 370, -317, -317, -317, -317, -317, -317, -54,
1286 -317, 285, -317, -29, -154, -42, -317, -68, -317, -62,
1287 -109, 417, -317, -95, -317, -316, -22, -281, 186, -179,
1288 -220, -317, 278, 203, -247, 97, -317, 469, 145, -317,
1292 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1293 positive, shift that token. If negative, reduce the rule which
1294 number is the opposite. If zero, do what YYDEFACT says.
1295 If YYTABLE_NINF, syntax error. */
1296 #define YYTABLE_NINF -151
1297 static const short yytable[] =
1299 144, 87, 241, 118, 216, 66, 334, 165, 98, 119,
1300 347, 274, 86, 168, 67, 92, 166, 122, 352, 179,
1301 292, 24, 128, 357, 110, 19, 140, 141, 298, 141,
1302 142, 293, 142, 66, 370, 171, 173, 24, 339, 293,
1303 214, 272, 108, 24, 123, 238, 140, 141, 118, 169,
1304 142, 350, 385, 118, 136, 322, 229, 283, 182, 118,
1305 242, 131, -148, 125, 20, 275, 336, 368, 137, 359,
1306 395, 396, 143, 355, 143, 232, 359, 233, 215, 239,
1307 344, 243, 171, 140, 141, 140, 141, 142, 386, 142,
1308 387, 174, 143, 140, 141, 56, 29, 142, 359, 170,
1309 340, 341, 330, 149, 337, 302, 382, 35, 360, 152,
1310 26, 356, 361, 362, 363, 360, 323, 383, 21, 361,
1311 362, 363, 377, 196, 379, 22, 26, 197, 383, 143,
1312 146, 143, 26, 235, 23, 390, 237, 360, 150, 143,
1313 1, 361, 362, 363, 153, 179, 2, 266, 180, 324,
1314 267, 30, 349, 118, 351, 296, 297, 301, 27, 119,
1315 31, 3, 4, 5, 6, 7, 8, 102, 186, 187,
1316 188, 104, 103, 36, 27, 269, 105, 32, 33, 2,
1317 27, 181, 9, 10, 182, 37, 38, 39, 40, 41,
1318 42, 43, 44, 45, 3, 4, 5, 6, 7, 8,
1319 106, 295, 55, 279, 299, 107, 280, 36, 46, -150,
1320 34, 47, 320, 28, -149, 9, 10, 321, 303, 37,
1321 38, 39, 40, 41, 42, 43, 44, 45, 56, 28,
1322 289, 290, 291, 59, 63, 28, 64, 304, 306, 305,
1323 307, 61, 94, 168, 68, 47, 37, 38, 39, 40,
1324 130, 69, 43, 44, 45, 37, 38, 39, 40, 93,
1325 378, 380, 37, 38, 39, 40, 308, 310, 309, 311,
1326 65, 312, 99, 313, 101, 391, 392, 199, 393, 169,
1327 394, 71, 72, 73, 74, 75, 109, 76, 77, 78,
1328 79, 80, 81, 82, 83, 84, 65, 85, 200, 201,
1329 202, 203, 204, 111, 205, 206, 207, 208, 209, 210,
1330 211, 112, 114, 96, 97, 71, 72, 73, 74, 75,
1331 63, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1332 120, 85, 37, 38, 39, 40, 124, 129, 43, 44,
1333 45, 37, 38, 39, 40, 71, 72, 73, 74, 75,
1334 327, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1335 125, 85, 116, 72, 73, 74, 75, 135, 76, 77,
1336 78, 79, 80, 81, 82, 83, 117, 138, 85, 71,
1337 72, 73, 74, 75, 139, 76, 77, 78, 79, 80,
1338 81, 82, 83, 84, 145, 85, 221, 222, 73, 74,
1339 75, 148, 76, 77, 78, 79, 80, 81, 82, 83,
1340 223, 151, 85, 116, 72, 73, 74, 75, 154, 76,
1341 77, 78, 79, 80, 81, 82, 83, 273, 155, 85,
1342 121, 72, 156, 161, 159, 158, 76, 77, 78, 79,
1343 80, 81, 82, 83, 127, 72, 85, 160, 162, 163,
1344 76, 77, 78, 79, 80, 81, 82, 83, 116, 72,
1345 85, 164, 167, 172, 76, 77, 78, 79, 80, 81,
1346 82, 83, 175, 176, 85, 177, 190, 192, 189, 194,
1347 191, 193, 195, 181, 217, 230, 218, 220, 169, 168,
1348 234, 236, 182, 179, 246, 250, 247, 248, 249, 253,
1349 251, 270, 252, 271, 254, 255, 256, 257, 258, 259,
1350 260, 276, 282, 261, 284, 285, 325, 329, 288, 353,
1351 262, 263, 264, 315, -147, 265, 268, 338, 277, 343,
1352 358, 366, 281, 318, 287, 278, 286, 316, 367, 317,
1353 373, 319, 331, 388, 332, 333, 389, 25, 245, 244,
1354 240, 335, 314, 384, 178, 342, 328, 348, 354, 397,
1355 369, 375, 371, 95, 372, 374, 0, 376, 0, 0,
1359 static const short yycheck[] =
1361 101, 43, 181, 71, 158, 36, 287, 5, 50, 71,
1362 326, 5, 43, 19, 36, 44, 125, 85, 334, 19,
1363 19, 13, 90, 339, 66, 21, 19, 20, 19, 20,
1364 23, 30, 23, 64, 350, 130, 131, 29, 319, 30,
1365 19, 220, 64, 35, 86, 19, 19, 20, 116, 55,
1366 23, 332, 368, 121, 96, 275, 165, 236, 58, 127,
1367 53, 92, 56, 61, 19, 59, 19, 348, 97, 19,
1368 386, 387, 65, 19, 65, 170, 19, 172, 57, 53,
1369 53, 182, 177, 19, 20, 19, 20, 23, 369, 23,
1370 371, 133, 65, 19, 20, 19, 14, 23, 19, 130,
1371 320, 321, 281, 19, 57, 259, 56, 25, 58, 19,
1372 13, 57, 62, 63, 64, 58, 22, 364, 19, 62,
1373 63, 64, 58, 53, 58, 19, 29, 57, 375, 65,
1374 54, 65, 35, 175, 0, 56, 178, 58, 54, 65,
1375 3, 62, 63, 64, 54, 19, 9, 56, 22, 55,
1376 59, 53, 331, 221, 333, 256, 257, 258, 13, 221,
1377 4, 24, 25, 26, 27, 28, 29, 54, 19, 20,
1378 21, 54, 59, 19, 29, 217, 59, 53, 53, 9,
1379 35, 55, 45, 46, 58, 31, 32, 33, 34, 35,
1380 36, 37, 38, 39, 24, 25, 26, 27, 28, 29,
1381 54, 255, 21, 56, 258, 59, 59, 19, 54, 56,
1382 53, 57, 59, 13, 56, 45, 46, 59, 260, 31,
1383 32, 33, 34, 35, 36, 37, 38, 39, 19, 29,
1384 247, 248, 249, 19, 19, 35, 21, 19, 19, 21,
1385 21, 19, 54, 19, 19, 57, 31, 32, 33, 34,
1386 19, 55, 37, 38, 39, 31, 32, 33, 34, 55,
1387 361, 362, 31, 32, 33, 34, 19, 19, 21, 21,
1388 55, 19, 55, 21, 58, 376, 377, 19, 379, 55,
1389 381, 5, 6, 7, 8, 9, 19, 11, 12, 13,
1390 14, 15, 16, 17, 18, 19, 55, 21, 40, 41,
1391 42, 43, 44, 19, 46, 47, 48, 49, 50, 51,
1392 52, 19, 19, 37, 38, 5, 6, 7, 8, 9,
1393 19, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1394 5, 21, 31, 32, 33, 34, 19, 19, 37, 38,
1395 39, 31, 32, 33, 34, 5, 6, 7, 8, 9,
1396 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1397 61, 21, 5, 6, 7, 8, 9, 21, 11, 12,
1398 13, 14, 15, 16, 17, 18, 19, 19, 21, 5,
1399 6, 7, 8, 9, 19, 11, 12, 13, 14, 15,
1400 16, 17, 18, 19, 21, 21, 5, 6, 7, 8,
1401 9, 21, 11, 12, 13, 14, 15, 16, 17, 18,
1402 19, 21, 21, 5, 6, 7, 8, 9, 56, 11,
1403 12, 13, 14, 15, 16, 17, 18, 19, 19, 21,
1404 5, 6, 55, 19, 56, 60, 11, 12, 13, 14,
1405 15, 16, 17, 18, 5, 6, 21, 55, 19, 19,
1406 11, 12, 13, 14, 15, 16, 17, 18, 5, 6,
1407 21, 55, 5, 19, 11, 12, 13, 14, 15, 16,
1408 17, 18, 56, 19, 21, 19, 57, 57, 20, 57,
1409 21, 21, 21, 55, 19, 19, 55, 55, 55, 19,
1410 19, 55, 58, 19, 57, 57, 56, 56, 56, 24,
1411 57, 19, 57, 19, 58, 58, 58, 58, 58, 58,
1412 58, 19, 19, 58, 19, 24, 19, 19, 24, 30,
1413 58, 58, 58, 24, 56, 58, 53, 24, 56, 19,
1414 19, 24, 55, 53, 56, 59, 57, 56, 19, 56,
1415 24, 56, 55, 57, 56, 55, 24, 13, 184, 183,
1416 180, 55, 267, 367, 137, 55, 278, 56, 53, 57,
1417 56, 358, 56, 48, 56, 53, -1, 58, -1, -1,
1421 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1422 symbol of state STATE-NUM. */
1423 static const unsigned char yystos[] =
1425 0, 3, 9, 24, 25, 26, 27, 28, 29, 45,
1426 46, 67, 68, 69, 70, 71, 111, 114, 116, 21,
1427 19, 19, 19, 0, 68, 70, 111, 114, 116, 69,
1428 53, 4, 53, 53, 53, 69, 19, 31, 32, 33,
1429 34, 35, 36, 37, 38, 39, 54, 57, 73, 74,
1430 75, 79, 80, 82, 102, 21, 19, 112, 113, 19,
1431 117, 19, 115, 19, 21, 55, 75, 102, 19, 55,
1432 89, 5, 6, 7, 8, 9, 11, 12, 13, 14,
1433 15, 16, 17, 18, 19, 21, 75, 91, 92, 93,
1434 94, 95, 89, 55, 54, 74, 37, 38, 91, 55,
1435 72, 58, 54, 59, 54, 59, 54, 59, 102, 19,
1436 91, 19, 19, 90, 19, 88, 5, 19, 93, 95,
1437 5, 5, 93, 91, 19, 61, 96, 5, 93, 19,
1438 19, 75, 97, 98, 99, 21, 91, 89, 19, 19,
1439 19, 20, 23, 65, 118, 21, 54, 113, 21, 19,
1440 54, 21, 19, 54, 56, 19, 55, 83, 60, 56,
1441 55, 19, 19, 19, 55, 5, 96, 5, 19, 55,
1442 75, 99, 19, 99, 91, 56, 19, 19, 97, 19,
1443 22, 55, 58, 76, 77, 78, 19, 20, 21, 20,
1444 57, 21, 57, 21, 57, 21, 53, 57, 101, 19,
1445 40, 41, 42, 43, 44, 46, 47, 48, 49, 50,
1446 51, 52, 84, 87, 19, 57, 90, 19, 55, 81,
1447 55, 5, 6, 19, 91, 105, 106, 107, 108, 96,
1448 19, 100, 99, 99, 19, 91, 55, 91, 19, 53,
1449 78, 105, 53, 118, 77, 76, 57, 56, 56, 56,
1450 57, 57, 57, 24, 58, 58, 58, 58, 58, 58,
1451 58, 58, 58, 58, 58, 58, 56, 59, 53, 91,
1452 19, 19, 105, 19, 5, 59, 19, 56, 59, 56,
1453 59, 55, 19, 105, 19, 24, 57, 56, 24, 72,
1454 72, 72, 19, 30, 85, 85, 118, 118, 19, 85,
1455 86, 118, 90, 91, 19, 21, 19, 21, 19, 21,
1456 19, 21, 19, 21, 87, 24, 56, 56, 53, 56,
1457 59, 59, 106, 22, 55, 19, 103, 10, 108, 19,
1458 105, 55, 56, 55, 103, 55, 19, 57, 24, 103,
1459 106, 106, 55, 19, 53, 104, 118, 101, 56, 105,
1460 103, 105, 101, 30, 53, 19, 57, 101, 19, 19,
1461 58, 62, 63, 64, 109, 110, 24, 19, 103, 56,
1462 101, 56, 56, 24, 53, 109, 58, 58, 118, 58,
1463 118, 58, 56, 110, 104, 101, 103, 103, 57, 24,
1464 56, 118, 118, 118, 118, 101, 101, 57
1467 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1468 # define YYSIZE_T __SIZE_TYPE__
1470 #if ! defined (YYSIZE_T) && defined (size_t)
1471 # define YYSIZE_T size_t
1473 #if ! defined (YYSIZE_T)
1474 # if defined (__STDC__) || defined (__cplusplus)
1475 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1476 # define YYSIZE_T size_t
1479 #if ! defined (YYSIZE_T)
1480 # define YYSIZE_T unsigned int
1483 #define yyerrok (yyerrstatus = 0)
1484 #define yyclearin (yychar = YYEMPTY)
1485 #define YYEMPTY (-2)
1488 #define YYACCEPT goto yyacceptlab
1489 #define YYABORT goto yyabortlab
1490 #define YYERROR goto yyerrorlab
1493 /* Like YYERROR except do call yyerror. This remains here temporarily
1494 to ease the transition to the new meaning of YYERROR, for GCC.
1495 Once GCC version 2 has supplanted version 1, this can go. */
1497 #define YYFAIL goto yyerrlab
1499 #define YYRECOVERING() (!!yyerrstatus)
1501 #define YYBACKUP(Token, Value) \
1503 if (yychar == YYEMPTY && yylen == 1) \
1507 yytoken = YYTRANSLATE (yychar); \
1513 yyerror ("syntax error: cannot back up");\
1519 #define YYERRCODE 256
1521 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1524 #ifndef YYLLOC_DEFAULT
1525 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1526 ((Current).first_line = (Rhs)[1].first_line, \
1527 (Current).first_column = (Rhs)[1].first_column, \
1528 (Current).last_line = (Rhs)[N].last_line, \
1529 (Current).last_column = (Rhs)[N].last_column)
1532 /* YYLEX -- calling `yylex' with the right arguments. */
1535 # define YYLEX yylex (YYLEX_PARAM)
1537 # define YYLEX yylex ()
1540 /* Enable debugging if requested. */
1544 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1545 # define YYFPRINTF fprintf
1548 # define YYDPRINTF(Args) \
1554 # define YYDSYMPRINT(Args) \
1560 # define YYDSYMPRINTF(Title, Token, Value, Location) \
1564 YYFPRINTF (stderr, "%s ", Title); \
1565 yysymprint (stderr, \
1567 YYFPRINTF (stderr, "\n"); \
1571 /*------------------------------------------------------------------.
1572 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1574 `------------------------------------------------------------------*/
1576 #if defined (__STDC__) || defined (__cplusplus)
1578 yy_stack_print (short *bottom, short *top)
1581 yy_stack_print (bottom, top)
1586 YYFPRINTF (stderr, "Stack now");
1587 for (/* Nothing. */; bottom <= top; ++bottom)
1588 YYFPRINTF (stderr, " %d", *bottom);
1589 YYFPRINTF (stderr, "\n");
1592 # define YY_STACK_PRINT(Bottom, Top) \
1595 yy_stack_print ((Bottom), (Top)); \
1599 /*------------------------------------------------.
1600 | Report that the YYRULE is going to be reduced. |
1601 `------------------------------------------------*/
1603 #if defined (__STDC__) || defined (__cplusplus)
1605 yy_reduce_print (int yyrule)
1608 yy_reduce_print (yyrule)
1613 unsigned int yylno = yyrline[yyrule];
1614 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1616 /* Print the symbols being reduced, and their result. */
1617 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1618 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1619 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1622 # define YY_REDUCE_PRINT(Rule) \
1625 yy_reduce_print (Rule); \
1628 /* Nonzero means print parse trace. It is left uninitialized so that
1629 multiple parsers can coexist. */
1631 #else /* !YYDEBUG */
1632 # define YYDPRINTF(Args)
1633 # define YYDSYMPRINT(Args)
1634 # define YYDSYMPRINTF(Title, Token, Value, Location)
1635 # define YY_STACK_PRINT(Bottom, Top)
1636 # define YY_REDUCE_PRINT(Rule)
1637 #endif /* !YYDEBUG */
1640 /* YYINITDEPTH -- initial size of the parser's stacks. */
1642 # define YYINITDEPTH 200
1645 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1646 if the built-in stack extension method is used).
1648 Do not make this value too large; the results are undefined if
1649 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1650 evaluated with infinite-precision integer arithmetic. */
1652 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1657 # define YYMAXDEPTH 10000
1665 # if defined (__GLIBC__) && defined (_STRING_H)
1666 # define yystrlen strlen
1668 /* Return the length of YYSTR. */
1670 # if defined (__STDC__) || defined (__cplusplus)
1671 yystrlen (const char *yystr)
1677 register const char *yys = yystr;
1679 while (*yys++ != '\0')
1682 return yys - yystr - 1;
1688 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1689 # define yystpcpy stpcpy
1691 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1694 # if defined (__STDC__) || defined (__cplusplus)
1695 yystpcpy (char *yydest, const char *yysrc)
1697 yystpcpy (yydest, yysrc)
1702 register char *yyd = yydest;
1703 register const char *yys = yysrc;
1705 while ((*yyd++ = *yys++) != '\0')
1713 #endif /* !YYERROR_VERBOSE */
1718 /*--------------------------------.
1719 | Print this symbol on YYOUTPUT. |
1720 `--------------------------------*/
1722 #if defined (__STDC__) || defined (__cplusplus)
1724 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1727 yysymprint (yyoutput, yytype, yyvaluep)
1733 /* Pacify ``unused variable'' warnings. */
1736 if (yytype < YYNTOKENS)
1738 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1740 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1744 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1751 YYFPRINTF (yyoutput, ")");
1754 #endif /* ! YYDEBUG */
1755 /*-----------------------------------------------.
1756 | Release the memory associated to this symbol. |
1757 `-----------------------------------------------*/
1759 #if defined (__STDC__) || defined (__cplusplus)
1761 yydestruct (int yytype, YYSTYPE *yyvaluep)
1764 yydestruct (yytype, yyvaluep)
1769 /* Pacify ``unused variable'' warnings. */
1781 /* Prevent warnings from -Wmissing-prototypes. */
1783 #ifdef YYPARSE_PARAM
1784 # if defined (__STDC__) || defined (__cplusplus)
1785 int yyparse (void *YYPARSE_PARAM);
1789 #else /* ! YYPARSE_PARAM */
1790 #if defined (__STDC__) || defined (__cplusplus)
1795 #endif /* ! YYPARSE_PARAM */
1799 /* The lookahead symbol. */
1802 /* The semantic value of the lookahead symbol. */
1805 /* Number of syntax errors so far. */
1814 #ifdef YYPARSE_PARAM
1815 # if defined (__STDC__) || defined (__cplusplus)
1816 int yyparse (void *YYPARSE_PARAM)
1818 int yyparse (YYPARSE_PARAM)
1819 void *YYPARSE_PARAM;
1821 #else /* ! YYPARSE_PARAM */
1822 #if defined (__STDC__) || defined (__cplusplus)
1833 register int yystate;
1836 /* Number of tokens to shift before error messages enabled. */
1838 /* Lookahead token as an internal (translated) token number. */
1841 /* Three stacks and their tools:
1842 `yyss': related to states,
1843 `yyvs': related to semantic values,
1844 `yyls': related to locations.
1846 Refer to the stacks thru separate pointers, to allow yyoverflow
1847 to reallocate them elsewhere. */
1849 /* The state stack. */
1850 short yyssa[YYINITDEPTH];
1851 short *yyss = yyssa;
1852 register short *yyssp;
1854 /* The semantic value stack. */
1855 YYSTYPE yyvsa[YYINITDEPTH];
1856 YYSTYPE *yyvs = yyvsa;
1857 register YYSTYPE *yyvsp;
1861 #define YYPOPSTACK (yyvsp--, yyssp--)
1863 YYSIZE_T yystacksize = YYINITDEPTH;
1865 /* The variables used to return semantic value and location from the
1870 /* When reducing, the number of symbols on the RHS of the reduced
1874 YYDPRINTF ((stderr, "Starting parse\n"));
1879 yychar = YYEMPTY; /* Cause a token to be read. */
1881 /* Initialize stack pointers.
1882 Waste one element of value and location stack
1883 so that they stay on the same level as the state stack.
1884 The wasted elements are never initialized. */
1891 /*------------------------------------------------------------.
1892 | yynewstate -- Push a new state, which is found in yystate. |
1893 `------------------------------------------------------------*/
1895 /* In all cases, when you get here, the value and location stacks
1896 have just been pushed. so pushing a state here evens the stacks.
1903 if (yyss + yystacksize - 1 <= yyssp)
1905 /* Get the current used size of the three stacks, in elements. */
1906 YYSIZE_T yysize = yyssp - yyss + 1;
1910 /* Give user a chance to reallocate the stack. Use copies of
1911 these so that the &'s don't force the real ones into
1913 YYSTYPE *yyvs1 = yyvs;
1914 short *yyss1 = yyss;
1917 /* Each stack pointer address is followed by the size of the
1918 data in use in that stack, in bytes. This used to be a
1919 conditional around just the two extra args, but that might
1920 be undefined if yyoverflow is a macro. */
1921 yyoverflow ("parser stack overflow",
1922 &yyss1, yysize * sizeof (*yyssp),
1923 &yyvs1, yysize * sizeof (*yyvsp),
1930 #else /* no yyoverflow */
1931 # ifndef YYSTACK_RELOCATE
1934 /* Extend the stack our own way. */
1935 if (YYMAXDEPTH <= yystacksize)
1938 if (YYMAXDEPTH < yystacksize)
1939 yystacksize = YYMAXDEPTH;
1942 short *yyss1 = yyss;
1943 union yyalloc *yyptr =
1944 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1947 YYSTACK_RELOCATE (yyss);
1948 YYSTACK_RELOCATE (yyvs);
1950 # undef YYSTACK_RELOCATE
1952 YYSTACK_FREE (yyss1);
1955 #endif /* no yyoverflow */
1957 yyssp = yyss + yysize - 1;
1958 yyvsp = yyvs + yysize - 1;
1961 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1962 (unsigned long int) yystacksize));
1964 if (yyss + yystacksize - 1 <= yyssp)
1968 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1977 /* Do appropriate processing given the current state. */
1978 /* Read a lookahead token if we need one and don't already have one. */
1981 /* First try to decide what to do without reference to lookahead token. */
1983 yyn = yypact[yystate];
1984 if (yyn == YYPACT_NINF)
1987 /* Not known => get a lookahead token if don't already have one. */
1989 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1990 if (yychar == YYEMPTY)
1992 YYDPRINTF ((stderr, "Reading a token: "));
1996 if (yychar <= YYEOF)
1998 yychar = yytoken = YYEOF;
1999 YYDPRINTF ((stderr, "Now at end of input.\n"));
2003 yytoken = YYTRANSLATE (yychar);
2004 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
2007 /* If the proper action on seeing token YYTOKEN is to reduce or to
2008 detect an error, take that action. */
2010 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2015 if (yyn == 0 || yyn == YYTABLE_NINF)
2024 /* Shift the lookahead token. */
2025 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
2027 /* Discard the token being shifted unless it is eof. */
2028 if (yychar != YYEOF)
2034 /* Count tokens shifted since error; after three, turn off error
2043 /*-----------------------------------------------------------.
2044 | yydefault -- do the default action for the current state. |
2045 `-----------------------------------------------------------*/
2047 yyn = yydefact[yystate];
2053 /*-----------------------------.
2054 | yyreduce -- Do a reduction. |
2055 `-----------------------------*/
2057 /* yyn is the number of a rule to reduce with. */
2060 /* If YYLEN is nonzero, implement the default value of the action:
2063 Otherwise, the following line sets YYVAL to garbage.
2064 This behavior is undocumented and Bison
2065 users should not rely upon it. Assigning to YYVAL
2066 unconditionally makes the parser a bit smaller, and it avoids a
2067 GCC warning that YYVAL may be used uninitialized. */
2068 yyval = yyvsp[1-yylen];
2071 YY_REDUCE_PRINT (yyn);
2097 Node *node = node_new (CCODE_NODE,
2099 "cbuf:steal", (yyvsp[0].cbuf)->str,
2100 "line_no", ccode_line,
2102 nodes = g_list_append(nodes,node);
2103 g_string_free(yyvsp[0].cbuf,FALSE);
2110 Node *node = node_new (CCODE_NODE,
2112 "cbuf:steal", (yyvsp[0].cbuf)->str,
2113 "line_no", ccode_line,
2115 nodes = g_list_append(nodes,node);
2116 g_string_free(yyvsp[0].cbuf,FALSE);
2123 Node *node = node_new (CCODE_NODE,
2125 "cbuf:steal", (yyvsp[0].cbuf)->str,
2126 "line_no", ccode_line,
2128 nodes = g_list_append(nodes,node);
2129 g_string_free(yyvsp[0].cbuf,FALSE);
2136 Node *node = node_new (CCODE_NODE,
2138 "cbuf:steal", (yyvsp[0].cbuf)->str,
2139 "line_no", ccode_line,
2141 nodes = g_list_append(nodes,node);
2142 g_string_free(yyvsp[0].cbuf,FALSE);
2149 Node *node = node_new (CCODE_NODE,
2151 "cbuf:steal", (yyvsp[0].cbuf)->str,
2152 "line_no", ccode_line,
2154 nodes = g_list_append(nodes,node);
2155 g_string_free(yyvsp[0].cbuf,FALSE);
2162 Node *node = node_new (CCODE_NODE,
2164 "cbuf:steal", (yyvsp[0].cbuf)->str,
2165 "line_no", ccode_line,
2167 nodes = g_list_append(nodes,node);
2168 g_string_free(yyvsp[0].cbuf,FALSE);
2215 ((Class *)class)->nodes = class_nodes;
2217 nodes = g_list_append(nodes,class);
2224 ((Class *)class)->nodes = NULL;
2226 nodes = g_list_append(nodes,class);
2233 class = node_new (CLASS_NODE,
2234 "otype:steal", yyvsp[-3].id,
2235 "ptype:steal", yyvsp[-1].id,
2236 "bonobo_object_class:steal", bonobo_object_class,
2237 "interfaces:steal", interfaces,
2238 "chunk_size:steal", chunk_size,
2240 bonobo_object_class = NULL;
2249 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2250 g_free (chunk_size);
2251 chunk_size = g_strdup(yyvsp[-2].id);
2252 } else if(strcmp(yyvsp[-3].id,"BonoboObject") == 0) {
2253 g_free (bonobo_object_class);
2254 bonobo_object_class = g_strdup(yyvsp[-2].id);
2256 yyerror(_("parse error"));
2265 if (strcmp (yyvsp[-3].id, "interface") == 0) {
2266 interfaces = g_list_append (interfaces,
2267 g_strdup (yyvsp[-2].id));
2269 yyerror(_("parse error"));
2278 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2279 g_free (chunk_size);
2280 if(atoi(yyvsp[-2].id) != 0)
2281 chunk_size = g_strdup(yyvsp[-2].id);
2285 yyerror(_("parse error"));
2309 if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
2310 g_free (yyvsp[-1].id);
2311 yyerror (_("parse error"));
2314 g_free (yyvsp[-1].id);
2315 last_added_method->bonobo_object_func = TRUE;
2322 if (strcmp (yyvsp[-2].id, "interface") != 0) {
2323 g_free (yyvsp[-2].id);
2324 g_free (yyvsp[-1].id);
2325 yyerror (_("parse error"));
2328 g_free (yyvsp[-2].id);
2329 node_set ((Node *)last_added_method,
2330 "interface:steal", yyvsp[-1].id,
2357 { the_scope = PUBLIC_SCOPE; }
2362 { the_scope = PRIVATE_SCOPE; }
2367 { the_scope = PROTECTED_SCOPE; }
2372 { the_scope = CLASS_SCOPE; }
2378 if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
2379 g_free (yyvsp[-1].id);
2380 destructor_unref = FALSE;
2381 destructor = yyvsp[0].id;
2382 destructor_line = line_no;
2383 destructor_simple = TRUE;
2384 } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
2385 g_free (yyvsp[-1].id);
2386 destructor_unref = TRUE;
2387 destructor = yyvsp[0].id;
2388 destructor_line = line_no;
2389 destructor_simple = TRUE;
2391 g_free (yyvsp[-1].id);
2392 g_free (yyvsp[0].id);
2393 yyerror (_("parse error"));
2402 if (strcmp (yyvsp[-2].id, "destroy") == 0) {
2403 g_free(yyvsp[-2].id);
2404 destructor_unref = FALSE;
2405 destructor = (yyvsp[0].cbuf)->str;
2406 g_string_free(yyvsp[0].cbuf, FALSE);
2407 destructor_line = ccode_line;
2408 destructor_simple = FALSE;
2409 } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
2410 g_free (yyvsp[-2].id);
2411 destructor_unref = TRUE;
2412 destructor = (yyvsp[0].cbuf)->str;
2413 g_string_free (yyvsp[0].cbuf, FALSE);
2414 destructor_line = ccode_line;
2415 destructor_simple = FALSE;
2417 g_free (yyvsp[-2].id);
2418 g_string_free (yyvsp[0].cbuf, TRUE);
2419 yyerror (_("parse error"));
2428 initializer = yyvsp[0].id;
2429 initializer_line = ccode_line;
2436 initializer = (yyvsp[0].cbuf)->str;
2437 initializer_line = ccode_line;
2438 g_string_free(yyvsp[0].cbuf, FALSE);
2454 { destructor = NULL; }
2459 { initializer = NULL; }
2473 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
2480 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
2488 if(strcmp(yyvsp[-6].id,"get")==0 &&
2489 strcmp(yyvsp[-3].id,"set")==0) {
2490 Type *type = pop_type();
2491 g_free (yyvsp[-6].id);
2492 g_free (yyvsp[-3].id);
2493 node = node_new (ARGUMENT_NODE,
2494 "gtktype:steal", yyvsp[-9].id,
2495 "atype:steal", type,
2496 "flags:steal", yyvsp[-10].list,
2497 "name:steal", yyvsp[-8].id,
2498 "get:steal", (yyvsp[-4].cbuf)->str,
2499 "get_line", yyvsp[-5].line,
2500 "set:steal", (yyvsp[-1].cbuf)->str,
2501 "set_line", yyvsp[-2].line,
2502 "line_no", yyvsp[-11].line,
2505 class_nodes = g_list_append(class_nodes,node);
2507 g_string_free (yyvsp[-4].cbuf, FALSE);
2508 g_string_free (yyvsp[-1].cbuf, FALSE);
2510 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
2511 strcmp(yyvsp[-3].id,"get")==0) {
2512 Type *type = pop_type();
2513 g_free (yyvsp[-6].id);
2514 g_free (yyvsp[-3].id);
2515 node = node_new (ARGUMENT_NODE,
2516 "gtktype:steal", yyvsp[-9].id,
2517 "atype:steal", type,
2518 "flags:steal", yyvsp[-10].list,
2519 "name:steal", yyvsp[-8].id,
2520 "get:steal", (yyvsp[-1].cbuf)->str,
2521 "get_line", yyvsp[-2].line,
2522 "set:steal", (yyvsp[-4].cbuf)->str,
2523 "set_line", yyvsp[-5].line,
2524 "line_no", yyvsp[-11].line,
2526 g_string_free (yyvsp[-1].cbuf, FALSE);
2527 g_string_free (yyvsp[-4].cbuf, FALSE);
2528 class_nodes = g_list_append(class_nodes,node);
2530 g_free (yyvsp[-9].id);
2531 g_free (yyvsp[-8].id);
2532 g_free (yyvsp[-6].id);
2533 g_free (yyvsp[-3].id);
2534 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
2535 g_list_free (yyvsp[-10].list);
2536 g_string_free (yyvsp[-1].cbuf, TRUE);
2537 g_string_free (yyvsp[-4].cbuf, TRUE);
2538 yyerror (_("parse error"));
2542 if (yyvsp[-7].id != NULL) {
2543 Argument *arg = (Argument *)node;
2544 export_accessors (arg->name,
2545 arg->get != NULL, arg->get_line,
2546 arg->set != NULL, arg->set_line,
2550 g_free (yyvsp[-7].id);
2560 if(strcmp(yyvsp[-3].id, "get") == 0) {
2561 Type *type = pop_type();
2562 g_free (yyvsp[-3].id);
2563 node = node_new (ARGUMENT_NODE,
2564 "gtktype:steal", yyvsp[-6].id,
2565 "atype:steal", type,
2566 "flags:steal", yyvsp[-7].list,
2567 "name:steal", yyvsp[-5].id,
2568 "get:steal", (yyvsp[-1].cbuf)->str,
2569 "get_line", yyvsp[-2].line,
2570 "line_no", yyvsp[-8].line,
2573 g_string_free (yyvsp[-1].cbuf, FALSE);
2574 class_nodes = g_list_append(class_nodes, node);
2575 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
2576 Type *type = pop_type();
2577 g_free (yyvsp[-3].id);
2578 node = node_new (ARGUMENT_NODE,
2579 "gtktype:steal", yyvsp[-6].id,
2580 "atype:steal", type,
2581 "flags:steal", yyvsp[-7].list,
2582 "name:steal", yyvsp[-5].id,
2583 "set:steal", (yyvsp[-1].cbuf)->str,
2584 "set_line", yyvsp[-2].line,
2585 "line_no", yyvsp[-8].line,
2588 g_string_free (yyvsp[-1].cbuf, FALSE);
2589 class_nodes = g_list_append (class_nodes, node);
2591 g_free (yyvsp[-3].id);
2592 g_free (yyvsp[-6].id);
2593 g_free (yyvsp[-5].id);
2594 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
2595 g_list_free (yyvsp[-7].list);
2596 g_string_free (yyvsp[-1].cbuf, TRUE);
2597 yyerror(_("parse error"));
2601 if (yyvsp[-4].id != NULL) {
2602 Argument *arg = (Argument *)node;
2603 export_accessors (arg->name,
2604 arg->get != NULL, arg->get_line,
2605 arg->set != NULL, arg->set_line,
2609 g_free (yyvsp[-4].id);
2615 #line 1012 "parse.y"
2618 char *get, *set = NULL;
2623 if(strcmp(yyvsp[0].id, "link")!=0 &&
2624 strcmp(yyvsp[0].id, "stringlink")!=0 &&
2625 strcmp(yyvsp[0].id, "objectlink")!=0) {
2626 g_free(yyvsp[0].id);
2627 g_free(yyvsp[-3].id);
2628 g_free(yyvsp[-2].id);
2629 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2630 g_list_free(yyvsp[-4].list);
2631 yyerror(_("parse error"));
2637 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2638 if(var->scope == PRIVATE_SCOPE) {
2639 root = "self->_priv";
2640 } else if(var->scope == CLASS_SCOPE) {
2641 root = "SELF_GET_CLASS(self)";
2643 error_print(GOB_ERROR, yyvsp[-5].line,
2644 _("Self aliases needed when autolinking to a classwide member"));
2649 if(strcmp(yyvsp[0].id, "link")==0) {
2650 set = g_strdup_printf("%s->%s = ARG;",
2651 root, yyvsp[-2].id);
2652 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2653 set = g_strdup_printf("g_free (%s->%s); "
2654 "%s->%s = g_strdup (ARG);",
2656 root, yyvsp[-2].id);
2657 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2658 set = g_strdup_printf(
2660 "g_object_ref (G_OBJECT (ARG)); "
2661 "if (%s->%s != NULL) "
2662 "g_object_unref (G_OBJECT (%s->%s)); "
2666 root, yyvsp[-2].id);
2668 g_assert_not_reached();
2671 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2673 g_free (yyvsp[0].id);
2676 type = (Type *)node_copy ((Node *)var->vtype);
2678 node = node_new (ARGUMENT_NODE,
2679 "gtktype:steal", yyvsp[-3].id,
2680 "atype:steal", type,
2681 "flags:steal", yyvsp[-4].list,
2682 "name:steal", yyvsp[-2].id,
2684 "get_line", yyvsp[-5].line,
2686 "set_line", yyvsp[-5].line,
2687 "line_no", yyvsp[-5].line,
2690 if (yyvsp[-1].id != NULL) {
2691 Argument *arg = (Argument *)node;
2692 export_accessors (arg->name,
2693 arg->get != NULL, arg->get_line,
2694 arg->set != NULL, arg->set_line,
2698 g_free (yyvsp[-1].id);
2701 class_nodes = g_list_append (class_nodes, node);
2706 #line 1101 "parse.y"
2708 if (strcmp (yyvsp[-1].id, "export")!=0) {
2709 g_free (yyvsp[-1].id);
2710 yyerror (_("parse error"));
2713 yyval.id = yyvsp[-1].id;
2718 #line 1109 "parse.y"
2725 #line 1114 "parse.y"
2728 node_set ((Node *)property,
2729 "line_no", yyvsp[-10].line,
2730 "gtktype:steal", debool (yyvsp[-9].id),
2731 "name:steal", yyvsp[-8].id,
2733 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2734 strcmp (yyvsp[-3].id, "set") == 0) {
2735 node_set ((Node *)property,
2736 "get:steal", (yyvsp[-4].cbuf)->str,
2737 "get_line", yyvsp[-5].line,
2738 "set:steal", (yyvsp[-1].cbuf)->str,
2739 "set_line", yyvsp[-2].line,
2741 g_string_free (yyvsp[-4].cbuf, FALSE);
2742 g_string_free (yyvsp[-1].cbuf, FALSE);
2743 g_free (yyvsp[-6].id);
2744 g_free (yyvsp[-3].id);
2745 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2746 strcmp (yyvsp[-3].id, "get") == 0) {
2747 node_set ((Node *)property,
2748 "get:steal", (yyvsp[-1].cbuf)->str,
2749 "get_line", yyvsp[-2].line,
2750 "set:steal", (yyvsp[-4].cbuf)->str,
2751 "set_line", yyvsp[-5].line,
2753 g_string_free (yyvsp[-4].cbuf, FALSE);
2754 g_string_free (yyvsp[-1].cbuf, FALSE);
2755 g_free (yyvsp[-6].id);
2756 g_free (yyvsp[-3].id);
2758 g_string_free (yyvsp[-4].cbuf, TRUE);
2759 g_string_free (yyvsp[-1].cbuf, TRUE);
2760 g_free (yyvsp[-6].id);
2761 g_free (yyvsp[-3].id);
2762 node_free ((Node *)property);
2764 yyerror (_("parse error"));
2767 property_link_and_export ((Node *)property);
2768 if (property != NULL) {
2769 class_nodes = g_list_append (class_nodes,
2777 #line 1162 "parse.y"
2780 node_set ((Node *)property,
2781 "line_no", yyvsp[-7].line,
2782 "gtktype:steal", debool (yyvsp[-6].id),
2783 "name:steal", yyvsp[-5].id,
2785 if (strcmp (yyvsp[-3].id, "get") == 0) {
2786 node_set ((Node *)property,
2787 "get:steal", (yyvsp[-1].cbuf)->str,
2788 "get_line", yyvsp[-2].line,
2790 g_string_free (yyvsp[-1].cbuf, FALSE);
2791 g_free (yyvsp[-3].id);
2792 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2793 node_set ((Node *)property,
2794 "set:steal", (yyvsp[-1].cbuf)->str,
2795 "set_line", yyvsp[-2].line,
2797 g_string_free (yyvsp[-1].cbuf, FALSE);
2798 g_free (yyvsp[-3].id);
2800 g_string_free (yyvsp[-1].cbuf, TRUE);
2801 g_free (yyvsp[-3].id);
2802 node_free ((Node *)property);
2804 yyerror (_("parse error"));
2807 property_link_and_export ((Node *)property);
2808 if (property != NULL) {
2809 class_nodes = g_list_append (class_nodes,
2817 #line 1198 "parse.y"
2820 node_set ((Node *)property,
2821 "line_no", yyvsp[-4].line,
2822 "gtktype:steal", debool (yyvsp[-3].id),
2823 "name:steal", yyvsp[-2].id,
2825 property_link_and_export ((Node *)property);
2826 if (property != NULL) {
2827 class_nodes = g_list_append (class_nodes,
2835 #line 1214 "parse.y"
2840 #line 1215 "parse.y"
2845 #line 1218 "parse.y"
2850 #line 1219 "parse.y"
2855 #line 1222 "parse.y"
2856 { yyval.id = yyvsp[0].id; }
2860 #line 1223 "parse.y"
2862 if (strcmp (yyvsp[-3].id, "_") != 0) {
2863 g_free (yyvsp[-3].id);
2864 yyerror(_("parse error"));
2867 g_free (yyvsp[-3].id);
2868 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2869 g_free (yyvsp[-1].id);
2874 #line 1235 "parse.y"
2875 { yyval.id = yyvsp[0].id; }
2879 #line 1236 "parse.y"
2880 { yyval.id = yyvsp[0].id; }
2884 #line 1239 "parse.y"
2887 node_set ((Node *)property,
2888 "nick:steal", yyvsp[0].id,
2894 #line 1245 "parse.y"
2897 node_set ((Node *)property,
2898 "blurb:steal", yyvsp[0].id,
2904 #line 1251 "parse.y"
2907 node_set ((Node *)property,
2908 "maximum:steal", yyvsp[0].id,
2914 #line 1257 "parse.y"
2917 node_set ((Node *)property,
2918 "minimum:steal", yyvsp[0].id,
2924 #line 1263 "parse.y"
2927 node_set ((Node *)property,
2928 "default_value:steal", yyvsp[0].id,
2934 #line 1269 "parse.y"
2937 node_set ((Node *)property,
2938 "flags:steal", yyvsp[0].list,
2944 #line 1275 "parse.y"
2946 Type *type = pop_type ();
2948 node_set ((Node *)property,
2949 "ptype:steal", type,
2955 #line 1282 "parse.y"
2958 node_set ((Node *)property,
2959 "extra_gtktype:steal", yyvsp[0].id,
2965 #line 1288 "parse.y"
2968 node_set ((Node *)property,
2969 "extra_gtktype:steal", yyvsp[0].id,
2975 #line 1294 "parse.y"
2978 node_set ((Node *)property,
2979 "extra_gtktype:steal", yyvsp[0].id,
2985 #line 1300 "parse.y"
2988 node_set ((Node *)property,
2989 "extra_gtktype:steal", yyvsp[0].id,
2995 #line 1306 "parse.y"
2998 node_set ((Node *)property,
2999 "extra_gtktype:steal", yyvsp[0].id,
3005 #line 1312 "parse.y"
3008 node_set ((Node *)property,
3009 "extra_gtktype:steal", yyvsp[0].id,
3015 #line 1318 "parse.y"
3018 node_set ((Node *)property,
3019 "extra_gtktype:steal", yyvsp[0].id,
3025 #line 1324 "parse.y"
3028 node_set ((Node *)property,
3029 "extra_gtktype:steal", yyvsp[0].id,
3035 #line 1330 "parse.y"
3038 node_set ((Node *)property,
3039 "extra_gtktype:steal", yyvsp[0].id,
3045 #line 1336 "parse.y"
3048 node_set ((Node *)property,
3049 "extra_gtktype:steal", yyvsp[0].id,
3055 #line 1342 "parse.y"
3058 if (strcmp (yyvsp[0].id, "link") == 0) {
3059 g_free(yyvsp[0].id);
3060 node_set ((Node *)property,
3063 } else if (strcmp (yyvsp[0].id, "export") == 0) {
3064 g_free(yyvsp[0].id);
3065 node_set ((Node *)property,
3069 g_free(yyvsp[0].id);
3070 yyerror(_("parse error"));
3077 #line 1362 "parse.y"
3079 if(strcmp(yyvsp[-2].id,"type")!=0) {
3080 g_free(yyvsp[-4].id);
3081 g_free(yyvsp[-2].id);
3082 yyerror(_("parse error"));
3085 yyval.id = debool (yyvsp[-4].id);
3090 #line 1371 "parse.y"
3092 yyval.id = debool (yyvsp[0].id);
3093 typestack = g_list_prepend(typestack,NULL);
3098 #line 1377 "parse.y"
3099 { yyval.list = yyvsp[-1].list; }
3103 #line 1378 "parse.y"
3104 { yyval.list = NULL; }
3108 #line 1381 "parse.y"
3110 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
3115 #line 1384 "parse.y"
3117 yyval.list = g_list_append(NULL,yyvsp[0].id);
3122 #line 1390 "parse.y"
3124 Node *node = node_new (TYPE_NODE,
3125 "name:steal", yyvsp[-1].id,
3126 "pointer:steal", yyvsp[0].id,
3128 typestack = g_list_prepend(typestack,node);
3133 #line 1397 "parse.y"
3135 Node *node = node_new (TYPE_NODE,
3136 "name:steal", yyvsp[0].id,
3138 typestack = g_list_prepend(typestack,node);
3143 #line 1406 "parse.y"
3145 yyval.id = yyvsp[0].id;
3150 #line 1409 "parse.y"
3152 yyval.id = yyvsp[0].id;
3157 #line 1412 "parse.y"
3159 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
3160 g_free(yyvsp[0].id);
3165 #line 1416 "parse.y"
3167 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3168 g_free(yyvsp[-1].id);
3173 #line 1420 "parse.y"
3175 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3176 g_free(yyvsp[0].id);
3181 #line 1424 "parse.y"
3183 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
3185 g_free(yyvsp[0].id);
3190 #line 1429 "parse.y"
3192 yyval.id = g_strconcat(yyvsp[-2].id, " ",
3193 yyvsp[-1].id, " const", NULL);
3194 g_free(yyvsp[-1].id);
3199 #line 1437 "parse.y"
3201 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3202 g_free(yyvsp[0].id);
3207 #line 1441 "parse.y"
3209 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3210 g_free(yyvsp[-1].id);
3211 g_free(yyvsp[0].id);
3216 #line 1446 "parse.y"
3218 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
3219 g_free(yyvsp[0].id);
3224 #line 1450 "parse.y"
3226 yyval.id = yyvsp[0].id;
3231 #line 1453 "parse.y"
3233 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3234 g_free(yyvsp[-1].id);
3239 #line 1457 "parse.y"
3241 yyval.id = g_strdup(yyvsp[0].id);
3246 #line 1460 "parse.y"
3248 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3253 #line 1465 "parse.y"
3254 { yyval.id = "void"; }
3258 #line 1466 "parse.y"
3259 { yyval.id = "char"; }
3263 #line 1467 "parse.y"
3264 { yyval.id = "short"; }
3268 #line 1468 "parse.y"
3269 { yyval.id = "int"; }
3273 #line 1469 "parse.y"
3274 { yyval.id = "long"; }
3278 #line 1470 "parse.y"
3279 { yyval.id = "float"; }
3283 #line 1471 "parse.y"
3284 { yyval.id = "double"; }
3288 #line 1472 "parse.y"
3289 { yyval.id = "signed"; }
3293 #line 1473 "parse.y"
3294 { yyval.id = "unsigned"; }
3298 #line 1476 "parse.y"
3299 { yyval.id = "struct"; }
3303 #line 1477 "parse.y"
3304 { yyval.id = "union"; }
3308 #line 1478 "parse.y"
3309 { yyval.id = "enum"; }
3313 #line 1481 "parse.y"
3314 { yyval.id = g_strdup("*"); }
3318 #line 1482 "parse.y"
3319 { yyval.id = g_strdup("* const"); }
3323 #line 1483 "parse.y"
3325 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
3326 g_free(yyvsp[0].id);
3331 #line 1487 "parse.y"
3333 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
3334 g_free(yyvsp[0].id);
3339 #line 1494 "parse.y"
3341 if(strcmp(yyvsp[-1].id, "first")==0)
3342 yyval.sigtype = SIGNAL_FIRST_METHOD;
3343 else if(strcmp(yyvsp[-1].id, "last")==0)
3344 yyval.sigtype = SIGNAL_LAST_METHOD;
3346 yyerror(_("signal must be 'first' or 'last'"));
3347 g_free(yyvsp[-1].id);
3350 g_free(yyvsp[-1].id);
3355 #line 1506 "parse.y"
3357 yyval.sigtype = SIGNAL_LAST_METHOD;
3362 #line 1512 "parse.y"
3364 if(strcmp(yyvsp[-1].id,"first")==0)
3365 yyval.sigtype = SIGNAL_FIRST_METHOD;
3366 else if(strcmp(yyvsp[-1].id,"last")==0)
3367 yyval.sigtype = SIGNAL_LAST_METHOD;
3369 yyerror(_("signal must be 'first' or 'last'"));
3370 g_free(yyvsp[-1].id);
3373 g_free(yyvsp[-1].id);
3378 #line 1524 "parse.y"
3380 if(strcmp(yyvsp[-2].id,"first")==0)
3381 yyval.sigtype = SIGNAL_FIRST_METHOD;
3382 else if(strcmp(yyvsp[-2].id,"last")==0)
3383 yyval.sigtype = SIGNAL_LAST_METHOD;
3385 yyerror(_("signal must be 'first' or 'last'"));
3386 g_free(yyvsp[-2].id);
3389 g_free(yyvsp[-2].id);
3394 #line 1536 "parse.y"
3396 yyval.sigtype = SIGNAL_LAST_METHOD;
3401 #line 1539 "parse.y"
3403 /* the_scope was default thus public */
3404 the_scope = PUBLIC_SCOPE;
3409 #line 1545 "parse.y"
3411 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
3416 #line 1550 "parse.y"
3418 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3423 #line 1553 "parse.y"
3425 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3430 #line 1558 "parse.y"
3431 { yyval.cbuf = yyvsp[0].cbuf; }
3435 #line 1559 "parse.y"
3436 { yyval.cbuf = NULL; }
3440 #line 1563 "parse.y"
3443 yyerror(_("signal without 'self' as "
3444 "first parameter"));
3445 free_all_global_state();
3448 if(the_scope == CLASS_SCOPE) {
3449 yyerror(_("a method cannot be of class scope"));
3450 free_all_global_state();
3453 push_function(the_scope, yyvsp[-7].sigtype,NULL,
3454 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
3455 ccode_line, vararg, yyvsp[-8].list);
3460 #line 1579 "parse.y"
3463 yyerror(_("signal without 'self' as "
3464 "first parameter"));
3465 free_all_global_state();
3468 if(the_scope == CLASS_SCOPE) {
3469 yyerror(_("a method cannot be of class scope"));
3470 free_all_global_state();
3473 push_function(the_scope, yyvsp[-7].sigtype, NULL,
3474 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
3475 ccode_line, vararg, yyvsp[-8].list);
3480 #line 1595 "parse.y"
3483 yyerror(_("virtual method without 'self' as "
3484 "first parameter"));
3485 free_all_global_state();
3488 if(the_scope == CLASS_SCOPE) {
3489 yyerror(_("a method cannot be of class scope"));
3490 free_all_global_state();
3493 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3494 yyvsp[0].cbuf, yyvsp[-8].line,
3495 ccode_line, vararg, NULL);
3500 #line 1611 "parse.y"
3503 yyerror(_("virtual method without 'self' as "
3504 "first parameter"));
3505 free_all_global_state();
3508 if(the_scope == CLASS_SCOPE) {
3509 yyerror(_("a method cannot be of class scope"));
3510 free_all_global_state();
3513 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3514 yyvsp[0].cbuf, yyvsp[-7].line,
3515 ccode_line, vararg, NULL);
3520 #line 1627 "parse.y"
3523 yyerror(_("virtual method without 'self' as "
3524 "first parameter"));
3525 free_all_global_state();
3528 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
3529 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
3530 ccode_line, vararg, NULL);
3535 #line 1638 "parse.y"
3537 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3538 yyvsp[-5].id, yyvsp[0].cbuf,
3539 yyvsp[-10].line, ccode_line,
3545 #line 1644 "parse.y"
3547 if(the_scope == CLASS_SCOPE) {
3548 yyerror(_("a method cannot be of class scope"));
3549 free_all_global_state();
3552 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3553 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3559 #line 1654 "parse.y"
3561 if(strcmp(yyvsp[-4].id, "init")==0) {
3562 push_init_arg(yyvsp[-2].id,FALSE);
3563 push_function(NO_SCOPE, INIT_METHOD, NULL,
3564 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3565 ccode_line, FALSE, NULL);
3566 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3567 push_init_arg(yyvsp[-2].id,TRUE);
3568 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3569 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3570 ccode_line, FALSE, NULL);
3572 g_free(yyvsp[-4].id);
3573 g_free(yyvsp[-2].id);
3574 g_string_free(yyvsp[0].cbuf,TRUE);
3575 yyerror(_("parse error "
3576 "(untyped blocks must be init or "
3584 #line 1677 "parse.y"
3586 g_free(onerror); onerror = NULL;
3587 g_free(defreturn); defreturn = NULL;
3588 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3589 g_free(yyvsp[-1].id);
3590 g_free(yyvsp[0].id);
3591 yyerror(_("parse error"));
3594 g_free(yyvsp[-1].id);
3599 #line 1688 "parse.y"
3601 g_free(onerror); onerror = NULL;
3602 g_free(defreturn); defreturn = NULL;
3603 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3604 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3605 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3606 yyerror(_("parse error"));
3609 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3610 onerror = defreturn = NULL;
3611 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3612 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3613 yyerror(_("parse error"));
3616 g_free(yyvsp[-3].id);
3617 g_free(yyvsp[-1].id);
3622 #line 1707 "parse.y"
3624 g_free(onerror); onerror = NULL;
3625 g_free(defreturn); defreturn = NULL;
3630 #line 1713 "parse.y"
3631 { yyval.id = yyvsp[0].id; }
3635 #line 1714 "parse.y"
3637 yyval.id = (yyvsp[0].cbuf)->str;
3638 g_string_free(yyvsp[0].cbuf, FALSE);
3643 #line 1720 "parse.y"
3644 { vararg = FALSE; has_self = FALSE; }
3648 #line 1721 "parse.y"
3652 if(strcmp(yyvsp[0].id,"self")==0)
3653 push_self(yyvsp[0].id, FALSE);
3655 g_free(yyvsp[0].id);
3656 yyerror(_("parse error"));
3663 #line 1732 "parse.y"
3667 if(strcmp(yyvsp[-1].id,"self")==0)
3668 push_self(yyvsp[-1].id, TRUE);
3670 g_free(yyvsp[-1].id);
3671 yyerror(_("parse error"));
3678 #line 1743 "parse.y"
3682 if(strcmp(yyvsp[0].id,"self")==0)
3683 push_self(yyvsp[0].id, TRUE);
3685 g_free(yyvsp[0].id);
3686 yyerror(_("parse error"));
3693 #line 1754 "parse.y"
3696 if(strcmp(yyvsp[-2].id,"self")==0)
3697 push_self(yyvsp[-2].id, FALSE);
3699 g_free(yyvsp[-2].id);
3700 yyerror(_("parse error"));
3707 #line 1764 "parse.y"
3710 if(strcmp(yyvsp[-3].id,"self")==0)
3711 push_self(yyvsp[-3].id, TRUE);
3713 g_free(yyvsp[-3].id);
3714 yyerror(_("parse error"));
3721 #line 1774 "parse.y"
3724 if(strcmp(yyvsp[-2].id,"self")==0)
3725 push_self(yyvsp[-2].id, TRUE);
3727 g_free(yyvsp[-2].id);
3728 yyerror(_("parse error"));
3735 #line 1784 "parse.y"
3736 { has_self = FALSE; }
3740 #line 1787 "parse.y"
3745 #line 1788 "parse.y"
3750 #line 1791 "parse.y"
3755 #line 1792 "parse.y"
3760 #line 1795 "parse.y"
3762 push_funcarg(yyvsp[0].id,NULL);
3767 #line 1798 "parse.y"
3769 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3774 #line 1801 "parse.y"
3776 if(strcmp(yyvsp[-2].id,"check")!=0) {
3777 yyerror(_("parse error"));
3780 g_free(yyvsp[-2].id);
3781 push_funcarg(yyvsp[-4].id,NULL);
3786 #line 1809 "parse.y"
3788 if(strcmp(yyvsp[-2].id,"check")!=0) {
3789 yyerror(_("parse error"));
3792 g_free(yyvsp[-2].id);
3793 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3798 #line 1819 "parse.y"
3803 #line 1820 "parse.y"
3808 #line 1823 "parse.y"
3810 if(strcmp(yyvsp[0].id,"type")==0) {
3811 Node *node = node_new (CHECK_NODE,
3812 "chtype", TYPE_CHECK,
3814 checks = g_list_append(checks,node);
3815 } else if(strcmp(yyvsp[0].id,"null")==0) {
3816 Node *node = node_new (CHECK_NODE,
3817 "chtype", NULL_CHECK,
3819 checks = g_list_append(checks,node);
3821 yyerror(_("parse error"));
3824 g_free(yyvsp[0].id);
3829 #line 1840 "parse.y"
3831 Node *node = node_new (CHECK_NODE,
3833 "number:steal", yyvsp[0].id,
3835 checks = g_list_append(checks,node);
3840 #line 1847 "parse.y"
3842 Node *node = node_new (CHECK_NODE,
3844 "number:steal", yyvsp[0].id,
3846 checks = g_list_append(checks,node);
3851 #line 1854 "parse.y"
3853 Node *node = node_new (CHECK_NODE,
3855 "number:steal", yyvsp[0].id,
3857 checks = g_list_append(checks,node);
3862 #line 1861 "parse.y"
3864 Node *node = node_new (CHECK_NODE,
3866 "number:steal", yyvsp[0].id,
3868 checks = g_list_append(checks,node);
3873 #line 1868 "parse.y"
3875 Node *node = node_new (CHECK_NODE,
3877 "number:steal", yyvsp[0].id,
3879 checks = g_list_append(checks,node);
3884 #line 1875 "parse.y"
3886 Node *node = node_new (CHECK_NODE,
3888 "number:steal", yyvsp[0].id,
3890 checks = g_list_append(checks,node);
3895 #line 1884 "parse.y"
3897 Node *node = node_new (ENUMDEF_NODE,
3898 "etype:steal", yyvsp[-1].id,
3899 "prefix:steal", yyvsp[-5].id,
3900 "values:steal", enum_vals,
3903 nodes = g_list_append (nodes, node);
3908 #line 1893 "parse.y"
3910 Node *node = node_new (ENUMDEF_NODE,
3911 "etype:steal", yyvsp[-1].id,
3912 "prefix:steal", yyvsp[-6].id,
3913 "values:steal", enum_vals,
3916 nodes = g_list_append (nodes, node);
3921 #line 1904 "parse.y"
3926 #line 1905 "parse.y"
3931 #line 1908 "parse.y"
3934 char *num = yyvsp[0].id;
3936 /* A float value, that's a bad enum */
3937 if (num[0] >= '0' &&
3939 strchr (num, '.') != NULL) {
3940 g_free (yyvsp[-2].id);
3942 yyerror(_("parse error (enumerator value not integer constant)"));
3946 node = node_new (ENUMVALUE_NODE,
3947 "name:steal", yyvsp[-2].id,
3950 enum_vals = g_list_append (enum_vals, node);
3955 #line 1928 "parse.y"
3959 node = node_new (ENUMVALUE_NODE,
3960 "name:steal", yyvsp[0].id,
3962 enum_vals = g_list_append (enum_vals, node);
3967 #line 1938 "parse.y"
3969 Node *node = node_new (FLAGS_NODE,
3970 "ftype:steal", yyvsp[-1].id,
3971 "prefix:steal", yyvsp[-5].id,
3972 "values:steal", flag_vals,
3975 nodes = g_list_append (nodes, node);
3980 #line 1947 "parse.y"
3982 Node *node = node_new (FLAGS_NODE,
3983 "ftype:steal", yyvsp[-1].id,
3984 "prefix:steal", yyvsp[-6].id,
3985 "values:steal", flag_vals,
3988 nodes = g_list_append (nodes, node);
3993 #line 1958 "parse.y"
3995 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
4000 #line 1961 "parse.y"
4002 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
4007 #line 1966 "parse.y"
4009 Node *node = node_new (ERROR_NODE,
4010 "etype:steal", yyvsp[-1].id,
4011 "prefix:steal", yyvsp[-5].id,
4012 "values:steal", error_vals,
4015 nodes = g_list_append (nodes, node);
4020 #line 1975 "parse.y"
4022 Node *node = node_new (ERROR_NODE,
4023 "etype:steal", yyvsp[-1].id,
4024 "prefix:steal", yyvsp[-6].id,
4025 "values:steal", error_vals,
4028 nodes = g_list_append (nodes, node);
4033 #line 1986 "parse.y"
4035 error_vals = g_list_append (error_vals, yyvsp[0].id);
4040 #line 1989 "parse.y"
4042 error_vals = g_list_append (error_vals, yyvsp[0].id);
4047 #line 1995 "parse.y"
4048 { yyval.id = yyvsp[0].id; }
4052 #line 1996 "parse.y"
4054 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
4055 g_free(yyvsp[0].id);
4060 #line 2000 "parse.y"
4061 { yyval.id = yyvsp[0].id; }
4065 #line 2001 "parse.y"
4066 { yyval.id = yyvsp[0].id; }
4072 /* Line 1000 of yacc.c. */
4073 #line 4074 "parse.c"
4079 YY_STACK_PRINT (yyss, yyssp);
4084 /* Now `shift' the result of the reduction. Determine what state
4085 that goes to, based on the state we popped back to and the rule
4086 number reduced by. */
4090 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4091 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4092 yystate = yytable[yystate];
4094 yystate = yydefgoto[yyn - YYNTOKENS];
4099 /*------------------------------------.
4100 | yyerrlab -- here on detecting error |
4101 `------------------------------------*/
4103 /* If not already recovering from an error, report this error. */
4108 yyn = yypact[yystate];
4110 if (YYPACT_NINF < yyn && yyn < YYLAST)
4112 YYSIZE_T yysize = 0;
4113 int yytype = YYTRANSLATE (yychar);
4114 const char* yyprefix;
4118 /* Start YYX at -YYN if negative to avoid negative indexes in
4120 int yyxbegin = yyn < 0 ? -yyn : 0;
4122 /* Stay within bounds of both yycheck and yytname. */
4123 int yychecklim = YYLAST - yyn;
4124 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4127 yyprefix = ", expecting ";
4128 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4129 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4131 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
4139 yysize += (sizeof ("syntax error, unexpected ")
4140 + yystrlen (yytname[yytype]));
4141 yymsg = (char *) YYSTACK_ALLOC (yysize);
4144 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
4145 yyp = yystpcpy (yyp, yytname[yytype]);
4149 yyprefix = ", expecting ";
4150 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4151 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4153 yyp = yystpcpy (yyp, yyprefix);
4154 yyp = yystpcpy (yyp, yytname[yyx]);
4159 YYSTACK_FREE (yymsg);
4162 yyerror ("syntax error; also virtual memory exhausted");
4165 #endif /* YYERROR_VERBOSE */
4166 yyerror ("syntax error");
4171 if (yyerrstatus == 3)
4173 /* If just tried and failed to reuse lookahead token after an
4174 error, discard it. */
4176 if (yychar <= YYEOF)
4178 /* If at end of input, pop the error token,
4179 then the rest of the stack, then return failure. */
4180 if (yychar == YYEOF)
4186 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4187 yydestruct (yystos[*yyssp], yyvsp);
4192 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
4193 yydestruct (yytoken, &yylval);
4199 /* Else will try to reuse lookahead token after shifting the error
4204 /*---------------------------------------------------.
4205 | yyerrorlab -- error raised explicitly by YYERROR. |
4206 `---------------------------------------------------*/
4210 /* Pacify GCC when the user code never invokes YYERROR and the label
4211 yyerrorlab therefore never appears in user code. */
4222 /*-------------------------------------------------------------.
4223 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4224 `-------------------------------------------------------------*/
4226 yyerrstatus = 3; /* Each real token shifted decrements this. */
4230 yyn = yypact[yystate];
4231 if (yyn != YYPACT_NINF)
4234 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4242 /* Pop the current state because it cannot handle the error token. */
4246 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4247 yydestruct (yystos[yystate], yyvsp);
4250 YY_STACK_PRINT (yyss, yyssp);
4256 YYDPRINTF ((stderr, "Shifting error token, "));
4265 /*-------------------------------------.
4266 | yyacceptlab -- YYACCEPT comes here. |
4267 `-------------------------------------*/
4272 /*-----------------------------------.
4273 | yyabortlab -- YYABORT comes here. |
4274 `-----------------------------------*/
4280 /*----------------------------------------------.
4281 | yyoverflowlab -- parser overflow comes here. |
4282 `----------------------------------------------*/
4284 yyerror ("parser stack overflow");
4292 YYSTACK_FREE (yyss);
4298 #line 2004 "parse.y"