1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
130 #define THREEDOTS 265
141 #define TYPETOKEN 276
142 #define ARRAY_DIM 277
143 #define SINGLE_CHAR 278
154 #define PROTECTED 289
155 #define CLASSWIDE 290
165 #define DEFAULT_VALUE 300
169 #define FLAGS_TYPE 304
170 #define ENUM_TYPE 305
171 #define PARAM_TYPE 306
172 #define BOXED_TYPE 307
173 #define OBJECT_TYPE 308
178 /* Copy the first part of user declarations. */
188 #include "treefuncs.h"
192 /* FIXME: add gettext support */
197 static GList *class_nodes = NULL;
200 static GList *enum_vals = NULL;
201 static GList *flag_vals = NULL;
202 static GList *error_vals = NULL;
204 static gboolean abstract = FALSE;
205 static char *chunk_size = NULL;
206 static char *bonobo_object_class = NULL;
207 static int glade_xml = FALSE;
208 static GList *interfaces = NULL;
209 static GList *typestack = NULL;
210 static GList *funcargs = NULL;
211 static GList *checks = NULL;
212 static int has_self = FALSE;
213 static int vararg = FALSE;
214 static Method *last_added_method = NULL;
216 /* destructor and initializer for variables */
217 static gboolean destructor_unref = FALSE;
218 static char *destructor = NULL;
219 static int destructor_line = 0;
220 static gboolean destructor_simple = TRUE;
221 static char *initializer = NULL;
222 static int initializer_line = 0;
223 static int glade_widget = FALSE;
225 static char *funcattrs = NULL;
226 static char *onerror = NULL;
227 static char *defreturn = NULL;
229 static GList *gtktypes = NULL;
231 static Property *property = NULL;
233 /* this can be a global as we will only do one function at a time
235 static int the_scope = NO_SCOPE;
237 void free(void *ptr);
240 extern int ccode_line;
242 extern gboolean for_cpp;
252 if(strcmp(yytext,"\n")==0) {
253 out=g_strconcat("Error: ",str," before newline",NULL);
254 } else if(yytext[0]=='\0') {
255 out=g_strconcat("Error: ", str, " at end of input", NULL);
257 char *tmp = g_strdup(yytext);
258 while((p=strchr(tmp, '\n')))
261 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
265 fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
274 Type *type = typestack->data;
275 typestack = g_list_remove(typestack,typestack->data);
280 push_variable (char *name, int scope, int line_no, char *postfix)
283 Type *type = pop_type ();
285 type->postfix = postfix;
287 var = node_new (VARIABLE_NODE,
290 "glade_widget", glade_widget,
293 "destructor_unref", destructor_unref,
294 "destructor:steal", destructor,
295 "destructor_line", destructor_line,
296 "destructor_simple", destructor_simple,
297 "initializer:steal", initializer,
298 "initializer_line", initializer_line,
299 "initializer_simple", TRUE,
301 class_nodes = g_list_append(class_nodes, var);
302 glade_widget = FALSE;
306 push_function (int scope, int method, char *oid, char *id,
307 GString *cbuf, int line_no, int ccode_line,
308 gboolean vararg, GList *flags)
314 g_assert(scope != CLASS_SCOPE);
316 if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
317 type = (Type *)node_new (TYPE_NODE,
324 /* a complicated and ugly test to figure out if we have
325 the wrong number of types for a signal */
326 if((method == SIGNAL_FIRST_METHOD ||
327 method == SIGNAL_LAST_METHOD) &&
328 g_list_length(gtktypes) != g_list_length(funcargs) &&
329 !(g_list_length(funcargs) == 1 &&
330 g_list_length(gtktypes) == 2 &&
331 strcmp(gtktypes->next->data, "NONE")==0)) {
332 error_print(GOB_WARN, line_no,
333 _("The number of GTK arguments and "
334 "function arguments for a signal "
335 "don't seem to match"));
337 if(g_list_length(gtktypes) > 2) {
339 for(li = gtktypes->next; li; li = li->next) {
340 if(strcmp(li->data, "NONE")==0) {
341 error_print(GOB_ERROR, line_no,
342 _("NONE can only appear in an "
343 "argument list by itself"));
349 c_cbuf = p = cbuf->str;
350 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
357 node = node_new (METHOD_NODE,
362 "gtktypes:steal", gtktypes,
363 "flags:steal", flags,
365 "args:steal", funcargs,
366 "funcattrs:steal", funcattrs,
367 "onerror:steal", onerror,
368 "defreturn:steal", defreturn,
369 "cbuf:steal", c_cbuf,
371 "ccode_line", ccode_line,
373 "unique_id", method_unique_id++,
376 last_added_method = (Method *)node;
380 /*only free segment if we haven't passed it
390 class_nodes = g_list_append(class_nodes, node);
394 free_all_global_state(void)
406 g_list_foreach(gtktypes, (GFunc)g_free, NULL);
407 g_list_free(gtktypes);
410 node_list_free (funcargs);
415 push_funcarg(char *name, char *postfix)
418 Type *type = pop_type();
420 type->postfix = postfix;
422 node = node_new (FUNCARG_NODE,
425 "checks:steal", checks,
429 funcargs = g_list_append(funcargs, node);
433 push_init_arg(char *name, int is_class)
440 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
442 tn = g_strdup(((Class *)class)->otype);
444 type = node_new (TYPE_NODE,
448 node = node_new (FUNCARG_NODE,
449 "atype:steal", (Type *)type,
452 funcargs = g_list_prepend(funcargs, node);
456 push_self(char *id, gboolean constant)
461 type = node_new (TYPE_NODE,
462 "name", ((Class *)class)->otype,
463 "pointer", constant ? "const *" : "*",
465 ch = g_list_append (ch, node_new (CHECK_NODE,
466 "chtype", NULL_CHECK,
468 ch = g_list_append (ch, node_new (CHECK_NODE,
469 "chtype", TYPE_CHECK,
471 node = node_new (FUNCARG_NODE,
472 "atype:steal", (Type *)type,
476 funcargs = g_list_prepend(funcargs, node);
480 find_var_or_die(const char *id, int line)
484 for(li = class_nodes; li != NULL; li = li->next) {
486 Node *node = li->data;
487 if(node->type != VARIABLE_NODE)
490 if(strcmp(var->id, id)==0)
494 error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
496 g_assert_not_reached();
501 set_attr_value(char *type, char *val)
503 if(strcmp(type, "attr")==0) {
509 } else if(strcmp(type, "onerror")==0) {
515 } else if(strcmp(type, "defreturn")==0) {
526 export_accessors (const char *var_name,
538 the_type = (Type *)node_copy ((Node *)type);
540 the_type = get_tree_type (gtktype, TRUE);
542 if (the_type == NULL) {
543 error_print (GOB_ERROR, line_no,
544 _("Cannot determine type of property or argument"));
549 char *get_id = g_strdup_printf ("get_%s", var_name);
550 GString *get_cbuf = g_string_new (NULL);
551 Node *node1 = node_new (TYPE_NODE,
552 "name", the_type->name,
553 "pointer", the_type->pointer,
554 "postfix", the_type->postfix,
556 Node *node3 = node_new (TYPE_NODE,
557 "name", class->class.otype,
561 g_string_sprintf (get_cbuf,
563 "g_object_get (G_OBJECT (self), \"%s\", "
567 the_type->pointer ? the_type->pointer : "",
570 typestack = g_list_prepend (typestack, node1);
571 typestack = g_list_prepend (typestack, node3);
573 push_funcarg ("self", FALSE);
575 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
576 get_id, get_cbuf, get_lineno,
577 lineno, FALSE, NULL);
581 char *set_id = g_strdup_printf ("set_%s", var_name);
582 GString *set_cbuf = g_string_new (NULL);
583 Node *node1 = node_new (TYPE_NODE,
584 "name", the_type->name,
585 "pointer", the_type->pointer,
586 "postfix", the_type->postfix,
588 Node *node2 = node_new (TYPE_NODE,
591 Node *node3 = node_new (TYPE_NODE,
592 "name", class->class.otype,
596 g_string_sprintf (set_cbuf,
597 "\tg_object_set (G_OBJECT (self), "
598 "\"%s\", val, NULL);\n",
601 typestack = g_list_prepend (typestack, node2);
602 typestack = g_list_prepend (typestack, node1);
603 typestack = g_list_prepend (typestack, node3);
605 push_funcarg ("self", FALSE);
606 push_funcarg ("val", FALSE);
608 typestack = g_list_prepend (typestack, node2);
609 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
610 set_id, set_cbuf, set_lineno,
611 lineno, FALSE, NULL);
614 node_free ((Node *)the_type);
618 get_prop_enum_flag_cast (Property *prop)
621 if (prop->extra_gtktype == NULL ||
622 /* HACK! just in case someone made this
623 * work with 2.0.0 by using the TYPE
625 ((strstr (prop->extra_gtktype, "_TYPE_") != NULL ||
626 strstr (prop->extra_gtktype, "TYPE_") == prop->extra_gtktype) &&
627 strchr (prop->extra_gtktype, ':') == NULL)) {
628 if (prop->ptype != NULL)
629 return get_type (prop->ptype, TRUE);
631 return g_strdup ("");
633 tmp = remove_sep (prop->extra_gtktype);
634 ret = g_strdup_printf ("(%s) ", tmp);
640 add_construct_glade (char * file, char * root, char * domain)
645 type = (Type *)node_new (TYPE_NODE,
649 initializer = g_strdup_printf("\t{\n"
650 "\tGtkWidget * root;\n"
651 "\t%%1$s->_priv->_glade_xml = glade_xml_new(%s, %s, %s);\n"
652 "\troot = glade_xml_get_widget(%%1$s->_priv->_glade_xml, %s);\n"
653 "\tgtk_widget_show(root);\n"
654 "\tgtk_container_add(GTK_CONTAINER(%%1$s), root);\n"
655 "\tglade_xml_signal_autoconnect_full(%%1$s->_priv->_glade_xml, (GladeXMLConnectFunc)___glade_xml_connect_foreach, (gpointer)%%1$s);\n"
656 "}\n", file, root, domain ? domain : "NULL", root);
658 var = node_new (VARIABLE_NODE,
659 "scope", PRIVATE_SCOPE,
661 "glade_widget", FALSE,
662 "id:steal", "_glade_xml",
663 "destructor_unref", FALSE,
664 "destructor", "g_object_unref",
665 "destructor_simple", TRUE,
666 "initializer", initializer,
667 "initializer_simple", FALSE,
669 class_nodes = g_list_prepend(class_nodes, var);
673 property_link_and_export (Node *node)
675 Property *prop = (Property *)node;
679 char *get = NULL, *set = NULL;
682 if (prop->set != NULL ||
684 error_print (GOB_ERROR, prop->line_no,
685 _("Property linking requested, but "
686 "getters and setters exist"));
689 var = find_var_or_die (prop->name, prop->line_no);
690 if(var->scope == PRIVATE_SCOPE) {
691 root = "self->_priv";
692 } else if (var->scope == CLASS_SCOPE) {
693 root = "SELF_GET_CLASS(self)";
695 error_print (GOB_ERROR, prop->line_no,
696 _("Self aliases needed when autolinking to a classwide member"));
701 if (strcmp (prop->gtktype, "STRING") == 0) {
702 set = g_strdup_printf("{ char *old = %s->%s; "
703 "%s->%s = g_value_dup_string (VAL); g_free (old); }",
706 get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
708 } else if (strcmp (prop->gtktype, "OBJECT") == 0) {
710 if (prop->extra_gtktype != NULL) {
711 cast = remove_sep (prop->extra_gtktype);
713 cast = g_strdup ("void");
715 set = g_strdup_printf("{ GObject *___old = (GObject *)%s->%s; "
716 "%s->%s = (%s *)g_value_dup_object (VAL); "
717 "if (___old != NULL) { "
718 "g_object_unref (G_OBJECT (___old)); "
724 get = g_strdup_printf ("g_value_set_object (VAL, "
725 "(gpointer)%s->%s);",
728 } else if (strcmp (prop->gtktype, "BOXED") == 0) {
729 char *type = make_me_type (prop->extra_gtktype,
731 if (prop->extra_gtktype == NULL) {
732 error_print (GOB_ERROR, prop->line_no,
733 _("Property linking requested for BOXED, but "
734 "boxed_type not set"));
736 set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
737 "gpointer ___new = (gpointer)g_value_get_boxed (VAL); "
738 "if (___new != ___old) { "
739 "if (___old != NULL) g_boxed_free (%s, ___old); "
740 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
741 "else %s->%s = NULL;"
749 get = g_strdup_printf("g_value_set_boxed (VAL, %s->%s);",
755 const char *getcast = "";
756 const char *setcast = "";
757 char *to_free = NULL;
758 set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
759 g_strdown (set_func);
760 get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
761 g_strdown (get_func);
764 if (strcmp (prop->gtktype, "FLAGS") == 0) {
765 setcast = "(guint) ";
767 get_prop_enum_flag_cast (prop);
768 } else if (strcmp (prop->gtktype, "ENUM") == 0) {
771 get_prop_enum_flag_cast (prop);
772 } else if (strcmp (prop->gtktype, "POINTER") == 0) {
773 setcast = "(gpointer) ";
774 getcast = g_strdup_printf ("(%s%s) ",
776 prop->ptype->pointer ? prop->ptype->pointer : "");
780 set = g_strdup_printf("%s->%s = %s%s (VAL);",
784 get = g_strdup_printf("%s (VAL, %s%s->%s);",
796 "get_line", prop->line_no,
798 "set_line", prop->line_no,
803 export_accessors (prop->name,
804 prop->get != NULL, prop->get_line,
805 prop->set != NULL, prop->set_line,
816 if (strcmp (s, "BOOL") == 0) {
817 error_print (GOB_WARN, line_no,
818 _("BOOL type is deprecated, please use BOOLEAN"));
820 return g_strdup ("BOOLEAN");
827 ensure_property (void)
829 if (property == NULL)
830 property = (Property *)node_new (PROPERTY_NODE, NULL);
835 /* Enabling traces. */
840 /* Enabling verbose error messages. */
841 #ifdef YYERROR_VERBOSE
842 # undef YYERROR_VERBOSE
843 # define YYERROR_VERBOSE 1
845 # define YYERROR_VERBOSE 0
848 /* Enabling the token table. */
849 #ifndef YYTOKEN_TABLE
850 # define YYTOKEN_TABLE 0
853 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
854 typedef union YYSTYPE
863 /* Line 187 of yacc.c. */
866 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
867 # define YYSTYPE_IS_DECLARED 1
868 # define YYSTYPE_IS_TRIVIAL 1
873 /* Copy the second part of user declarations. */
876 /* Line 216 of yacc.c. */
884 typedef YYTYPE_UINT8 yytype_uint8;
886 typedef unsigned char yytype_uint8;
890 typedef YYTYPE_INT8 yytype_int8;
891 #elif (defined __STDC__ || defined __C99__FUNC__ \
892 || defined __cplusplus || defined _MSC_VER)
893 typedef signed char yytype_int8;
895 typedef short int yytype_int8;
899 typedef YYTYPE_UINT16 yytype_uint16;
901 typedef unsigned short int yytype_uint16;
905 typedef YYTYPE_INT16 yytype_int16;
907 typedef short int yytype_int16;
911 # ifdef __SIZE_TYPE__
912 # define YYSIZE_T __SIZE_TYPE__
913 # elif defined size_t
914 # define YYSIZE_T size_t
915 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
916 || defined __cplusplus || defined _MSC_VER)
917 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
918 # define YYSIZE_T size_t
920 # define YYSIZE_T unsigned int
924 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
929 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
930 # define YY_(msgid) dgettext ("bison-runtime", msgid)
934 # define YY_(msgid) msgid
938 /* Suppress unused-variable warnings by "using" E. */
939 #if ! defined lint || defined __GNUC__
940 # define YYUSE(e) ((void) (e))
942 # define YYUSE(e) /* empty */
945 /* Identity function, used to suppress warnings about constant conditions. */
949 #if (defined __STDC__ || defined __C99__FUNC__ \
950 || defined __cplusplus || defined _MSC_VER)
963 #if ! defined yyoverflow || YYERROR_VERBOSE
965 /* The parser invokes alloca or malloc; define the necessary symbols. */
967 # ifdef YYSTACK_USE_ALLOCA
968 # if YYSTACK_USE_ALLOCA
970 # define YYSTACK_ALLOC __builtin_alloca
971 # elif defined __BUILTIN_VA_ARG_INCR
972 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
974 # define YYSTACK_ALLOC __alloca
975 # elif defined _MSC_VER
976 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
977 # define alloca _alloca
979 # define YYSTACK_ALLOC alloca
980 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
981 || defined __cplusplus || defined _MSC_VER)
982 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
991 # ifdef YYSTACK_ALLOC
992 /* Pacify GCC's `empty if-body' warning. */
993 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
994 # ifndef YYSTACK_ALLOC_MAXIMUM
995 /* The OS might guarantee only one guard page at the bottom of the stack,
996 and a page size can be as small as 4096 bytes. So we cannot safely
997 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
998 to allow for a few compiler-allocated temporary stack slots. */
999 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1002 # define YYSTACK_ALLOC YYMALLOC
1003 # define YYSTACK_FREE YYFREE
1004 # ifndef YYSTACK_ALLOC_MAXIMUM
1005 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1007 # if (defined __cplusplus && ! defined _STDLIB_H \
1008 && ! ((defined YYMALLOC || defined malloc) \
1009 && (defined YYFREE || defined free)))
1010 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1012 # define _STDLIB_H 1
1016 # define YYMALLOC malloc
1017 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1018 || defined __cplusplus || defined _MSC_VER)
1019 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1023 # define YYFREE free
1024 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1025 || defined __cplusplus || defined _MSC_VER)
1026 void free (void *); /* INFRINGES ON USER NAME SPACE */
1030 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1033 #if (! defined yyoverflow \
1034 && (! defined __cplusplus \
1035 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1037 /* A type that is properly aligned for any stack member. */
1044 /* The size of the maximum gap between one aligned stack and the next. */
1045 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1047 /* The size of an array large to enough to hold all stacks, each with
1049 # define YYSTACK_BYTES(N) \
1050 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1051 + YYSTACK_GAP_MAXIMUM)
1053 /* Copy COUNT objects from FROM to TO. The source and destination do
1056 # if defined __GNUC__ && 1 < __GNUC__
1057 # define YYCOPY(To, From, Count) \
1058 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1060 # define YYCOPY(To, From, Count) \
1064 for (yyi = 0; yyi < (Count); yyi++) \
1065 (To)[yyi] = (From)[yyi]; \
1071 /* Relocate STACK from its old location to the new one. The
1072 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1073 elements in the stack, and YYPTR gives the new location of the
1074 stack. Advance YYPTR to a properly aligned location for the next
1076 # define YYSTACK_RELOCATE(Stack) \
1079 YYSIZE_T yynewbytes; \
1080 YYCOPY (&yyptr->Stack, Stack, yysize); \
1081 Stack = &yyptr->Stack; \
1082 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1083 yyptr += yynewbytes / sizeof (*yyptr); \
1089 /* YYFINAL -- State number of the termination state. */
1091 /* YYLAST -- Last index in YYTABLE. */
1094 /* YYNTOKENS -- Number of terminals. */
1095 #define YYNTOKENS 67
1096 /* YYNNTS -- Number of nonterminals. */
1098 /* YYNRULES -- Number of rules. */
1099 #define YYNRULES 197
1100 /* YYNRULES -- Number of states. */
1101 #define YYNSTATES 417
1103 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1104 #define YYUNDEFTOK 2
1105 #define YYMAXUTOK 308
1107 #define YYTRANSLATE(YYX) \
1108 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1110 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1111 static const yytype_uint8 yytranslate[] =
1113 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1114 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1115 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1116 2, 2, 2, 65, 2, 2, 2, 2, 2, 2,
1117 56, 57, 62, 2, 60, 66, 2, 2, 2, 2,
1118 2, 2, 2, 2, 2, 2, 2, 2, 2, 58,
1119 64, 59, 63, 2, 2, 2, 2, 2, 2, 2,
1120 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1121 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1122 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1123 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1124 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1125 2, 2, 2, 54, 61, 55, 2, 2, 2, 2,
1126 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1127 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1128 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1129 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1130 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1131 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1132 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1133 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1134 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1135 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1136 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1137 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1138 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1139 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1140 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1141 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1142 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1143 45, 46, 47, 48, 49, 50, 51, 52, 53
1147 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1149 static const yytype_uint16 yyprhs[] =
1151 0, 0, 3, 7, 10, 13, 15, 17, 19, 21,
1152 23, 25, 27, 29, 32, 35, 38, 41, 43, 45,
1153 47, 49, 54, 58, 64, 65, 70, 76, 82, 88,
1154 95, 103, 110, 118, 121, 123, 125, 128, 132, 134,
1155 136, 138, 140, 142, 144, 146, 148, 151, 155, 158,
1156 162, 165, 168, 170, 172, 174, 175, 181, 188, 201,
1157 211, 218, 222, 223, 235, 244, 250, 254, 255, 259,
1158 261, 263, 268, 270, 272, 276, 280, 284, 288, 292,
1159 296, 300, 304, 308, 312, 316, 320, 324, 328, 332,
1160 336, 340, 342, 348, 350, 354, 355, 359, 361, 364,
1161 366, 368, 370, 373, 376, 379, 383, 387, 390, 393,
1162 396, 398, 401, 403, 406, 408, 410, 412, 414, 416,
1163 418, 420, 422, 424, 426, 428, 430, 432, 435, 438,
1164 442, 445, 447, 451, 455, 458, 460, 465, 469, 471,
1165 474, 476, 487, 499, 509, 519, 528, 540, 549, 555,
1166 558, 563, 570, 571, 573, 576, 578, 580, 583, 586,
1167 590, 595, 600, 602, 606, 608, 612, 614, 617, 621,
1168 628, 636, 639, 641, 643, 646, 649, 653, 657, 661,
1169 665, 673, 682, 686, 688, 692, 694, 702, 711, 715,
1170 717, 725, 734, 738, 740, 742, 745, 747
1173 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1174 static const yytype_int8 yyrhs[] =
1176 68, 0, -1, 70, 71, 70, -1, 71, 70, -1,
1177 70, 71, -1, 71, -1, 24, -1, 25, -1, 28,
1178 -1, 26, -1, 27, -1, 29, -1, 30, -1, 70,
1179 69, -1, 70, 112, -1, 70, 115, -1, 70, 117,
1180 -1, 69, -1, 112, -1, 115, -1, 117, -1, 72,
1181 54, 74, 55, -1, 72, 54, 55, -1, 3, 21,
1182 4, 21, 73, -1, -1, 56, 19, 57, 73, -1,
1183 56, 19, 19, 57, 73, -1, 56, 19, 21, 57,
1184 73, -1, 56, 19, 20, 57, 73, -1, 56, 19,
1185 31, 31, 57, 73, -1, 56, 19, 31, 31, 31,
1186 57, 73, -1, 56, 19, 19, 31, 57, 73, -1,
1187 56, 19, 19, 31, 31, 57, 73, -1, 74, 75,
1188 -1, 75, -1, 103, -1, 19, 103, -1, 19, 21,
1189 103, -1, 80, -1, 81, -1, 83, -1, 58, -1,
1190 32, -1, 33, -1, 34, -1, 35, -1, 19, 19,
1191 -1, 19, 54, 24, -1, 59, 119, -1, 59, 54,
1192 24, -1, 77, 78, -1, 78, 77, -1, 78, -1,
1193 77, -1, 19, -1, -1, 76, 92, 19, 79, 58,
1194 -1, 76, 92, 19, 22, 79, 58, -1, 37, 90,
1195 89, 19, 82, 19, 54, 24, 19, 54, 24, 58,
1196 -1, 37, 90, 89, 19, 82, 19, 54, 24, 58,
1197 -1, 37, 90, 89, 19, 82, 19, -1, 56, 19,
1198 57, -1, -1, 36, 19, 19, 84, 19, 54, 24,
1199 19, 54, 24, 58, -1, 36, 19, 19, 84, 19,
1200 54, 24, 58, -1, 36, 19, 19, 84, 58, -1,
1201 56, 85, 57, -1, -1, 85, 60, 88, -1, 88,
1202 -1, 31, -1, 19, 56, 31, 57, -1, 119, -1,
1203 86, -1, 41, 59, 86, -1, 42, 59, 86, -1,
1204 43, 59, 119, -1, 44, 59, 119, -1, 45, 59,
1205 87, -1, 47, 59, 91, -1, 48, 59, 92, -1,
1206 49, 59, 21, -1, 49, 59, 19, -1, 50, 59,
1207 21, -1, 50, 59, 19, -1, 51, 59, 21, -1,
1208 51, 59, 19, -1, 52, 59, 21, -1, 52, 59,
1209 19, -1, 53, 59, 21, -1, 53, 59, 19, -1,
1210 19, -1, 19, 56, 19, 92, 57, -1, 19, -1,
1211 56, 91, 57, -1, -1, 19, 61, 91, -1, 19,
1212 -1, 93, 97, -1, 93, -1, 94, -1, 19, -1,
1213 5, 19, -1, 19, 5, -1, 96, 19, -1, 5,
1214 96, 19, -1, 96, 19, 5, -1, 95, 94, -1,
1215 21, 94, -1, 5, 94, -1, 21, -1, 21, 5,
1216 -1, 95, -1, 95, 5, -1, 6, -1, 18, -1,
1217 14, -1, 15, -1, 13, -1, 16, -1, 17, -1,
1218 11, -1, 12, -1, 7, -1, 8, -1, 9, -1,
1219 62, -1, 62, 5, -1, 62, 97, -1, 62, 5,
1220 97, -1, 19, 100, -1, 100, -1, 76, 19, 100,
1221 -1, 19, 76, 100, -1, 76, 100, -1, 98, -1,
1222 19, 56, 101, 57, -1, 101, 60, 19, -1, 19,
1223 -1, 54, 24, -1, 58, -1, 39, 90, 99, 92,
1224 19, 56, 106, 57, 104, 102, -1, 76, 39, 90,
1225 98, 92, 19, 56, 106, 57, 104, 102, -1, 38,
1226 76, 92, 19, 56, 106, 57, 104, 102, -1, 76,
1227 38, 92, 19, 56, 106, 57, 104, 102, -1, 38,
1228 92, 19, 56, 106, 57, 104, 102, -1, 40, 56,
1229 21, 57, 92, 19, 56, 106, 57, 104, 102, -1,
1230 76, 92, 19, 56, 106, 57, 104, 102, -1, 19,
1231 56, 19, 57, 102, -1, 19, 105, -1, 19, 105,
1232 19, 105, -1, 19, 105, 19, 105, 19, 105, -1,
1233 -1, 119, -1, 54, 24, -1, 6, -1, 19, -1,
1234 19, 5, -1, 5, 19, -1, 19, 60, 107, -1,
1235 19, 5, 60, 107, -1, 5, 19, 60, 107, -1,
1236 107, -1, 108, 60, 10, -1, 108, -1, 108, 60,
1237 109, -1, 109, -1, 92, 19, -1, 92, 19, 22,
1238 -1, 92, 19, 56, 19, 110, 57, -1, 92, 19,
1239 22, 56, 19, 110, 57, -1, 110, 111, -1, 111,
1240 -1, 19, -1, 63, 119, -1, 64, 119, -1, 63,
1241 59, 119, -1, 64, 59, 119, -1, 59, 59, 119,
1242 -1, 65, 59, 119, -1, 9, 19, 54, 113, 55,
1243 21, 58, -1, 9, 19, 54, 113, 60, 55, 21,
1244 58, -1, 113, 60, 114, -1, 114, -1, 19, 59,
1245 119, -1, 19, -1, 47, 19, 54, 116, 55, 21,
1246 58, -1, 47, 19, 54, 116, 60, 55, 21, 58,
1247 -1, 116, 60, 19, -1, 19, -1, 46, 19, 54,
1248 118, 55, 21, 58, -1, 46, 19, 54, 118, 60,
1249 55, 21, 58, -1, 118, 60, 19, -1, 19, -1,
1250 20, -1, 66, 20, -1, 23, -1, 19, -1
1253 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1254 static const yytype_uint16 yyrline[] =
1256 0, 699, 699, 700, 701, 702, 705, 714, 723, 732,
1257 741, 750, 759, 770, 771, 772, 773, 774, 775, 776,
1258 777, 780, 785, 792, 809, 810, 818, 830, 839, 851,
1259 860, 869, 878, 889, 890, 893, 894, 903, 915, 916,
1260 917, 918, 921, 922, 923, 924, 927, 947, 971, 975,
1261 983, 984, 985, 986, 987, 995, 1001, 1004, 1009, 1077,
1262 1131, 1220, 1228, 1233, 1281, 1317, 1333, 1334, 1337, 1338,
1263 1341, 1342, 1354, 1355, 1358, 1364, 1370, 1376, 1382, 1388,
1264 1394, 1401, 1407, 1413, 1419, 1425, 1431, 1437, 1443, 1449,
1265 1455, 1461, 1486, 1495, 1501, 1502, 1505, 1508, 1514, 1521,
1266 1530, 1533, 1536, 1540, 1544, 1548, 1553, 1561, 1565, 1570,
1267 1574, 1577, 1581, 1584, 1589, 1590, 1591, 1592, 1593, 1594,
1268 1595, 1596, 1597, 1600, 1601, 1602, 1605, 1606, 1607, 1611,
1269 1618, 1630, 1636, 1648, 1660, 1663, 1669, 1674, 1677, 1682,
1270 1683, 1687, 1710, 1733, 1756, 1779, 1797, 1810, 1820, 1860,
1271 1872, 1892, 1923, 1930, 1931, 1937, 1938, 1949, 1960, 1971,
1272 1981, 1991, 2001, 2004, 2005, 2008, 2009, 2012, 2015, 2018,
1273 2026, 2036, 2037, 2040, 2057, 2064, 2071, 2078, 2085, 2092,
1274 2101, 2110, 2121, 2122, 2125, 2145, 2155, 2164, 2175, 2178,
1275 2183, 2192, 2203, 2206, 2212, 2213, 2217, 2218
1279 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1280 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1281 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1282 static const char *const yytname[] =
1284 "$end", "error", "$undefined", "CLASS", "FROM", "CONST", "VOID",
1285 "STRUCT", "UNION", "ENUM", "THREEDOTS", "SIGNED", "UNSIGNED", "LONG",
1286 "SHORT", "INT", "FLOAT", "DOUBLE", "CHAR", "TOKEN", "NUMBER",
1287 "TYPETOKEN", "ARRAY_DIM", "SINGLE_CHAR", "CCODE", "ADCODE", "HTCODE",
1288 "PHCODE", "HCODE", "ACODE", "ATCODE", "STRING", "PUBLIC", "PRIVATE",
1289 "PROTECTED", "CLASSWIDE", "PROPERTY", "ARGUMENT", "VIRTUAL", "SIGNAL",
1290 "OVERRIDE", "NICK", "BLURB", "MAXIMUM", "MINIMUM", "DEFAULT_VALUE",
1291 "ERROR", "FLAGS", "TYPE", "FLAGS_TYPE", "ENUM_TYPE", "PARAM_TYPE",
1292 "BOXED_TYPE", "OBJECT_TYPE", "'{'", "'}'", "'('", "')'", "';'", "'='",
1293 "','", "'|'", "'*'", "'>'", "'<'", "'!'", "'-'", "$accept", "prog",
1294 "ccode", "ccodes", "class", "classdec", "classflags", "classcode",
1295 "thing", "scope", "destructor", "initializer", "varoptions", "variable",
1296 "argument", "export", "property", "param_spec", "param_spec_list",
1297 "string", "anyval", "param_spec_value", "argtype", "flags", "flaglist",
1298 "type", "specifier_list", "spec_list", "specifier", "strunionenum",
1299 "pointer", "simplesigtype", "fullsigtype", "sigtype", "tokenlist",
1300 "codenocode", "method", "methodmods", "retcode", "funcargs", "arglist",
1301 "arglist1", "arg", "checklist", "check", "enumcode", "enumvals",
1302 "enumval", "flagcode", "flagvals", "errorcode", "errorvals", "numtok", 0
1307 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1309 static const yytype_uint16 yytoknum[] =
1311 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1312 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1313 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1314 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1315 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1316 305, 306, 307, 308, 123, 125, 40, 41, 59, 61,
1317 44, 124, 42, 62, 60, 33, 45
1321 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1322 static const yytype_uint8 yyr1[] =
1324 0, 67, 68, 68, 68, 68, 69, 69, 69, 69,
1325 69, 69, 69, 70, 70, 70, 70, 70, 70, 70,
1326 70, 71, 71, 72, 73, 73, 73, 73, 73, 73,
1327 73, 73, 73, 74, 74, 75, 75, 75, 75, 75,
1328 75, 75, 76, 76, 76, 76, 77, 77, 78, 78,
1329 79, 79, 79, 79, 79, 79, 80, 80, 81, 81,
1330 81, 82, 82, 83, 83, 83, 84, 84, 85, 85,
1331 86, 86, 87, 87, 88, 88, 88, 88, 88, 88,
1332 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
1333 88, 88, 89, 89, 90, 90, 91, 91, 92, 92,
1334 93, 93, 93, 93, 93, 93, 93, 94, 94, 94,
1335 94, 94, 94, 94, 95, 95, 95, 95, 95, 95,
1336 95, 95, 95, 96, 96, 96, 97, 97, 97, 97,
1337 98, 98, 99, 99, 99, 99, 100, 101, 101, 102,
1338 102, 103, 103, 103, 103, 103, 103, 103, 103, 104,
1339 104, 104, 104, 105, 105, 106, 106, 106, 106, 106,
1340 106, 106, 106, 107, 107, 108, 108, 109, 109, 109,
1341 109, 110, 110, 111, 111, 111, 111, 111, 111, 111,
1342 112, 112, 113, 113, 114, 114, 115, 115, 116, 116,
1343 117, 117, 118, 118, 119, 119, 119, 119
1346 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1347 static const yytype_uint8 yyr2[] =
1349 0, 2, 3, 2, 2, 1, 1, 1, 1, 1,
1350 1, 1, 1, 2, 2, 2, 2, 1, 1, 1,
1351 1, 4, 3, 5, 0, 4, 5, 5, 5, 6,
1352 7, 6, 7, 2, 1, 1, 2, 3, 1, 1,
1353 1, 1, 1, 1, 1, 1, 2, 3, 2, 3,
1354 2, 2, 1, 1, 1, 0, 5, 6, 12, 9,
1355 6, 3, 0, 11, 8, 5, 3, 0, 3, 1,
1356 1, 4, 1, 1, 3, 3, 3, 3, 3, 3,
1357 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1358 3, 1, 5, 1, 3, 0, 3, 1, 2, 1,
1359 1, 1, 2, 2, 2, 3, 3, 2, 2, 2,
1360 1, 2, 1, 2, 1, 1, 1, 1, 1, 1,
1361 1, 1, 1, 1, 1, 1, 1, 2, 2, 3,
1362 2, 1, 3, 3, 2, 1, 4, 3, 1, 2,
1363 1, 10, 11, 9, 9, 8, 11, 8, 5, 2,
1364 4, 6, 0, 1, 2, 1, 1, 2, 2, 3,
1365 4, 4, 1, 3, 1, 3, 1, 2, 3, 6,
1366 7, 2, 1, 1, 2, 2, 3, 3, 3, 3,
1367 7, 8, 3, 1, 3, 1, 7, 8, 3, 1,
1368 7, 8, 3, 1, 1, 2, 1, 1
1371 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1372 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1373 means the default is an error. */
1374 static const yytype_uint8 yydefact[] =
1376 0, 0, 0, 6, 7, 9, 10, 8, 11, 12,
1377 0, 0, 0, 17, 0, 5, 0, 18, 19, 20,
1378 0, 0, 0, 0, 1, 13, 4, 14, 15, 16,
1379 3, 0, 0, 0, 0, 0, 2, 0, 42, 43,
1380 44, 45, 0, 95, 0, 95, 0, 22, 41, 0,
1381 34, 0, 38, 39, 40, 35, 24, 185, 0, 183,
1382 193, 0, 189, 0, 0, 0, 0, 0, 36, 0,
1383 0, 0, 0, 114, 123, 124, 125, 121, 122, 118,
1384 116, 117, 119, 120, 115, 101, 110, 0, 0, 99,
1385 100, 112, 0, 0, 0, 21, 33, 0, 95, 0,
1386 0, 23, 0, 0, 0, 0, 0, 0, 0, 37,
1387 0, 0, 67, 97, 0, 93, 0, 0, 102, 109,
1388 0, 103, 111, 108, 0, 0, 126, 98, 113, 107,
1389 104, 0, 0, 135, 0, 131, 0, 0, 0, 55,
1390 0, 197, 194, 196, 0, 184, 0, 0, 182, 0,
1391 192, 0, 0, 188, 0, 0, 0, 0, 0, 0,
1392 94, 0, 62, 105, 0, 0, 127, 128, 106, 0,
1393 0, 0, 130, 0, 134, 0, 0, 0, 0, 0,
1394 54, 55, 0, 0, 53, 52, 0, 0, 0, 0,
1395 0, 24, 195, 180, 0, 190, 0, 186, 0, 0,
1396 140, 148, 91, 0, 0, 0, 0, 0, 0, 0,
1397 0, 0, 0, 0, 0, 0, 69, 0, 65, 96,
1398 0, 0, 0, 0, 0, 114, 101, 0, 0, 162,
1399 164, 166, 129, 138, 0, 133, 132, 0, 0, 0,
1400 0, 46, 0, 0, 0, 0, 48, 50, 0, 51,
1401 56, 0, 24, 24, 24, 0, 25, 181, 191, 187,
1402 139, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1403 0, 0, 0, 66, 0, 0, 0, 0, 60, 0,
1404 102, 103, 0, 167, 152, 0, 136, 0, 0, 0,
1405 0, 0, 47, 57, 152, 49, 0, 24, 26, 28,
1406 27, 0, 24, 0, 70, 74, 75, 76, 77, 197,
1407 73, 78, 72, 79, 80, 82, 81, 84, 83, 86,
1408 85, 88, 87, 90, 89, 68, 0, 92, 61, 0,
1409 152, 0, 0, 159, 168, 0, 0, 0, 163, 165,
1410 137, 0, 0, 152, 0, 0, 24, 31, 24, 29,
1411 0, 0, 64, 0, 0, 161, 160, 0, 0, 0,
1412 149, 153, 145, 152, 0, 0, 0, 147, 32, 30,
1413 0, 0, 0, 59, 143, 0, 173, 0, 0, 0,
1414 0, 0, 172, 154, 0, 0, 152, 144, 152, 71,
1415 0, 0, 0, 0, 0, 174, 0, 175, 0, 169,
1416 171, 150, 141, 0, 0, 63, 0, 170, 178, 176,
1417 177, 179, 0, 146, 142, 58, 151
1420 /* YYDEFGOTO[NTERM-NUM]. */
1421 static const yytype_int16 yydefgoto[] =
1423 -1, 12, 13, 14, 15, 16, 101, 49, 50, 51,
1424 184, 185, 186, 52, 53, 222, 54, 158, 215, 305,
1425 311, 216, 116, 71, 114, 227, 89, 90, 91, 92,
1426 127, 133, 134, 135, 234, 201, 55, 337, 360, 228,
1427 229, 230, 231, 381, 382, 17, 58, 59, 18, 63,
1431 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1433 #define YYPACT_NINF -326
1434 static const yytype_int16 yypact[] =
1436 145, 13, 77, -326, -326, -326, -326, -326, -326, -326,
1437 108, 196, 146, -326, 145, 205, 168, -326, -326, -326,
1438 264, 173, 221, 232, -326, -326, 205, -326, -326, -326,
1439 205, 161, 259, 276, 283, 301, 205, 222, -326, -326,
1440 -326, -326, 309, 273, 327, 273, 281, -326, -326, 170,
1441 -326, 292, -326, -326, -326, -326, 291, 290, -27, -326,
1442 -326, 40, -326, 127, 294, 250, 332, 292, -326, 333,
1443 334, 335, 375, -326, -326, -326, -326, -326, -326, -326,
1444 -326, -326, -326, -326, -326, 350, 443, 392, 337, 295,
1445 -326, 457, 339, 239, 357, -326, -326, 392, 273, 366,
1446 376, -326, 27, 381, 71, 391, 95, 398, 124, -326,
1447 372, 417, 390, 389, 394, 396, 434, 471, -326, -326,
1448 446, -326, 471, -326, 447, 411, 4, -326, 471, -326,
1449 474, 231, 461, -326, 392, -326, 424, 472, 475, 122,
1450 192, -326, -326, -326, 470, -326, 435, 476, -326, 437,
1451 -326, 477, 438, -326, 478, 163, 444, 274, 0, 334,
1452 -326, 482, 448, -326, 449, 409, 295, -326, -326, 450,
1453 483, 484, -326, 6, -326, 488, 392, 452, 6, 392,
1454 64, 38, 409, 32, 451, 490, 453, 80, 455, 456,
1455 485, 291, -326, -326, 459, -326, 460, -326, 462, 491,
1456 -326, -326, -326, 463, 464, 465, 466, 467, 468, 469,
1457 473, 479, 480, 481, 486, -30, -326, 487, -326, -326,
1458 392, 495, 500, 409, 426, 489, 11, 502, 492, -326,
1459 493, -326, -326, -326, 126, -326, -326, 494, 510, 409,
1460 511, -326, 507, 496, 498, 509, -326, -326, 64, -326,
1461 -326, 187, 291, 291, 291, 189, -326, -326, -326, -326,
1462 -326, 85, 85, 27, 27, 18, 334, 392, -6, 219,
1463 226, 260, 293, -326, 274, 512, 499, 501, 497, 503,
1464 128, 179, 392, 100, 515, 358, -326, 516, 409, 505,
1465 506, 508, -326, -326, 515, -326, 513, 291, -326, -326,
1466 -326, 514, 291, 517, -326, -326, -326, -326, -326, 517,
1467 -326, -326, -326, -326, -326, -326, -326, -326, -326, -326,
1468 -326, -326, -326, -326, -326, -326, 12, -326, -326, 518,
1469 515, 392, 392, -326, 519, 524, 69, 163, -326, -326,
1470 -326, 520, 409, 515, 409, 163, 291, -326, 291, -326,
1471 521, 522, -326, 61, 163, -326, -326, 525, 66, 523,
1472 529, -326, -326, 515, 526, 163, 527, -326, -326, -326,
1473 528, 533, 532, -326, -326, 66, -326, 530, 83, 101,
1474 531, 75, -326, -326, 69, 163, 515, -326, 515, -326,
1475 504, 535, 88, 27, 27, -326, 27, -326, 27, -326,
1476 -326, 546, -326, 163, 163, -326, 534, -326, -326, -326,
1477 -326, -326, 69, -326, -326, -326, -326
1480 /* YYPGOTO[NTERM-NUM]. */
1481 static const yytype_int16 yypgoto[] =
1483 -326, -326, -4, 102, 552, -326, -189, -326, 538, -26,
1484 352, 383, 387, -326, -326, -326, -326, -326, -326, 5,
1485 -326, 298, -326, -24, -154, -43, -326, -69, -326, -66,
1486 -57, 431, -326, -96, -326, -325, -23, -287, -297, -178,
1487 -259, -326, 289, 203, -216, 154, -326, 536, 212, -326,
1491 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1492 positive, shift that token. If negative, reduce the rule which
1493 number is the opposite. If zero, do what YYDEFACT says.
1494 If YYTABLE_NINF, syntax error. */
1495 #define YYTABLE_NINF -159
1496 static const yytype_int16 yytable[] =
1498 145, 88, 256, 119, 244, 219, 120, 345, 99, 166,
1499 25, 67, 362, 315, 68, 316, 281, 123, 87, 217,
1500 367, 93, 129, 333, 111, 169, 25, 273, 103, 374,
1501 274, 351, 25, 104, 20, 172, 174, 309, 142, 67,
1502 387, 143, 109, 354, 124, 279, 141, 142, 119, 304,
1503 143, 141, 142, 119, 137, 143, 365, 180, 218, 119,
1504 402, 290, 170, 298, 299, 300, 126, 132, -156, 167,
1505 352, 282, 355, 356, 138, 235, 385, 236, 413, 414,
1506 372, 246, 172, 241, 144, 376, 245, 401, 141, 142,
1507 57, 175, 143, 144, 376, 105, 21, 183, 144, 403,
1508 106, 404, 141, 142, 303, 171, 143, 376, 347, 232,
1509 341, 251, 313, 349, 150, 416, 304, 30, 242, 373,
1510 141, 142, 334, 359, 143, 377, 147, 22, 36, 378,
1511 379, 380, 399, 238, 377, 144, 240, 252, 378, 379,
1512 380, 180, 394, 153, 181, 407, 24, 377, 1, 144,
1513 151, 378, 379, 380, 2, 119, 335, 368, 120, 369,
1514 396, 307, 308, 312, 364, 400, 366, 144, 27, 3,
1515 4, 5, 6, 7, 8, 9, 400, 276, 182, 154,
1516 37, 183, 107, 286, 27, -158, 287, 108, 331, 37,
1517 27, 10, 11, 38, 39, 40, 41, 42, 43, 44,
1518 45, 46, 38, 39, 40, 41, 42, 43, 44, 45,
1519 46, 187, 188, 189, 2, 23, 47, 199, 296, 48,
1520 301, 200, 31, 190, 314, 95, 28, 33, 48, 3,
1521 4, 5, 6, 7, 8, 9, -157, 29, 317, 332,
1522 318, 64, 28, 65, 297, 319, 302, 320, 28, 191,
1523 169, 10, 11, 29, 38, 39, 40, 41, 131, 29,
1524 44, 45, 46, 38, 39, 40, 41, 306, 32, 64,
1525 310, 38, 39, 40, 41, 34, 395, 397, 66, 321,
1526 56, 322, 38, 39, 40, 41, 35, 170, 44, 45,
1527 46, 408, 409, 202, 410, 57, 411, 72, 73, 74,
1528 75, 76, 60, 77, 78, 79, 80, 81, 82, 83,
1529 84, 85, 323, 86, 324, 203, 204, 205, 206, 207,
1530 62, 208, 209, 210, 211, 212, 213, 214, 69, 70,
1531 97, 98, 72, 73, 74, 75, 76, 94, 77, 78,
1532 79, 80, 81, 82, 83, 84, 85, 100, 86, 102,
1533 66, 110, 112, 113, 115, 121, 125, 126, 130, 38,
1534 39, 40, 41, 72, 73, 74, 75, 76, 338, 77,
1535 78, 79, 80, 81, 82, 83, 84, 85, 136, 86,
1536 117, 73, 74, 75, 76, 139, 77, 78, 79, 80,
1537 81, 82, 83, 84, 118, 140, 86, 72, 73, 74,
1538 75, 76, 146, 77, 78, 79, 80, 81, 82, 83,
1539 84, 85, 149, 86, 224, 225, 74, 75, 76, 152,
1540 77, 78, 79, 80, 81, 82, 83, 84, 226, 155,
1541 86, 117, 73, 74, 75, 76, 156, 77, 78, 79,
1542 80, 81, 82, 83, 84, 280, 157, 86, 122, 73,
1543 159, 160, 161, 162, 77, 78, 79, 80, 81, 82,
1544 83, 84, 128, 73, 86, 163, 164, 165, 77, 78,
1545 79, 80, 81, 82, 83, 84, 117, 73, 86, 168,
1546 173, 176, 77, 78, 79, 80, 81, 82, 83, 84,
1547 192, 177, 86, 193, 178, 195, 197, 194, 196, 198,
1548 182, 220, 233, 169, 221, 223, 170, 237, 239, 248,
1549 183, 250, 253, 254, 277, 260, 255, 257, 258, 278,
1550 259, 283, 261, 262, 263, 264, 265, 266, 267, 289,
1551 291, 292, 268, 295, 336, 340, 326, 249, 269, 270,
1552 271, 275, 353, 358, 375, 272, -155, 383, 384, 284,
1553 288, 329, 370, 285, 293, 294, 327, 390, 328, 406,
1554 330, 342, 405, 343, 344, 412, 26, 247, 243, 179,
1555 346, 348, 325, 350, 339, 357, 371, 363, 392, 0,
1556 0, 0, 0, 386, 388, 389, 391, 96, 0, 393,
1557 398, 0, 415, 0, 0, 0, 0, 0, 0, 0,
1558 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1559 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1560 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1561 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1565 static const yytype_int16 yycheck[] =
1567 102, 44, 191, 72, 182, 159, 72, 294, 51, 5,
1568 14, 37, 337, 19, 37, 21, 5, 86, 44, 19,
1569 345, 45, 91, 282, 67, 19, 30, 57, 55, 354,
1570 60, 19, 36, 60, 21, 131, 132, 19, 20, 65,
1571 365, 23, 65, 330, 87, 223, 19, 20, 117, 31,
1572 23, 19, 20, 122, 97, 23, 343, 19, 58, 128,
1573 385, 239, 56, 252, 253, 254, 62, 93, 57, 126,
1574 58, 60, 331, 332, 98, 171, 363, 173, 403, 404,
1575 19, 183, 178, 19, 66, 19, 54, 384, 19, 20,
1576 19, 134, 23, 66, 19, 55, 19, 59, 66, 386,
1577 60, 388, 19, 20, 19, 131, 23, 19, 297, 166,
1578 288, 31, 266, 302, 19, 412, 31, 15, 54, 58,
1579 19, 20, 22, 54, 23, 59, 55, 19, 26, 63,
1580 64, 65, 57, 176, 59, 66, 179, 57, 63, 64,
1581 65, 19, 59, 19, 22, 57, 0, 59, 3, 66,
1582 55, 63, 64, 65, 9, 224, 56, 346, 224, 348,
1583 59, 263, 264, 265, 342, 381, 344, 66, 14, 24,
1584 25, 26, 27, 28, 29, 30, 392, 220, 56, 55,
1585 19, 59, 55, 57, 30, 57, 60, 60, 60, 19,
1586 36, 46, 47, 32, 33, 34, 35, 36, 37, 38,
1587 39, 40, 32, 33, 34, 35, 36, 37, 38, 39,
1588 40, 19, 20, 21, 9, 19, 55, 54, 31, 58,
1589 31, 58, 54, 31, 267, 55, 14, 54, 58, 24,
1590 25, 26, 27, 28, 29, 30, 57, 14, 19, 60,
1591 21, 19, 30, 21, 57, 19, 57, 21, 36, 57,
1592 19, 46, 47, 30, 32, 33, 34, 35, 19, 36,
1593 38, 39, 40, 32, 33, 34, 35, 262, 4, 19,
1594 265, 32, 33, 34, 35, 54, 378, 379, 56, 19,
1595 21, 21, 32, 33, 34, 35, 54, 56, 38, 39,
1596 40, 393, 394, 19, 396, 19, 398, 5, 6, 7,
1597 8, 9, 19, 11, 12, 13, 14, 15, 16, 17,
1598 18, 19, 19, 21, 21, 41, 42, 43, 44, 45,
1599 19, 47, 48, 49, 50, 51, 52, 53, 19, 56,
1600 38, 39, 5, 6, 7, 8, 9, 56, 11, 12,
1601 13, 14, 15, 16, 17, 18, 19, 56, 21, 59,
1602 56, 19, 19, 19, 19, 5, 19, 62, 19, 32,
1603 33, 34, 35, 5, 6, 7, 8, 9, 10, 11,
1604 12, 13, 14, 15, 16, 17, 18, 19, 21, 21,
1605 5, 6, 7, 8, 9, 19, 11, 12, 13, 14,
1606 15, 16, 17, 18, 19, 19, 21, 5, 6, 7,
1607 8, 9, 21, 11, 12, 13, 14, 15, 16, 17,
1608 18, 19, 21, 21, 5, 6, 7, 8, 9, 21,
1609 11, 12, 13, 14, 15, 16, 17, 18, 19, 57,
1610 21, 5, 6, 7, 8, 9, 19, 11, 12, 13,
1611 14, 15, 16, 17, 18, 19, 56, 21, 5, 6,
1612 61, 57, 56, 19, 11, 12, 13, 14, 15, 16,
1613 17, 18, 5, 6, 21, 19, 19, 56, 11, 12,
1614 13, 14, 15, 16, 17, 18, 5, 6, 21, 5,
1615 19, 57, 11, 12, 13, 14, 15, 16, 17, 18,
1616 20, 19, 21, 58, 19, 58, 58, 21, 21, 21,
1617 56, 19, 19, 19, 56, 56, 56, 19, 56, 19,
1618 59, 58, 57, 57, 19, 24, 31, 58, 58, 19,
1619 58, 19, 59, 59, 59, 59, 59, 59, 59, 19,
1620 19, 24, 59, 24, 19, 19, 24, 185, 59, 59,
1621 59, 54, 24, 19, 19, 59, 57, 24, 19, 57,
1622 56, 54, 31, 60, 58, 57, 57, 24, 57, 24,
1623 57, 56, 58, 57, 56, 19, 14, 184, 181, 138,
1624 57, 57, 274, 56, 285, 56, 54, 57, 375, -1,
1625 -1, -1, -1, 57, 57, 57, 54, 49, -1, 59,
1626 59, -1, 58, -1, -1, -1, -1, -1, -1, -1,
1627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1628 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1629 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1630 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1634 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1635 symbol of state STATE-NUM. */
1636 static const yytype_uint8 yystos[] =
1638 0, 3, 9, 24, 25, 26, 27, 28, 29, 30,
1639 46, 47, 68, 69, 70, 71, 72, 112, 115, 117,
1640 21, 19, 19, 19, 0, 69, 71, 112, 115, 117,
1641 70, 54, 4, 54, 54, 54, 70, 19, 32, 33,
1642 34, 35, 36, 37, 38, 39, 40, 55, 58, 74,
1643 75, 76, 80, 81, 83, 103, 21, 19, 113, 114,
1644 19, 118, 19, 116, 19, 21, 56, 76, 103, 19,
1645 56, 90, 5, 6, 7, 8, 9, 11, 12, 13,
1646 14, 15, 16, 17, 18, 19, 21, 76, 92, 93,
1647 94, 95, 96, 90, 56, 55, 75, 38, 39, 92,
1648 56, 73, 59, 55, 60, 55, 60, 55, 60, 103,
1649 19, 92, 19, 19, 91, 19, 89, 5, 19, 94,
1650 96, 5, 5, 94, 92, 19, 62, 97, 5, 94,
1651 19, 19, 76, 98, 99, 100, 21, 92, 90, 19,
1652 19, 19, 20, 23, 66, 119, 21, 55, 114, 21,
1653 19, 55, 21, 19, 55, 57, 19, 56, 84, 61,
1654 57, 56, 19, 19, 19, 56, 5, 97, 5, 19,
1655 56, 76, 100, 19, 100, 92, 57, 19, 19, 98,
1656 19, 22, 56, 59, 77, 78, 79, 19, 20, 21,
1657 31, 57, 20, 58, 21, 58, 21, 58, 21, 54,
1658 58, 102, 19, 41, 42, 43, 44, 45, 47, 48,
1659 49, 50, 51, 52, 53, 85, 88, 19, 58, 91,
1660 19, 56, 82, 56, 5, 6, 19, 92, 106, 107,
1661 108, 109, 97, 19, 101, 100, 100, 19, 92, 56,
1662 92, 19, 54, 79, 106, 54, 119, 78, 19, 77,
1663 58, 31, 57, 57, 57, 31, 73, 58, 58, 58,
1664 24, 59, 59, 59, 59, 59, 59, 59, 59, 59,
1665 59, 59, 59, 57, 60, 54, 92, 19, 19, 106,
1666 19, 5, 60, 19, 57, 60, 57, 60, 56, 19,
1667 106, 19, 24, 58, 57, 24, 31, 57, 73, 73,
1668 73, 31, 57, 19, 31, 86, 86, 119, 119, 19,
1669 86, 87, 119, 91, 92, 19, 21, 19, 21, 19,
1670 21, 19, 21, 19, 21, 88, 24, 57, 57, 54,
1671 57, 60, 60, 107, 22, 56, 19, 104, 10, 109,
1672 19, 106, 56, 57, 56, 104, 57, 73, 57, 73,
1673 56, 19, 58, 24, 104, 107, 107, 56, 19, 54,
1674 105, 119, 102, 57, 106, 104, 106, 102, 73, 73,
1675 31, 54, 19, 58, 102, 19, 19, 59, 63, 64,
1676 65, 110, 111, 24, 19, 104, 57, 102, 57, 57,
1677 24, 54, 110, 59, 59, 119, 59, 119, 59, 57,
1678 111, 105, 102, 104, 104, 58, 24, 57, 119, 119,
1679 119, 119, 19, 102, 102, 58, 105
1682 #define yyerrok (yyerrstatus = 0)
1683 #define yyclearin (yychar = YYEMPTY)
1684 #define YYEMPTY (-2)
1687 #define YYACCEPT goto yyacceptlab
1688 #define YYABORT goto yyabortlab
1689 #define YYERROR goto yyerrorlab
1692 /* Like YYERROR except do call yyerror. This remains here temporarily
1693 to ease the transition to the new meaning of YYERROR, for GCC.
1694 Once GCC version 2 has supplanted version 1, this can go. */
1696 #define YYFAIL goto yyerrlab
1698 #define YYRECOVERING() (!!yyerrstatus)
1700 #define YYBACKUP(Token, Value) \
1702 if (yychar == YYEMPTY && yylen == 1) \
1706 yytoken = YYTRANSLATE (yychar); \
1712 yyerror (YY_("syntax error: cannot back up")); \
1719 #define YYERRCODE 256
1722 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1723 If N is 0, then set CURRENT to the empty location which ends
1724 the previous symbol: RHS[0] (always defined). */
1726 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1727 #ifndef YYLLOC_DEFAULT
1728 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1732 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1733 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1734 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1735 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1739 (Current).first_line = (Current).last_line = \
1740 YYRHSLOC (Rhs, 0).last_line; \
1741 (Current).first_column = (Current).last_column = \
1742 YYRHSLOC (Rhs, 0).last_column; \
1748 /* YY_LOCATION_PRINT -- Print the location on the stream.
1749 This macro was not mandated originally: define only if we know
1750 we won't break user code: when these are the locations we know. */
1752 #ifndef YY_LOCATION_PRINT
1753 # if YYLTYPE_IS_TRIVIAL
1754 # define YY_LOCATION_PRINT(File, Loc) \
1755 fprintf (File, "%d.%d-%d.%d", \
1756 (Loc).first_line, (Loc).first_column, \
1757 (Loc).last_line, (Loc).last_column)
1759 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1764 /* YYLEX -- calling `yylex' with the right arguments. */
1767 # define YYLEX yylex (YYLEX_PARAM)
1769 # define YYLEX yylex ()
1772 /* Enable debugging if requested. */
1776 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1777 # define YYFPRINTF fprintf
1780 # define YYDPRINTF(Args) \
1786 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1790 YYFPRINTF (stderr, "%s ", Title); \
1791 yy_symbol_print (stderr, \
1793 YYFPRINTF (stderr, "\n"); \
1798 /*--------------------------------.
1799 | Print this symbol on YYOUTPUT. |
1800 `--------------------------------*/
1803 #if (defined __STDC__ || defined __C99__FUNC__ \
1804 || defined __cplusplus || defined _MSC_VER)
1806 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1809 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1812 YYSTYPE const * const yyvaluep;
1818 if (yytype < YYNTOKENS)
1819 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1831 /*--------------------------------.
1832 | Print this symbol on YYOUTPUT. |
1833 `--------------------------------*/
1835 #if (defined __STDC__ || defined __C99__FUNC__ \
1836 || defined __cplusplus || defined _MSC_VER)
1838 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1841 yy_symbol_print (yyoutput, yytype, yyvaluep)
1844 YYSTYPE const * const yyvaluep;
1847 if (yytype < YYNTOKENS)
1848 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1850 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1852 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1853 YYFPRINTF (yyoutput, ")");
1856 /*------------------------------------------------------------------.
1857 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1859 `------------------------------------------------------------------*/
1861 #if (defined __STDC__ || defined __C99__FUNC__ \
1862 || defined __cplusplus || defined _MSC_VER)
1864 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1867 yy_stack_print (bottom, top)
1868 yytype_int16 *bottom;
1872 YYFPRINTF (stderr, "Stack now");
1873 for (; bottom <= top; ++bottom)
1874 YYFPRINTF (stderr, " %d", *bottom);
1875 YYFPRINTF (stderr, "\n");
1878 # define YY_STACK_PRINT(Bottom, Top) \
1881 yy_stack_print ((Bottom), (Top)); \
1885 /*------------------------------------------------.
1886 | Report that the YYRULE is going to be reduced. |
1887 `------------------------------------------------*/
1889 #if (defined __STDC__ || defined __C99__FUNC__ \
1890 || defined __cplusplus || defined _MSC_VER)
1892 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1895 yy_reduce_print (yyvsp, yyrule)
1900 int yynrhs = yyr2[yyrule];
1902 unsigned long int yylno = yyrline[yyrule];
1903 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1905 /* The symbols being reduced. */
1906 for (yyi = 0; yyi < yynrhs; yyi++)
1908 fprintf (stderr, " $%d = ", yyi + 1);
1909 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1910 &(yyvsp[(yyi + 1) - (yynrhs)])
1912 fprintf (stderr, "\n");
1916 # define YY_REDUCE_PRINT(Rule) \
1919 yy_reduce_print (yyvsp, Rule); \
1922 /* Nonzero means print parse trace. It is left uninitialized so that
1923 multiple parsers can coexist. */
1925 #else /* !YYDEBUG */
1926 # define YYDPRINTF(Args)
1927 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1928 # define YY_STACK_PRINT(Bottom, Top)
1929 # define YY_REDUCE_PRINT(Rule)
1930 #endif /* !YYDEBUG */
1933 /* YYINITDEPTH -- initial size of the parser's stacks. */
1935 # define YYINITDEPTH 200
1938 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1939 if the built-in stack extension method is used).
1941 Do not make this value too large; the results are undefined if
1942 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1943 evaluated with infinite-precision integer arithmetic. */
1946 # define YYMAXDEPTH 10000
1954 # if defined __GLIBC__ && defined _STRING_H
1955 # define yystrlen strlen
1957 /* Return the length of YYSTR. */
1958 #if (defined __STDC__ || defined __C99__FUNC__ \
1959 || defined __cplusplus || defined _MSC_VER)
1961 yystrlen (const char *yystr)
1969 for (yylen = 0; yystr[yylen]; yylen++)
1977 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1978 # define yystpcpy stpcpy
1980 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1982 #if (defined __STDC__ || defined __C99__FUNC__ \
1983 || defined __cplusplus || defined _MSC_VER)
1985 yystpcpy (char *yydest, const char *yysrc)
1988 yystpcpy (yydest, yysrc)
1994 const char *yys = yysrc;
1996 while ((*yyd++ = *yys++) != '\0')
2005 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2006 quotes and backslashes, so that it's suitable for yyerror. The
2007 heuristic is that double-quoting is unnecessary unless the string
2008 contains an apostrophe, a comma, or backslash (other than
2009 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2010 null, do not copy; instead, return the length of what the result
2013 yytnamerr (char *yyres, const char *yystr)
2018 char const *yyp = yystr;
2025 goto do_not_strip_quotes;
2029 goto do_not_strip_quotes;
2042 do_not_strip_quotes: ;
2046 return yystrlen (yystr);
2048 return yystpcpy (yyres, yystr) - yyres;
2052 /* Copy into YYRESULT an error message about the unexpected token
2053 YYCHAR while in state YYSTATE. Return the number of bytes copied,
2054 including the terminating null byte. If YYRESULT is null, do not
2055 copy anything; just return the number of bytes that would be
2056 copied. As a special case, return 0 if an ordinary "syntax error"
2057 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
2058 size calculation. */
2060 yysyntax_error (char *yyresult, int yystate, int yychar)
2062 int yyn = yypact[yystate];
2064 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
2068 int yytype = YYTRANSLATE (yychar);
2069 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2070 YYSIZE_T yysize = yysize0;
2072 int yysize_overflow = 0;
2073 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2074 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2078 /* This is so xgettext sees the translatable formats that are
2079 constructed on the fly. */
2080 YY_("syntax error, unexpected %s");
2081 YY_("syntax error, unexpected %s, expecting %s");
2082 YY_("syntax error, unexpected %s, expecting %s or %s");
2083 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2084 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2088 static char const yyunexpected[] = "syntax error, unexpected %s";
2089 static char const yyexpecting[] = ", expecting %s";
2090 static char const yyor[] = " or %s";
2091 char yyformat[sizeof yyunexpected
2092 + sizeof yyexpecting - 1
2093 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2094 * (sizeof yyor - 1))];
2095 char const *yyprefix = yyexpecting;
2097 /* Start YYX at -YYN if negative to avoid negative indexes in
2099 int yyxbegin = yyn < 0 ? -yyn : 0;
2101 /* Stay within bounds of both yycheck and yytname. */
2102 int yychecklim = YYLAST - yyn + 1;
2103 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2106 yyarg[0] = yytname[yytype];
2107 yyfmt = yystpcpy (yyformat, yyunexpected);
2109 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2110 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2112 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2116 yyformat[sizeof yyunexpected - 1] = '\0';
2119 yyarg[yycount++] = yytname[yyx];
2120 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2121 yysize_overflow |= (yysize1 < yysize);
2123 yyfmt = yystpcpy (yyfmt, yyprefix);
2127 yyf = YY_(yyformat);
2128 yysize1 = yysize + yystrlen (yyf);
2129 yysize_overflow |= (yysize1 < yysize);
2132 if (yysize_overflow)
2133 return YYSIZE_MAXIMUM;
2137 /* Avoid sprintf, as that infringes on the user's name space.
2138 Don't have undefined behavior even if the translation
2139 produced a string with the wrong number of "%s"s. */
2140 char *yyp = yyresult;
2142 while ((*yyp = *yyf) != '\0')
2144 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2146 yyp += yytnamerr (yyp, yyarg[yyi++]);
2159 #endif /* YYERROR_VERBOSE */
2162 /*-----------------------------------------------.
2163 | Release the memory associated to this symbol. |
2164 `-----------------------------------------------*/
2167 #if (defined __STDC__ || defined __C99__FUNC__ \
2168 || defined __cplusplus || defined _MSC_VER)
2170 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2173 yydestruct (yymsg, yytype, yyvaluep)
2183 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2194 /* Prevent warnings from -Wmissing-prototypes. */
2196 #ifdef YYPARSE_PARAM
2197 #if defined __STDC__ || defined __cplusplus
2198 int yyparse (void *YYPARSE_PARAM);
2202 #else /* ! YYPARSE_PARAM */
2203 #if defined __STDC__ || defined __cplusplus
2208 #endif /* ! YYPARSE_PARAM */
2212 /* The look-ahead symbol. */
2215 /* The semantic value of the look-ahead symbol. */
2218 /* Number of syntax errors so far. */
2227 #ifdef YYPARSE_PARAM
2228 #if (defined __STDC__ || defined __C99__FUNC__ \
2229 || defined __cplusplus || defined _MSC_VER)
2231 yyparse (void *YYPARSE_PARAM)
2234 yyparse (YYPARSE_PARAM)
2235 void *YYPARSE_PARAM;
2237 #else /* ! YYPARSE_PARAM */
2238 #if (defined __STDC__ || defined __C99__FUNC__ \
2239 || defined __cplusplus || defined _MSC_VER)
2253 /* Number of tokens to shift before error messages enabled. */
2255 /* Look-ahead token as an internal (translated) token number. */
2258 /* Buffer for error messages, and its allocated size. */
2260 char *yymsg = yymsgbuf;
2261 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2264 /* Three stacks and their tools:
2265 `yyss': related to states,
2266 `yyvs': related to semantic values,
2267 `yyls': related to locations.
2269 Refer to the stacks thru separate pointers, to allow yyoverflow
2270 to reallocate them elsewhere. */
2272 /* The state stack. */
2273 yytype_int16 yyssa[YYINITDEPTH];
2274 yytype_int16 *yyss = yyssa;
2275 yytype_int16 *yyssp;
2277 /* The semantic value stack. */
2278 YYSTYPE yyvsa[YYINITDEPTH];
2279 YYSTYPE *yyvs = yyvsa;
2284 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2286 YYSIZE_T yystacksize = YYINITDEPTH;
2288 /* The variables used to return semantic value and location from the
2293 /* The number of symbols on the RHS of the reduced rule.
2294 Keep to zero when no symbol should be popped. */
2297 YYDPRINTF ((stderr, "Starting parse\n"));
2302 yychar = YYEMPTY; /* Cause a token to be read. */
2304 /* Initialize stack pointers.
2305 Waste one element of value and location stack
2306 so that they stay on the same level as the state stack.
2307 The wasted elements are never initialized. */
2314 /*------------------------------------------------------------.
2315 | yynewstate -- Push a new state, which is found in yystate. |
2316 `------------------------------------------------------------*/
2318 /* In all cases, when you get here, the value and location stacks
2319 have just been pushed. So pushing a state here evens the stacks. */
2325 if (yyss + yystacksize - 1 <= yyssp)
2327 /* Get the current used size of the three stacks, in elements. */
2328 YYSIZE_T yysize = yyssp - yyss + 1;
2332 /* Give user a chance to reallocate the stack. Use copies of
2333 these so that the &'s don't force the real ones into
2335 YYSTYPE *yyvs1 = yyvs;
2336 yytype_int16 *yyss1 = yyss;
2339 /* Each stack pointer address is followed by the size of the
2340 data in use in that stack, in bytes. This used to be a
2341 conditional around just the two extra args, but that might
2342 be undefined if yyoverflow is a macro. */
2343 yyoverflow (YY_("memory exhausted"),
2344 &yyss1, yysize * sizeof (*yyssp),
2345 &yyvs1, yysize * sizeof (*yyvsp),
2352 #else /* no yyoverflow */
2353 # ifndef YYSTACK_RELOCATE
2354 goto yyexhaustedlab;
2356 /* Extend the stack our own way. */
2357 if (YYMAXDEPTH <= yystacksize)
2358 goto yyexhaustedlab;
2360 if (YYMAXDEPTH < yystacksize)
2361 yystacksize = YYMAXDEPTH;
2364 yytype_int16 *yyss1 = yyss;
2365 union yyalloc *yyptr =
2366 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2368 goto yyexhaustedlab;
2369 YYSTACK_RELOCATE (yyss);
2370 YYSTACK_RELOCATE (yyvs);
2372 # undef YYSTACK_RELOCATE
2374 YYSTACK_FREE (yyss1);
2377 #endif /* no yyoverflow */
2379 yyssp = yyss + yysize - 1;
2380 yyvsp = yyvs + yysize - 1;
2383 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2384 (unsigned long int) yystacksize));
2386 if (yyss + yystacksize - 1 <= yyssp)
2390 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2399 /* Do appropriate processing given the current state. Read a
2400 look-ahead token if we need one and don't already have one. */
2402 /* First try to decide what to do without reference to look-ahead token. */
2403 yyn = yypact[yystate];
2404 if (yyn == YYPACT_NINF)
2407 /* Not known => get a look-ahead token if don't already have one. */
2409 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2410 if (yychar == YYEMPTY)
2412 YYDPRINTF ((stderr, "Reading a token: "));
2416 if (yychar <= YYEOF)
2418 yychar = yytoken = YYEOF;
2419 YYDPRINTF ((stderr, "Now at end of input.\n"));
2423 yytoken = YYTRANSLATE (yychar);
2424 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2427 /* If the proper action on seeing token YYTOKEN is to reduce or to
2428 detect an error, take that action. */
2430 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2435 if (yyn == 0 || yyn == YYTABLE_NINF)
2444 /* Count tokens shifted since error; after three, turn off error
2449 /* Shift the look-ahead token. */
2450 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2452 /* Discard the shifted token unless it is eof. */
2453 if (yychar != YYEOF)
2462 /*-----------------------------------------------------------.
2463 | yydefault -- do the default action for the current state. |
2464 `-----------------------------------------------------------*/
2466 yyn = yydefact[yystate];
2472 /*-----------------------------.
2473 | yyreduce -- Do a reduction. |
2474 `-----------------------------*/
2476 /* yyn is the number of a rule to reduce with. */
2479 /* If YYLEN is nonzero, implement the default value of the action:
2482 Otherwise, the following line sets YYVAL to garbage.
2483 This behavior is undocumented and Bison
2484 users should not rely upon it. Assigning to YYVAL
2485 unconditionally makes the parser a bit smaller, and it avoids a
2486 GCC warning that YYVAL may be used uninitialized. */
2487 yyval = yyvsp[1-yylen];
2490 YY_REDUCE_PRINT (yyn);
2516 Node *node = node_new (CCODE_NODE,
2518 "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str,
2519 "line_no", ccode_line,
2521 nodes = g_list_append(nodes,node);
2522 g_string_free((yyvsp[(1) - (1)].cbuf),FALSE);
2529 Node *node = node_new (CCODE_NODE,
2531 "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str,
2532 "line_no", ccode_line,
2534 nodes = g_list_append(nodes,node);
2535 g_string_free((yyvsp[(1) - (1)].cbuf),FALSE);
2542 Node *node = node_new (CCODE_NODE,
2544 "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str,
2545 "line_no", ccode_line,
2547 nodes = g_list_append(nodes,node);
2548 g_string_free((yyvsp[(1) - (1)].cbuf),FALSE);
2555 Node *node = node_new (CCODE_NODE,
2557 "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str,
2558 "line_no", ccode_line,
2560 nodes = g_list_append(nodes,node);
2561 g_string_free((yyvsp[(1) - (1)].cbuf),FALSE);
2568 Node *node = node_new (CCODE_NODE,
2570 "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str,
2571 "line_no", ccode_line,
2573 nodes = g_list_append(nodes,node);
2574 g_string_free((yyvsp[(1) - (1)].cbuf),FALSE);
2581 Node *node = node_new (CCODE_NODE,
2583 "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str,
2584 "line_no", ccode_line,
2586 nodes = g_list_append(nodes,node);
2587 g_string_free((yyvsp[(1) - (1)].cbuf),FALSE);
2594 Node *node = node_new (CCODE_NODE,
2596 "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str,
2597 "line_no", ccode_line,
2599 nodes = g_list_append(nodes,node);
2600 g_string_free((yyvsp[(1) - (1)].cbuf),FALSE);
2647 ((Class *)class)->nodes = class_nodes;
2649 nodes = g_list_append(nodes,class);
2656 ((Class *)class)->nodes = NULL;
2658 nodes = g_list_append(nodes,class);
2665 class = node_new (CLASS_NODE,
2666 "otype:steal", (yyvsp[(2) - (5)].id),
2667 "ptype:steal", (yyvsp[(4) - (5)].id),
2668 "bonobo_object_class:steal", bonobo_object_class,
2669 "glade_xml", glade_xml,
2670 "interfaces:steal", interfaces,
2671 "chunk_size:steal", chunk_size,
2672 "abstract", abstract,
2674 bonobo_object_class = NULL;
2684 if(strcmp((yyvsp[(2) - (4)].id),"abstract") == 0) {
2687 yyerror(_("parse error"));
2696 if(strcmp((yyvsp[(2) - (5)].id),"chunks") == 0) {
2697 g_free (chunk_size);
2698 chunk_size = g_strdup((yyvsp[(3) - (5)].id));
2699 } else if(strcmp((yyvsp[(2) - (5)].id),"BonoboObject") == 0) {
2700 g_free (bonobo_object_class);
2701 bonobo_object_class = g_strdup((yyvsp[(3) - (5)].id));
2703 yyerror(_("parse error"));
2712 if (strcmp ((yyvsp[(2) - (5)].id), "interface") == 0) {
2713 interfaces = g_list_append (interfaces,
2714 g_strdup ((yyvsp[(3) - (5)].id)));
2716 yyerror(_("parse error"));
2725 if(strcmp((yyvsp[(2) - (5)].id),"chunks") == 0) {
2726 g_free (chunk_size);
2727 if(atoi((yyvsp[(3) - (5)].id)) != 0)
2728 chunk_size = g_strdup((yyvsp[(3) - (5)].id));
2732 yyerror(_("parse error"));
2741 if (strcmp ((yyvsp[(2) - (6)].id), "GladeXML") == 0) {
2743 add_construct_glade((yyvsp[(3) - (6)].id), (yyvsp[(4) - (6)].id), NULL);
2745 yyerror(_("parse error"));
2754 if (strcmp ((yyvsp[(2) - (7)].id), "GladeXML") == 0) {
2756 add_construct_glade((yyvsp[(3) - (7)].id), (yyvsp[(4) - (7)].id), (yyvsp[(5) - (7)].id));
2758 yyerror(_("parse error"));
2767 if (strcmp ((yyvsp[(2) - (6)].id), "GladeXML") == 0) {
2769 add_construct_glade((yyvsp[(3) - (6)].id), (yyvsp[(4) - (6)].id), NULL);
2771 yyerror(_("parse error"));
2780 if (strcmp ((yyvsp[(2) - (7)].id), "GladeXML") == 0) {
2782 add_construct_glade((yyvsp[(3) - (7)].id), (yyvsp[(4) - (7)].id), (yyvsp[(5) - (7)].id));
2784 yyerror(_("parse error"));
2808 if (strcmp ((yyvsp[(1) - (2)].id), "BonoboObject") != 0) {
2809 g_free ((yyvsp[(1) - (2)].id));
2810 yyerror (_("parse error"));
2813 g_free ((yyvsp[(1) - (2)].id));
2814 last_added_method->bonobo_object_func = TRUE;
2821 if (strcmp ((yyvsp[(1) - (3)].id), "interface") != 0) {
2822 g_free ((yyvsp[(1) - (3)].id));
2823 g_free ((yyvsp[(2) - (3)].id));
2824 yyerror (_("parse error"));
2827 g_free ((yyvsp[(1) - (3)].id));
2828 node_set ((Node *)last_added_method,
2829 "interface:steal", (yyvsp[(2) - (3)].id),
2856 { the_scope = PUBLIC_SCOPE; }
2861 { the_scope = PRIVATE_SCOPE; }
2866 { the_scope = PROTECTED_SCOPE; }
2871 { the_scope = CLASS_SCOPE; }
2877 if (strcmp ((yyvsp[(1) - (2)].id), "destroywith") == 0) {
2878 g_free ((yyvsp[(1) - (2)].id));
2879 destructor_unref = FALSE;
2880 destructor = (yyvsp[(2) - (2)].id);
2881 destructor_line = line_no;
2882 destructor_simple = TRUE;
2883 } else if (strcmp ((yyvsp[(1) - (2)].id), "unrefwith") == 0) {
2884 g_free ((yyvsp[(1) - (2)].id));
2885 destructor_unref = TRUE;
2886 destructor = (yyvsp[(2) - (2)].id);
2887 destructor_line = line_no;
2888 destructor_simple = TRUE;
2890 g_free ((yyvsp[(1) - (2)].id));
2891 g_free ((yyvsp[(2) - (2)].id));
2892 yyerror (_("parse error"));
2901 if (strcmp ((yyvsp[(1) - (3)].id), "destroy") == 0) {
2902 g_free((yyvsp[(1) - (3)].id));
2903 destructor_unref = FALSE;
2904 destructor = ((yyvsp[(3) - (3)].cbuf))->str;
2905 g_string_free((yyvsp[(3) - (3)].cbuf), FALSE);
2906 destructor_line = ccode_line;
2907 destructor_simple = FALSE;
2908 } else if (strcmp ((yyvsp[(1) - (3)].id), "unref") == 0) {
2909 g_free ((yyvsp[(1) - (3)].id));
2910 destructor_unref = TRUE;
2911 destructor = ((yyvsp[(3) - (3)].cbuf))->str;
2912 g_string_free ((yyvsp[(3) - (3)].cbuf), FALSE);
2913 destructor_line = ccode_line;
2914 destructor_simple = FALSE;
2916 g_free ((yyvsp[(1) - (3)].id));
2917 g_string_free ((yyvsp[(3) - (3)].cbuf), TRUE);
2918 yyerror (_("parse error"));
2927 initializer = (yyvsp[(2) - (2)].id);
2928 initializer_line = ccode_line;
2935 initializer = ((yyvsp[(3) - (3)].cbuf))->str;
2936 initializer_line = ccode_line;
2937 g_string_free((yyvsp[(3) - (3)].cbuf), FALSE);
2953 { destructor = NULL; }
2958 { initializer = NULL; }
2964 if (strcmp ((yyvsp[(1) - (1)].id), "GladeXML") == 0) {
2965 glade_widget = TRUE;
2967 yyerror(_("parse error"));
2982 #line 1001 "parse.y"
2984 push_variable((yyvsp[(3) - (5)].id), the_scope,(yyvsp[(1) - (5)].line), NULL);
2989 #line 1004 "parse.y"
2991 push_variable((yyvsp[(3) - (6)].id), the_scope, (yyvsp[(1) - (6)].line), (yyvsp[(4) - (6)].id));
2996 #line 1009 "parse.y"
2999 if(strcmp((yyvsp[(6) - (12)].id),"get")==0 &&
3000 strcmp((yyvsp[(9) - (12)].id),"set")==0) {
3001 Type *type = pop_type();
3002 g_free ((yyvsp[(6) - (12)].id));
3003 g_free ((yyvsp[(9) - (12)].id));
3004 node = node_new (ARGUMENT_NODE,
3005 "gtktype:steal", (yyvsp[(3) - (12)].id),
3006 "atype:steal", type,
3007 "flags:steal", (yyvsp[(2) - (12)].list),
3008 "name:steal", (yyvsp[(4) - (12)].id),
3009 "get:steal", ((yyvsp[(8) - (12)].cbuf))->str,
3010 "get_line", (yyvsp[(7) - (12)].line),
3011 "set:steal", ((yyvsp[(11) - (12)].cbuf))->str,
3012 "set_line", (yyvsp[(10) - (12)].line),
3013 "line_no", (yyvsp[(1) - (12)].line),
3016 class_nodes = g_list_append(class_nodes,node);
3018 g_string_free ((yyvsp[(8) - (12)].cbuf), FALSE);
3019 g_string_free ((yyvsp[(11) - (12)].cbuf), FALSE);
3021 } else if(strcmp((yyvsp[(6) - (12)].id),"set")==0 &&
3022 strcmp((yyvsp[(9) - (12)].id),"get")==0) {
3023 Type *type = pop_type();
3024 g_free ((yyvsp[(6) - (12)].id));
3025 g_free ((yyvsp[(9) - (12)].id));
3026 node = node_new (ARGUMENT_NODE,
3027 "gtktype:steal", (yyvsp[(3) - (12)].id),
3028 "atype:steal", type,
3029 "flags:steal", (yyvsp[(2) - (12)].list),
3030 "name:steal", (yyvsp[(4) - (12)].id),
3031 "get:steal", ((yyvsp[(11) - (12)].cbuf))->str,
3032 "get_line", (yyvsp[(10) - (12)].line),
3033 "set:steal", ((yyvsp[(8) - (12)].cbuf))->str,
3034 "set_line", (yyvsp[(7) - (12)].line),
3035 "line_no", (yyvsp[(1) - (12)].line),
3037 g_string_free ((yyvsp[(11) - (12)].cbuf), FALSE);
3038 g_string_free ((yyvsp[(8) - (12)].cbuf), FALSE);
3039 class_nodes = g_list_append(class_nodes,node);
3041 g_free ((yyvsp[(3) - (12)].id));
3042 g_free ((yyvsp[(4) - (12)].id));
3043 g_free ((yyvsp[(6) - (12)].id));
3044 g_free ((yyvsp[(9) - (12)].id));
3045 g_list_foreach ((yyvsp[(2) - (12)].list), (GFunc)g_free, NULL);
3046 g_list_free ((yyvsp[(2) - (12)].list));
3047 g_string_free ((yyvsp[(11) - (12)].cbuf), TRUE);
3048 g_string_free ((yyvsp[(8) - (12)].cbuf), TRUE);
3049 yyerror (_("parse error"));
3053 if ((yyvsp[(5) - (12)].id) != NULL) {
3054 Argument *arg = (Argument *)node;
3055 export_accessors (arg->name,
3056 arg->get != NULL, arg->get_line,
3057 arg->set != NULL, arg->set_line,
3061 g_free ((yyvsp[(5) - (12)].id));
3068 #line 1077 "parse.y"
3071 if(strcmp((yyvsp[(6) - (9)].id), "get") == 0) {
3072 Type *type = pop_type();
3073 g_free ((yyvsp[(6) - (9)].id));
3074 node = node_new (ARGUMENT_NODE,
3075 "gtktype:steal", (yyvsp[(3) - (9)].id),
3076 "atype:steal", type,
3077 "flags:steal", (yyvsp[(2) - (9)].list),
3078 "name:steal", (yyvsp[(4) - (9)].id),
3079 "get:steal", ((yyvsp[(8) - (9)].cbuf))->str,
3080 "get_line", (yyvsp[(7) - (9)].line),
3081 "line_no", (yyvsp[(1) - (9)].line),
3084 g_string_free ((yyvsp[(8) - (9)].cbuf), FALSE);
3085 class_nodes = g_list_append(class_nodes, node);
3086 } else if(strcmp((yyvsp[(6) - (9)].id), "set") == 0) {
3087 Type *type = pop_type();
3088 g_free ((yyvsp[(6) - (9)].id));
3089 node = node_new (ARGUMENT_NODE,
3090 "gtktype:steal", (yyvsp[(3) - (9)].id),
3091 "atype:steal", type,
3092 "flags:steal", (yyvsp[(2) - (9)].list),
3093 "name:steal", (yyvsp[(4) - (9)].id),
3094 "set:steal", ((yyvsp[(8) - (9)].cbuf))->str,
3095 "set_line", (yyvsp[(7) - (9)].line),
3096 "line_no", (yyvsp[(1) - (9)].line),
3099 g_string_free ((yyvsp[(8) - (9)].cbuf), FALSE);
3100 class_nodes = g_list_append (class_nodes, node);
3102 g_free ((yyvsp[(6) - (9)].id));
3103 g_free ((yyvsp[(3) - (9)].id));
3104 g_free ((yyvsp[(4) - (9)].id));
3105 g_list_foreach ((yyvsp[(2) - (9)].list), (GFunc)g_free, NULL);
3106 g_list_free ((yyvsp[(2) - (9)].list));
3107 g_string_free ((yyvsp[(8) - (9)].cbuf), TRUE);
3108 yyerror(_("parse error"));
3112 if ((yyvsp[(5) - (9)].id) != NULL) {
3113 Argument *arg = (Argument *)node;
3114 export_accessors (arg->name,
3115 arg->get != NULL, arg->get_line,
3116 arg->set != NULL, arg->set_line,
3120 g_free ((yyvsp[(5) - (9)].id));
3126 #line 1131 "parse.y"
3129 char *get, *set = NULL;
3134 if(strcmp((yyvsp[(6) - (6)].id), "link")!=0 &&
3135 strcmp((yyvsp[(6) - (6)].id), "stringlink")!=0 &&
3136 strcmp((yyvsp[(6) - (6)].id), "objectlink")!=0) {
3137 g_free((yyvsp[(6) - (6)].id));
3138 g_free((yyvsp[(3) - (6)].id));
3139 g_free((yyvsp[(4) - (6)].id));
3140 g_list_foreach((yyvsp[(2) - (6)].list),(GFunc)g_free,NULL);
3141 g_list_free((yyvsp[(2) - (6)].list));
3142 yyerror(_("parse error"));
3148 var = find_var_or_die((yyvsp[(4) - (6)].id), (yyvsp[(1) - (6)].line));
3149 if(var->scope == PRIVATE_SCOPE) {
3150 root = "self->_priv";
3151 } else if(var->scope == CLASS_SCOPE) {
3152 root = "SELF_GET_CLASS(self)";
3154 error_print(GOB_ERROR, (yyvsp[(1) - (6)].line),
3155 _("Self aliases needed when autolinking to a classwide member"));
3160 if(strcmp((yyvsp[(6) - (6)].id), "link")==0) {
3161 set = g_strdup_printf("%s->%s = ARG;",
3162 root, (yyvsp[(4) - (6)].id));
3163 } else if(strcmp((yyvsp[(6) - (6)].id), "stringlink")==0) {
3164 set = g_strdup_printf("g_free (%s->%s); "
3165 "%s->%s = g_strdup (ARG);",
3166 root, (yyvsp[(4) - (6)].id),
3167 root, (yyvsp[(4) - (6)].id));
3168 } else if(strcmp((yyvsp[(6) - (6)].id), "objectlink")==0) {
3169 set = g_strdup_printf(
3171 "g_object_ref (G_OBJECT (ARG)); "
3172 "if (%s->%s != NULL) "
3173 "g_object_unref (G_OBJECT (%s->%s)); "
3175 root, (yyvsp[(4) - (6)].id),
3176 root, (yyvsp[(4) - (6)].id),
3177 root, (yyvsp[(4) - (6)].id));
3179 g_assert_not_reached();
3182 get = g_strdup_printf("ARG = %s->%s;", root, (yyvsp[(4) - (6)].id));
3184 g_free ((yyvsp[(6) - (6)].id));
3187 type = (Type *)node_copy ((Node *)var->vtype);
3189 node = node_new (ARGUMENT_NODE,
3190 "gtktype:steal", (yyvsp[(3) - (6)].id),
3191 "atype:steal", type,
3192 "flags:steal", (yyvsp[(2) - (6)].list),
3193 "name:steal", (yyvsp[(4) - (6)].id),
3195 "get_line", (yyvsp[(1) - (6)].line),
3197 "set_line", (yyvsp[(1) - (6)].line),
3198 "line_no", (yyvsp[(1) - (6)].line),
3201 if ((yyvsp[(5) - (6)].id) != NULL) {
3202 Argument *arg = (Argument *)node;
3203 export_accessors (arg->name,
3204 arg->get != NULL, arg->get_line,
3205 arg->set != NULL, arg->set_line,
3209 g_free ((yyvsp[(5) - (6)].id));
3212 class_nodes = g_list_append (class_nodes, node);
3217 #line 1220 "parse.y"
3219 if (strcmp ((yyvsp[(2) - (3)].id), "export")!=0) {
3220 g_free ((yyvsp[(2) - (3)].id));
3221 yyerror (_("parse error"));
3224 (yyval.id) = (yyvsp[(2) - (3)].id);
3229 #line 1228 "parse.y"
3236 #line 1233 "parse.y"
3239 node_set ((Node *)property,
3240 "line_no", (yyvsp[(1) - (11)].line),
3241 "gtktype:steal", debool ((yyvsp[(2) - (11)].id)),
3242 "name:steal", (yyvsp[(3) - (11)].id),
3244 if (strcmp ((yyvsp[(5) - (11)].id), "get") == 0 &&
3245 strcmp ((yyvsp[(8) - (11)].id), "set") == 0) {
3246 node_set ((Node *)property,
3247 "get:steal", ((yyvsp[(7) - (11)].cbuf))->str,
3248 "get_line", (yyvsp[(6) - (11)].line),
3249 "set:steal", ((yyvsp[(10) - (11)].cbuf))->str,
3250 "set_line", (yyvsp[(9) - (11)].line),
3252 g_string_free ((yyvsp[(7) - (11)].cbuf), FALSE);
3253 g_string_free ((yyvsp[(10) - (11)].cbuf), FALSE);
3254 g_free ((yyvsp[(5) - (11)].id));
3255 g_free ((yyvsp[(8) - (11)].id));
3256 } else if (strcmp ((yyvsp[(5) - (11)].id), "set") == 0 &&
3257 strcmp ((yyvsp[(8) - (11)].id), "get") == 0) {
3258 node_set ((Node *)property,
3259 "get:steal", ((yyvsp[(10) - (11)].cbuf))->str,
3260 "get_line", (yyvsp[(9) - (11)].line),
3261 "set:steal", ((yyvsp[(7) - (11)].cbuf))->str,
3262 "set_line", (yyvsp[(6) - (11)].line),
3264 g_string_free ((yyvsp[(7) - (11)].cbuf), FALSE);
3265 g_string_free ((yyvsp[(10) - (11)].cbuf), FALSE);
3266 g_free ((yyvsp[(5) - (11)].id));
3267 g_free ((yyvsp[(8) - (11)].id));
3269 g_string_free ((yyvsp[(7) - (11)].cbuf), TRUE);
3270 g_string_free ((yyvsp[(10) - (11)].cbuf), TRUE);
3271 g_free ((yyvsp[(5) - (11)].id));
3272 g_free ((yyvsp[(8) - (11)].id));
3273 node_free ((Node *)property);
3275 yyerror (_("parse error"));
3278 property_link_and_export ((Node *)property);
3279 if (property != NULL) {
3280 class_nodes = g_list_append (class_nodes,
3288 #line 1281 "parse.y"
3291 node_set ((Node *)property,
3292 "line_no", (yyvsp[(1) - (8)].line),
3293 "gtktype:steal", debool ((yyvsp[(2) - (8)].id)),
3294 "name:steal", (yyvsp[(3) - (8)].id),
3296 if (strcmp ((yyvsp[(5) - (8)].id), "get") == 0) {
3297 node_set ((Node *)property,
3298 "get:steal", ((yyvsp[(7) - (8)].cbuf))->str,
3299 "get_line", (yyvsp[(6) - (8)].line),
3301 g_string_free ((yyvsp[(7) - (8)].cbuf), FALSE);
3302 g_free ((yyvsp[(5) - (8)].id));
3303 } else if (strcmp ((yyvsp[(5) - (8)].id), "set") == 0) {
3304 node_set ((Node *)property,
3305 "set:steal", ((yyvsp[(7) - (8)].cbuf))->str,
3306 "set_line", (yyvsp[(6) - (8)].line),
3308 g_string_free ((yyvsp[(7) - (8)].cbuf), FALSE);
3309 g_free ((yyvsp[(5) - (8)].id));
3311 g_string_free ((yyvsp[(7) - (8)].cbuf), TRUE);
3312 g_free ((yyvsp[(5) - (8)].id));
3313 node_free ((Node *)property);
3315 yyerror (_("parse error"));
3318 property_link_and_export ((Node *)property);
3319 if (property != NULL) {
3320 class_nodes = g_list_append (class_nodes,
3328 #line 1317 "parse.y"
3331 node_set ((Node *)property,
3332 "line_no", (yyvsp[(1) - (5)].line),
3333 "gtktype:steal", debool ((yyvsp[(2) - (5)].id)),
3334 "name:steal", (yyvsp[(3) - (5)].id),
3336 property_link_and_export ((Node *)property);
3337 if (property != NULL) {
3338 class_nodes = g_list_append (class_nodes,
3346 #line 1333 "parse.y"
3351 #line 1334 "parse.y"
3356 #line 1337 "parse.y"
3361 #line 1338 "parse.y"
3366 #line 1341 "parse.y"
3367 { (yyval.id) = (yyvsp[(1) - (1)].id); }
3371 #line 1342 "parse.y"
3373 if (strcmp ((yyvsp[(1) - (4)].id), "_") != 0) {
3374 g_free ((yyvsp[(1) - (4)].id));
3375 yyerror(_("parse error"));
3378 g_free ((yyvsp[(1) - (4)].id));
3379 (yyval.id) = g_strconcat ("_(", (yyvsp[(3) - (4)].id), ")", NULL);
3380 g_free ((yyvsp[(3) - (4)].id));
3385 #line 1354 "parse.y"
3386 { (yyval.id) = (yyvsp[(1) - (1)].id); }
3390 #line 1355 "parse.y"
3391 { (yyval.id) = (yyvsp[(1) - (1)].id); }
3395 #line 1358 "parse.y"
3398 node_set ((Node *)property,
3399 "nick:steal", (yyvsp[(3) - (3)].id),
3405 #line 1364 "parse.y"
3408 node_set ((Node *)property,
3409 "blurb:steal", (yyvsp[(3) - (3)].id),
3415 #line 1370 "parse.y"
3418 node_set ((Node *)property,
3419 "maximum:steal", (yyvsp[(3) - (3)].id),
3425 #line 1376 "parse.y"
3428 node_set ((Node *)property,
3429 "minimum:steal", (yyvsp[(3) - (3)].id),
3435 #line 1382 "parse.y"
3438 node_set ((Node *)property,
3439 "default_value:steal", (yyvsp[(3) - (3)].id),
3445 #line 1388 "parse.y"
3448 node_set ((Node *)property,
3449 "flags:steal", (yyvsp[(3) - (3)].list),
3455 #line 1394 "parse.y"
3457 Type *type = pop_type ();
3459 node_set ((Node *)property,
3460 "ptype:steal", type,
3466 #line 1401 "parse.y"
3469 node_set ((Node *)property,
3470 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3476 #line 1407 "parse.y"
3479 node_set ((Node *)property,
3480 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3486 #line 1413 "parse.y"
3489 node_set ((Node *)property,
3490 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3496 #line 1419 "parse.y"
3499 node_set ((Node *)property,
3500 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3506 #line 1425 "parse.y"
3509 node_set ((Node *)property,
3510 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3516 #line 1431 "parse.y"
3519 node_set ((Node *)property,
3520 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3526 #line 1437 "parse.y"
3529 node_set ((Node *)property,
3530 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3536 #line 1443 "parse.y"
3539 node_set ((Node *)property,
3540 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3546 #line 1449 "parse.y"
3549 node_set ((Node *)property,
3550 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3556 #line 1455 "parse.y"
3559 node_set ((Node *)property,
3560 "extra_gtktype:steal", (yyvsp[(3) - (3)].id),
3566 #line 1461 "parse.y"
3569 if (strcmp ((yyvsp[(1) - (1)].id), "override") == 0) {
3570 g_free((yyvsp[(1) - (1)].id));
3571 node_set ((Node *)property,
3574 } else if (strcmp ((yyvsp[(1) - (1)].id), "link") == 0) {
3575 g_free((yyvsp[(1) - (1)].id));
3576 node_set ((Node *)property,
3579 } else if (strcmp ((yyvsp[(1) - (1)].id), "export") == 0) {
3580 g_free((yyvsp[(1) - (1)].id));
3581 node_set ((Node *)property,
3585 g_free((yyvsp[(1) - (1)].id));
3586 yyerror(_("parse error"));
3593 #line 1486 "parse.y"
3595 if(strcmp((yyvsp[(3) - (5)].id),"type")!=0) {
3596 g_free((yyvsp[(1) - (5)].id));
3597 g_free((yyvsp[(3) - (5)].id));
3598 yyerror(_("parse error"));
3601 (yyval.id) = debool ((yyvsp[(1) - (5)].id));
3606 #line 1495 "parse.y"
3608 (yyval.id) = debool ((yyvsp[(1) - (1)].id));
3609 typestack = g_list_prepend(typestack,NULL);
3614 #line 1501 "parse.y"
3615 { (yyval.list) = (yyvsp[(2) - (3)].list); }
3619 #line 1502 "parse.y"
3620 { (yyval.list) = NULL; }
3624 #line 1505 "parse.y"
3626 (yyval.list) = g_list_append((yyvsp[(3) - (3)].list),(yyvsp[(1) - (3)].id));
3631 #line 1508 "parse.y"
3633 (yyval.list) = g_list_append(NULL,(yyvsp[(1) - (1)].id));
3638 #line 1514 "parse.y"
3640 Node *node = node_new (TYPE_NODE,
3641 "name:steal", (yyvsp[(1) - (2)].id),
3642 "pointer:steal", (yyvsp[(2) - (2)].id),
3644 typestack = g_list_prepend(typestack,node);
3649 #line 1521 "parse.y"
3651 Node *node = node_new (TYPE_NODE,
3652 "name:steal", (yyvsp[(1) - (1)].id),
3654 typestack = g_list_prepend(typestack,node);
3659 #line 1530 "parse.y"
3661 (yyval.id) = (yyvsp[(1) - (1)].id);
3666 #line 1533 "parse.y"
3668 (yyval.id) = (yyvsp[(1) - (1)].id);
3673 #line 1536 "parse.y"
3675 (yyval.id) = g_strconcat("const ", (yyvsp[(2) - (2)].id), NULL);
3676 g_free((yyvsp[(2) - (2)].id));
3681 #line 1540 "parse.y"
3683 (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " const", NULL);
3684 g_free((yyvsp[(1) - (2)].id));
3689 #line 1544 "parse.y"
3691 (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " ", (yyvsp[(2) - (2)].id), NULL);
3692 g_free((yyvsp[(2) - (2)].id));
3697 #line 1548 "parse.y"
3699 (yyval.id) = g_strconcat("const ", (yyvsp[(2) - (3)].id), " ",
3700 (yyvsp[(3) - (3)].id), NULL);
3701 g_free((yyvsp[(3) - (3)].id));
3706 #line 1553 "parse.y"
3708 (yyval.id) = g_strconcat((yyvsp[(1) - (3)].id), " ",
3709 (yyvsp[(2) - (3)].id), " const", NULL);
3710 g_free((yyvsp[(2) - (3)].id));
3715 #line 1561 "parse.y"
3717 (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " ", (yyvsp[(2) - (2)].id), NULL);
3718 g_free((yyvsp[(2) - (2)].id));
3723 #line 1565 "parse.y"
3725 (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " ", (yyvsp[(2) - (2)].id), NULL);
3726 g_free((yyvsp[(1) - (2)].id));
3727 g_free((yyvsp[(2) - (2)].id));
3732 #line 1570 "parse.y"
3734 (yyval.id) = g_strconcat("const ", (yyvsp[(2) - (2)].id), NULL);
3735 g_free((yyvsp[(2) - (2)].id));
3740 #line 1574 "parse.y"
3742 (yyval.id) = (yyvsp[(1) - (1)].id);
3747 #line 1577 "parse.y"
3749 (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " const", NULL);
3750 g_free((yyvsp[(1) - (2)].id));
3755 #line 1581 "parse.y"
3757 (yyval.id) = g_strdup((yyvsp[(1) - (1)].id));
3762 #line 1584 "parse.y"
3764 (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " const", NULL);
3769 #line 1589 "parse.y"
3770 { (yyval.id) = "void"; }
3774 #line 1590 "parse.y"
3775 { (yyval.id) = "char"; }
3779 #line 1591 "parse.y"
3780 { (yyval.id) = "short"; }
3784 #line 1592 "parse.y"
3785 { (yyval.id) = "int"; }
3789 #line 1593 "parse.y"
3790 { (yyval.id) = "long"; }
3794 #line 1594 "parse.y"
3795 { (yyval.id) = "float"; }
3799 #line 1595 "parse.y"
3800 { (yyval.id) = "double"; }
3804 #line 1596 "parse.y"
3805 { (yyval.id) = "signed"; }
3809 #line 1597 "parse.y"
3810 { (yyval.id) = "unsigned"; }
3814 #line 1600 "parse.y"
3815 { (yyval.id) = "struct"; }
3819 #line 1601 "parse.y"
3820 { (yyval.id) = "union"; }
3824 #line 1602 "parse.y"
3825 { (yyval.id) = "enum"; }
3829 #line 1605 "parse.y"
3830 { (yyval.id) = g_strdup("*"); }
3834 #line 1606 "parse.y"
3835 { (yyval.id) = g_strdup("* const"); }
3839 #line 1607 "parse.y"
3841 (yyval.id) = g_strconcat("*", (yyvsp[(2) - (2)].id), NULL);
3842 g_free((yyvsp[(2) - (2)].id));
3847 #line 1611 "parse.y"
3849 (yyval.id) = g_strconcat("* const", (yyvsp[(3) - (3)].id), NULL);
3850 g_free((yyvsp[(3) - (3)].id));
3855 #line 1618 "parse.y"
3857 if(strcmp((yyvsp[(1) - (2)].id), "first")==0)
3858 (yyval.sigtype) = SIGNAL_FIRST_METHOD;
3859 else if(strcmp((yyvsp[(1) - (2)].id), "last")==0)
3860 (yyval.sigtype) = SIGNAL_LAST_METHOD;
3862 yyerror(_("signal must be 'first' or 'last'"));
3863 g_free((yyvsp[(1) - (2)].id));
3866 g_free((yyvsp[(1) - (2)].id));
3871 #line 1630 "parse.y"
3873 (yyval.sigtype) = SIGNAL_LAST_METHOD;
3878 #line 1636 "parse.y"
3880 if(strcmp((yyvsp[(2) - (3)].id),"first")==0)
3881 (yyval.sigtype) = SIGNAL_FIRST_METHOD;
3882 else if(strcmp((yyvsp[(2) - (3)].id),"last")==0)
3883 (yyval.sigtype) = SIGNAL_LAST_METHOD;
3885 yyerror(_("signal must be 'first' or 'last'"));
3886 g_free((yyvsp[(2) - (3)].id));
3889 g_free((yyvsp[(2) - (3)].id));
3894 #line 1648 "parse.y"
3896 if(strcmp((yyvsp[(1) - (3)].id),"first")==0)
3897 (yyval.sigtype) = SIGNAL_FIRST_METHOD;
3898 else if(strcmp((yyvsp[(1) - (3)].id),"last")==0)
3899 (yyval.sigtype) = SIGNAL_LAST_METHOD;
3901 yyerror(_("signal must be 'first' or 'last'"));
3902 g_free((yyvsp[(1) - (3)].id));
3905 g_free((yyvsp[(1) - (3)].id));
3910 #line 1660 "parse.y"
3912 (yyval.sigtype) = SIGNAL_LAST_METHOD;
3917 #line 1663 "parse.y"
3919 /* the_scope was default thus public */
3920 the_scope = PUBLIC_SCOPE;
3925 #line 1669 "parse.y"
3927 gtktypes = g_list_prepend(gtktypes, debool ((yyvsp[(1) - (4)].id)));
3932 #line 1674 "parse.y"
3934 gtktypes = g_list_append(gtktypes, debool ((yyvsp[(3) - (3)].id)));
3939 #line 1677 "parse.y"
3941 gtktypes = g_list_append(gtktypes, debool ((yyvsp[(1) - (1)].id)));
3946 #line 1682 "parse.y"
3947 { (yyval.cbuf) = (yyvsp[(2) - (2)].cbuf); }
3951 #line 1683 "parse.y"
3952 { (yyval.cbuf) = NULL; }
3956 #line 1687 "parse.y"
3959 yyerror(_("signal without 'self' as "
3960 "first parameter"));
3961 free_all_global_state();
3964 if(the_scope == CLASS_SCOPE) {
3965 yyerror(_("a method cannot be of class scope"));
3966 free_all_global_state();
3969 if (funcattrs != NULL) {
3970 char *error = g_strdup_printf
3971 (_("function attribute macros ('%s' in this case) may not be used with signal methods"),
3976 push_function(the_scope, (yyvsp[(3) - (10)].sigtype),NULL,
3977 (yyvsp[(5) - (10)].id), (yyvsp[(10) - (10)].cbuf),(yyvsp[(1) - (10)].line),
3978 ccode_line, vararg, (yyvsp[(2) - (10)].list));
3983 #line 1710 "parse.y"
3986 yyerror(_("signal without 'self' as "
3987 "first parameter"));
3988 free_all_global_state();
3991 if(the_scope == CLASS_SCOPE) {
3992 yyerror(_("a method cannot be of class scope"));
3993 free_all_global_state();
3996 if (funcattrs != NULL) {
3997 char *error = g_strdup_printf
3998 (_("function attribute macros ('%s' in this case) may not be used with signal methods"),
4003 push_function(the_scope, (yyvsp[(4) - (11)].sigtype), NULL,
4004 (yyvsp[(6) - (11)].id), (yyvsp[(11) - (11)].cbuf), (yyvsp[(2) - (11)].line),
4005 ccode_line, vararg, (yyvsp[(3) - (11)].list));
4010 #line 1733 "parse.y"
4013 yyerror(_("virtual method without 'self' as "
4014 "first parameter"));
4015 free_all_global_state();
4018 if(the_scope == CLASS_SCOPE) {
4019 yyerror(_("a method cannot be of class scope"));
4020 free_all_global_state();
4023 if (funcattrs != NULL) {
4024 char *error = g_strdup_printf
4025 (_("function attribute macros ('%s' in this case) may not be used with virtual methods"),
4030 push_function(the_scope, VIRTUAL_METHOD, NULL, (yyvsp[(4) - (9)].id),
4031 (yyvsp[(9) - (9)].cbuf), (yyvsp[(1) - (9)].line),
4032 ccode_line, vararg, NULL);
4037 #line 1756 "parse.y"
4040 yyerror(_("virtual method without 'self' as "
4041 "first parameter"));
4042 free_all_global_state();
4045 if(the_scope == CLASS_SCOPE) {
4046 yyerror(_("a method cannot be of class scope"));
4047 free_all_global_state();
4050 if (funcattrs != NULL) {
4051 char *error = g_strdup_printf
4052 (_("function attribute macros ('%s' in this case) may not be used with virtual methods"),
4057 push_function(the_scope, VIRTUAL_METHOD, NULL, (yyvsp[(4) - (9)].id),
4058 (yyvsp[(9) - (9)].cbuf), (yyvsp[(2) - (9)].line),
4059 ccode_line, vararg, NULL);
4064 #line 1779 "parse.y"
4067 yyerror(_("virtual method without 'szelf' as "
4068 "first parameter"));
4069 free_all_global_state();
4072 if (funcattrs != NULL) {
4073 char *error = g_strdup_printf
4074 (_("function attribute macros ('%s' in this case) may not be used with virtual methods"),
4079 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
4080 (yyvsp[(3) - (8)].id), (yyvsp[(8) - (8)].cbuf), (yyvsp[(1) - (8)].line),
4081 ccode_line, vararg, NULL);
4086 #line 1797 "parse.y"
4088 if (funcattrs != NULL) {
4089 char *error = g_strdup_printf
4090 (_("function attribute macros ('%s' in this case) may not be used with override methods"),
4095 push_function(NO_SCOPE, OVERRIDE_METHOD, (yyvsp[(3) - (11)].id),
4096 (yyvsp[(6) - (11)].id), (yyvsp[(11) - (11)].cbuf),
4097 (yyvsp[(1) - (11)].line), ccode_line,
4103 #line 1810 "parse.y"
4105 if(the_scope == CLASS_SCOPE) {
4106 yyerror(_("a method cannot be of class scope"));
4107 free_all_global_state();
4110 push_function(the_scope, REGULAR_METHOD, NULL, (yyvsp[(3) - (8)].id),
4111 (yyvsp[(8) - (8)].cbuf), (yyvsp[(1) - (8)].line), ccode_line,
4117 #line 1820 "parse.y"
4119 if(strcmp((yyvsp[(1) - (5)].id), "init")==0) {
4120 push_init_arg((yyvsp[(3) - (5)].id),FALSE);
4121 push_function(NO_SCOPE, INIT_METHOD, NULL,
4122 (yyvsp[(1) - (5)].id), (yyvsp[(5) - (5)].cbuf), (yyvsp[(2) - (5)].line),
4123 ccode_line, FALSE, NULL);
4124 } else if(strcmp((yyvsp[(1) - (5)].id), "class_init")==0) {
4125 push_init_arg((yyvsp[(3) - (5)].id),TRUE);
4126 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
4127 (yyvsp[(1) - (5)].id), (yyvsp[(5) - (5)].cbuf), (yyvsp[(2) - (5)].line),
4128 ccode_line, FALSE, NULL);
4129 } else if(strcmp((yyvsp[(1) - (5)].id), "constructor")==0) {
4130 push_init_arg((yyvsp[(3) - (5)].id), FALSE);
4131 push_function(NO_SCOPE, CONSTRUCTOR_METHOD, NULL,
4132 (yyvsp[(1) - (5)].id), (yyvsp[(5) - (5)].cbuf), (yyvsp[(2) - (5)].line),
4133 ccode_line, FALSE, NULL);
4134 } else if(strcmp((yyvsp[(1) - (5)].id), "dispose")==0) {
4135 push_init_arg((yyvsp[(3) - (5)].id), FALSE);
4136 push_function(NO_SCOPE, DISPOSE_METHOD, NULL,
4137 (yyvsp[(1) - (5)].id), (yyvsp[(5) - (5)].cbuf), (yyvsp[(2) - (5)].line),
4138 ccode_line, FALSE, NULL);
4139 } else if(strcmp((yyvsp[(1) - (5)].id), "finalize")==0) {
4140 push_init_arg((yyvsp[(3) - (5)].id), FALSE);
4141 push_function(NO_SCOPE, FINALIZE_METHOD, NULL,
4142 (yyvsp[(1) - (5)].id), (yyvsp[(5) - (5)].cbuf), (yyvsp[(2) - (5)].line),
4143 ccode_line, FALSE, NULL);
4146 g_free((yyvsp[(1) - (5)].id));
4147 g_free((yyvsp[(3) - (5)].id));
4148 g_string_free((yyvsp[(5) - (5)].cbuf),TRUE);
4149 yyerror(_("parse error "
4150 "(untyped blocks must be init, "
4151 "class_init, constructor, dispose "
4159 #line 1860 "parse.y"
4161 g_free(funcattrs); funcattrs = NULL;
4162 g_free(onerror); onerror = NULL;
4163 g_free(defreturn); defreturn = NULL;
4164 if(!set_attr_value((yyvsp[(1) - (2)].id), (yyvsp[(2) - (2)].id))) {
4165 g_free((yyvsp[(1) - (2)].id));
4166 g_free((yyvsp[(2) - (2)].id));
4167 yyerror(_("parse error"));
4170 g_free((yyvsp[(1) - (2)].id));
4175 #line 1872 "parse.y"
4177 g_free(funcattrs); funcattrs = NULL;
4178 g_free(onerror); onerror = NULL;
4179 g_free(defreturn); defreturn = NULL;
4180 if(!set_attr_value((yyvsp[(1) - (4)].id), (yyvsp[(2) - (4)].id))) {
4181 g_free((yyvsp[(1) - (4)].id)); g_free((yyvsp[(2) - (4)].id));
4182 g_free((yyvsp[(3) - (4)].id)); g_free((yyvsp[(4) - (4)].id));
4183 yyerror(_("parse error"));
4186 if(!set_attr_value((yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].id))) {
4187 funcattrs = onerror = defreturn = NULL;
4188 g_free((yyvsp[(1) - (4)].id)); g_free((yyvsp[(2) - (4)].id));
4189 g_free((yyvsp[(3) - (4)].id)); g_free((yyvsp[(4) - (4)].id));
4190 yyerror(_("parse error"));
4193 g_free((yyvsp[(1) - (4)].id));
4194 g_free((yyvsp[(3) - (4)].id));
4199 #line 1892 "parse.y"
4201 g_free(funcattrs); funcattrs = NULL;
4202 g_free(onerror); onerror = NULL;
4203 g_free(defreturn); defreturn = NULL;
4204 if(!set_attr_value((yyvsp[(1) - (6)].id), (yyvsp[(2) - (6)].id))) {
4205 g_free((yyvsp[(1) - (6)].id)); g_free((yyvsp[(2) - (6)].id));
4206 g_free((yyvsp[(3) - (6)].id)); g_free((yyvsp[(4) - (6)].id));
4207 g_free((yyvsp[(5) - (6)].id)); g_free((yyvsp[(6) - (6)].id));
4208 yyerror(_("parse error"));
4211 if(!set_attr_value((yyvsp[(3) - (6)].id), (yyvsp[(4) - (6)].id))) {
4212 funcattrs = onerror = defreturn = NULL;
4213 g_free((yyvsp[(1) - (6)].id)); g_free((yyvsp[(2) - (6)].id));
4214 g_free((yyvsp[(3) - (6)].id)); g_free((yyvsp[(4) - (6)].id));
4215 g_free((yyvsp[(5) - (6)].id)); g_free((yyvsp[(6) - (6)].id));
4216 yyerror(_("parse error"));
4219 if(!set_attr_value((yyvsp[(5) - (6)].id), (yyvsp[(6) - (6)].id))) {
4220 funcattrs = onerror = defreturn = NULL;
4221 g_free((yyvsp[(1) - (6)].id)); g_free((yyvsp[(2) - (6)].id));
4222 g_free((yyvsp[(3) - (6)].id)); g_free((yyvsp[(4) - (6)].id));
4223 g_free((yyvsp[(5) - (6)].id)); g_free((yyvsp[(6) - (6)].id));
4224 yyerror(_("parse error"));
4227 g_free((yyvsp[(1) - (6)].id));
4228 g_free((yyvsp[(3) - (6)].id));
4229 g_free((yyvsp[(5) - (6)].id));
4234 #line 1923 "parse.y"
4236 g_free(funcattrs); funcattrs = NULL;
4237 g_free(onerror); onerror = NULL;
4238 g_free(defreturn); defreturn = NULL;
4243 #line 1930 "parse.y"
4244 { (yyval.id) = (yyvsp[(1) - (1)].id); }
4248 #line 1931 "parse.y"
4250 (yyval.id) = ((yyvsp[(2) - (2)].cbuf))->str;
4251 g_string_free((yyvsp[(2) - (2)].cbuf), FALSE);
4256 #line 1937 "parse.y"
4257 { vararg = FALSE; has_self = FALSE; }
4261 #line 1938 "parse.y"
4265 if(strcmp((yyvsp[(1) - (1)].id),"self")==0)
4266 push_self((yyvsp[(1) - (1)].id), FALSE);
4268 g_free((yyvsp[(1) - (1)].id));
4269 yyerror(_("parse error"));
4276 #line 1949 "parse.y"
4280 if(strcmp((yyvsp[(1) - (2)].id),"self")==0)
4281 push_self((yyvsp[(1) - (2)].id), TRUE);
4283 g_free((yyvsp[(1) - (2)].id));
4284 yyerror(_("parse error"));
4291 #line 1960 "parse.y"
4295 if(strcmp((yyvsp[(2) - (2)].id),"self")==0)
4296 push_self((yyvsp[(2) - (2)].id), TRUE);
4298 g_free((yyvsp[(2) - (2)].id));
4299 yyerror(_("parse error"));
4306 #line 1971 "parse.y"
4309 if(strcmp((yyvsp[(1) - (3)].id),"self")==0)
4310 push_self((yyvsp[(1) - (3)].id), FALSE);
4312 g_free((yyvsp[(1) - (3)].id));
4313 yyerror(_("parse error"));
4320 #line 1981 "parse.y"
4323 if(strcmp((yyvsp[(1) - (4)].id),"self")==0)
4324 push_self((yyvsp[(1) - (4)].id), TRUE);
4326 g_free((yyvsp[(1) - (4)].id));
4327 yyerror(_("parse error"));
4334 #line 1991 "parse.y"
4337 if(strcmp((yyvsp[(2) - (4)].id),"self")==0)
4338 push_self((yyvsp[(2) - (4)].id), TRUE);
4340 g_free((yyvsp[(2) - (4)].id));
4341 yyerror(_("parse error"));
4348 #line 2001 "parse.y"
4349 { has_self = FALSE; }
4353 #line 2004 "parse.y"
4358 #line 2005 "parse.y"
4363 #line 2008 "parse.y"
4368 #line 2009 "parse.y"
4373 #line 2012 "parse.y"
4375 push_funcarg((yyvsp[(2) - (2)].id),NULL);
4380 #line 2015 "parse.y"
4382 push_funcarg((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].id));
4387 #line 2018 "parse.y"
4389 if(strcmp((yyvsp[(4) - (6)].id),"check")!=0) {
4390 yyerror(_("parse error"));
4393 g_free((yyvsp[(4) - (6)].id));
4394 push_funcarg((yyvsp[(2) - (6)].id),NULL);
4399 #line 2026 "parse.y"
4401 if(strcmp((yyvsp[(5) - (7)].id),"check")!=0) {
4402 yyerror(_("parse error"));
4405 g_free((yyvsp[(5) - (7)].id));
4406 push_funcarg((yyvsp[(2) - (7)].id),(yyvsp[(3) - (7)].id));
4411 #line 2036 "parse.y"
4416 #line 2037 "parse.y"
4421 #line 2040 "parse.y"
4423 if(strcmp((yyvsp[(1) - (1)].id),"type")==0) {
4424 Node *node = node_new (CHECK_NODE,
4425 "chtype", TYPE_CHECK,
4427 checks = g_list_append(checks,node);
4428 } else if(strcmp((yyvsp[(1) - (1)].id),"null")==0) {
4429 Node *node = node_new (CHECK_NODE,
4430 "chtype", NULL_CHECK,
4432 checks = g_list_append(checks,node);
4434 yyerror(_("parse error"));
4437 g_free((yyvsp[(1) - (1)].id));
4442 #line 2057 "parse.y"
4444 Node *node = node_new (CHECK_NODE,
4446 "number:steal", (yyvsp[(2) - (2)].id),
4448 checks = g_list_append(checks,node);
4453 #line 2064 "parse.y"
4455 Node *node = node_new (CHECK_NODE,
4457 "number:steal", (yyvsp[(2) - (2)].id),
4459 checks = g_list_append(checks,node);
4464 #line 2071 "parse.y"
4466 Node *node = node_new (CHECK_NODE,
4468 "number:steal", (yyvsp[(3) - (3)].id),
4470 checks = g_list_append(checks,node);
4475 #line 2078 "parse.y"
4477 Node *node = node_new (CHECK_NODE,
4479 "number:steal", (yyvsp[(3) - (3)].id),
4481 checks = g_list_append(checks,node);
4486 #line 2085 "parse.y"
4488 Node *node = node_new (CHECK_NODE,
4490 "number:steal", (yyvsp[(3) - (3)].id),
4492 checks = g_list_append(checks,node);
4497 #line 2092 "parse.y"
4499 Node *node = node_new (CHECK_NODE,
4501 "number:steal", (yyvsp[(3) - (3)].id),
4503 checks = g_list_append(checks,node);
4508 #line 2101 "parse.y"
4510 Node *node = node_new (ENUMDEF_NODE,
4511 "etype:steal", (yyvsp[(6) - (7)].id),
4512 "prefix:steal", (yyvsp[(2) - (7)].id),
4513 "values:steal", enum_vals,
4516 nodes = g_list_append (nodes, node);
4521 #line 2110 "parse.y"
4523 Node *node = node_new (ENUMDEF_NODE,
4524 "etype:steal", (yyvsp[(7) - (8)].id),
4525 "prefix:steal", (yyvsp[(2) - (8)].id),
4526 "values:steal", enum_vals,
4529 nodes = g_list_append (nodes, node);
4534 #line 2121 "parse.y"
4539 #line 2122 "parse.y"
4544 #line 2125 "parse.y"
4547 char *num = (yyvsp[(3) - (3)].id);
4549 /* A float value, that's a bad enum */
4550 if (num[0] >= '0' &&
4552 strchr (num, '.') != NULL) {
4553 g_free ((yyvsp[(1) - (3)].id));
4555 yyerror(_("parse error (enumerator value not integer constant)"));
4559 node = node_new (ENUMVALUE_NODE,
4560 "name:steal", (yyvsp[(1) - (3)].id),
4563 enum_vals = g_list_append (enum_vals, node);
4568 #line 2145 "parse.y"
4572 node = node_new (ENUMVALUE_NODE,
4573 "name:steal", (yyvsp[(1) - (1)].id),
4575 enum_vals = g_list_append (enum_vals, node);
4580 #line 2155 "parse.y"
4582 Node *node = node_new (FLAGS_NODE,
4583 "ftype:steal", (yyvsp[(6) - (7)].id),
4584 "prefix:steal", (yyvsp[(2) - (7)].id),
4585 "values:steal", flag_vals,
4588 nodes = g_list_append (nodes, node);
4593 #line 2164 "parse.y"
4595 Node *node = node_new (FLAGS_NODE,
4596 "ftype:steal", (yyvsp[(7) - (8)].id),
4597 "prefix:steal", (yyvsp[(2) - (8)].id),
4598 "values:steal", flag_vals,
4601 nodes = g_list_append (nodes, node);
4606 #line 2175 "parse.y"
4608 flag_vals = g_list_append (flag_vals, (yyvsp[(3) - (3)].id));
4613 #line 2178 "parse.y"
4615 flag_vals = g_list_append (flag_vals, (yyvsp[(1) - (1)].id));
4620 #line 2183 "parse.y"
4622 Node *node = node_new (ERROR_NODE,
4623 "etype:steal", (yyvsp[(6) - (7)].id),
4624 "prefix:steal", (yyvsp[(2) - (7)].id),
4625 "values:steal", error_vals,
4628 nodes = g_list_append (nodes, node);
4633 #line 2192 "parse.y"
4635 Node *node = node_new (ERROR_NODE,
4636 "etype:steal", (yyvsp[(7) - (8)].id),
4637 "prefix:steal", (yyvsp[(2) - (8)].id),
4638 "values:steal", error_vals,
4641 nodes = g_list_append (nodes, node);
4646 #line 2203 "parse.y"
4648 error_vals = g_list_append (error_vals, (yyvsp[(3) - (3)].id));
4653 #line 2206 "parse.y"
4655 error_vals = g_list_append (error_vals, (yyvsp[(1) - (1)].id));
4660 #line 2212 "parse.y"
4661 { (yyval.id) = (yyvsp[(1) - (1)].id); }
4665 #line 2213 "parse.y"
4667 (yyval.id) = g_strconcat("-",(yyvsp[(2) - (2)].id),NULL);
4668 g_free((yyvsp[(2) - (2)].id));
4673 #line 2217 "parse.y"
4674 { (yyval.id) = (yyvsp[(1) - (1)].id); }
4678 #line 2218 "parse.y"
4679 { (yyval.id) = (yyvsp[(1) - (1)].id); }
4683 /* Line 1267 of yacc.c. */
4684 #line 4685 "parse.c"
4687 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4691 YY_STACK_PRINT (yyss, yyssp);
4696 /* Now `shift' the result of the reduction. Determine what state
4697 that goes to, based on the state we popped back to and the rule
4698 number reduced by. */
4702 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4703 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4704 yystate = yytable[yystate];
4706 yystate = yydefgoto[yyn - YYNTOKENS];
4711 /*------------------------------------.
4712 | yyerrlab -- here on detecting error |
4713 `------------------------------------*/
4715 /* If not already recovering from an error, report this error. */
4719 #if ! YYERROR_VERBOSE
4720 yyerror (YY_("syntax error"));
4723 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4724 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4726 YYSIZE_T yyalloc = 2 * yysize;
4727 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4728 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4729 if (yymsg != yymsgbuf)
4730 YYSTACK_FREE (yymsg);
4731 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4733 yymsg_alloc = yyalloc;
4737 yymsg_alloc = sizeof yymsgbuf;
4741 if (0 < yysize && yysize <= yymsg_alloc)
4743 (void) yysyntax_error (yymsg, yystate, yychar);
4748 yyerror (YY_("syntax error"));
4750 goto yyexhaustedlab;
4758 if (yyerrstatus == 3)
4760 /* If just tried and failed to reuse look-ahead token after an
4761 error, discard it. */
4763 if (yychar <= YYEOF)
4765 /* Return failure if at end of input. */
4766 if (yychar == YYEOF)
4771 yydestruct ("Error: discarding",
4777 /* Else will try to reuse look-ahead token after shifting the error
4782 /*---------------------------------------------------.
4783 | yyerrorlab -- error raised explicitly by YYERROR. |
4784 `---------------------------------------------------*/
4787 /* Pacify compilers like GCC when the user code never invokes
4788 YYERROR and the label yyerrorlab therefore never appears in user
4790 if (/*CONSTCOND*/ 0)
4793 /* Do not reclaim the symbols of the rule which action triggered
4797 YY_STACK_PRINT (yyss, yyssp);
4802 /*-------------------------------------------------------------.
4803 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4804 `-------------------------------------------------------------*/
4806 yyerrstatus = 3; /* Each real token shifted decrements this. */
4810 yyn = yypact[yystate];
4811 if (yyn != YYPACT_NINF)
4814 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4822 /* Pop the current state because it cannot handle the error token. */
4827 yydestruct ("Error: popping",
4828 yystos[yystate], yyvsp);
4831 YY_STACK_PRINT (yyss, yyssp);
4840 /* Shift the error token. */
4841 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4847 /*-------------------------------------.
4848 | yyacceptlab -- YYACCEPT comes here. |
4849 `-------------------------------------*/
4854 /*-----------------------------------.
4855 | yyabortlab -- YYABORT comes here. |
4856 `-----------------------------------*/
4862 /*-------------------------------------------------.
4863 | yyexhaustedlab -- memory exhaustion comes here. |
4864 `-------------------------------------------------*/
4866 yyerror (YY_("memory exhausted"));
4872 if (yychar != YYEOF && yychar != YYEMPTY)
4873 yydestruct ("Cleanup: discarding lookahead",
4875 /* Do not reclaim the symbols of the rule which action triggered
4876 this YYABORT or YYACCEPT. */
4878 YY_STACK_PRINT (yyss, yyssp);
4879 while (yyssp != yyss)
4881 yydestruct ("Cleanup: popping",
4882 yystos[*yyssp], yyvsp);
4887 YYSTACK_FREE (yyss);
4890 if (yymsg != yymsgbuf)
4891 YYSTACK_FREE (yymsg);
4893 /* Make sure YYID is used. */
4894 return YYID (yyresult);
4898 #line 2221 "parse.y"