1 /* A Bison parser, made by GNU Bison 1.875c. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
115 #define THREEDOTS 265
126 #define TYPETOKEN 276
127 #define ARRAY_DIM 277
128 #define SINGLE_CHAR 278
138 #define PROTECTED 288
139 #define CLASSWIDE 289
149 #define DEFAULT_VALUE 299
153 #define FLAGS_TYPE 303
154 #define ENUM_TYPE 304
155 #define PARAM_TYPE 305
156 #define BOXED_TYPE 306
157 #define OBJECT_TYPE 307
162 /* Copy the first part of user declarations. */
172 #include "treefuncs.h"
176 /* FIXME: add gettext support */
181 static GList *class_nodes = NULL;
184 static GList *enum_vals = NULL;
185 static GList *flag_vals = NULL;
186 static GList *error_vals = NULL;
188 static char *chunk_size = NULL;
189 static char *bonobo_object_class = NULL;
190 static int glade_xml = FALSE;
191 static GList *interfaces = NULL;
192 static GList *typestack = NULL;
193 static GList *funcargs = NULL;
194 static GList *checks = NULL;
195 static int has_self = FALSE;
196 static int vararg = FALSE;
197 static Method *last_added_method = NULL;
199 /* destructor and initializer for variables */
200 static gboolean destructor_unref = FALSE;
201 static char *destructor = NULL;
202 static int destructor_line = 0;
203 static gboolean destructor_simple = TRUE;
204 static char *initializer = NULL;
205 static int initializer_line = 0;
206 static int glade_widget = FALSE;
208 static char *onerror = NULL;
209 static char *defreturn = NULL;
211 static GList *gtktypes = NULL;
213 static Property *property = NULL;
215 /* this can be a global as we will only do one function at a time
217 static int the_scope = NO_SCOPE;
219 void free(void *ptr);
222 extern int ccode_line;
224 extern gboolean for_cpp;
234 if(strcmp(yytext,"\n")==0) {
235 out=g_strconcat("Error: ",str," before newline",NULL);
236 } else if(yytext[0]=='\0') {
237 out=g_strconcat("Error: ", str, " at end of input", NULL);
239 char *tmp = g_strdup(yytext);
240 while((p=strchr(tmp, '\n')))
243 out=g_strconcat("Error: ", str, " before '", tmp, "'", NULL);
247 fprintf(stderr, "%s:%d: %s\n", filename, line_no, out);
256 Type *type = typestack->data;
257 typestack = g_list_remove(typestack,typestack->data);
262 push_variable (char *name, int scope, int line_no, char *postfix)
265 Type *type = pop_type ();
267 type->postfix = postfix;
269 var = node_new (VARIABLE_NODE,
272 "glade_widget", glade_widget,
275 "destructor_unref", destructor_unref,
276 "destructor:steal", destructor,
277 "destructor_line", destructor_line,
278 "destructor_simple", destructor_simple,
279 "initializer:steal", initializer,
280 "initializer_line", initializer_line,
281 "initializer_simple", TRUE,
283 class_nodes = g_list_append(class_nodes, var);
284 glade_widget = FALSE;
288 push_function (int scope, int method, char *oid, char *id,
289 GString *cbuf, int line_no, int ccode_line,
290 gboolean vararg, GList *flags)
296 g_assert(scope != CLASS_SCOPE);
298 if(method == INIT_METHOD || method == CLASS_INIT_METHOD) {
299 type = (Type *)node_new (TYPE_NODE,
306 /* a complicated and ugly test to figure out if we have
307 the wrong number of types for a signal */
308 if((method == SIGNAL_FIRST_METHOD ||
309 method == SIGNAL_LAST_METHOD) &&
310 g_list_length(gtktypes) != g_list_length(funcargs) &&
311 !(g_list_length(funcargs) == 1 &&
312 g_list_length(gtktypes) == 2 &&
313 strcmp(gtktypes->next->data, "NONE")==0)) {
314 error_print(GOB_WARN, line_no,
315 _("The number of GTK arguments and "
316 "function arguments for a signal "
317 "don't seem to match"));
319 if(g_list_length(gtktypes) > 2) {
321 for(li = gtktypes->next; li; li = li->next) {
322 if(strcmp(li->data, "NONE")==0) {
323 error_print(GOB_ERROR, line_no,
324 _("NONE can only appear in an "
325 "argument list by itself"));
331 c_cbuf = p = cbuf->str;
332 while(p && *p && (*p==' ' || *p=='\t' || *p=='\n' || *p=='\r'))
339 node = node_new (METHOD_NODE,
344 "gtktypes:steal", gtktypes,
345 "flags:steal", flags,
347 "args:steal", funcargs,
348 "onerror:steal", onerror,
349 "defreturn:steal", defreturn,
350 "cbuf:steal", c_cbuf,
352 "ccode_line", ccode_line,
354 "unique_id", method_unique_id++,
357 last_added_method = (Method *)node;
361 /*only free segment if we haven't passed it
370 class_nodes = g_list_append(class_nodes, node);
374 free_all_global_state(void)
384 g_list_foreach(gtktypes, (GFunc)g_free, NULL);
385 g_list_free(gtktypes);
388 node_list_free (funcargs);
393 push_funcarg(char *name, char *postfix)
396 Type *type = pop_type();
398 type->postfix = postfix;
400 node = node_new (FUNCARG_NODE,
403 "checks:steal", checks,
407 funcargs = g_list_append(funcargs, node);
411 push_init_arg(char *name, int is_class)
418 tn = g_strconcat(((Class *)class)->otype,":Class",NULL);
420 tn = g_strdup(((Class *)class)->otype);
422 type = node_new (TYPE_NODE,
426 node = node_new (FUNCARG_NODE,
427 "atype:steal", (Type *)type,
430 funcargs = g_list_prepend(funcargs, node);
434 push_self(char *id, gboolean constant)
439 type = node_new (TYPE_NODE,
440 "name", ((Class *)class)->otype,
441 "pointer", constant ? "const *" : "*",
443 ch = g_list_append (ch, node_new (CHECK_NODE,
444 "chtype", NULL_CHECK,
446 ch = g_list_append (ch, node_new (CHECK_NODE,
447 "chtype", TYPE_CHECK,
449 node = node_new (FUNCARG_NODE,
450 "atype:steal", (Type *)type,
454 funcargs = g_list_prepend(funcargs, node);
458 find_var_or_die(const char *id, int line)
462 for(li = class_nodes; li != NULL; li = li->next) {
464 Node *node = li->data;
465 if(node->type != VARIABLE_NODE)
468 if(strcmp(var->id, id)==0)
472 error_printf(GOB_ERROR, line, _("Variable %s not defined here"), id);
474 g_assert_not_reached();
479 set_return_value(char *type, char *val)
481 if(strcmp(type, "onerror")==0) {
487 } else if(strcmp(type, "defreturn")==0) {
498 export_accessors (const char *var_name,
510 the_type = (Type *)node_copy ((Node *)type);
512 the_type = get_tree_type (gtktype, TRUE);
514 if (the_type == NULL) {
515 error_print (GOB_ERROR, line_no,
516 _("Cannot determine type of property or argument"));
521 char *get_id = g_strdup_printf ("get_%s", var_name);
522 GString *get_cbuf = g_string_new (NULL);
523 Node *node1 = node_new (TYPE_NODE,
524 "name", the_type->name,
525 "pointer", the_type->pointer,
526 "postfix", the_type->postfix,
528 Node *node3 = node_new (TYPE_NODE,
529 "name", class->class.otype,
533 g_string_sprintf (get_cbuf,
535 "g_object_get (G_OBJECT (self), \"%s\", "
539 the_type->pointer ? the_type->pointer : "",
542 typestack = g_list_prepend (typestack, node1);
543 typestack = g_list_prepend (typestack, node3);
545 push_funcarg ("self", FALSE);
547 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
548 get_id, get_cbuf, get_lineno,
549 lineno, FALSE, NULL);
553 char *set_id = g_strdup_printf ("set_%s", var_name);
554 GString *set_cbuf = g_string_new (NULL);
555 Node *node1 = node_new (TYPE_NODE,
556 "name", the_type->name,
557 "pointer", the_type->pointer,
558 "postfix", the_type->postfix,
560 Node *node2 = node_new (TYPE_NODE,
563 Node *node3 = node_new (TYPE_NODE,
564 "name", class->class.otype,
568 g_string_sprintf (set_cbuf,
569 "\tg_object_set (G_OBJECT (self), "
570 "\"%s\", val, NULL);\n",
573 typestack = g_list_prepend (typestack, node2);
574 typestack = g_list_prepend (typestack, node1);
575 typestack = g_list_prepend (typestack, node3);
577 push_funcarg ("self", FALSE);
578 push_funcarg ("val", FALSE);
580 typestack = g_list_prepend (typestack, node2);
581 push_function (PUBLIC_SCOPE, REGULAR_METHOD, NULL,
582 set_id, set_cbuf, set_lineno,
583 lineno, FALSE, NULL);
586 node_free ((Node *)the_type);
590 get_prop_enum_flag_cast (Property *prop)
593 if (prop->extra_gtktype == NULL ||
594 /* HACK! just in case someone made this
595 * work with 2.0.0 by using the TYPE
597 ((strstr (prop->extra_gtktype, "_TYPE_") != NULL ||
598 strstr (prop->extra_gtktype, "TYPE_") == prop->extra_gtktype) &&
599 strchr (prop->extra_gtktype, ':') == NULL)) {
600 if (prop->ptype != NULL)
601 return get_type (prop->ptype, TRUE);
603 return g_strdup ("");
605 tmp = remove_sep (prop->extra_gtktype);
606 ret = g_strdup_printf ("(%s) ", tmp);
612 add_construct_glade (char * file, char * root, char * domain)
616 GList * flags = NULL;
619 type = (Type *)node_new (TYPE_NODE,
623 initializer = g_strdup_printf("\t{\n"
624 "\tGtkWidget * root;\n"
625 "\to->_priv->_glade_xml = glade_xml_new(%s, %s, %s);\n"
626 "\troot = glade_xml_get_widget(o->_priv->_glade_xml, %s);\n"
627 "\tgtk_widget_show(root);\n"
628 "\tgtk_container_add(GTK_CONTAINER(o), root);\n"
629 "\tglade_xml_signal_autoconnect_full(o->_priv->_glade_xml, (GladeXMLConnectFunc)___glade_xml_connect_foreach, (gpointer)o);\n"
630 "}\n", file, root, domain ? domain : "NULL", root);
632 var = node_new (VARIABLE_NODE,
633 "scope", PRIVATE_SCOPE,
635 "glade_widget", FALSE,
636 "id:steal", "_glade_xml",
637 "destructor_unref", FALSE,
638 "destructor", "g_object_unref",
639 "destructor_simple", TRUE,
640 "initializer", initializer,
641 "initializer_simple", FALSE,
643 class_nodes = g_list_prepend(class_nodes, var);
647 property_link_and_export (Node *node)
649 Property *prop = (Property *)node;
653 char *get = NULL, *set = NULL;
656 if (prop->set != NULL ||
658 error_print (GOB_ERROR, prop->line_no,
659 _("Property linking requested, but "
660 "getters and setters exist"));
663 var = find_var_or_die (prop->name, prop->line_no);
664 if(var->scope == PRIVATE_SCOPE) {
665 root = "self->_priv";
666 } else if (var->scope == CLASS_SCOPE) {
667 root = "SELF_GET_CLASS(self)";
669 error_print (GOB_ERROR, prop->line_no,
670 _("Self aliases needed when autolinking to a classwide member"));
675 if (strcmp (prop->gtktype, "STRING") == 0) {
676 set = g_strdup_printf("{ char *old = %s->%s; "
677 "%s->%s = g_value_dup_string (VAL); g_free (old); }",
680 get = g_strdup_printf("g_value_set_string (VAL, %s->%s);",
682 } else if (strcmp (prop->gtktype, "OBJECT") == 0) {
684 if (prop->extra_gtktype != NULL) {
685 cast = remove_sep (prop->extra_gtktype);
687 cast = g_strdup ("void");
689 set = g_strdup_printf("{ GObject *___old = (GObject *)%s->%s; "
690 "%s->%s = (%s *)g_value_dup_object (VAL); "
691 "if (___old != NULL) { "
692 "g_object_unref (G_OBJECT (___old)); "
698 get = g_strdup_printf ("g_value_set_object (VAL, "
699 "(gpointer)%s->%s);",
702 } else if (strcmp (prop->gtktype, "BOXED") == 0) {
703 char *type = make_me_type (prop->extra_gtktype,
705 if (prop->extra_gtktype == NULL) {
706 error_print (GOB_ERROR, prop->line_no,
707 _("Property linking requested for BOXED, but "
708 "boxed_type not set"));
710 set = g_strdup_printf("{ gpointer ___old = (gpointer)%s->%s; "
711 "gpointer ___new = (gpointer)g_value_get_boxed (VAL); "
712 "if (___new != ___old) { "
713 "if (___old != NULL) g_boxed_free (%s, ___old); "
714 "if (___new != NULL) %s->%s = g_boxed_copy (%s, ___new); "
715 "else %s->%s = NULL;"
723 get = g_strdup_printf("g_value_set_boxed (VAL, %s->%s);",
729 const char *getcast = "";
730 const char *setcast = "";
731 char *to_free = NULL;
732 set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
733 g_strdown (set_func);
734 get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
735 g_strdown (get_func);
738 if (strcmp (prop->gtktype, "FLAGS") == 0) {
739 setcast = "(guint) ";
741 get_prop_enum_flag_cast (prop);
742 } else if (strcmp (prop->gtktype, "ENUM") == 0) {
745 get_prop_enum_flag_cast (prop);
746 } else if (strcmp (prop->gtktype, "POINTER") == 0) {
747 setcast = "(gpointer) ";
748 getcast = g_strdup_printf ("(%s%s) ",
750 prop->ptype->pointer ? prop->ptype->pointer : "");
754 set = g_strdup_printf("%s->%s = %s%s (VAL);",
758 get = g_strdup_printf("%s (VAL, %s%s->%s);",
770 "get_line", prop->line_no,
772 "set_line", prop->line_no,
777 export_accessors (prop->name,
778 prop->get != NULL, prop->get_line,
779 prop->set != NULL, prop->set_line,
790 if (strcmp (s, "BOOL") == 0) {
791 error_print (GOB_WARN, line_no,
792 _("BOOL type is deprecated, please use BOOLEAN"));
794 return g_strdup ("BOOLEAN");
801 ensure_property (void)
803 if (property == NULL)
804 property = (Property *)node_new (PROPERTY_NODE, NULL);
809 /* Enabling traces. */
814 /* Enabling verbose error messages. */
815 #ifdef YYERROR_VERBOSE
816 # undef YYERROR_VERBOSE
817 # define YYERROR_VERBOSE 1
819 # define YYERROR_VERBOSE 0
822 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
824 typedef union YYSTYPE {
831 /* Line 191 of yacc.c. */
833 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
834 # define YYSTYPE_IS_DECLARED 1
835 # define YYSTYPE_IS_TRIVIAL 1
840 /* Copy the second part of user declarations. */
843 /* Line 214 of yacc.c. */
846 #if ! defined (yyoverflow) || YYERROR_VERBOSE
852 # define YYMALLOC malloc
855 /* The parser invokes alloca or malloc; define the necessary symbols. */
857 # ifdef YYSTACK_USE_ALLOCA
858 # if YYSTACK_USE_ALLOCA
859 # define YYSTACK_ALLOC alloca
862 # if defined (alloca) || defined (_ALLOCA_H)
863 # define YYSTACK_ALLOC alloca
866 # define YYSTACK_ALLOC __builtin_alloca
871 # ifdef YYSTACK_ALLOC
872 /* Pacify GCC's `empty if-body' warning. */
873 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
875 # if defined (__STDC__) || defined (__cplusplus)
876 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
877 # define YYSIZE_T size_t
879 # define YYSTACK_ALLOC YYMALLOC
880 # define YYSTACK_FREE YYFREE
882 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
885 #if (! defined (yyoverflow) \
886 && (! defined (__cplusplus) \
887 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
889 /* A type that is properly aligned for any stack member. */
896 /* The size of the maximum gap between one aligned stack and the next. */
897 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
899 /* The size of an array large to enough to hold all stacks, each with
901 # define YYSTACK_BYTES(N) \
902 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
903 + YYSTACK_GAP_MAXIMUM)
905 /* Copy COUNT objects from FROM to TO. The source and destination do
908 # if defined (__GNUC__) && 1 < __GNUC__
909 # define YYCOPY(To, From, Count) \
910 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
912 # define YYCOPY(To, From, Count) \
915 register YYSIZE_T yyi; \
916 for (yyi = 0; yyi < (Count); yyi++) \
917 (To)[yyi] = (From)[yyi]; \
923 /* Relocate STACK from its old location to the new one. The
924 local variables YYSIZE and YYSTACKSIZE give the old and new number of
925 elements in the stack, and YYPTR gives the new location of the
926 stack. Advance YYPTR to a properly aligned location for the next
928 # define YYSTACK_RELOCATE(Stack) \
931 YYSIZE_T yynewbytes; \
932 YYCOPY (&yyptr->Stack, Stack, yysize); \
933 Stack = &yyptr->Stack; \
934 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
935 yyptr += yynewbytes / sizeof (*yyptr); \
941 #if defined (__STDC__) || defined (__cplusplus)
942 typedef signed char yysigned_char;
944 typedef short yysigned_char;
947 /* YYFINAL -- State number of the termination state. */
949 /* YYLAST -- Last index in YYTABLE. */
952 /* YYNTOKENS -- Number of terminals. */
954 /* YYNNTS -- Number of nonterminals. */
956 /* YYNRULES -- Number of rules. */
958 /* YYNRULES -- Number of states. */
959 #define YYNSTATES 412
961 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
963 #define YYMAXUTOK 307
965 #define YYTRANSLATE(YYX) \
966 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
968 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
969 static const unsigned char yytranslate[] =
971 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
972 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
973 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
974 2, 2, 2, 64, 2, 2, 2, 2, 2, 2,
975 55, 56, 61, 2, 59, 65, 2, 2, 2, 2,
976 2, 2, 2, 2, 2, 2, 2, 2, 2, 57,
977 63, 58, 62, 2, 2, 2, 2, 2, 2, 2,
978 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
979 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
980 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
981 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
982 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
983 2, 2, 2, 53, 60, 54, 2, 2, 2, 2,
984 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
985 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
986 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
987 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
988 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
989 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
990 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
991 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
992 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
993 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
994 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
995 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
996 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
997 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
998 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
999 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1000 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1001 45, 46, 47, 48, 49, 50, 51, 52
1005 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1007 static const unsigned short yyprhs[] =
1009 0, 0, 3, 7, 10, 13, 15, 17, 19, 21,
1010 23, 25, 27, 30, 33, 36, 39, 41, 43, 45,
1011 47, 52, 56, 62, 63, 69, 75, 81, 88, 96,
1012 103, 111, 114, 116, 118, 121, 125, 127, 129, 131,
1013 133, 135, 137, 139, 141, 144, 148, 151, 155, 158,
1014 161, 163, 165, 167, 168, 174, 181, 194, 204, 211,
1015 215, 216, 228, 237, 243, 247, 248, 252, 254, 256,
1016 261, 263, 265, 269, 273, 277, 281, 285, 289, 293,
1017 297, 301, 305, 309, 313, 317, 321, 325, 329, 333,
1018 335, 341, 343, 347, 348, 352, 354, 357, 359, 361,
1019 363, 366, 369, 372, 376, 380, 383, 386, 389, 391,
1020 394, 396, 399, 401, 403, 405, 407, 409, 411, 413,
1021 415, 417, 419, 421, 423, 425, 428, 431, 435, 438,
1022 440, 444, 448, 451, 453, 458, 462, 464, 467, 469,
1023 480, 492, 502, 512, 521, 533, 542, 548, 551, 556,
1024 557, 559, 562, 564, 566, 569, 572, 576, 581, 586,
1025 588, 592, 594, 598, 600, 603, 607, 614, 622, 625,
1026 627, 629, 632, 635, 639, 643, 647, 651, 659, 668,
1027 672, 674, 678, 680, 688, 697, 701, 703, 711, 720,
1028 724, 726, 728, 731, 733
1031 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1032 static const yysigned_char yyrhs[] =
1034 67, 0, -1, 69, 70, 69, -1, 70, 69, -1,
1035 69, 70, -1, 70, -1, 24, -1, 27, -1, 25,
1036 -1, 26, -1, 28, -1, 29, -1, 69, 68, -1,
1037 69, 111, -1, 69, 114, -1, 69, 116, -1, 68,
1038 -1, 111, -1, 114, -1, 116, -1, 71, 53, 73,
1039 54, -1, 71, 53, 54, -1, 3, 21, 4, 21,
1040 72, -1, -1, 55, 19, 19, 56, 72, -1, 55,
1041 19, 21, 56, 72, -1, 55, 19, 20, 56, 72,
1042 -1, 55, 19, 30, 30, 56, 72, -1, 55, 19,
1043 30, 30, 30, 56, 72, -1, 55, 19, 19, 30,
1044 56, 72, -1, 55, 19, 19, 30, 30, 56, 72,
1045 -1, 73, 74, -1, 74, -1, 102, -1, 19, 102,
1046 -1, 19, 21, 102, -1, 79, -1, 80, -1, 82,
1047 -1, 57, -1, 31, -1, 32, -1, 33, -1, 34,
1048 -1, 19, 19, -1, 19, 53, 24, -1, 58, 118,
1049 -1, 58, 53, 24, -1, 76, 77, -1, 77, 76,
1050 -1, 77, -1, 76, -1, 19, -1, -1, 75, 91,
1051 19, 78, 57, -1, 75, 91, 19, 22, 78, 57,
1052 -1, 36, 89, 88, 19, 81, 19, 53, 24, 19,
1053 53, 24, 57, -1, 36, 89, 88, 19, 81, 19,
1054 53, 24, 57, -1, 36, 89, 88, 19, 81, 19,
1055 -1, 55, 19, 56, -1, -1, 35, 19, 19, 83,
1056 19, 53, 24, 19, 53, 24, 57, -1, 35, 19,
1057 19, 83, 19, 53, 24, 57, -1, 35, 19, 19,
1058 83, 57, -1, 55, 84, 56, -1, -1, 84, 59,
1059 87, -1, 87, -1, 30, -1, 19, 55, 30, 56,
1060 -1, 118, -1, 85, -1, 40, 58, 85, -1, 41,
1061 58, 85, -1, 42, 58, 118, -1, 43, 58, 118,
1062 -1, 44, 58, 86, -1, 46, 58, 90, -1, 47,
1063 58, 91, -1, 48, 58, 21, -1, 48, 58, 19,
1064 -1, 49, 58, 21, -1, 49, 58, 19, -1, 50,
1065 58, 21, -1, 50, 58, 19, -1, 51, 58, 21,
1066 -1, 51, 58, 19, -1, 52, 58, 21, -1, 52,
1067 58, 19, -1, 19, -1, 19, 55, 19, 91, 56,
1068 -1, 19, -1, 55, 90, 56, -1, -1, 19, 60,
1069 90, -1, 19, -1, 92, 96, -1, 92, -1, 93,
1070 -1, 19, -1, 5, 19, -1, 19, 5, -1, 95,
1071 19, -1, 5, 95, 19, -1, 95, 19, 5, -1,
1072 94, 93, -1, 21, 93, -1, 5, 93, -1, 21,
1073 -1, 21, 5, -1, 94, -1, 94, 5, -1, 6,
1074 -1, 18, -1, 14, -1, 15, -1, 13, -1, 16,
1075 -1, 17, -1, 11, -1, 12, -1, 7, -1, 8,
1076 -1, 9, -1, 61, -1, 61, 5, -1, 61, 96,
1077 -1, 61, 5, 96, -1, 19, 99, -1, 99, -1,
1078 75, 19, 99, -1, 19, 75, 99, -1, 75, 99,
1079 -1, 97, -1, 19, 55, 100, 56, -1, 100, 59,
1080 19, -1, 19, -1, 53, 24, -1, 57, -1, 38,
1081 89, 98, 91, 19, 55, 105, 56, 103, 101, -1,
1082 75, 38, 89, 97, 91, 19, 55, 105, 56, 103,
1083 101, -1, 37, 75, 91, 19, 55, 105, 56, 103,
1084 101, -1, 75, 37, 91, 19, 55, 105, 56, 103,
1085 101, -1, 37, 91, 19, 55, 105, 56, 103, 101,
1086 -1, 39, 55, 21, 56, 91, 19, 55, 105, 56,
1087 103, 101, -1, 75, 91, 19, 55, 105, 56, 103,
1088 101, -1, 19, 55, 19, 56, 101, -1, 19, 104,
1089 -1, 19, 104, 19, 104, -1, -1, 118, -1, 53,
1090 24, -1, 6, -1, 19, -1, 19, 5, -1, 5,
1091 19, -1, 19, 59, 106, -1, 19, 5, 59, 106,
1092 -1, 5, 19, 59, 106, -1, 106, -1, 107, 59,
1093 10, -1, 107, -1, 107, 59, 108, -1, 108, -1,
1094 91, 19, -1, 91, 19, 22, -1, 91, 19, 55,
1095 19, 109, 56, -1, 91, 19, 22, 55, 19, 109,
1096 56, -1, 109, 110, -1, 110, -1, 19, -1, 62,
1097 118, -1, 63, 118, -1, 62, 58, 118, -1, 63,
1098 58, 118, -1, 58, 58, 118, -1, 64, 58, 118,
1099 -1, 9, 19, 53, 112, 54, 21, 57, -1, 9,
1100 19, 53, 112, 59, 54, 21, 57, -1, 112, 59,
1101 113, -1, 113, -1, 19, 58, 118, -1, 19, -1,
1102 46, 19, 53, 115, 54, 21, 57, -1, 46, 19,
1103 53, 115, 59, 54, 21, 57, -1, 115, 59, 19,
1104 -1, 19, -1, 45, 19, 53, 117, 54, 21, 57,
1105 -1, 45, 19, 53, 117, 59, 54, 21, 57, -1,
1106 117, 59, 19, -1, 19, -1, 20, -1, 65, 20,
1110 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1111 static const unsigned short yyrline[] =
1113 0, 689, 689, 690, 691, 692, 695, 704, 713, 722,
1114 731, 740, 751, 752, 753, 754, 755, 756, 757, 758,
1115 761, 766, 773, 789, 790, 802, 811, 823, 832, 841,
1116 850, 861, 862, 865, 866, 875, 887, 888, 889, 890,
1117 893, 894, 895, 896, 899, 919, 943, 947, 955, 956,
1118 957, 958, 959, 967, 973, 976, 981, 1049, 1103, 1192,
1119 1200, 1205, 1253, 1289, 1305, 1306, 1309, 1310, 1313, 1314,
1120 1326, 1327, 1330, 1336, 1342, 1348, 1354, 1360, 1366, 1373,
1121 1379, 1385, 1391, 1397, 1403, 1409, 1415, 1421, 1427, 1433,
1122 1458, 1467, 1473, 1474, 1477, 1480, 1486, 1493, 1502, 1505,
1123 1508, 1512, 1516, 1520, 1525, 1533, 1537, 1542, 1546, 1549,
1124 1553, 1556, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568,
1125 1569, 1572, 1573, 1574, 1577, 1578, 1579, 1583, 1590, 1602,
1126 1608, 1620, 1632, 1635, 1641, 1646, 1649, 1654, 1655, 1659,
1127 1675, 1691, 1707, 1723, 1734, 1740, 1750, 1773, 1784, 1803,
1128 1809, 1810, 1816, 1817, 1828, 1839, 1850, 1860, 1870, 1880,
1129 1883, 1884, 1887, 1888, 1891, 1894, 1897, 1905, 1915, 1916,
1130 1919, 1936, 1943, 1950, 1957, 1964, 1971, 1980, 1989, 2000,
1131 2001, 2004, 2024, 2034, 2043, 2054, 2057, 2062, 2071, 2082,
1132 2085, 2091, 2092, 2096, 2097
1136 #if YYDEBUG || YYERROR_VERBOSE
1137 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1138 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1139 static const char *const yytname[] =
1141 "$end", "error", "$undefined", "CLASS", "FROM", "CONST", "VOID",
1142 "STRUCT", "UNION", "ENUM", "THREEDOTS", "SIGNED", "UNSIGNED", "LONG",
1143 "SHORT", "INT", "FLOAT", "DOUBLE", "CHAR", "TOKEN", "NUMBER",
1144 "TYPETOKEN", "ARRAY_DIM", "SINGLE_CHAR", "CCODE", "HTCODE", "PHCODE",
1145 "HCODE", "ACODE", "ATCODE", "STRING", "PUBLIC", "PRIVATE", "PROTECTED",
1146 "CLASSWIDE", "PROPERTY", "ARGUMENT", "VIRTUAL", "SIGNAL", "OVERRIDE",
1147 "NICK", "BLURB", "MAXIMUM", "MINIMUM", "DEFAULT_VALUE", "ERROR", "FLAGS",
1148 "TYPE", "FLAGS_TYPE", "ENUM_TYPE", "PARAM_TYPE", "BOXED_TYPE",
1149 "OBJECT_TYPE", "'{'", "'}'", "'('", "')'", "';'", "'='", "','", "'|'",
1150 "'*'", "'>'", "'<'", "'!'", "'-'", "$accept", "prog", "ccode", "ccodes",
1151 "class", "classdec", "classflags", "classcode", "thing", "scope",
1152 "destructor", "initializer", "varoptions", "variable", "argument",
1153 "export", "property", "param_spec", "param_spec_list", "string",
1154 "anyval", "param_spec_value", "argtype", "flags", "flaglist", "type",
1155 "specifier_list", "spec_list", "specifier", "strunionenum", "pointer",
1156 "simplesigtype", "fullsigtype", "sigtype", "tokenlist", "codenocode",
1157 "method", "returnvals", "retcode", "funcargs", "arglist", "arglist1",
1158 "arg", "checklist", "check", "enumcode", "enumvals", "enumval",
1159 "flagcode", "flagvals", "errorcode", "errorvals", "numtok", 0
1164 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1166 static const unsigned short yytoknum[] =
1168 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1169 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1170 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1171 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1172 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1173 305, 306, 307, 123, 125, 40, 41, 59, 61, 44,
1174 124, 42, 62, 60, 33, 45
1178 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1179 static const unsigned char yyr1[] =
1181 0, 66, 67, 67, 67, 67, 68, 68, 68, 68,
1182 68, 68, 69, 69, 69, 69, 69, 69, 69, 69,
1183 70, 70, 71, 72, 72, 72, 72, 72, 72, 72,
1184 72, 73, 73, 74, 74, 74, 74, 74, 74, 74,
1185 75, 75, 75, 75, 76, 76, 77, 77, 78, 78,
1186 78, 78, 78, 78, 79, 79, 80, 80, 80, 81,
1187 81, 82, 82, 82, 83, 83, 84, 84, 85, 85,
1188 86, 86, 87, 87, 87, 87, 87, 87, 87, 87,
1189 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
1190 88, 88, 89, 89, 90, 90, 91, 91, 92, 92,
1191 92, 92, 92, 92, 92, 93, 93, 93, 93, 93,
1192 93, 93, 94, 94, 94, 94, 94, 94, 94, 94,
1193 94, 95, 95, 95, 96, 96, 96, 96, 97, 97,
1194 98, 98, 98, 98, 99, 100, 100, 101, 101, 102,
1195 102, 102, 102, 102, 102, 102, 102, 103, 103, 103,
1196 104, 104, 105, 105, 105, 105, 105, 105, 105, 105,
1197 106, 106, 107, 107, 108, 108, 108, 108, 109, 109,
1198 110, 110, 110, 110, 110, 110, 110, 111, 111, 112,
1199 112, 113, 113, 114, 114, 115, 115, 116, 116, 117,
1200 117, 118, 118, 118, 118
1203 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1204 static const unsigned char yyr2[] =
1206 0, 2, 3, 2, 2, 1, 1, 1, 1, 1,
1207 1, 1, 2, 2, 2, 2, 1, 1, 1, 1,
1208 4, 3, 5, 0, 5, 5, 5, 6, 7, 6,
1209 7, 2, 1, 1, 2, 3, 1, 1, 1, 1,
1210 1, 1, 1, 1, 2, 3, 2, 3, 2, 2,
1211 1, 1, 1, 0, 5, 6, 12, 9, 6, 3,
1212 0, 11, 8, 5, 3, 0, 3, 1, 1, 4,
1213 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
1214 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1215 5, 1, 3, 0, 3, 1, 2, 1, 1, 1,
1216 2, 2, 2, 3, 3, 2, 2, 2, 1, 2,
1217 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1218 1, 1, 1, 1, 1, 2, 2, 3, 2, 1,
1219 3, 3, 2, 1, 4, 3, 1, 2, 1, 10,
1220 11, 9, 9, 8, 11, 8, 5, 2, 4, 0,
1221 1, 2, 1, 1, 2, 2, 3, 4, 4, 1,
1222 3, 1, 3, 1, 2, 3, 6, 7, 2, 1,
1223 1, 2, 2, 3, 3, 3, 3, 7, 8, 3,
1224 1, 3, 1, 7, 8, 3, 1, 7, 8, 3,
1228 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1229 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1230 means the default is an error. */
1231 static const unsigned char yydefact[] =
1233 0, 0, 0, 6, 8, 9, 7, 10, 11, 0,
1234 0, 0, 16, 0, 5, 0, 17, 18, 19, 0,
1235 0, 0, 0, 1, 12, 4, 13, 14, 15, 3,
1236 0, 0, 0, 0, 0, 2, 0, 40, 41, 42,
1237 43, 0, 93, 0, 93, 0, 21, 39, 0, 32,
1238 0, 36, 37, 38, 33, 23, 182, 0, 180, 190,
1239 0, 186, 0, 0, 0, 0, 0, 34, 0, 0,
1240 0, 0, 112, 121, 122, 123, 119, 120, 116, 114,
1241 115, 117, 118, 113, 99, 108, 0, 0, 97, 98,
1242 110, 0, 0, 0, 20, 31, 0, 93, 0, 0,
1243 22, 0, 0, 0, 0, 0, 0, 0, 35, 0,
1244 0, 65, 95, 0, 91, 0, 0, 100, 107, 0,
1245 101, 109, 106, 0, 0, 124, 96, 111, 105, 102,
1246 0, 0, 133, 0, 129, 0, 0, 0, 53, 0,
1247 194, 191, 193, 0, 181, 0, 0, 179, 0, 189,
1248 0, 0, 185, 0, 0, 0, 0, 0, 0, 92,
1249 0, 60, 103, 0, 0, 125, 126, 104, 0, 0,
1250 0, 128, 0, 132, 0, 0, 0, 0, 0, 52,
1251 53, 0, 0, 51, 50, 0, 0, 0, 0, 0,
1252 192, 177, 0, 187, 0, 183, 0, 0, 138, 146,
1253 89, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1254 0, 0, 0, 0, 67, 0, 63, 94, 0, 0,
1255 0, 0, 0, 112, 99, 0, 0, 159, 161, 163,
1256 127, 136, 0, 131, 130, 0, 0, 0, 0, 44,
1257 0, 0, 0, 0, 46, 48, 0, 49, 54, 0,
1258 23, 23, 23, 0, 178, 188, 184, 137, 0, 0,
1259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1260 64, 0, 0, 0, 0, 58, 0, 100, 101, 0,
1261 164, 149, 0, 134, 0, 0, 0, 0, 0, 45,
1262 55, 149, 47, 0, 23, 24, 26, 25, 0, 23,
1263 0, 68, 72, 73, 74, 75, 194, 71, 76, 70,
1264 77, 78, 80, 79, 82, 81, 84, 83, 86, 85,
1265 88, 87, 66, 0, 90, 59, 0, 149, 0, 0,
1266 156, 165, 0, 0, 0, 160, 162, 135, 0, 0,
1267 149, 0, 0, 23, 29, 23, 27, 0, 0, 62,
1268 0, 0, 158, 157, 0, 0, 0, 147, 150, 143,
1269 149, 0, 0, 0, 145, 30, 28, 0, 0, 0,
1270 57, 141, 0, 170, 0, 0, 0, 0, 0, 169,
1271 151, 0, 0, 149, 142, 149, 69, 0, 0, 0,
1272 0, 0, 171, 0, 172, 0, 166, 168, 148, 139,
1273 0, 0, 61, 0, 167, 175, 173, 174, 176, 144,
1277 /* YYDEFGOTO[NTERM-NUM]. */
1278 static const short yydefgoto[] =
1280 -1, 11, 12, 13, 14, 15, 100, 48, 49, 50,
1281 183, 184, 185, 51, 52, 220, 53, 157, 213, 302,
1282 308, 214, 115, 70, 113, 225, 88, 89, 90, 91,
1283 126, 132, 133, 134, 232, 199, 54, 334, 357, 226,
1284 227, 228, 229, 378, 379, 16, 57, 58, 17, 62,
1288 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1290 #define YYPACT_NINF -326
1291 static const short yypact[] =
1293 166, 18, 73, -326, -326, -326, -326, -326, -326, 115,
1294 116, 147, -326, 166, 210, 121, -326, -326, -326, 148,
1295 127, 128, 135, -326, -326, 210, -326, -326, -326, 210,
1296 167, 175, 178, 204, 225, 210, 226, -326, -326, -326,
1297 -326, 230, 195, 330, 195, 199, -326, -326, 194, -326,
1298 296, -326, -326, -326, -326, 206, 209, -32, -326, -326,
1299 -18, -326, 156, 217, 321, 261, 296, -326, 268, 272,
1300 274, 377, -326, -326, -326, -326, -326, -326, -326, -326,
1301 -326, -326, -326, -326, 290, 445, 394, 277, 237, -326,
1302 459, 280, 151, 279, -326, -326, 394, 195, 297, 304,
1303 -326, 99, 310, 31, 311, 83, 329, 89, -326, 300,
1304 338, 325, 327, 341, 349, 395, 473, -326, -326, 402,
1305 -326, 473, -326, 412, 383, 5, -326, 473, -326, 443,
1306 251, 433, -326, 394, -326, 397, 435, 436, 12, 188,
1307 -326, -326, -326, 447, -326, 424, 448, -326, 425, -326,
1308 462, 438, -326, 471, 163, 413, 278, 11, 272, -326,
1309 474, 441, -326, 442, 411, 237, -326, -326, 444, 479,
1310 481, -326, 1, -326, 482, 394, 449, 1, 394, 76,
1311 19, 411, 9, 450, 483, 446, 84, 451, 453, 475,
1312 -326, -326, 454, -326, 455, -326, 456, 486, -326, -326,
1313 -326, 457, 458, 460, 461, 463, 464, 465, 466, 467,
1314 468, 469, 470, -10, -326, 476, -326, -326, 394, 487,
1315 495, 411, 428, 477, 13, 498, 478, -326, 472, -326,
1316 -326, -326, 51, -326, -326, 480, 501, 411, 511, -326,
1317 508, 484, 488, 512, -326, -326, 76, -326, -326, 85,
1318 206, 206, 206, 90, -326, -326, -326, -326, 98, 98,
1319 99, 99, 60, 272, 394, 168, 252, 257, 258, 267,
1320 -326, 278, 513, 489, 490, 485, 491, 158, 184, 394,
1321 66, 520, 360, -326, 521, 411, 493, 494, 496, -326,
1322 -326, 520, -326, 497, 206, -326, -326, -326, 499, 206,
1323 502, -326, -326, -326, -326, -326, 502, -326, -326, -326,
1324 -326, -326, -326, -326, -326, -326, -326, -326, -326, -326,
1325 -326, -326, -326, 14, -326, -326, 518, 520, 394, 394,
1326 -326, 503, 524, 74, 163, -326, -326, -326, 500, 411,
1327 520, 411, 163, 206, -326, 206, -326, 519, 506, -326,
1328 29, 163, -326, -326, 533, 104, 530, 541, -326, -326,
1329 520, 505, 163, 507, -326, -326, -326, 509, 538, 514,
1330 -326, -326, 104, -326, 510, 80, 93, 515, 68, -326,
1331 -326, 74, 163, 520, -326, 520, -326, 517, 540, 86,
1332 99, 99, -326, 99, -326, 99, -326, -326, -326, -326,
1333 163, 163, -326, 522, -326, -326, -326, -326, -326, -326,
1337 /* YYPGOTO[NTERM-NUM]. */
1338 static const short yypgoto[] =
1340 -326, -326, 142, 227, 553, -326, -239, -326, 523, -29,
1341 385, 387, 392, -326, -326, -326, -326, -326, -326, 7,
1342 -326, 305, -326, -19, -152, -42, -326, -69, -326, -68,
1343 -106, 440, -326, -88, -326, -325, -13, -287, 197, -176,
1344 -264, -326, 293, 208, -136, 143, -326, 492, 144, -326,
1348 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1349 positive, shift that token. If negative, reduce the rule which
1350 number is the opposite. If zero, do what YYDEFACT says.
1351 If YYTABLE_NINF, syntax error. */
1352 #define YYTABLE_NINF -156
1353 static const short yytable[] =
1355 144, 87, 118, 119, 342, 242, 217, 66, 98, 359,
1356 165, 295, 296, 297, 86, 330, 122, 364, 278, 166,
1357 168, 128, 102, 67, 110, 92, 371, 103, 140, 141,
1358 215, 179, 142, 348, 180, 66, 104, 384, 179, 19,
1359 351, 105, 171, 173, 123, 276, 270, 118, 369, 271,
1360 56, 108, 118, 362, 136, 344, 169, 399, 118, 230,
1361 346, 287, 243, 131, 352, 353, 125, 181, 216, -153,
1362 182, 349, 279, 382, 143, 409, 410, 182, 137, 306,
1363 141, 244, 233, 142, 234, 146, 370, 373, 331, 171,
1364 301, 174, 20, 140, 141, 239, 400, 142, 401, 140,
1365 141, 170, 149, 142, 365, 373, 366, 283, 152, 338,
1366 284, 310, 140, 141, 249, 293, 142, 300, 140, 141,
1367 298, 332, 142, 373, 396, 143, 374, 356, 301, 240,
1368 375, 376, 377, 236, 21, 22, 238, 150, 391, 143,
1369 250, 294, 404, 153, 374, 143, 299, 23, 375, 376,
1370 377, 393, 31, 118, 119, 24, 26, 27, 143, 304,
1371 305, 309, 374, 361, 143, 363, 375, 376, 377, 1,
1372 130, 24, 26, 27, 30, 2, 273, 24, 26, 27,
1373 32, 33, 37, 38, 39, 40, 36, 312, 34, 313,
1374 3, 4, 5, 6, 7, 8, 55, 56, 37, 38,
1375 39, 40, 41, 42, 43, 44, 45, 186, 187, 188,
1376 106, 9, 10, 36, -155, 107, 197, 328, 189, 2,
1377 198, 46, 311, 59, 47, 37, 38, 39, 40, 41,
1378 42, 43, 44, 45, 3, 4, 5, 6, 7, 8,
1379 -154, 29, 397, 329, 61, 63, 28, 64, 94, 68,
1380 69, 47, 35, 397, 93, 9, 10, 37, 38, 39,
1381 40, 99, 28, 43, 44, 45, 303, 101, 28, 307,
1382 168, 314, 65, 315, 392, 394, 316, 318, 317, 319,
1383 109, 65, 37, 38, 39, 40, 320, 111, 321, 405,
1384 406, 112, 407, 114, 408, 120, 124, 200, 125, 129,
1385 135, 71, 72, 73, 74, 75, 169, 76, 77, 78,
1386 79, 80, 81, 82, 83, 84, 138, 85, 201, 202,
1387 203, 204, 205, 139, 206, 207, 208, 209, 210, 211,
1388 212, 145, 148, 96, 97, 71, 72, 73, 74, 75,
1389 63, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1390 151, 85, 37, 38, 39, 40, 154, 155, 43, 44,
1391 45, 37, 38, 39, 40, 71, 72, 73, 74, 75,
1392 335, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1393 156, 85, 116, 72, 73, 74, 75, 158, 76, 77,
1394 78, 79, 80, 81, 82, 83, 117, 159, 85, 71,
1395 72, 73, 74, 75, 160, 76, 77, 78, 79, 80,
1396 81, 82, 83, 84, 161, 85, 222, 223, 73, 74,
1397 75, 162, 76, 77, 78, 79, 80, 81, 82, 83,
1398 224, 163, 85, 116, 72, 73, 74, 75, 164, 76,
1399 77, 78, 79, 80, 81, 82, 83, 277, 167, 85,
1400 121, 72, 172, 175, 176, 177, 76, 77, 78, 79,
1401 80, 81, 82, 83, 127, 72, 85, 190, 181, 192,
1402 76, 77, 78, 79, 80, 81, 82, 83, 116, 72,
1403 85, 191, 193, 194, 76, 77, 78, 79, 80, 81,
1404 82, 83, 196, 218, 85, 195, 219, 221, 231, 169,
1405 168, 235, 246, 248, 237, 253, 274, 251, 182, 252,
1406 257, 254, 255, 256, 275, 258, 259, 280, 260, 261,
1407 286, 262, 263, 264, 265, 266, 267, 268, 269, 272,
1408 288, 282, 289, -152, 281, 285, 292, 323, 326, 333,
1409 337, 290, 350, 355, 291, 324, 325, 327, 339, 367,
1410 340, 341, 372, 343, 380, 345, 360, 347, 354, 368,
1411 381, 383, 387, 385, 403, 386, 25, 388, 390, 247,
1412 245, 95, 241, 395, 402, 336, 322, 178, 398, 411,
1413 389, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1417 static const short yycheck[] =
1419 101, 43, 71, 71, 291, 181, 158, 36, 50, 334,
1420 5, 250, 251, 252, 43, 279, 85, 342, 5, 125,
1421 19, 90, 54, 36, 66, 44, 351, 59, 19, 20,
1422 19, 19, 23, 19, 22, 64, 54, 362, 19, 21,
1423 327, 59, 130, 131, 86, 221, 56, 116, 19, 59,
1424 19, 64, 121, 340, 96, 294, 55, 382, 127, 165,
1425 299, 237, 53, 92, 328, 329, 61, 55, 57, 56,
1426 58, 57, 59, 360, 65, 400, 401, 58, 97, 19,
1427 20, 182, 170, 23, 172, 54, 57, 19, 22, 177,
1428 30, 133, 19, 19, 20, 19, 383, 23, 385, 19,
1429 20, 130, 19, 23, 343, 19, 345, 56, 19, 285,
1430 59, 263, 19, 20, 30, 30, 23, 19, 19, 20,
1431 30, 55, 23, 19, 56, 65, 58, 53, 30, 53,
1432 62, 63, 64, 175, 19, 19, 178, 54, 58, 65,
1433 56, 56, 56, 54, 58, 65, 56, 0, 62, 63,
1434 64, 58, 4, 222, 222, 13, 13, 13, 65, 260,
1435 261, 262, 58, 339, 65, 341, 62, 63, 64, 3,
1436 19, 29, 29, 29, 53, 9, 218, 35, 35, 35,
1437 53, 53, 31, 32, 33, 34, 19, 19, 53, 21,
1438 24, 25, 26, 27, 28, 29, 21, 19, 31, 32,
1439 33, 34, 35, 36, 37, 38, 39, 19, 20, 21,
1440 54, 45, 46, 19, 56, 59, 53, 59, 30, 9,
1441 57, 54, 264, 19, 57, 31, 32, 33, 34, 35,
1442 36, 37, 38, 39, 24, 25, 26, 27, 28, 29,
1443 56, 14, 378, 59, 19, 19, 13, 21, 54, 19,
1444 55, 57, 25, 389, 55, 45, 46, 31, 32, 33,
1445 34, 55, 29, 37, 38, 39, 259, 58, 35, 262,
1446 19, 19, 55, 21, 375, 376, 19, 19, 21, 21,
1447 19, 55, 31, 32, 33, 34, 19, 19, 21, 390,
1448 391, 19, 393, 19, 395, 5, 19, 19, 61, 19,
1449 21, 5, 6, 7, 8, 9, 55, 11, 12, 13,
1450 14, 15, 16, 17, 18, 19, 19, 21, 40, 41,
1451 42, 43, 44, 19, 46, 47, 48, 49, 50, 51,
1452 52, 21, 21, 37, 38, 5, 6, 7, 8, 9,
1453 19, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1454 21, 21, 31, 32, 33, 34, 56, 19, 37, 38,
1455 39, 31, 32, 33, 34, 5, 6, 7, 8, 9,
1456 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1457 55, 21, 5, 6, 7, 8, 9, 60, 11, 12,
1458 13, 14, 15, 16, 17, 18, 19, 56, 21, 5,
1459 6, 7, 8, 9, 55, 11, 12, 13, 14, 15,
1460 16, 17, 18, 19, 19, 21, 5, 6, 7, 8,
1461 9, 19, 11, 12, 13, 14, 15, 16, 17, 18,
1462 19, 19, 21, 5, 6, 7, 8, 9, 55, 11,
1463 12, 13, 14, 15, 16, 17, 18, 19, 5, 21,
1464 5, 6, 19, 56, 19, 19, 11, 12, 13, 14,
1465 15, 16, 17, 18, 5, 6, 21, 20, 55, 21,
1466 11, 12, 13, 14, 15, 16, 17, 18, 5, 6,
1467 21, 57, 57, 21, 11, 12, 13, 14, 15, 16,
1468 17, 18, 21, 19, 21, 57, 55, 55, 19, 55,
1469 19, 19, 19, 57, 55, 30, 19, 56, 58, 56,
1470 24, 57, 57, 57, 19, 58, 58, 19, 58, 58,
1471 19, 58, 58, 58, 58, 58, 58, 58, 58, 53,
1472 19, 59, 24, 56, 56, 55, 24, 24, 53, 19,
1473 19, 57, 24, 19, 56, 56, 56, 56, 55, 30,
1474 56, 55, 19, 56, 24, 56, 56, 55, 55, 53,
1475 19, 56, 24, 56, 24, 56, 13, 53, 58, 184,
1476 183, 48, 180, 58, 57, 282, 271, 137, 381, 57,
1477 372, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1478 -1, -1, -1, -1, -1, 103
1481 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1482 symbol of state STATE-NUM. */
1483 static const unsigned char yystos[] =
1485 0, 3, 9, 24, 25, 26, 27, 28, 29, 45,
1486 46, 67, 68, 69, 70, 71, 111, 114, 116, 21,
1487 19, 19, 19, 0, 68, 70, 111, 114, 116, 69,
1488 53, 4, 53, 53, 53, 69, 19, 31, 32, 33,
1489 34, 35, 36, 37, 38, 39, 54, 57, 73, 74,
1490 75, 79, 80, 82, 102, 21, 19, 112, 113, 19,
1491 117, 19, 115, 19, 21, 55, 75, 102, 19, 55,
1492 89, 5, 6, 7, 8, 9, 11, 12, 13, 14,
1493 15, 16, 17, 18, 19, 21, 75, 91, 92, 93,
1494 94, 95, 89, 55, 54, 74, 37, 38, 91, 55,
1495 72, 58, 54, 59, 54, 59, 54, 59, 102, 19,
1496 91, 19, 19, 90, 19, 88, 5, 19, 93, 95,
1497 5, 5, 93, 91, 19, 61, 96, 5, 93, 19,
1498 19, 75, 97, 98, 99, 21, 91, 89, 19, 19,
1499 19, 20, 23, 65, 118, 21, 54, 113, 21, 19,
1500 54, 21, 19, 54, 56, 19, 55, 83, 60, 56,
1501 55, 19, 19, 19, 55, 5, 96, 5, 19, 55,
1502 75, 99, 19, 99, 91, 56, 19, 19, 97, 19,
1503 22, 55, 58, 76, 77, 78, 19, 20, 21, 30,
1504 20, 57, 21, 57, 21, 57, 21, 53, 57, 101,
1505 19, 40, 41, 42, 43, 44, 46, 47, 48, 49,
1506 50, 51, 52, 84, 87, 19, 57, 90, 19, 55,
1507 81, 55, 5, 6, 19, 91, 105, 106, 107, 108,
1508 96, 19, 100, 99, 99, 19, 91, 55, 91, 19,
1509 53, 78, 105, 53, 118, 77, 19, 76, 57, 30,
1510 56, 56, 56, 30, 57, 57, 57, 24, 58, 58,
1511 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
1512 56, 59, 53, 91, 19, 19, 105, 19, 5, 59,
1513 19, 56, 59, 56, 59, 55, 19, 105, 19, 24,
1514 57, 56, 24, 30, 56, 72, 72, 72, 30, 56,
1515 19, 30, 85, 85, 118, 118, 19, 85, 86, 118,
1516 90, 91, 19, 21, 19, 21, 19, 21, 19, 21,
1517 19, 21, 87, 24, 56, 56, 53, 56, 59, 59,
1518 106, 22, 55, 19, 103, 10, 108, 19, 105, 55,
1519 56, 55, 103, 56, 72, 56, 72, 55, 19, 57,
1520 24, 103, 106, 106, 55, 19, 53, 104, 118, 101,
1521 56, 105, 103, 105, 101, 72, 72, 30, 53, 19,
1522 57, 101, 19, 19, 58, 62, 63, 64, 109, 110,
1523 24, 19, 103, 56, 101, 56, 56, 24, 53, 109,
1524 58, 58, 118, 58, 118, 58, 56, 110, 104, 101,
1525 103, 103, 57, 24, 56, 118, 118, 118, 118, 101,
1529 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1530 # define YYSIZE_T __SIZE_TYPE__
1532 #if ! defined (YYSIZE_T) && defined (size_t)
1533 # define YYSIZE_T size_t
1535 #if ! defined (YYSIZE_T)
1536 # if defined (__STDC__) || defined (__cplusplus)
1537 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1538 # define YYSIZE_T size_t
1541 #if ! defined (YYSIZE_T)
1542 # define YYSIZE_T unsigned int
1545 #define yyerrok (yyerrstatus = 0)
1546 #define yyclearin (yychar = YYEMPTY)
1547 #define YYEMPTY (-2)
1550 #define YYACCEPT goto yyacceptlab
1551 #define YYABORT goto yyabortlab
1552 #define YYERROR goto yyerrorlab
1555 /* Like YYERROR except do call yyerror. This remains here temporarily
1556 to ease the transition to the new meaning of YYERROR, for GCC.
1557 Once GCC version 2 has supplanted version 1, this can go. */
1559 #define YYFAIL goto yyerrlab
1561 #define YYRECOVERING() (!!yyerrstatus)
1563 #define YYBACKUP(Token, Value) \
1565 if (yychar == YYEMPTY && yylen == 1) \
1569 yytoken = YYTRANSLATE (yychar); \
1575 yyerror ("syntax error: cannot back up");\
1581 #define YYERRCODE 256
1583 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1586 #ifndef YYLLOC_DEFAULT
1587 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1588 ((Current).first_line = (Rhs)[1].first_line, \
1589 (Current).first_column = (Rhs)[1].first_column, \
1590 (Current).last_line = (Rhs)[N].last_line, \
1591 (Current).last_column = (Rhs)[N].last_column)
1594 /* YYLEX -- calling `yylex' with the right arguments. */
1597 # define YYLEX yylex (YYLEX_PARAM)
1599 # define YYLEX yylex ()
1602 /* Enable debugging if requested. */
1606 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1607 # define YYFPRINTF fprintf
1610 # define YYDPRINTF(Args) \
1616 # define YYDSYMPRINT(Args) \
1622 # define YYDSYMPRINTF(Title, Token, Value, Location) \
1626 YYFPRINTF (stderr, "%s ", Title); \
1627 yysymprint (stderr, \
1629 YYFPRINTF (stderr, "\n"); \
1633 /*------------------------------------------------------------------.
1634 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1636 `------------------------------------------------------------------*/
1638 #if defined (__STDC__) || defined (__cplusplus)
1640 yy_stack_print (short *bottom, short *top)
1643 yy_stack_print (bottom, top)
1648 YYFPRINTF (stderr, "Stack now");
1649 for (/* Nothing. */; bottom <= top; ++bottom)
1650 YYFPRINTF (stderr, " %d", *bottom);
1651 YYFPRINTF (stderr, "\n");
1654 # define YY_STACK_PRINT(Bottom, Top) \
1657 yy_stack_print ((Bottom), (Top)); \
1661 /*------------------------------------------------.
1662 | Report that the YYRULE is going to be reduced. |
1663 `------------------------------------------------*/
1665 #if defined (__STDC__) || defined (__cplusplus)
1667 yy_reduce_print (int yyrule)
1670 yy_reduce_print (yyrule)
1675 unsigned int yylno = yyrline[yyrule];
1676 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1678 /* Print the symbols being reduced, and their result. */
1679 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1680 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1681 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1684 # define YY_REDUCE_PRINT(Rule) \
1687 yy_reduce_print (Rule); \
1690 /* Nonzero means print parse trace. It is left uninitialized so that
1691 multiple parsers can coexist. */
1693 #else /* !YYDEBUG */
1694 # define YYDPRINTF(Args)
1695 # define YYDSYMPRINT(Args)
1696 # define YYDSYMPRINTF(Title, Token, Value, Location)
1697 # define YY_STACK_PRINT(Bottom, Top)
1698 # define YY_REDUCE_PRINT(Rule)
1699 #endif /* !YYDEBUG */
1702 /* YYINITDEPTH -- initial size of the parser's stacks. */
1704 # define YYINITDEPTH 200
1707 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1708 if the built-in stack extension method is used).
1710 Do not make this value too large; the results are undefined if
1711 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1712 evaluated with infinite-precision integer arithmetic. */
1714 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1719 # define YYMAXDEPTH 10000
1727 # if defined (__GLIBC__) && defined (_STRING_H)
1728 # define yystrlen strlen
1730 /* Return the length of YYSTR. */
1732 # if defined (__STDC__) || defined (__cplusplus)
1733 yystrlen (const char *yystr)
1739 register const char *yys = yystr;
1741 while (*yys++ != '\0')
1744 return yys - yystr - 1;
1750 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1751 # define yystpcpy stpcpy
1753 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1756 # if defined (__STDC__) || defined (__cplusplus)
1757 yystpcpy (char *yydest, const char *yysrc)
1759 yystpcpy (yydest, yysrc)
1764 register char *yyd = yydest;
1765 register const char *yys = yysrc;
1767 while ((*yyd++ = *yys++) != '\0')
1775 #endif /* !YYERROR_VERBOSE */
1780 /*--------------------------------.
1781 | Print this symbol on YYOUTPUT. |
1782 `--------------------------------*/
1784 #if defined (__STDC__) || defined (__cplusplus)
1786 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1789 yysymprint (yyoutput, yytype, yyvaluep)
1795 /* Pacify ``unused variable'' warnings. */
1798 if (yytype < YYNTOKENS)
1800 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1802 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1806 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1813 YYFPRINTF (yyoutput, ")");
1816 #endif /* ! YYDEBUG */
1817 /*-----------------------------------------------.
1818 | Release the memory associated to this symbol. |
1819 `-----------------------------------------------*/
1821 #if defined (__STDC__) || defined (__cplusplus)
1823 yydestruct (int yytype, YYSTYPE *yyvaluep)
1826 yydestruct (yytype, yyvaluep)
1831 /* Pacify ``unused variable'' warnings. */
1843 /* Prevent warnings from -Wmissing-prototypes. */
1845 #ifdef YYPARSE_PARAM
1846 # if defined (__STDC__) || defined (__cplusplus)
1847 int yyparse (void *YYPARSE_PARAM);
1851 #else /* ! YYPARSE_PARAM */
1852 #if defined (__STDC__) || defined (__cplusplus)
1857 #endif /* ! YYPARSE_PARAM */
1861 /* The lookahead symbol. */
1864 /* The semantic value of the lookahead symbol. */
1867 /* Number of syntax errors so far. */
1876 #ifdef YYPARSE_PARAM
1877 # if defined (__STDC__) || defined (__cplusplus)
1878 int yyparse (void *YYPARSE_PARAM)
1880 int yyparse (YYPARSE_PARAM)
1881 void *YYPARSE_PARAM;
1883 #else /* ! YYPARSE_PARAM */
1884 #if defined (__STDC__) || defined (__cplusplus)
1895 register int yystate;
1898 /* Number of tokens to shift before error messages enabled. */
1900 /* Lookahead token as an internal (translated) token number. */
1903 /* Three stacks and their tools:
1904 `yyss': related to states,
1905 `yyvs': related to semantic values,
1906 `yyls': related to locations.
1908 Refer to the stacks thru separate pointers, to allow yyoverflow
1909 to reallocate them elsewhere. */
1911 /* The state stack. */
1912 short yyssa[YYINITDEPTH];
1913 short *yyss = yyssa;
1914 register short *yyssp;
1916 /* The semantic value stack. */
1917 YYSTYPE yyvsa[YYINITDEPTH];
1918 YYSTYPE *yyvs = yyvsa;
1919 register YYSTYPE *yyvsp;
1923 #define YYPOPSTACK (yyvsp--, yyssp--)
1925 YYSIZE_T yystacksize = YYINITDEPTH;
1927 /* The variables used to return semantic value and location from the
1932 /* When reducing, the number of symbols on the RHS of the reduced
1936 YYDPRINTF ((stderr, "Starting parse\n"));
1941 yychar = YYEMPTY; /* Cause a token to be read. */
1943 /* Initialize stack pointers.
1944 Waste one element of value and location stack
1945 so that they stay on the same level as the state stack.
1946 The wasted elements are never initialized. */
1953 /*------------------------------------------------------------.
1954 | yynewstate -- Push a new state, which is found in yystate. |
1955 `------------------------------------------------------------*/
1957 /* In all cases, when you get here, the value and location stacks
1958 have just been pushed. so pushing a state here evens the stacks.
1965 if (yyss + yystacksize - 1 <= yyssp)
1967 /* Get the current used size of the three stacks, in elements. */
1968 YYSIZE_T yysize = yyssp - yyss + 1;
1972 /* Give user a chance to reallocate the stack. Use copies of
1973 these so that the &'s don't force the real ones into
1975 YYSTYPE *yyvs1 = yyvs;
1976 short *yyss1 = yyss;
1979 /* Each stack pointer address is followed by the size of the
1980 data in use in that stack, in bytes. This used to be a
1981 conditional around just the two extra args, but that might
1982 be undefined if yyoverflow is a macro. */
1983 yyoverflow ("parser stack overflow",
1984 &yyss1, yysize * sizeof (*yyssp),
1985 &yyvs1, yysize * sizeof (*yyvsp),
1992 #else /* no yyoverflow */
1993 # ifndef YYSTACK_RELOCATE
1996 /* Extend the stack our own way. */
1997 if (YYMAXDEPTH <= yystacksize)
2000 if (YYMAXDEPTH < yystacksize)
2001 yystacksize = YYMAXDEPTH;
2004 short *yyss1 = yyss;
2005 union yyalloc *yyptr =
2006 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2009 YYSTACK_RELOCATE (yyss);
2010 YYSTACK_RELOCATE (yyvs);
2012 # undef YYSTACK_RELOCATE
2014 YYSTACK_FREE (yyss1);
2017 #endif /* no yyoverflow */
2019 yyssp = yyss + yysize - 1;
2020 yyvsp = yyvs + yysize - 1;
2023 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2024 (unsigned long int) yystacksize));
2026 if (yyss + yystacksize - 1 <= yyssp)
2030 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2039 /* Do appropriate processing given the current state. */
2040 /* Read a lookahead token if we need one and don't already have one. */
2043 /* First try to decide what to do without reference to lookahead token. */
2045 yyn = yypact[yystate];
2046 if (yyn == YYPACT_NINF)
2049 /* Not known => get a lookahead token if don't already have one. */
2051 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2052 if (yychar == YYEMPTY)
2054 YYDPRINTF ((stderr, "Reading a token: "));
2058 if (yychar <= YYEOF)
2060 yychar = yytoken = YYEOF;
2061 YYDPRINTF ((stderr, "Now at end of input.\n"));
2065 yytoken = YYTRANSLATE (yychar);
2066 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
2069 /* If the proper action on seeing token YYTOKEN is to reduce or to
2070 detect an error, take that action. */
2072 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2077 if (yyn == 0 || yyn == YYTABLE_NINF)
2086 /* Shift the lookahead token. */
2087 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
2089 /* Discard the token being shifted unless it is eof. */
2090 if (yychar != YYEOF)
2096 /* Count tokens shifted since error; after three, turn off error
2105 /*-----------------------------------------------------------.
2106 | yydefault -- do the default action for the current state. |
2107 `-----------------------------------------------------------*/
2109 yyn = yydefact[yystate];
2115 /*-----------------------------.
2116 | yyreduce -- Do a reduction. |
2117 `-----------------------------*/
2119 /* yyn is the number of a rule to reduce with. */
2122 /* If YYLEN is nonzero, implement the default value of the action:
2125 Otherwise, the following line sets YYVAL to garbage.
2126 This behavior is undocumented and Bison
2127 users should not rely upon it. Assigning to YYVAL
2128 unconditionally makes the parser a bit smaller, and it avoids a
2129 GCC warning that YYVAL may be used uninitialized. */
2130 yyval = yyvsp[1-yylen];
2133 YY_REDUCE_PRINT (yyn);
2159 Node *node = node_new (CCODE_NODE,
2161 "cbuf:steal", (yyvsp[0].cbuf)->str,
2162 "line_no", ccode_line,
2164 nodes = g_list_append(nodes,node);
2165 g_string_free(yyvsp[0].cbuf,FALSE);
2172 Node *node = node_new (CCODE_NODE,
2174 "cbuf:steal", (yyvsp[0].cbuf)->str,
2175 "line_no", ccode_line,
2177 nodes = g_list_append(nodes,node);
2178 g_string_free(yyvsp[0].cbuf,FALSE);
2185 Node *node = node_new (CCODE_NODE,
2187 "cbuf:steal", (yyvsp[0].cbuf)->str,
2188 "line_no", ccode_line,
2190 nodes = g_list_append(nodes,node);
2191 g_string_free(yyvsp[0].cbuf,FALSE);
2198 Node *node = node_new (CCODE_NODE,
2200 "cbuf:steal", (yyvsp[0].cbuf)->str,
2201 "line_no", ccode_line,
2203 nodes = g_list_append(nodes,node);
2204 g_string_free(yyvsp[0].cbuf,FALSE);
2211 Node *node = node_new (CCODE_NODE,
2213 "cbuf:steal", (yyvsp[0].cbuf)->str,
2214 "line_no", ccode_line,
2216 nodes = g_list_append(nodes,node);
2217 g_string_free(yyvsp[0].cbuf,FALSE);
2224 Node *node = node_new (CCODE_NODE,
2226 "cbuf:steal", (yyvsp[0].cbuf)->str,
2227 "line_no", ccode_line,
2229 nodes = g_list_append(nodes,node);
2230 g_string_free(yyvsp[0].cbuf,FALSE);
2277 ((Class *)class)->nodes = class_nodes;
2279 nodes = g_list_append(nodes,class);
2286 ((Class *)class)->nodes = NULL;
2288 nodes = g_list_append(nodes,class);
2295 class = node_new (CLASS_NODE,
2296 "otype:steal", yyvsp[-3].id,
2297 "ptype:steal", yyvsp[-1].id,
2298 "bonobo_object_class:steal", bonobo_object_class,
2299 "glade_xml", glade_xml,
2300 "interfaces:steal", interfaces,
2301 "chunk_size:steal", chunk_size,
2303 bonobo_object_class = NULL;
2313 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2314 g_free (chunk_size);
2315 chunk_size = g_strdup(yyvsp[-2].id);
2316 } else if(strcmp(yyvsp[-3].id,"BonoboObject") == 0) {
2317 g_free (bonobo_object_class);
2318 bonobo_object_class = g_strdup(yyvsp[-2].id);
2320 yyerror(_("parse error"));
2329 if (strcmp (yyvsp[-3].id, "interface") == 0) {
2330 interfaces = g_list_append (interfaces,
2331 g_strdup (yyvsp[-2].id));
2333 yyerror(_("parse error"));
2342 if(strcmp(yyvsp[-3].id,"chunks") == 0) {
2343 g_free (chunk_size);
2344 if(atoi(yyvsp[-2].id) != 0)
2345 chunk_size = g_strdup(yyvsp[-2].id);
2349 yyerror(_("parse error"));
2358 if (strcmp (yyvsp[-4].id, "GladeXML") == 0) {
2360 add_construct_glade(yyvsp[-3].id, yyvsp[-2].id, NULL);
2362 yyerror(_("parse error"));
2371 if (strcmp (yyvsp[-5].id, "GladeXML") == 0) {
2373 add_construct_glade(yyvsp[-4].id, yyvsp[-3].id, yyvsp[-2].id);
2375 yyerror(_("parse error"));
2384 if (strcmp (yyvsp[-4].id, "GladeXML") == 0) {
2386 add_construct_glade(yyvsp[-3].id, yyvsp[-2].id, NULL);
2388 yyerror(_("parse error"));
2397 if (strcmp (yyvsp[-5].id, "GladeXML") == 0) {
2399 add_construct_glade(yyvsp[-4].id, yyvsp[-3].id, yyvsp[-2].id);
2401 yyerror(_("parse error"));
2425 if (strcmp (yyvsp[-1].id, "BonoboObject") != 0) {
2426 g_free (yyvsp[-1].id);
2427 yyerror (_("parse error"));
2430 g_free (yyvsp[-1].id);
2431 last_added_method->bonobo_object_func = TRUE;
2438 if (strcmp (yyvsp[-2].id, "interface") != 0) {
2439 g_free (yyvsp[-2].id);
2440 g_free (yyvsp[-1].id);
2441 yyerror (_("parse error"));
2444 g_free (yyvsp[-2].id);
2445 node_set ((Node *)last_added_method,
2446 "interface:steal", yyvsp[-1].id,
2473 { the_scope = PUBLIC_SCOPE; }
2478 { the_scope = PRIVATE_SCOPE; }
2483 { the_scope = PROTECTED_SCOPE; }
2488 { the_scope = CLASS_SCOPE; }
2494 if (strcmp (yyvsp[-1].id, "destroywith") == 0) {
2495 g_free (yyvsp[-1].id);
2496 destructor_unref = FALSE;
2497 destructor = yyvsp[0].id;
2498 destructor_line = line_no;
2499 destructor_simple = TRUE;
2500 } else if (strcmp (yyvsp[-1].id, "unrefwith") == 0) {
2501 g_free (yyvsp[-1].id);
2502 destructor_unref = TRUE;
2503 destructor = yyvsp[0].id;
2504 destructor_line = line_no;
2505 destructor_simple = TRUE;
2507 g_free (yyvsp[-1].id);
2508 g_free (yyvsp[0].id);
2509 yyerror (_("parse error"));
2518 if (strcmp (yyvsp[-2].id, "destroy") == 0) {
2519 g_free(yyvsp[-2].id);
2520 destructor_unref = FALSE;
2521 destructor = (yyvsp[0].cbuf)->str;
2522 g_string_free(yyvsp[0].cbuf, FALSE);
2523 destructor_line = ccode_line;
2524 destructor_simple = FALSE;
2525 } else if (strcmp (yyvsp[-2].id, "unref") == 0) {
2526 g_free (yyvsp[-2].id);
2527 destructor_unref = TRUE;
2528 destructor = (yyvsp[0].cbuf)->str;
2529 g_string_free (yyvsp[0].cbuf, FALSE);
2530 destructor_line = ccode_line;
2531 destructor_simple = FALSE;
2533 g_free (yyvsp[-2].id);
2534 g_string_free (yyvsp[0].cbuf, TRUE);
2535 yyerror (_("parse error"));
2544 initializer = yyvsp[0].id;
2545 initializer_line = ccode_line;
2552 initializer = (yyvsp[0].cbuf)->str;
2553 initializer_line = ccode_line;
2554 g_string_free(yyvsp[0].cbuf, FALSE);
2570 { destructor = NULL; }
2575 { initializer = NULL; }
2581 if (strcmp (yyvsp[0].id, "GladeXML") == 0) {
2582 glade_widget = TRUE;
2584 yyerror(_("parse error"));
2601 push_variable(yyvsp[-2].id, the_scope,yyvsp[-4].line, NULL);
2608 push_variable(yyvsp[-3].id, the_scope, yyvsp[-5].line, yyvsp[-2].id);
2616 if(strcmp(yyvsp[-6].id,"get")==0 &&
2617 strcmp(yyvsp[-3].id,"set")==0) {
2618 Type *type = pop_type();
2619 g_free (yyvsp[-6].id);
2620 g_free (yyvsp[-3].id);
2621 node = node_new (ARGUMENT_NODE,
2622 "gtktype:steal", yyvsp[-9].id,
2623 "atype:steal", type,
2624 "flags:steal", yyvsp[-10].list,
2625 "name:steal", yyvsp[-8].id,
2626 "get:steal", (yyvsp[-4].cbuf)->str,
2627 "get_line", yyvsp[-5].line,
2628 "set:steal", (yyvsp[-1].cbuf)->str,
2629 "set_line", yyvsp[-2].line,
2630 "line_no", yyvsp[-11].line,
2633 class_nodes = g_list_append(class_nodes,node);
2635 g_string_free (yyvsp[-4].cbuf, FALSE);
2636 g_string_free (yyvsp[-1].cbuf, FALSE);
2638 } else if(strcmp(yyvsp[-6].id,"set")==0 &&
2639 strcmp(yyvsp[-3].id,"get")==0) {
2640 Type *type = pop_type();
2641 g_free (yyvsp[-6].id);
2642 g_free (yyvsp[-3].id);
2643 node = node_new (ARGUMENT_NODE,
2644 "gtktype:steal", yyvsp[-9].id,
2645 "atype:steal", type,
2646 "flags:steal", yyvsp[-10].list,
2647 "name:steal", yyvsp[-8].id,
2648 "get:steal", (yyvsp[-1].cbuf)->str,
2649 "get_line", yyvsp[-2].line,
2650 "set:steal", (yyvsp[-4].cbuf)->str,
2651 "set_line", yyvsp[-5].line,
2652 "line_no", yyvsp[-11].line,
2654 g_string_free (yyvsp[-1].cbuf, FALSE);
2655 g_string_free (yyvsp[-4].cbuf, FALSE);
2656 class_nodes = g_list_append(class_nodes,node);
2658 g_free (yyvsp[-9].id);
2659 g_free (yyvsp[-8].id);
2660 g_free (yyvsp[-6].id);
2661 g_free (yyvsp[-3].id);
2662 g_list_foreach (yyvsp[-10].list, (GFunc)g_free, NULL);
2663 g_list_free (yyvsp[-10].list);
2664 g_string_free (yyvsp[-1].cbuf, TRUE);
2665 g_string_free (yyvsp[-4].cbuf, TRUE);
2666 yyerror (_("parse error"));
2670 if (yyvsp[-7].id != NULL) {
2671 Argument *arg = (Argument *)node;
2672 export_accessors (arg->name,
2673 arg->get != NULL, arg->get_line,
2674 arg->set != NULL, arg->set_line,
2678 g_free (yyvsp[-7].id);
2685 #line 1049 "parse.y"
2688 if(strcmp(yyvsp[-3].id, "get") == 0) {
2689 Type *type = pop_type();
2690 g_free (yyvsp[-3].id);
2691 node = node_new (ARGUMENT_NODE,
2692 "gtktype:steal", yyvsp[-6].id,
2693 "atype:steal", type,
2694 "flags:steal", yyvsp[-7].list,
2695 "name:steal", yyvsp[-5].id,
2696 "get:steal", (yyvsp[-1].cbuf)->str,
2697 "get_line", yyvsp[-2].line,
2698 "line_no", yyvsp[-8].line,
2701 g_string_free (yyvsp[-1].cbuf, FALSE);
2702 class_nodes = g_list_append(class_nodes, node);
2703 } else if(strcmp(yyvsp[-3].id, "set") == 0) {
2704 Type *type = pop_type();
2705 g_free (yyvsp[-3].id);
2706 node = node_new (ARGUMENT_NODE,
2707 "gtktype:steal", yyvsp[-6].id,
2708 "atype:steal", type,
2709 "flags:steal", yyvsp[-7].list,
2710 "name:steal", yyvsp[-5].id,
2711 "set:steal", (yyvsp[-1].cbuf)->str,
2712 "set_line", yyvsp[-2].line,
2713 "line_no", yyvsp[-8].line,
2716 g_string_free (yyvsp[-1].cbuf, FALSE);
2717 class_nodes = g_list_append (class_nodes, node);
2719 g_free (yyvsp[-3].id);
2720 g_free (yyvsp[-6].id);
2721 g_free (yyvsp[-5].id);
2722 g_list_foreach (yyvsp[-7].list, (GFunc)g_free, NULL);
2723 g_list_free (yyvsp[-7].list);
2724 g_string_free (yyvsp[-1].cbuf, TRUE);
2725 yyerror(_("parse error"));
2729 if (yyvsp[-4].id != NULL) {
2730 Argument *arg = (Argument *)node;
2731 export_accessors (arg->name,
2732 arg->get != NULL, arg->get_line,
2733 arg->set != NULL, arg->set_line,
2737 g_free (yyvsp[-4].id);
2743 #line 1103 "parse.y"
2746 char *get, *set = NULL;
2751 if(strcmp(yyvsp[0].id, "link")!=0 &&
2752 strcmp(yyvsp[0].id, "stringlink")!=0 &&
2753 strcmp(yyvsp[0].id, "objectlink")!=0) {
2754 g_free(yyvsp[0].id);
2755 g_free(yyvsp[-3].id);
2756 g_free(yyvsp[-2].id);
2757 g_list_foreach(yyvsp[-4].list,(GFunc)g_free,NULL);
2758 g_list_free(yyvsp[-4].list);
2759 yyerror(_("parse error"));
2765 var = find_var_or_die(yyvsp[-2].id, yyvsp[-5].line);
2766 if(var->scope == PRIVATE_SCOPE) {
2767 root = "self->_priv";
2768 } else if(var->scope == CLASS_SCOPE) {
2769 root = "SELF_GET_CLASS(self)";
2771 error_print(GOB_ERROR, yyvsp[-5].line,
2772 _("Self aliases needed when autolinking to a classwide member"));
2777 if(strcmp(yyvsp[0].id, "link")==0) {
2778 set = g_strdup_printf("%s->%s = ARG;",
2779 root, yyvsp[-2].id);
2780 } else if(strcmp(yyvsp[0].id, "stringlink")==0) {
2781 set = g_strdup_printf("g_free (%s->%s); "
2782 "%s->%s = g_strdup (ARG);",
2784 root, yyvsp[-2].id);
2785 } else if(strcmp(yyvsp[0].id, "objectlink")==0) {
2786 set = g_strdup_printf(
2788 "g_object_ref (G_OBJECT (ARG)); "
2789 "if (%s->%s != NULL) "
2790 "g_object_unref (G_OBJECT (%s->%s)); "
2794 root, yyvsp[-2].id);
2796 g_assert_not_reached();
2799 get = g_strdup_printf("ARG = %s->%s;", root, yyvsp[-2].id);
2801 g_free (yyvsp[0].id);
2804 type = (Type *)node_copy ((Node *)var->vtype);
2806 node = node_new (ARGUMENT_NODE,
2807 "gtktype:steal", yyvsp[-3].id,
2808 "atype:steal", type,
2809 "flags:steal", yyvsp[-4].list,
2810 "name:steal", yyvsp[-2].id,
2812 "get_line", yyvsp[-5].line,
2814 "set_line", yyvsp[-5].line,
2815 "line_no", yyvsp[-5].line,
2818 if (yyvsp[-1].id != NULL) {
2819 Argument *arg = (Argument *)node;
2820 export_accessors (arg->name,
2821 arg->get != NULL, arg->get_line,
2822 arg->set != NULL, arg->set_line,
2826 g_free (yyvsp[-1].id);
2829 class_nodes = g_list_append (class_nodes, node);
2834 #line 1192 "parse.y"
2836 if (strcmp (yyvsp[-1].id, "export")!=0) {
2837 g_free (yyvsp[-1].id);
2838 yyerror (_("parse error"));
2841 yyval.id = yyvsp[-1].id;
2846 #line 1200 "parse.y"
2853 #line 1205 "parse.y"
2856 node_set ((Node *)property,
2857 "line_no", yyvsp[-10].line,
2858 "gtktype:steal", debool (yyvsp[-9].id),
2859 "name:steal", yyvsp[-8].id,
2861 if (strcmp (yyvsp[-6].id, "get") == 0 &&
2862 strcmp (yyvsp[-3].id, "set") == 0) {
2863 node_set ((Node *)property,
2864 "get:steal", (yyvsp[-4].cbuf)->str,
2865 "get_line", yyvsp[-5].line,
2866 "set:steal", (yyvsp[-1].cbuf)->str,
2867 "set_line", yyvsp[-2].line,
2869 g_string_free (yyvsp[-4].cbuf, FALSE);
2870 g_string_free (yyvsp[-1].cbuf, FALSE);
2871 g_free (yyvsp[-6].id);
2872 g_free (yyvsp[-3].id);
2873 } else if (strcmp (yyvsp[-6].id, "set") == 0 &&
2874 strcmp (yyvsp[-3].id, "get") == 0) {
2875 node_set ((Node *)property,
2876 "get:steal", (yyvsp[-1].cbuf)->str,
2877 "get_line", yyvsp[-2].line,
2878 "set:steal", (yyvsp[-4].cbuf)->str,
2879 "set_line", yyvsp[-5].line,
2881 g_string_free (yyvsp[-4].cbuf, FALSE);
2882 g_string_free (yyvsp[-1].cbuf, FALSE);
2883 g_free (yyvsp[-6].id);
2884 g_free (yyvsp[-3].id);
2886 g_string_free (yyvsp[-4].cbuf, TRUE);
2887 g_string_free (yyvsp[-1].cbuf, TRUE);
2888 g_free (yyvsp[-6].id);
2889 g_free (yyvsp[-3].id);
2890 node_free ((Node *)property);
2892 yyerror (_("parse error"));
2895 property_link_and_export ((Node *)property);
2896 if (property != NULL) {
2897 class_nodes = g_list_append (class_nodes,
2905 #line 1253 "parse.y"
2908 node_set ((Node *)property,
2909 "line_no", yyvsp[-7].line,
2910 "gtktype:steal", debool (yyvsp[-6].id),
2911 "name:steal", yyvsp[-5].id,
2913 if (strcmp (yyvsp[-3].id, "get") == 0) {
2914 node_set ((Node *)property,
2915 "get:steal", (yyvsp[-1].cbuf)->str,
2916 "get_line", yyvsp[-2].line,
2918 g_string_free (yyvsp[-1].cbuf, FALSE);
2919 g_free (yyvsp[-3].id);
2920 } else if (strcmp (yyvsp[-3].id, "set") == 0) {
2921 node_set ((Node *)property,
2922 "set:steal", (yyvsp[-1].cbuf)->str,
2923 "set_line", yyvsp[-2].line,
2925 g_string_free (yyvsp[-1].cbuf, FALSE);
2926 g_free (yyvsp[-3].id);
2928 g_string_free (yyvsp[-1].cbuf, TRUE);
2929 g_free (yyvsp[-3].id);
2930 node_free ((Node *)property);
2932 yyerror (_("parse error"));
2935 property_link_and_export ((Node *)property);
2936 if (property != NULL) {
2937 class_nodes = g_list_append (class_nodes,
2945 #line 1289 "parse.y"
2948 node_set ((Node *)property,
2949 "line_no", yyvsp[-4].line,
2950 "gtktype:steal", debool (yyvsp[-3].id),
2951 "name:steal", yyvsp[-2].id,
2953 property_link_and_export ((Node *)property);
2954 if (property != NULL) {
2955 class_nodes = g_list_append (class_nodes,
2963 #line 1305 "parse.y"
2968 #line 1306 "parse.y"
2973 #line 1309 "parse.y"
2978 #line 1310 "parse.y"
2983 #line 1313 "parse.y"
2984 { yyval.id = yyvsp[0].id; }
2988 #line 1314 "parse.y"
2990 if (strcmp (yyvsp[-3].id, "_") != 0) {
2991 g_free (yyvsp[-3].id);
2992 yyerror(_("parse error"));
2995 g_free (yyvsp[-3].id);
2996 yyval.id = g_strconcat ("_(", yyvsp[-1].id, ")", NULL);
2997 g_free (yyvsp[-1].id);
3002 #line 1326 "parse.y"
3003 { yyval.id = yyvsp[0].id; }
3007 #line 1327 "parse.y"
3008 { yyval.id = yyvsp[0].id; }
3012 #line 1330 "parse.y"
3015 node_set ((Node *)property,
3016 "nick:steal", yyvsp[0].id,
3022 #line 1336 "parse.y"
3025 node_set ((Node *)property,
3026 "blurb:steal", yyvsp[0].id,
3032 #line 1342 "parse.y"
3035 node_set ((Node *)property,
3036 "maximum:steal", yyvsp[0].id,
3042 #line 1348 "parse.y"
3045 node_set ((Node *)property,
3046 "minimum:steal", yyvsp[0].id,
3052 #line 1354 "parse.y"
3055 node_set ((Node *)property,
3056 "default_value:steal", yyvsp[0].id,
3062 #line 1360 "parse.y"
3065 node_set ((Node *)property,
3066 "flags:steal", yyvsp[0].list,
3072 #line 1366 "parse.y"
3074 Type *type = pop_type ();
3076 node_set ((Node *)property,
3077 "ptype:steal", type,
3083 #line 1373 "parse.y"
3086 node_set ((Node *)property,
3087 "extra_gtktype:steal", yyvsp[0].id,
3093 #line 1379 "parse.y"
3096 node_set ((Node *)property,
3097 "extra_gtktype:steal", yyvsp[0].id,
3103 #line 1385 "parse.y"
3106 node_set ((Node *)property,
3107 "extra_gtktype:steal", yyvsp[0].id,
3113 #line 1391 "parse.y"
3116 node_set ((Node *)property,
3117 "extra_gtktype:steal", yyvsp[0].id,
3123 #line 1397 "parse.y"
3126 node_set ((Node *)property,
3127 "extra_gtktype:steal", yyvsp[0].id,
3133 #line 1403 "parse.y"
3136 node_set ((Node *)property,
3137 "extra_gtktype:steal", yyvsp[0].id,
3143 #line 1409 "parse.y"
3146 node_set ((Node *)property,
3147 "extra_gtktype:steal", yyvsp[0].id,
3153 #line 1415 "parse.y"
3156 node_set ((Node *)property,
3157 "extra_gtktype:steal", yyvsp[0].id,
3163 #line 1421 "parse.y"
3166 node_set ((Node *)property,
3167 "extra_gtktype:steal", yyvsp[0].id,
3173 #line 1427 "parse.y"
3176 node_set ((Node *)property,
3177 "extra_gtktype:steal", yyvsp[0].id,
3183 #line 1433 "parse.y"
3186 if (strcmp (yyvsp[0].id, "override") == 0) {
3187 g_free(yyvsp[0].id);
3188 node_set ((Node *)property,
3191 } else if (strcmp (yyvsp[0].id, "link") == 0) {
3192 g_free(yyvsp[0].id);
3193 node_set ((Node *)property,
3196 } else if (strcmp (yyvsp[0].id, "export") == 0) {
3197 g_free(yyvsp[0].id);
3198 node_set ((Node *)property,
3202 g_free(yyvsp[0].id);
3203 yyerror(_("parse error"));
3210 #line 1458 "parse.y"
3212 if(strcmp(yyvsp[-2].id,"type")!=0) {
3213 g_free(yyvsp[-4].id);
3214 g_free(yyvsp[-2].id);
3215 yyerror(_("parse error"));
3218 yyval.id = debool (yyvsp[-4].id);
3223 #line 1467 "parse.y"
3225 yyval.id = debool (yyvsp[0].id);
3226 typestack = g_list_prepend(typestack,NULL);
3231 #line 1473 "parse.y"
3232 { yyval.list = yyvsp[-1].list; }
3236 #line 1474 "parse.y"
3237 { yyval.list = NULL; }
3241 #line 1477 "parse.y"
3243 yyval.list = g_list_append(yyvsp[0].list,yyvsp[-2].id);
3248 #line 1480 "parse.y"
3250 yyval.list = g_list_append(NULL,yyvsp[0].id);
3255 #line 1486 "parse.y"
3257 Node *node = node_new (TYPE_NODE,
3258 "name:steal", yyvsp[-1].id,
3259 "pointer:steal", yyvsp[0].id,
3261 typestack = g_list_prepend(typestack,node);
3266 #line 1493 "parse.y"
3268 Node *node = node_new (TYPE_NODE,
3269 "name:steal", yyvsp[0].id,
3271 typestack = g_list_prepend(typestack,node);
3276 #line 1502 "parse.y"
3278 yyval.id = yyvsp[0].id;
3283 #line 1505 "parse.y"
3285 yyval.id = yyvsp[0].id;
3290 #line 1508 "parse.y"
3292 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
3293 g_free(yyvsp[0].id);
3298 #line 1512 "parse.y"
3300 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3301 g_free(yyvsp[-1].id);
3306 #line 1516 "parse.y"
3308 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3309 g_free(yyvsp[0].id);
3314 #line 1520 "parse.y"
3316 yyval.id = g_strconcat("const ", yyvsp[-1].id, " ",
3318 g_free(yyvsp[0].id);
3323 #line 1525 "parse.y"
3325 yyval.id = g_strconcat(yyvsp[-2].id, " ",
3326 yyvsp[-1].id, " const", NULL);
3327 g_free(yyvsp[-1].id);
3332 #line 1533 "parse.y"
3334 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3335 g_free(yyvsp[0].id);
3340 #line 1537 "parse.y"
3342 yyval.id = g_strconcat(yyvsp[-1].id, " ", yyvsp[0].id, NULL);
3343 g_free(yyvsp[-1].id);
3344 g_free(yyvsp[0].id);
3349 #line 1542 "parse.y"
3351 yyval.id = g_strconcat("const ", yyvsp[0].id, NULL);
3352 g_free(yyvsp[0].id);
3357 #line 1546 "parse.y"
3359 yyval.id = yyvsp[0].id;
3364 #line 1549 "parse.y"
3366 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3367 g_free(yyvsp[-1].id);
3372 #line 1553 "parse.y"
3374 yyval.id = g_strdup(yyvsp[0].id);
3379 #line 1556 "parse.y"
3381 yyval.id = g_strconcat(yyvsp[-1].id, " const", NULL);
3386 #line 1561 "parse.y"
3387 { yyval.id = "void"; }
3391 #line 1562 "parse.y"
3392 { yyval.id = "char"; }
3396 #line 1563 "parse.y"
3397 { yyval.id = "short"; }
3401 #line 1564 "parse.y"
3402 { yyval.id = "int"; }
3406 #line 1565 "parse.y"
3407 { yyval.id = "long"; }
3411 #line 1566 "parse.y"
3412 { yyval.id = "float"; }
3416 #line 1567 "parse.y"
3417 { yyval.id = "double"; }
3421 #line 1568 "parse.y"
3422 { yyval.id = "signed"; }
3426 #line 1569 "parse.y"
3427 { yyval.id = "unsigned"; }
3431 #line 1572 "parse.y"
3432 { yyval.id = "struct"; }
3436 #line 1573 "parse.y"
3437 { yyval.id = "union"; }
3441 #line 1574 "parse.y"
3442 { yyval.id = "enum"; }
3446 #line 1577 "parse.y"
3447 { yyval.id = g_strdup("*"); }
3451 #line 1578 "parse.y"
3452 { yyval.id = g_strdup("* const"); }
3456 #line 1579 "parse.y"
3458 yyval.id = g_strconcat("*", yyvsp[0].id, NULL);
3459 g_free(yyvsp[0].id);
3464 #line 1583 "parse.y"
3466 yyval.id = g_strconcat("* const", yyvsp[0].id, NULL);
3467 g_free(yyvsp[0].id);
3472 #line 1590 "parse.y"
3474 if(strcmp(yyvsp[-1].id, "first")==0)
3475 yyval.sigtype = SIGNAL_FIRST_METHOD;
3476 else if(strcmp(yyvsp[-1].id, "last")==0)
3477 yyval.sigtype = SIGNAL_LAST_METHOD;
3479 yyerror(_("signal must be 'first' or 'last'"));
3480 g_free(yyvsp[-1].id);
3483 g_free(yyvsp[-1].id);
3488 #line 1602 "parse.y"
3490 yyval.sigtype = SIGNAL_LAST_METHOD;
3495 #line 1608 "parse.y"
3497 if(strcmp(yyvsp[-1].id,"first")==0)
3498 yyval.sigtype = SIGNAL_FIRST_METHOD;
3499 else if(strcmp(yyvsp[-1].id,"last")==0)
3500 yyval.sigtype = SIGNAL_LAST_METHOD;
3502 yyerror(_("signal must be 'first' or 'last'"));
3503 g_free(yyvsp[-1].id);
3506 g_free(yyvsp[-1].id);
3511 #line 1620 "parse.y"
3513 if(strcmp(yyvsp[-2].id,"first")==0)
3514 yyval.sigtype = SIGNAL_FIRST_METHOD;
3515 else if(strcmp(yyvsp[-2].id,"last")==0)
3516 yyval.sigtype = SIGNAL_LAST_METHOD;
3518 yyerror(_("signal must be 'first' or 'last'"));
3519 g_free(yyvsp[-2].id);
3522 g_free(yyvsp[-2].id);
3527 #line 1632 "parse.y"
3529 yyval.sigtype = SIGNAL_LAST_METHOD;
3534 #line 1635 "parse.y"
3536 /* the_scope was default thus public */
3537 the_scope = PUBLIC_SCOPE;
3542 #line 1641 "parse.y"
3544 gtktypes = g_list_prepend(gtktypes, debool (yyvsp[-3].id));
3549 #line 1646 "parse.y"
3551 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3556 #line 1649 "parse.y"
3558 gtktypes = g_list_append(gtktypes, debool (yyvsp[0].id));
3563 #line 1654 "parse.y"
3564 { yyval.cbuf = yyvsp[0].cbuf; }
3568 #line 1655 "parse.y"
3569 { yyval.cbuf = NULL; }
3573 #line 1659 "parse.y"
3576 yyerror(_("signal without 'self' as "
3577 "first parameter"));
3578 free_all_global_state();
3581 if(the_scope == CLASS_SCOPE) {
3582 yyerror(_("a method cannot be of class scope"));
3583 free_all_global_state();
3586 push_function(the_scope, yyvsp[-7].sigtype,NULL,
3587 yyvsp[-5].id, yyvsp[0].cbuf,yyvsp[-9].line,
3588 ccode_line, vararg, yyvsp[-8].list);
3593 #line 1675 "parse.y"
3596 yyerror(_("signal without 'self' as "
3597 "first parameter"));
3598 free_all_global_state();
3601 if(the_scope == CLASS_SCOPE) {
3602 yyerror(_("a method cannot be of class scope"));
3603 free_all_global_state();
3606 push_function(the_scope, yyvsp[-7].sigtype, NULL,
3607 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-9].line,
3608 ccode_line, vararg, yyvsp[-8].list);
3613 #line 1691 "parse.y"
3616 yyerror(_("virtual method without 'self' as "
3617 "first parameter"));
3618 free_all_global_state();
3621 if(the_scope == CLASS_SCOPE) {
3622 yyerror(_("a method cannot be of class scope"));
3623 free_all_global_state();
3626 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3627 yyvsp[0].cbuf, yyvsp[-8].line,
3628 ccode_line, vararg, NULL);
3633 #line 1707 "parse.y"
3636 yyerror(_("virtual method without 'self' as "
3637 "first parameter"));
3638 free_all_global_state();
3641 if(the_scope == CLASS_SCOPE) {
3642 yyerror(_("a method cannot be of class scope"));
3643 free_all_global_state();
3646 push_function(the_scope, VIRTUAL_METHOD, NULL, yyvsp[-5].id,
3647 yyvsp[0].cbuf, yyvsp[-7].line,
3648 ccode_line, vararg, NULL);
3653 #line 1723 "parse.y"
3656 yyerror(_("virtual method without 'self' as "
3657 "first parameter"));
3658 free_all_global_state();
3661 push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL,
3662 yyvsp[-5].id, yyvsp[0].cbuf, yyvsp[-7].line,
3663 ccode_line, vararg, NULL);
3668 #line 1734 "parse.y"
3670 push_function(NO_SCOPE, OVERRIDE_METHOD, yyvsp[-8].id,
3671 yyvsp[-5].id, yyvsp[0].cbuf,
3672 yyvsp[-10].line, ccode_line,
3678 #line 1740 "parse.y"
3680 if(the_scope == CLASS_SCOPE) {
3681 yyerror(_("a method cannot be of class scope"));
3682 free_all_global_state();
3685 push_function(the_scope, REGULAR_METHOD, NULL, yyvsp[-5].id,
3686 yyvsp[0].cbuf, yyvsp[-7].line, ccode_line,
3692 #line 1750 "parse.y"
3694 if(strcmp(yyvsp[-4].id, "init")==0) {
3695 push_init_arg(yyvsp[-2].id,FALSE);
3696 push_function(NO_SCOPE, INIT_METHOD, NULL,
3697 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3698 ccode_line, FALSE, NULL);
3699 } else if(strcmp(yyvsp[-4].id, "class_init")==0) {
3700 push_init_arg(yyvsp[-2].id,TRUE);
3701 push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL,
3702 yyvsp[-4].id, yyvsp[0].cbuf, yyvsp[-3].line,
3703 ccode_line, FALSE, NULL);
3705 g_free(yyvsp[-4].id);
3706 g_free(yyvsp[-2].id);
3707 g_string_free(yyvsp[0].cbuf,TRUE);
3708 yyerror(_("parse error "
3709 "(untyped blocks must be init or "
3717 #line 1773 "parse.y"
3719 g_free(onerror); onerror = NULL;
3720 g_free(defreturn); defreturn = NULL;
3721 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3722 g_free(yyvsp[-1].id);
3723 g_free(yyvsp[0].id);
3724 yyerror(_("parse error"));
3727 g_free(yyvsp[-1].id);
3732 #line 1784 "parse.y"
3734 g_free(onerror); onerror = NULL;
3735 g_free(defreturn); defreturn = NULL;
3736 if(!set_return_value(yyvsp[-3].id, yyvsp[-2].id)) {
3737 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3738 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3739 yyerror(_("parse error"));
3742 if(!set_return_value(yyvsp[-1].id, yyvsp[0].id)) {
3743 onerror = defreturn = NULL;
3744 g_free(yyvsp[-3].id); g_free(yyvsp[-2].id);
3745 g_free(yyvsp[-1].id); g_free(yyvsp[0].id);
3746 yyerror(_("parse error"));
3749 g_free(yyvsp[-3].id);
3750 g_free(yyvsp[-1].id);
3755 #line 1803 "parse.y"
3757 g_free(onerror); onerror = NULL;
3758 g_free(defreturn); defreturn = NULL;
3763 #line 1809 "parse.y"
3764 { yyval.id = yyvsp[0].id; }
3768 #line 1810 "parse.y"
3770 yyval.id = (yyvsp[0].cbuf)->str;
3771 g_string_free(yyvsp[0].cbuf, FALSE);
3776 #line 1816 "parse.y"
3777 { vararg = FALSE; has_self = FALSE; }
3781 #line 1817 "parse.y"
3785 if(strcmp(yyvsp[0].id,"self")==0)
3786 push_self(yyvsp[0].id, FALSE);
3788 g_free(yyvsp[0].id);
3789 yyerror(_("parse error"));
3796 #line 1828 "parse.y"
3800 if(strcmp(yyvsp[-1].id,"self")==0)
3801 push_self(yyvsp[-1].id, TRUE);
3803 g_free(yyvsp[-1].id);
3804 yyerror(_("parse error"));
3811 #line 1839 "parse.y"
3815 if(strcmp(yyvsp[0].id,"self")==0)
3816 push_self(yyvsp[0].id, TRUE);
3818 g_free(yyvsp[0].id);
3819 yyerror(_("parse error"));
3826 #line 1850 "parse.y"
3829 if(strcmp(yyvsp[-2].id,"self")==0)
3830 push_self(yyvsp[-2].id, FALSE);
3832 g_free(yyvsp[-2].id);
3833 yyerror(_("parse error"));
3840 #line 1860 "parse.y"
3843 if(strcmp(yyvsp[-3].id,"self")==0)
3844 push_self(yyvsp[-3].id, TRUE);
3846 g_free(yyvsp[-3].id);
3847 yyerror(_("parse error"));
3854 #line 1870 "parse.y"
3857 if(strcmp(yyvsp[-2].id,"self")==0)
3858 push_self(yyvsp[-2].id, TRUE);
3860 g_free(yyvsp[-2].id);
3861 yyerror(_("parse error"));
3868 #line 1880 "parse.y"
3869 { has_self = FALSE; }
3873 #line 1883 "parse.y"
3878 #line 1884 "parse.y"
3883 #line 1887 "parse.y"
3888 #line 1888 "parse.y"
3893 #line 1891 "parse.y"
3895 push_funcarg(yyvsp[0].id,NULL);
3900 #line 1894 "parse.y"
3902 push_funcarg(yyvsp[-1].id,yyvsp[0].id);
3907 #line 1897 "parse.y"
3909 if(strcmp(yyvsp[-2].id,"check")!=0) {
3910 yyerror(_("parse error"));
3913 g_free(yyvsp[-2].id);
3914 push_funcarg(yyvsp[-4].id,NULL);
3919 #line 1905 "parse.y"
3921 if(strcmp(yyvsp[-2].id,"check")!=0) {
3922 yyerror(_("parse error"));
3925 g_free(yyvsp[-2].id);
3926 push_funcarg(yyvsp[-5].id,yyvsp[-4].id);
3931 #line 1915 "parse.y"
3936 #line 1916 "parse.y"
3941 #line 1919 "parse.y"
3943 if(strcmp(yyvsp[0].id,"type")==0) {
3944 Node *node = node_new (CHECK_NODE,
3945 "chtype", TYPE_CHECK,
3947 checks = g_list_append(checks,node);
3948 } else if(strcmp(yyvsp[0].id,"null")==0) {
3949 Node *node = node_new (CHECK_NODE,
3950 "chtype", NULL_CHECK,
3952 checks = g_list_append(checks,node);
3954 yyerror(_("parse error"));
3957 g_free(yyvsp[0].id);
3962 #line 1936 "parse.y"
3964 Node *node = node_new (CHECK_NODE,
3966 "number:steal", yyvsp[0].id,
3968 checks = g_list_append(checks,node);
3973 #line 1943 "parse.y"
3975 Node *node = node_new (CHECK_NODE,
3977 "number:steal", yyvsp[0].id,
3979 checks = g_list_append(checks,node);
3984 #line 1950 "parse.y"
3986 Node *node = node_new (CHECK_NODE,
3988 "number:steal", yyvsp[0].id,
3990 checks = g_list_append(checks,node);
3995 #line 1957 "parse.y"
3997 Node *node = node_new (CHECK_NODE,
3999 "number:steal", yyvsp[0].id,
4001 checks = g_list_append(checks,node);
4006 #line 1964 "parse.y"
4008 Node *node = node_new (CHECK_NODE,
4010 "number:steal", yyvsp[0].id,
4012 checks = g_list_append(checks,node);
4017 #line 1971 "parse.y"
4019 Node *node = node_new (CHECK_NODE,
4021 "number:steal", yyvsp[0].id,
4023 checks = g_list_append(checks,node);
4028 #line 1980 "parse.y"
4030 Node *node = node_new (ENUMDEF_NODE,
4031 "etype:steal", yyvsp[-1].id,
4032 "prefix:steal", yyvsp[-5].id,
4033 "values:steal", enum_vals,
4036 nodes = g_list_append (nodes, node);
4041 #line 1989 "parse.y"
4043 Node *node = node_new (ENUMDEF_NODE,
4044 "etype:steal", yyvsp[-1].id,
4045 "prefix:steal", yyvsp[-6].id,
4046 "values:steal", enum_vals,
4049 nodes = g_list_append (nodes, node);
4054 #line 2000 "parse.y"
4059 #line 2001 "parse.y"
4064 #line 2004 "parse.y"
4067 char *num = yyvsp[0].id;
4069 /* A float value, that's a bad enum */
4070 if (num[0] >= '0' &&
4072 strchr (num, '.') != NULL) {
4073 g_free (yyvsp[-2].id);
4075 yyerror(_("parse error (enumerator value not integer constant)"));
4079 node = node_new (ENUMVALUE_NODE,
4080 "name:steal", yyvsp[-2].id,
4083 enum_vals = g_list_append (enum_vals, node);
4088 #line 2024 "parse.y"
4092 node = node_new (ENUMVALUE_NODE,
4093 "name:steal", yyvsp[0].id,
4095 enum_vals = g_list_append (enum_vals, node);
4100 #line 2034 "parse.y"
4102 Node *node = node_new (FLAGS_NODE,
4103 "ftype:steal", yyvsp[-1].id,
4104 "prefix:steal", yyvsp[-5].id,
4105 "values:steal", flag_vals,
4108 nodes = g_list_append (nodes, node);
4113 #line 2043 "parse.y"
4115 Node *node = node_new (FLAGS_NODE,
4116 "ftype:steal", yyvsp[-1].id,
4117 "prefix:steal", yyvsp[-6].id,
4118 "values:steal", flag_vals,
4121 nodes = g_list_append (nodes, node);
4126 #line 2054 "parse.y"
4128 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
4133 #line 2057 "parse.y"
4135 flag_vals = g_list_append (flag_vals, yyvsp[0].id);
4140 #line 2062 "parse.y"
4142 Node *node = node_new (ERROR_NODE,
4143 "etype:steal", yyvsp[-1].id,
4144 "prefix:steal", yyvsp[-5].id,
4145 "values:steal", error_vals,
4148 nodes = g_list_append (nodes, node);
4153 #line 2071 "parse.y"
4155 Node *node = node_new (ERROR_NODE,
4156 "etype:steal", yyvsp[-1].id,
4157 "prefix:steal", yyvsp[-6].id,
4158 "values:steal", error_vals,
4161 nodes = g_list_append (nodes, node);
4166 #line 2082 "parse.y"
4168 error_vals = g_list_append (error_vals, yyvsp[0].id);
4173 #line 2085 "parse.y"
4175 error_vals = g_list_append (error_vals, yyvsp[0].id);
4180 #line 2091 "parse.y"
4181 { yyval.id = yyvsp[0].id; }
4185 #line 2092 "parse.y"
4187 yyval.id = g_strconcat("-",yyvsp[0].id,NULL);
4188 g_free(yyvsp[0].id);
4193 #line 2096 "parse.y"
4194 { yyval.id = yyvsp[0].id; }
4198 #line 2097 "parse.y"
4199 { yyval.id = yyvsp[0].id; }
4205 /* Line 1000 of yacc.c. */
4206 #line 4207 "parse.c"
4212 YY_STACK_PRINT (yyss, yyssp);
4217 /* Now `shift' the result of the reduction. Determine what state
4218 that goes to, based on the state we popped back to and the rule
4219 number reduced by. */
4223 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4224 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4225 yystate = yytable[yystate];
4227 yystate = yydefgoto[yyn - YYNTOKENS];
4232 /*------------------------------------.
4233 | yyerrlab -- here on detecting error |
4234 `------------------------------------*/
4236 /* If not already recovering from an error, report this error. */
4241 yyn = yypact[yystate];
4243 if (YYPACT_NINF < yyn && yyn < YYLAST)
4245 YYSIZE_T yysize = 0;
4246 int yytype = YYTRANSLATE (yychar);
4247 const char* yyprefix;
4251 /* Start YYX at -YYN if negative to avoid negative indexes in
4253 int yyxbegin = yyn < 0 ? -yyn : 0;
4255 /* Stay within bounds of both yycheck and yytname. */
4256 int yychecklim = YYLAST - yyn;
4257 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4260 yyprefix = ", expecting ";
4261 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4262 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4264 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
4272 yysize += (sizeof ("syntax error, unexpected ")
4273 + yystrlen (yytname[yytype]));
4274 yymsg = (char *) YYSTACK_ALLOC (yysize);
4277 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
4278 yyp = yystpcpy (yyp, yytname[yytype]);
4282 yyprefix = ", expecting ";
4283 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4284 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4286 yyp = yystpcpy (yyp, yyprefix);
4287 yyp = yystpcpy (yyp, yytname[yyx]);
4292 YYSTACK_FREE (yymsg);
4295 yyerror ("syntax error; also virtual memory exhausted");
4298 #endif /* YYERROR_VERBOSE */
4299 yyerror ("syntax error");
4304 if (yyerrstatus == 3)
4306 /* If just tried and failed to reuse lookahead token after an
4307 error, discard it. */
4309 if (yychar <= YYEOF)
4311 /* If at end of input, pop the error token,
4312 then the rest of the stack, then return failure. */
4313 if (yychar == YYEOF)
4319 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4320 yydestruct (yystos[*yyssp], yyvsp);
4325 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
4326 yydestruct (yytoken, &yylval);
4332 /* Else will try to reuse lookahead token after shifting the error
4337 /*---------------------------------------------------.
4338 | yyerrorlab -- error raised explicitly by YYERROR. |
4339 `---------------------------------------------------*/
4343 /* Pacify GCC when the user code never invokes YYERROR and the label
4344 yyerrorlab therefore never appears in user code. */
4355 /*-------------------------------------------------------------.
4356 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4357 `-------------------------------------------------------------*/
4359 yyerrstatus = 3; /* Each real token shifted decrements this. */
4363 yyn = yypact[yystate];
4364 if (yyn != YYPACT_NINF)
4367 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4375 /* Pop the current state because it cannot handle the error token. */
4379 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
4380 yydestruct (yystos[yystate], yyvsp);
4383 YY_STACK_PRINT (yyss, yyssp);
4389 YYDPRINTF ((stderr, "Shifting error token, "));
4398 /*-------------------------------------.
4399 | yyacceptlab -- YYACCEPT comes here. |
4400 `-------------------------------------*/
4405 /*-----------------------------------.
4406 | yyabortlab -- YYABORT comes here. |
4407 `-----------------------------------*/
4413 /*----------------------------------------------.
4414 | yyoverflowlab -- parser overflow comes here. |
4415 `----------------------------------------------*/
4417 yyerror ("parser stack overflow");
4425 YYSTACK_FREE (yyss);
4431 #line 2100 "parse.y"