4 /* A Bison parser, made by GNU Bison 2.3. */
6 /* Skeleton implementation for Bison's Yacc-like parsers in C
8 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
9 Free Software Foundation, Inc.
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA. */
26 /* As a special exception, you may create a larger work that contains
27 part or all of the Bison parser skeleton and distribute that work
28 under terms of your choice, so long as that work isn't itself a
29 parser generator using the skeleton or a modified version thereof
30 as a parser skeleton. Alternatively, if you modify or redistribute
31 the parser skeleton itself, you may (at your option) remove this
32 special exception, which will cause the skeleton and the resulting
33 Bison output files to be licensed under the GNU General Public
34 License without this special exception.
36 This special exception was added by the Free Software Foundation in
37 version 2.2 of Bison. */
39 /* C LALR(1) parser skeleton written by Richard Stallman, by
40 simplifying the original so-called "semantic" parser. */
42 /* All symbols defined below should begin with yy or YY, to avoid
43 infringing on user name space. This should be done even for local
44 variables, as they might otherwise be expanded by user macros.
45 There are some unavoidable exceptions within include files to
46 define necessary library symbols; they are noted "INFRINGES ON
47 USER NAME SPACE" below. */
49 /* Identify Bison output. */
53 #define YYBISON_VERSION "2.3"
56 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
64 /* Substitute the variable and function names. */
65 #define yyparse _gst_parse_yyparse
66 #define yylex _gst_parse_yylex
67 #define yyerror _gst_parse_yyerror
68 #define yylval _gst_parse_yylval
69 #define yychar _gst_parse_yychar
70 #define yydebug _gst_parse_yydebug
71 #define yynerrs _gst_parse_yynerrs
77 /* Put the tokens into the symbol table, so that GDB and other debuggers
92 #define IDENTIFIER 259
96 #define ASSIGNMENT 263
102 /* Copy the first part of user declarations. */
103 #line 1 "./grammar.y"
105 #include <glib-object.h>
111 #include "../gst_private.h"
112 #include "../gst-i18n-lib.h"
114 #include "../gstconfig.h"
115 #include "../gstparse.h"
116 #include "../gstinfo.h"
117 #include "../gsterror.h"
118 #include "../gsturi.h"
119 #include "../gstutils.h"
120 #include "../gstvalue.h"
121 #include "../gstchildproxy.h"
124 /* All error messages in this file are user-visible and need to be translated.
125 * Don't start the message with a capital, and don't end them with a period,
126 * as they will be presented inside a sentence/error.
129 #define YYERROR_VERBOSE 1
130 #define YYLEX_PARAM scanner
132 typedef void *yyscan_t;
134 int _gst_parse_yylex (void *yylval_param, yyscan_t yyscanner);
135 int _gst_parse_yylex_init (yyscan_t scanner);
136 int _gst_parse_yylex_destroy (yyscan_t scanner);
137 struct yy_buffer_state *_gst_parse_yy_scan_string (char *, yyscan_t);
138 void _gst_parse_yypush_buffer_state (void *new_buffer, yyscan_t yyscanner);
139 void _gst_parse_yypop_buffer_state (yyscan_t yyscanner);
142 #ifdef __GST_PARSE_TRACE
143 static guint __strings;
144 static guint __links;
145 static guint __chains;
147 __gst_parse_strdup (gchar * org)
152 ret = g_strdup (org);
153 /* g_print ("ALLOCATED STR (%3u): %p %s\n", __strings, ret, ret); */
158 __gst_parse_strfree (gchar * str)
161 /* g_print ("FREEING STR (%3u): %p %s\n", __strings - 1, str, str); */
163 g_return_if_fail (__strings > 0);
168 __gst_parse_link_new ()
173 ret = g_new0 (link_t, 1);
174 /* g_print ("ALLOCATED LINK (%3u): %p\n", __links, ret); */
179 __gst_parse_link_free (link_t * data)
182 /* g_print ("FREEING LINK (%3u): %p\n", __links - 1, data); */
184 g_return_if_fail (__links > 0);
189 __gst_parse_chain_new ()
194 ret = g_new0 (chain_t, 1);
195 /* g_print ("ALLOCATED CHAIN (%3u): %p\n", __chains, ret); */
200 __gst_parse_chain_free (chain_t * data)
202 /* g_print ("FREEING CHAIN (%3u): %p\n", __chains - 1, data); */
204 g_return_if_fail (__chains > 0);
208 #endif /* __GST_PARSE_TRACE */
217 /* FIXME: need to connect to "disposed" signal to clean up,
218 * but there is no such signal */
221 /*** define SET_ERROR and ERROR macros/functions */
223 #ifdef G_HAVE_ISO_VARARGS
225 # define SET_ERROR(error, type, ...) \
227 GST_CAT_ERROR (GST_CAT_PIPELINE, __VA_ARGS__); \
228 if ((error) && !*(error)) { \
229 g_set_error ((error), GST_PARSE_ERROR, (type), __VA_ARGS__); \
233 # define ERROR(type, ...) \
234 SET_ERROR (((graph_t *) graph)->error, (type), __VA_ARGS__ )
236 #elif defined(G_HAVE_GNUC_VARARGS)
238 # define SET_ERROR(error, type, args...) \
240 GST_CAT_ERROR (GST_CAT_PIPELINE, args ); \
241 if ((error) && !*(error)) { \
242 g_set_error ((error), GST_PARSE_ERROR, (type), args ); \
246 # define ERROR(type, args...) \
247 SET_ERROR (((graph_t *) graph)->error,(type) , args )
252 SET_ERROR (GError ** error, gint type, const char *format, ...)
256 g_warning ("error while parsing");
261 va_start (varargs, format);
262 string = g_strdup_vprintf (format, varargs);
265 g_set_error (error, GST_PARSE_ERROR, type, string);
272 #endif /* G_HAVE_ISO_VARARGS */
274 /*** define YYPRINTF macro/function if we're debugging */
276 /* bison 1.35 calls this macro with side effects, we need to make sure the
277 side effects work - crappy bison */
279 #ifndef GST_DISABLE_GST_DEBUG
282 # ifdef G_HAVE_ISO_VARARGS
284 /* # define YYFPRINTF(a, ...) GST_CAT_DEBUG (GST_CAT_PIPELINE, __VA_ARGS__) */
285 # define YYFPRINTF(a, ...) \
287 gchar *temp = g_strdup_printf (__VA_ARGS__); \
288 GST_CAT_LOG (GST_CAT_PIPELINE, temp); \
292 # elif defined(G_HAVE_GNUC_VARARGS)
294 # define YYFPRINTF(a, args...) \
296 gchar *temp = g_strdup_printf ( args ); \
297 GST_CAT_LOG (GST_CAT_PIPELINE, temp); \
304 YYPRINTF (const char *format, ...)
309 va_start (varargs, format);
310 temp = g_strdup_vprintf (format, varargs);
311 GST_CAT_LOG (GST_CAT_PIPELINE, "%s", temp);
316 # endif /* G_HAVE_ISO_VARARGS */
318 #endif /* GST_DISABLE_GST_DEBUG */
320 #define GST_BIN_MAKE(res, type, chainval, assign) \
322 chain_t *chain = chainval; \
324 GstBin *bin = (GstBin *) gst_element_factory_make (type, NULL); \
326 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_EMPTY_BIN, \
327 _("specified empty bin \"%s\", not allowed"), type); \
328 g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
329 g_slist_free (assign); \
332 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, \
333 _("no bin \"%s\", skipping"), type); \
334 g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
335 g_slist_free (assign); \
338 for (walk = chain->elements; walk; walk = walk->next ) \
339 gst_bin_add (bin, GST_ELEMENT (walk->data)); \
340 g_slist_free (chain->elements); \
341 chain->elements = g_slist_prepend (NULL, bin); \
343 /* set the properties now */ \
344 for (walk = assign; walk; walk = walk->next) \
345 gst_parse_element_set ((gchar *) walk->data, GST_ELEMENT (bin), graph); \
346 g_slist_free (assign); \
350 #define MAKE_LINK(link, _src, _src_name, _src_pads, _sink, _sink_name, _sink_pads) \
352 link = gst_parse_link_new (); \
354 link->sink = _sink; \
355 link->src_name = _src_name; \
356 link->sink_name = _sink_name; \
357 link->src_pads = _src_pads; \
358 link->sink_pads = _sink_pads; \
362 #define MAKE_REF(link, _src, _pads) \
364 gchar *padname = _src; \
365 GSList *pads = _pads; \
367 while (*padname != '.') padname++; \
370 if (*padname != '\0') \
371 pads = g_slist_prepend (pads, gst_parse_strdup (padname)); \
373 MAKE_LINK (link, NULL, _src, pads, NULL, NULL, NULL); \
377 gst_parse_element_set (gchar * value, GstElement * element, graph_t * graph)
385 /* parse the string, so the property name is null-terminated an pos points
386 to the beginning of the value */
387 while (!g_ascii_isspace (*pos) && (*pos != '='))
394 while (g_ascii_isspace (*pos))
398 while (g_ascii_isspace (*pos))
402 pos[strlen (pos) - 1] = '\0';
404 gst_parse_unescape (pos);
406 if (gst_child_proxy_lookup (GST_OBJECT (element), value, &target, &pspec)) {
407 value_type = G_PARAM_SPEC_VALUE_TYPE (pspec);
408 GST_CAT_LOG (GST_CAT_PIPELINE, "parsing property %s as a %s", pspec->name,
409 g_type_name (value_type));
410 g_value_init (&v, value_type);
411 if (!gst_value_deserialize (&v, pos))
413 g_object_set_property (G_OBJECT (target), pspec->name, &v);
414 gst_object_unref (target);
416 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_PROPERTY,
417 _("no property \"%s\" in element \"%s\""), value,
418 GST_ELEMENT_NAME (element));
422 gst_parse_strfree (value);
428 gst_object_unref (target);
429 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
430 _("could not set property \"%s\" in element \"%s\" to \"%s\""),
431 value, GST_ELEMENT_NAME (element), pos);
435 gst_parse_free_link (link_t * link)
437 gst_parse_strfree (link->src_name);
438 gst_parse_strfree (link->sink_name);
439 g_slist_foreach (link->src_pads, (GFunc) gst_parse_strfree, NULL);
440 g_slist_foreach (link->sink_pads, (GFunc) gst_parse_strfree, NULL);
441 g_slist_free (link->src_pads);
442 g_slist_free (link->sink_pads);
444 gst_caps_unref (link->caps);
445 gst_parse_link_free (link);
449 gst_parse_found_pad (GstElement * src, GstPad * pad, gpointer data)
451 DelayedLink *link = (DelayedLink *) data;
453 GST_CAT_INFO (GST_CAT_PIPELINE, "trying delayed linking %s:%s to %s:%s",
454 GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (link->src_pad),
455 GST_STR_NULL (GST_ELEMENT_NAME (link->sink)),
456 GST_STR_NULL (link->sink_pad));
458 if (gst_element_link_pads_filtered (src, link->src_pad, link->sink,
459 link->sink_pad, link->caps)) {
460 /* do this here, we don't want to get any problems later on when
461 * unlocking states */
462 GST_CAT_DEBUG (GST_CAT_PIPELINE, "delayed linking %s:%s to %s:%s worked",
463 GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (link->src_pad),
464 GST_STR_NULL (GST_ELEMENT_NAME (link->sink)),
465 GST_STR_NULL (link->sink_pad));
466 g_signal_handler_disconnect (src, link->signal_id);
467 g_free (link->src_pad);
468 g_free (link->sink_pad);
470 gst_caps_unref (link->caps);
475 /* both padnames and the caps may be NULL */
477 gst_parse_perform_delayed_link (GstElement * src, const gchar * src_pad,
478 GstElement * sink, const gchar * sink_pad, GstCaps * caps)
481 gst_element_class_get_pad_template_list (GST_ELEMENT_GET_CLASS (src));
483 for (; templs; templs = templs->next) {
484 GstPadTemplate *templ = (GstPadTemplate *) templs->data;
486 if ((GST_PAD_TEMPLATE_DIRECTION (templ) == GST_PAD_SRC) &&
487 (GST_PAD_TEMPLATE_PRESENCE (templ) == GST_PAD_SOMETIMES)) {
488 DelayedLink *data = g_new (DelayedLink, 1);
490 /* TODO: maybe we should check if src_pad matches this template's names */
492 GST_CAT_DEBUG (GST_CAT_PIPELINE, "trying delayed link %s:%s to %s:%s",
493 GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (src_pad),
494 GST_STR_NULL (GST_ELEMENT_NAME (sink)), GST_STR_NULL (sink_pad));
496 data->src_pad = g_strdup (src_pad);
498 data->sink_pad = g_strdup (sink_pad);
500 data->caps = gst_caps_copy (caps);
504 data->signal_id = g_signal_connect (G_OBJECT (src), "pad-added",
505 G_CALLBACK (gst_parse_found_pad), data);
513 * performs a link and frees the struct. src and sink elements must be given
514 * return values 0 - link performed
519 gst_parse_perform_link (link_t * link, graph_t * graph)
521 GstElement *src = link->src;
522 GstElement *sink = link->sink;
523 GSList *srcs = link->src_pads;
524 GSList *sinks = link->sink_pads;
526 g_assert (GST_IS_ELEMENT (src));
527 g_assert (GST_IS_ELEMENT (sink));
529 GST_CAT_INFO (GST_CAT_PIPELINE,
530 "linking %s:%s to %s:%s (%u/%u) with caps \"%" GST_PTR_FORMAT "\"",
531 GST_ELEMENT_NAME (src), link->src_name ? link->src_name : "(any)",
532 GST_ELEMENT_NAME (sink), link->sink_name ? link->sink_name : "(any)",
533 g_slist_length (srcs), g_slist_length (sinks), link->caps);
535 if (!srcs || !sinks) {
536 if (gst_element_link_pads_filtered (src,
537 srcs ? (const gchar *) srcs->data : NULL, sink,
538 sinks ? (const gchar *) sinks->data : NULL, link->caps)) {
541 if (gst_parse_perform_delayed_link (src,
542 srcs ? (const gchar *) srcs->data : NULL,
543 sink, sinks ? (const gchar *) sinks->data : NULL, link->caps)) {
550 if (g_slist_length (link->src_pads) != g_slist_length (link->src_pads)) {
553 while (srcs && sinks) {
554 const gchar *src_pad = (const gchar *) srcs->data;
555 const gchar *sink_pad = (const gchar *) sinks->data;
557 srcs = g_slist_next (srcs);
558 sinks = g_slist_next (sinks);
559 if (gst_element_link_pads_filtered (src, src_pad, sink, sink_pad,
563 if (gst_parse_perform_delayed_link (src, src_pad,
564 sink, sink_pad, link->caps)) {
573 gst_parse_free_link (link);
577 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
578 _("could not link %s to %s"), GST_ELEMENT_NAME (src),
579 GST_ELEMENT_NAME (sink));
580 gst_parse_free_link (link);
585 static int yyerror (void *scanner, graph_t * graph, const char *s);
588 /* Enabling traces. */
593 /* Enabling verbose error messages. */
594 #ifdef YYERROR_VERBOSE
595 # undef YYERROR_VERBOSE
596 # define YYERROR_VERBOSE 1
598 # define YYERROR_VERBOSE 0
601 /* Enabling the token table. */
602 #ifndef YYTOKEN_TABLE
603 # define YYTOKEN_TABLE 0
606 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
607 typedef union YYSTYPE
608 #line 468 "./grammar.y"
617 /* Line 187 of yacc.c. */
618 #line 598 "grammar.tab.c"
621 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
622 # define YYSTYPE_IS_DECLARED 1
623 # define YYSTYPE_IS_TRIVIAL 1
628 /* Copy the second part of user declarations. */
631 /* Line 216 of yacc.c. */
632 #line 611 "grammar.tab.c"
639 typedef YYTYPE_UINT8 yytype_uint8;
641 typedef unsigned char yytype_uint8;
645 typedef YYTYPE_INT8 yytype_int8;
646 #elif (defined __STDC__ || defined __C99__FUNC__ \
647 || defined __cplusplus || defined _MSC_VER)
648 typedef signed char yytype_int8;
650 typedef short int yytype_int8;
654 typedef YYTYPE_UINT16 yytype_uint16;
656 typedef unsigned short int yytype_uint16;
660 typedef YYTYPE_INT16 yytype_int16;
662 typedef short int yytype_int16;
666 # ifdef __SIZE_TYPE__
667 # define YYSIZE_T __SIZE_TYPE__
668 # elif defined size_t
669 # define YYSIZE_T size_t
670 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
671 || defined __cplusplus || defined _MSC_VER)
672 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
673 # define YYSIZE_T size_t
675 # define YYSIZE_T unsigned int
679 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
684 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
685 # define YY_(msgid) dgettext ("bison-runtime", msgid)
689 # define YY_(msgid) msgid
693 /* Suppress unused-variable warnings by "using" E. */
694 #if ! defined lint || defined __GNUC__
695 # define YYUSE(e) ((void) (e))
697 # define YYUSE(e) /* empty */
700 /* Identity function, used to suppress warnings about constant conditions. */
704 #if (defined __STDC__ || defined __C99__FUNC__ \
705 || defined __cplusplus || defined _MSC_VER)
718 #if ! defined yyoverflow || YYERROR_VERBOSE
720 /* The parser invokes alloca or malloc; define the necessary symbols. */
722 # ifdef YYSTACK_USE_ALLOCA
723 # if YYSTACK_USE_ALLOCA
725 # define YYSTACK_ALLOC __builtin_alloca
726 # elif defined __BUILTIN_VA_ARG_INCR
727 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
729 # define YYSTACK_ALLOC __alloca
730 # elif defined _MSC_VER
731 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
732 # define alloca _alloca
734 # define YYSTACK_ALLOC alloca
735 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
736 || defined __cplusplus || defined _MSC_VER)
737 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
746 # ifdef YYSTACK_ALLOC
747 /* Pacify GCC's `empty if-body' warning. */
748 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
749 # ifndef YYSTACK_ALLOC_MAXIMUM
750 /* The OS might guarantee only one guard page at the bottom of the stack,
751 and a page size can be as small as 4096 bytes. So we cannot safely
752 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
753 to allow for a few compiler-allocated temporary stack slots. */
754 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
757 # define YYSTACK_ALLOC YYMALLOC
758 # define YYSTACK_FREE YYFREE
759 # ifndef YYSTACK_ALLOC_MAXIMUM
760 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
762 # if (defined __cplusplus && ! defined _STDLIB_H \
763 && ! ((defined YYMALLOC || defined malloc) \
764 && (defined YYFREE || defined free)))
765 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
771 # define YYMALLOC malloc
772 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
773 || defined __cplusplus || defined _MSC_VER)
774 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
779 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
780 || defined __cplusplus || defined _MSC_VER)
781 void free (void *); /* INFRINGES ON USER NAME SPACE */
785 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
788 #if (! defined yyoverflow \
789 && (! defined __cplusplus \
790 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
792 /* A type that is properly aligned for any stack member. */
799 /* The size of the maximum gap between one aligned stack and the next. */
800 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
802 /* The size of an array large to enough to hold all stacks, each with
804 # define YYSTACK_BYTES(N) \
805 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
806 + YYSTACK_GAP_MAXIMUM)
808 /* Copy COUNT objects from FROM to TO. The source and destination do
811 # if defined __GNUC__ && 1 < __GNUC__
812 # define YYCOPY(To, From, Count) \
813 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
815 # define YYCOPY(To, From, Count) \
819 for (yyi = 0; yyi < (Count); yyi++) \
820 (To)[yyi] = (From)[yyi]; \
826 /* Relocate STACK from its old location to the new one. The
827 local variables YYSIZE and YYSTACKSIZE give the old and new number of
828 elements in the stack, and YYPTR gives the new location of the
829 stack. Advance YYPTR to a properly aligned location for the next
831 # define YYSTACK_RELOCATE(Stack) \
834 YYSIZE_T yynewbytes; \
835 YYCOPY (&yyptr->Stack, Stack, yysize); \
836 Stack = &yyptr->Stack; \
837 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
838 yyptr += yynewbytes / sizeof (*yyptr); \
844 /* YYFINAL -- State number of the termination state. */
846 /* YYLAST -- Last index in YYTABLE. */
849 /* YYNTOKENS -- Number of terminals. */
851 /* YYNNTS -- Number of nonterminals. */
853 /* YYNRULES -- Number of rules. */
855 /* YYNRULES -- Number of states. */
858 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
860 #define YYMAXUTOK 264
862 #define YYTRANSLATE(YYX) \
863 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
865 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
866 static const yytype_uint8 yytranslate[] = {
867 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
868 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
869 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
870 2, 2, 2, 14, 2, 2, 2, 2, 2, 2,
871 10, 11, 2, 2, 12, 2, 13, 2, 2, 2,
872 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
873 2, 15, 2, 2, 2, 2, 2, 2, 2, 2,
874 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
875 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
876 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
877 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
878 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
879 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
880 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
881 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
882 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
883 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
884 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
885 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
886 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
887 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
888 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
889 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
890 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
891 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
892 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
897 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
899 static const yytype_uint8 yyprhs[] = {
900 0, 0, 3, 5, 8, 9, 12, 17, 22, 26,
901 31, 33, 36, 39, 43, 45, 48, 50, 52, 53,
902 57, 59, 62, 65, 67, 69, 72, 75, 78, 81,
906 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
907 static const yytype_int8 yyrhs[] = {
908 27, 0, -1, 4, -1, 17, 8, -1, -1, 18,
909 8, -1, 10, 18, 26, 11, -1, 5, 18, 26,
910 11, -1, 5, 18, 11, -1, 5, 18, 1, 11,
911 -1, 6, -1, 6, 21, -1, 12, 4, -1, 12,
912 4, 21, -1, 7, -1, 7, 21, -1, 22, -1,
913 20, -1, -1, 23, 9, 23, -1, 24, -1, 24,
914 25, -1, 25, 1, -1, 17, -1, 19, -1, 26,
915 26, -1, 26, 25, -1, 26, 1, -1, 24, 26,
916 -1, 3, 26, -1, 24, 3, -1, -1, 26, -1
919 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
920 static const yytype_uint16 yyrline[] = {
921 0, 503, 503, 511, 515, 516, 518, 519, 522, 525,
922 530, 531, 535, 536, 539, 540, 543, 544, 545, 548,
923 561, 562, 563, 566, 571, 572, 607, 635, 636, 650,
928 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
929 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
930 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
931 static const char *const yytname[] = {
932 "$end", "error", "$undefined", "PARSE_URL", "IDENTIFIER", "BINREF",
933 "PADREF", "REF", "ASSIGNMENT", "LINK", "'('", "')'", "','", "'.'", "'!'",
934 "'='", "$accept", "element", "assignments", "bin", "pads", "padlist",
935 "reference", "linkpart", "link", "linklist", "chain", "graph", 0
940 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
942 static const yytype_uint16 yytoknum[] = {
943 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
944 40, 41, 44, 46, 33, 61
948 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
949 static const yytype_uint8 yyr1[] = {
950 0, 16, 17, 17, 18, 18, 19, 19, 19, 19,
951 20, 20, 21, 21, 22, 22, 23, 23, 23, 24,
952 25, 25, 25, 26, 26, 26, 26, 26, 26, 26,
956 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
957 static const yytype_uint8 yyr2[] = {
958 0, 2, 1, 2, 0, 2, 4, 4, 3, 4,
959 1, 2, 2, 3, 1, 2, 1, 1, 0, 3,
960 1, 2, 2, 1, 1, 2, 2, 2, 2, 2,
964 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
965 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
966 means the default is an error. */
967 static const yytype_uint8 yydefact[] = {
968 18, 18, 2, 4, 10, 14, 4, 23, 24, 17,
969 16, 0, 18, 0, 0, 0, 0, 0, 11, 15,
970 18, 3, 18, 30, 0, 27, 20, 0, 0, 1,
971 0, 5, 8, 0, 12, 0, 19, 0, 22, 9,
975 /* YYDEFGOTO[NTERM-NUM]. */
976 static const yytype_int8 yydefgoto[] = {
977 -1, 7, 16, 8, 9, 18, 10, 11, 26, 27,
981 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
983 #define YYPACT_NINF -6
984 static const yytype_int16 yypact[] = {
985 134, 158, -6, -6, -1, -1, -6, 6, -6, -6,
986 -6, 7, 166, 101, 18, 30, 89, 16, -6, -6,
987 2, -6, 129, 142, 42, -6, 150, 54, 66, -6,
988 11, -6, -6, 111, -1, 122, -6, 78, -6, -6,
992 /* YYPGOTO[NTERM-NUM]. */
993 static const yytype_int8 yypgoto[] = {
994 -6, -6, 19, -6, -6, -5, -6, 10, 3, 12,
998 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
999 positive, shift that token. If negative, reduce the rule which
1000 number is the opposite. If zero, do what YYDEFACT says.
1001 If YYTABLE_NINF, syntax error. */
1002 #define YYTABLE_NINF -33
1003 static const yytype_int8 yytable[] = {
1004 19, 13, 15, 12, 12, 1, 2, 3, 4, 5,
1005 31, 17, 6, 24, 21, 12, 22, 33, 29, 12,
1006 34, 35, 39, 12, 15, 20, 12, 24, 0, 41,
1007 -29, 25, 36, 1, 2, 3, 4, 5, 37, -18,
1008 6, -29, -28, 25, 0, 1, 2, 3, 4, 5,
1009 0, -18, 6, -28, -26, 38, 0, -26, -26, -26,
1010 -26, -26, 0, -26, -26, -26, -25, 25, 0, 1,
1011 2, 3, 4, 5, 0, -18, 6, -25, -21, 38,
1012 0, -21, -21, -21, -21, -21, 0, -21, -21, -21,
1013 30, 0, 1, 2, 3, 4, 5, 31, -18, 6,
1014 32, -32, 25, 0, 1, 2, 3, 4, 5, 0,
1015 -18, 6, 25, 0, 1, 2, 3, 4, 5, 0,
1016 -18, 6, 40, 25, 0, 1, 2, 3, 4, 5,
1017 0, -18, 6, 42, -31, 4, 5, 1, 2, 3,
1018 4, 5, 0, 0, 6, 1, 2, 3, 4, 5,
1019 0, -18, 6, 23, 2, 3, 4, 5, 0, -18,
1020 6, 1, 2, 3, 4, 5, 0, 0, 6, 23,
1024 static const yytype_int8 yycheck[] = {
1025 5, 0, 1, 0, 1, 3, 4, 5, 6, 7,
1026 8, 12, 10, 12, 8, 12, 9, 16, 0, 16,
1027 4, 20, 11, 20, 23, 6, 23, 26, -1, 34,
1028 0, 1, 22, 3, 4, 5, 6, 7, 26, 9,
1029 10, 11, 0, 1, -1, 3, 4, 5, 6, 7,
1030 -1, 9, 10, 11, 0, 1, -1, 3, 4, 5,
1031 6, 7, -1, 9, 10, 11, 0, 1, -1, 3,
1032 4, 5, 6, 7, -1, 9, 10, 11, 0, 1,
1033 -1, 3, 4, 5, 6, 7, -1, 9, 10, 11,
1034 1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
1035 11, 0, 1, -1, 3, 4, 5, 6, 7, -1,
1036 9, 10, 1, -1, 3, 4, 5, 6, 7, -1,
1037 9, 10, 11, 1, -1, 3, 4, 5, 6, 7,
1038 -1, 9, 10, 11, 0, 6, 7, 3, 4, 5,
1039 6, 7, -1, -1, 10, 3, 4, 5, 6, 7,
1040 -1, 9, 10, 3, 4, 5, 6, 7, -1, 9,
1041 10, 3, 4, 5, 6, 7, -1, -1, 10, 3,
1042 4, 5, 6, 7, -1, -1, 10
1045 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1046 symbol of state STATE-NUM. */
1047 static const yytype_uint8 yystos[] = {
1048 0, 3, 4, 5, 6, 7, 10, 17, 19, 20,
1049 22, 23, 24, 26, 27, 26, 18, 12, 21, 21,
1050 18, 8, 9, 3, 26, 1, 24, 25, 26, 0,
1051 1, 8, 11, 26, 4, 26, 23, 25, 1, 11,
1055 #define yyerrok (yyerrstatus = 0)
1056 #define yyclearin (yychar = YYEMPTY)
1057 #define YYEMPTY (-2)
1060 #define YYACCEPT goto yyacceptlab
1061 #define YYABORT goto yyabortlab
1062 #define YYERROR goto yyerrorlab
1065 /* Like YYERROR except do call yyerror. This remains here temporarily
1066 to ease the transition to the new meaning of YYERROR, for GCC.
1067 Once GCC version 2 has supplanted version 1, this can go. */
1069 #define YYFAIL goto yyerrlab
1071 #define YYRECOVERING() (!!yyerrstatus)
1073 #define YYBACKUP(Token, Value) \
1075 if (yychar == YYEMPTY && yylen == 1) \
1079 yytoken = YYTRANSLATE (yychar); \
1085 yyerror (scanner, graph, YY_("syntax error: cannot back up")); \
1092 #define YYERRCODE 256
1095 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1096 If N is 0, then set CURRENT to the empty location which ends
1097 the previous symbol: RHS[0] (always defined). */
1099 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1100 #ifndef YYLLOC_DEFAULT
1101 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1105 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1106 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1107 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1108 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1112 (Current).first_line = (Current).last_line = \
1113 YYRHSLOC (Rhs, 0).last_line; \
1114 (Current).first_column = (Current).last_column = \
1115 YYRHSLOC (Rhs, 0).last_column; \
1121 /* YY_LOCATION_PRINT -- Print the location on the stream.
1122 This macro was not mandated originally: define only if we know
1123 we won't break user code: when these are the locations we know. */
1125 #ifndef YY_LOCATION_PRINT
1126 # if YYLTYPE_IS_TRIVIAL
1127 # define YY_LOCATION_PRINT(File, Loc) \
1128 fprintf (File, "%d.%d-%d.%d", \
1129 (Loc).first_line, (Loc).first_column, \
1130 (Loc).last_line, (Loc).last_column)
1132 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1137 /* YYLEX -- calling `yylex' with the right arguments. */
1140 # define YYLEX yylex (&yylval, YYLEX_PARAM)
1142 # define YYLEX yylex (&yylval)
1145 /* Enable debugging if requested. */
1149 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1150 # define YYFPRINTF fprintf
1153 # define YYDPRINTF(Args) \
1159 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1163 YYFPRINTF (stderr, "%s ", Title); \
1164 yy_symbol_print (stderr, \
1165 Type, Value, scanner, graph); \
1166 YYFPRINTF (stderr, "\n"); \
1171 /*--------------------------------.
1172 | Print this symbol on YYOUTPUT. |
1173 `--------------------------------*/
1176 #if (defined __STDC__ || defined __C99__FUNC__ \
1177 || defined __cplusplus || defined _MSC_VER)
1179 yy_symbol_value_print (FILE * yyoutput, int yytype,
1180 YYSTYPE const *const yyvaluep, void *scanner, graph_t * graph)
1183 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, graph)
1186 YYSTYPE const *const yyvaluep;
1196 if (yytype < YYNTOKENS)
1197 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1208 /*--------------------------------.
1209 | Print this symbol on YYOUTPUT. |
1210 `--------------------------------*/
1212 #if (defined __STDC__ || defined __C99__FUNC__ \
1213 || defined __cplusplus || defined _MSC_VER)
1215 yy_symbol_print (FILE * yyoutput, int yytype, YYSTYPE const *const yyvaluep,
1216 void *scanner, graph_t * graph)
1219 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, graph)
1222 YYSTYPE const *const yyvaluep;
1227 if (yytype < YYNTOKENS)
1228 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1230 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1232 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, graph);
1233 YYFPRINTF (yyoutput, ")");
1236 /*------------------------------------------------------------------.
1237 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1239 `------------------------------------------------------------------*/
1241 #if (defined __STDC__ || defined __C99__FUNC__ \
1242 || defined __cplusplus || defined _MSC_VER)
1244 yy_stack_print (yytype_int16 * bottom, yytype_int16 * top)
1247 yy_stack_print (bottom, top)
1248 yytype_int16 *bottom;
1252 YYFPRINTF (stderr, "Stack now");
1253 for (; bottom <= top; ++bottom)
1254 YYFPRINTF (stderr, " %d", *bottom);
1255 YYFPRINTF (stderr, "\n");
1258 # define YY_STACK_PRINT(Bottom, Top) \
1261 yy_stack_print ((Bottom), (Top)); \
1265 /*------------------------------------------------.
1266 | Report that the YYRULE is going to be reduced. |
1267 `------------------------------------------------*/
1269 #if (defined __STDC__ || defined __C99__FUNC__ \
1270 || defined __cplusplus || defined _MSC_VER)
1272 yy_reduce_print (YYSTYPE * yyvsp, int yyrule, void *scanner, graph_t * graph)
1275 yy_reduce_print (yyvsp, yyrule, scanner, graph)
1282 int yynrhs = yyr2[yyrule];
1284 unsigned long int yylno = yyrline[yyrule];
1286 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1288 /* The symbols being reduced. */
1289 for (yyi = 0; yyi < yynrhs; yyi++) {
1290 fprintf (stderr, " $%d = ", yyi + 1);
1291 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1292 &(yyvsp[(yyi + 1) - (yynrhs)])
1294 fprintf (stderr, "\n");
1298 # define YY_REDUCE_PRINT(Rule) \
1301 yy_reduce_print (yyvsp, Rule, scanner, graph); \
1304 /* Nonzero means print parse trace. It is left uninitialized so that
1305 multiple parsers can coexist. */
1307 #else /* !YYDEBUG */
1308 # define YYDPRINTF(Args)
1309 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1310 # define YY_STACK_PRINT(Bottom, Top)
1311 # define YY_REDUCE_PRINT(Rule)
1312 #endif /* !YYDEBUG */
1315 /* YYINITDEPTH -- initial size of the parser's stacks. */
1317 # define YYINITDEPTH 200
1320 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1321 if the built-in stack extension method is used).
1323 Do not make this value too large; the results are undefined if
1324 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1325 evaluated with infinite-precision integer arithmetic. */
1328 # define YYMAXDEPTH 10000
1336 # if defined __GLIBC__ && defined _STRING_H
1337 # define yystrlen strlen
1339 /* Return the length of YYSTR. */
1340 #if (defined __STDC__ || defined __C99__FUNC__ \
1341 || defined __cplusplus || defined _MSC_VER)
1343 yystrlen (const char *yystr)
1352 for (yylen = 0; yystr[yylen]; yylen++)
1360 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1361 # define yystpcpy stpcpy
1363 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1365 #if (defined __STDC__ || defined __C99__FUNC__ \
1366 || defined __cplusplus || defined _MSC_VER)
1368 yystpcpy (char *yydest, const char *yysrc)
1371 yystpcpy (yydest, yysrc)
1377 const char *yys = yysrc;
1379 while ((*yyd++ = *yys++) != '\0')
1388 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1389 quotes and backslashes, so that it's suitable for yyerror. The
1390 heuristic is that double-quoting is unnecessary unless the string
1391 contains an apostrophe, a comma, or backslash (other than
1392 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1393 null, do not copy; instead, return the length of what the result
1396 yytnamerr (char *yyres, const char *yystr)
1398 if (*yystr == '"') {
1400 char const *yyp = yystr;
1406 goto do_not_strip_quotes;
1410 goto do_not_strip_quotes;
1423 do_not_strip_quotes:;
1427 return yystrlen (yystr);
1429 return yystpcpy (yyres, yystr) - yyres;
1433 /* Copy into YYRESULT an error message about the unexpected token
1434 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1435 including the terminating null byte. If YYRESULT is null, do not
1436 copy anything; just return the number of bytes that would be
1437 copied. As a special case, return 0 if an ordinary "syntax error"
1438 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1439 size calculation. */
1441 yysyntax_error (char *yyresult, int yystate, int yychar)
1443 int yyn = yypact[yystate];
1445 if (!(YYPACT_NINF < yyn && yyn <= YYLAST))
1448 int yytype = YYTRANSLATE (yychar);
1449 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1450 YYSIZE_T yysize = yysize0;
1452 int yysize_overflow = 0;
1454 { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1455 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1459 /* This is so xgettext sees the translatable formats that are
1460 constructed on the fly. */
1461 YY_ ("syntax error, unexpected %s");
1462 YY_ ("syntax error, unexpected %s, expecting %s");
1463 YY_ ("syntax error, unexpected %s, expecting %s or %s");
1464 YY_ ("syntax error, unexpected %s, expecting %s or %s or %s");
1465 YY_ ("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1469 static char const yyunexpected[] = "syntax error, unexpected %s";
1470 static char const yyexpecting[] = ", expecting %s";
1471 static char const yyor[] = " or %s";
1472 char yyformat[sizeof yyunexpected
1473 + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1474 * (sizeof yyor - 1))];
1475 char const *yyprefix = yyexpecting;
1477 /* Start YYX at -YYN if negative to avoid negative indexes in
1479 int yyxbegin = yyn < 0 ? -yyn : 0;
1481 /* Stay within bounds of both yycheck and yytname. */
1482 int yychecklim = YYLAST - yyn + 1;
1483 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1486 yyarg[0] = yytname[yytype];
1487 yyfmt = yystpcpy (yyformat, yyunexpected);
1489 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1490 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) {
1491 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) {
1494 yyformat[sizeof yyunexpected - 1] = '\0';
1497 yyarg[yycount++] = yytname[yyx];
1498 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1499 yysize_overflow |= (yysize1 < yysize);
1501 yyfmt = yystpcpy (yyfmt, yyprefix);
1505 yyf = YY_ (yyformat);
1506 yysize1 = yysize + yystrlen (yyf);
1507 yysize_overflow |= (yysize1 < yysize);
1510 if (yysize_overflow)
1511 return YYSIZE_MAXIMUM;
1514 /* Avoid sprintf, as that infringes on the user's name space.
1515 Don't have undefined behavior even if the translation
1516 produced a string with the wrong number of "%s"s. */
1517 char *yyp = yyresult;
1520 while ((*yyp = *yyf) != '\0') {
1521 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) {
1522 yyp += yytnamerr (yyp, yyarg[yyi++]);
1533 #endif /* YYERROR_VERBOSE */
1536 /*-----------------------------------------------.
1537 | Release the memory associated to this symbol. |
1538 `-----------------------------------------------*/
1541 #if (defined __STDC__ || defined __C99__FUNC__ \
1542 || defined __cplusplus || defined _MSC_VER)
1544 yydestruct (const char *yymsg, int yytype, YYSTYPE * yyvaluep, void *scanner,
1548 yydestruct (yymsg, yytype, yyvaluep, scanner, graph)
1562 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1572 /* Prevent warnings from -Wmissing-prototypes. */
1574 #ifdef YYPARSE_PARAM
1575 #if defined __STDC__ || defined __cplusplus
1576 int yyparse (void *YYPARSE_PARAM);
1580 #else /* ! YYPARSE_PARAM */
1581 #if defined __STDC__ || defined __cplusplus
1582 int yyparse (void *scanner, graph_t * graph);
1586 #endif /* ! YYPARSE_PARAM */
1597 #ifdef YYPARSE_PARAM
1598 #if (defined __STDC__ || defined __C99__FUNC__ \
1599 || defined __cplusplus || defined _MSC_VER)
1601 yyparse (void *YYPARSE_PARAM)
1604 yyparse (YYPARSE_PARAM)
1605 void *YYPARSE_PARAM;
1607 #else /* ! YYPARSE_PARAM */
1608 #if (defined __STDC__ || defined __C99__FUNC__ \
1609 || defined __cplusplus || defined _MSC_VER)
1611 yyparse (void *scanner, graph_t * graph)
1614 yyparse (scanner, graph)
1620 /* The look-ahead symbol. */
1623 /* The semantic value of the look-ahead symbol. */
1626 /* Number of syntax errors so far. */
1633 /* Number of tokens to shift before error messages enabled. */
1636 /* Look-ahead token as an internal (translated) token number. */
1640 /* Buffer for error messages, and its allocated size. */
1642 char *yymsg = yymsgbuf;
1643 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1646 /* Three stacks and their tools:
1647 `yyss': related to states,
1648 `yyvs': related to semantic values,
1649 `yyls': related to locations.
1651 Refer to the stacks thru separate pointers, to allow yyoverflow
1652 to reallocate them elsewhere. */
1654 /* The state stack. */
1655 yytype_int16 yyssa[YYINITDEPTH];
1656 yytype_int16 *yyss = yyssa;
1657 yytype_int16 *yyssp;
1659 /* The semantic value stack. */
1660 YYSTYPE yyvsa[YYINITDEPTH];
1661 YYSTYPE *yyvs = yyvsa;
1666 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1668 YYSIZE_T yystacksize = YYINITDEPTH;
1670 /* The variables used to return semantic value and location from the
1675 /* The number of symbols on the RHS of the reduced rule.
1676 Keep to zero when no symbol should be popped. */
1679 YYDPRINTF ((stderr, "Starting parse\n"));
1684 yychar = YYEMPTY; /* Cause a token to be read. */
1686 /* Initialize stack pointers.
1687 Waste one element of value and location stack
1688 so that they stay on the same level as the state stack.
1689 The wasted elements are never initialized. */
1696 /*------------------------------------------------------------.
1697 | yynewstate -- Push a new state, which is found in yystate. |
1698 `------------------------------------------------------------*/
1700 /* In all cases, when you get here, the value and location stacks
1701 have just been pushed. So pushing a state here evens the stacks. */
1707 if (yyss + yystacksize - 1 <= yyssp) {
1708 /* Get the current used size of the three stacks, in elements. */
1709 YYSIZE_T yysize = yyssp - yyss + 1;
1713 /* Give user a chance to reallocate the stack. Use copies of
1714 these so that the &'s don't force the real ones into
1716 YYSTYPE *yyvs1 = yyvs;
1717 yytype_int16 *yyss1 = yyss;
1720 /* Each stack pointer address is followed by the size of the
1721 data in use in that stack, in bytes. This used to be a
1722 conditional around just the two extra args, but that might
1723 be undefined if yyoverflow is a macro. */
1724 yyoverflow (YY_ ("memory exhausted"),
1725 &yyss1, yysize * sizeof (*yyssp),
1726 &yyvs1, yysize * sizeof (*yyvsp), &yystacksize);
1731 #else /* no yyoverflow */
1732 # ifndef YYSTACK_RELOCATE
1733 goto yyexhaustedlab;
1735 /* Extend the stack our own way. */
1736 if (YYMAXDEPTH <= yystacksize)
1737 goto yyexhaustedlab;
1739 if (YYMAXDEPTH < yystacksize)
1740 yystacksize = YYMAXDEPTH;
1743 yytype_int16 *yyss1 = yyss;
1744 union yyalloc *yyptr =
1745 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1747 goto yyexhaustedlab;
1748 YYSTACK_RELOCATE (yyss);
1749 YYSTACK_RELOCATE (yyvs);
1751 # undef YYSTACK_RELOCATE
1753 YYSTACK_FREE (yyss1);
1756 #endif /* no yyoverflow */
1758 yyssp = yyss + yysize - 1;
1759 yyvsp = yyvs + yysize - 1;
1762 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1763 (unsigned long int) yystacksize));
1765 if (yyss + yystacksize - 1 <= yyssp)
1769 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1778 /* Do appropriate processing given the current state. Read a
1779 look-ahead token if we need one and don't already have one. */
1781 /* First try to decide what to do without reference to look-ahead token. */
1782 yyn = yypact[yystate];
1783 if (yyn == YYPACT_NINF)
1786 /* Not known => get a look-ahead token if don't already have one. */
1788 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1789 if (yychar == YYEMPTY) {
1790 YYDPRINTF ((stderr, "Reading a token: "));
1794 if (yychar <= YYEOF) {
1795 yychar = yytoken = YYEOF;
1796 YYDPRINTF ((stderr, "Now at end of input.\n"));
1798 yytoken = YYTRANSLATE (yychar);
1799 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1802 /* If the proper action on seeing token YYTOKEN is to reduce or to
1803 detect an error, take that action. */
1805 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1809 if (yyn == 0 || yyn == YYTABLE_NINF)
1818 /* Count tokens shifted since error; after three, turn off error
1823 /* Shift the look-ahead token. */
1824 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1826 /* Discard the shifted token unless it is eof. */
1827 if (yychar != YYEOF)
1836 /*-----------------------------------------------------------.
1837 | yydefault -- do the default action for the current state. |
1838 `-----------------------------------------------------------*/
1840 yyn = yydefact[yystate];
1846 /*-----------------------------.
1847 | yyreduce -- Do a reduction. |
1848 `-----------------------------*/
1850 /* yyn is the number of a rule to reduce with. */
1853 /* If YYLEN is nonzero, implement the default value of the action:
1856 Otherwise, the following line sets YYVAL to garbage.
1857 This behavior is undocumented and Bison
1858 users should not rely upon it. Assigning to YYVAL
1859 unconditionally makes the parser a bit smaller, and it avoids a
1860 GCC warning that YYVAL may be used uninitialized. */
1861 yyval = yyvsp[1 - yylen];
1864 YY_REDUCE_PRINT (yyn);
1867 #line 503 "./grammar.y"
1869 (yyval.e) = gst_element_factory_make ((yyvsp[(1) - (1)].s), NULL);
1870 if ((yyval.e) == NULL) {
1871 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
1872 _("no element \"%s\""), (yyvsp[(1) - (1)].s));
1873 gst_parse_strfree ((yyvsp[(1) - (1)].s));
1876 gst_parse_strfree ((yyvsp[(1) - (1)].s));
1882 #line 511 "./grammar.y"
1884 gst_parse_element_set ((yyvsp[(2) - (2)].s), (yyvsp[(1) - (2)].e), graph);
1885 (yyval.e) = (yyvsp[(1) - (2)].e);
1891 #line 515 "./grammar.y"
1898 #line 516 "./grammar.y"
1900 (yyval.p) = g_slist_prepend ((yyvsp[(1) - (2)].p), (yyvsp[(2) - (2)].s));;
1905 #line 518 "./grammar.y"
1907 GST_BIN_MAKE ((yyval.c), "bin", (yyvsp[(3) - (4)].c),
1908 (yyvsp[(2) - (4)].p));;
1913 #line 519 "./grammar.y"
1915 GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].c),
1916 (yyvsp[(2) - (4)].p));
1917 gst_parse_strfree ((yyvsp[(1) - (4)].s));
1923 #line 522 "./grammar.y"
1925 GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (3)].s), NULL,
1926 (yyvsp[(2) - (3)].p));
1927 gst_parse_strfree ((yyvsp[(1) - (3)].s));
1933 #line 525 "./grammar.y"
1935 GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), NULL,
1936 (yyvsp[(2) - (4)].p));
1937 gst_parse_strfree ((yyvsp[(1) - (4)].s));
1943 #line 530 "./grammar.y"
1945 (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].s));;
1950 #line 531 "./grammar.y"
1952 (yyval.p) = (yyvsp[(2) - (2)].p);
1953 (yyval.p) = g_slist_prepend ((yyval.p), (yyvsp[(1) - (2)].s));
1959 #line 535 "./grammar.y"
1961 (yyval.p) = g_slist_prepend (NULL, (yyvsp[(2) - (2)].s));;
1966 #line 536 "./grammar.y"
1968 (yyval.p) = g_slist_prepend ((yyvsp[(3) - (3)].p), (yyvsp[(2) - (3)].s));;
1973 #line 539 "./grammar.y"
1975 MAKE_REF ((yyval.l), (yyvsp[(1) - (1)].s), NULL);;
1980 #line 540 "./grammar.y"
1982 MAKE_REF ((yyval.l), (yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].p));;
1987 #line 543 "./grammar.y"
1989 (yyval.l) = (yyvsp[(1) - (1)].l);;
1994 #line 544 "./grammar.y"
1996 MAKE_REF ((yyval.l), NULL, (yyvsp[(1) - (1)].p));;
2001 #line 545 "./grammar.y"
2003 MAKE_REF ((yyval.l), NULL, NULL);;
2008 #line 548 "./grammar.y"
2010 (yyval.l) = (yyvsp[(1) - (3)].l);
2011 if ((yyvsp[(2) - (3)].s)) {
2012 (yyval.l)->caps = gst_caps_from_string ((yyvsp[(2) - (3)].s));
2013 if ((yyval.l)->caps == NULL)
2014 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2015 _("could not parse caps \"%s\""), (yyvsp[(2) - (3)].s));
2016 gst_parse_strfree ((yyvsp[(2) - (3)].s));
2018 (yyval.l)->sink_name = (yyvsp[(3) - (3)].l)->src_name;
2019 (yyval.l)->sink_pads = (yyvsp[(3) - (3)].l)->src_pads;
2020 gst_parse_link_free ((yyvsp[(3) - (3)].l));
2026 #line 561 "./grammar.y"
2028 (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].l));;
2033 #line 562 "./grammar.y"
2035 (yyval.p) = g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].l));;
2040 #line 563 "./grammar.y"
2042 (yyval.p) = (yyvsp[(1) - (2)].p);;
2047 #line 566 "./grammar.y"
2049 (yyval.c) = gst_parse_chain_new ();
2050 (yyval.c)->first = (yyval.c)->last = (yyvsp[(1) - (1)].e);
2051 (yyval.c)->front = (yyval.c)->back = NULL;
2052 (yyval.c)->elements = g_slist_prepend (NULL, (yyvsp[(1) - (1)].e));
2058 #line 571 "./grammar.y"
2060 (yyval.c) = (yyvsp[(1) - (1)].c);;
2065 #line 572 "./grammar.y"
2067 if ((yyvsp[(1) - (2)].c)->back && (yyvsp[(2) - (2)].c)->front) {
2068 if (!(yyvsp[(1) - (2)].c)->back->sink_name) {
2069 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2070 _("link without source element"));
2071 gst_parse_free_link ((yyvsp[(1) - (2)].c)->back);
2073 ((graph_t *) graph)->links =
2074 g_slist_prepend (((graph_t *) graph)->links,
2075 (yyvsp[(1) - (2)].c)->back);
2077 if (!(yyvsp[(2) - (2)].c)->front->src_name) {
2078 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2079 _("link without sink element"));
2080 gst_parse_free_link ((yyvsp[(2) - (2)].c)->front);
2082 ((graph_t *) graph)->links =
2083 g_slist_prepend (((graph_t *) graph)->links,
2084 (yyvsp[(2) - (2)].c)->front);
2086 (yyvsp[(1) - (2)].c)->back = NULL;
2087 } else if ((yyvsp[(1) - (2)].c)->back) {
2088 if (!(yyvsp[(1) - (2)].c)->back->sink_name) {
2089 (yyvsp[(1) - (2)].c)->back->sink = (yyvsp[(2) - (2)].c)->first;
2091 } else if ((yyvsp[(2) - (2)].c)->front) {
2092 if (!(yyvsp[(2) - (2)].c)->front->src_name) {
2093 (yyvsp[(2) - (2)].c)->front->src = (yyvsp[(1) - (2)].c)->last;
2095 (yyvsp[(1) - (2)].c)->back = (yyvsp[(2) - (2)].c)->front;
2098 if ((yyvsp[(1) - (2)].c)->back) {
2099 ((graph_t *) graph)->links =
2100 g_slist_prepend (((graph_t *) graph)->links,
2101 (yyvsp[(1) - (2)].c)->back);
2103 (yyvsp[(1) - (2)].c)->last = (yyvsp[(2) - (2)].c)->last;
2104 (yyvsp[(1) - (2)].c)->back = (yyvsp[(2) - (2)].c)->back;
2105 (yyvsp[(1) - (2)].c)->elements =
2106 g_slist_concat ((yyvsp[(1) - (2)].c)->elements,
2107 (yyvsp[(2) - (2)].c)->elements);
2108 if ((yyvsp[(2) - (2)].c))
2109 gst_parse_chain_free ((yyvsp[(2) - (2)].c));
2110 (yyval.c) = (yyvsp[(1) - (2)].c);
2116 #line 607 "./grammar.y"
2120 if ((yyvsp[(1) - (2)].c)->back) {
2121 (yyvsp[(2) - (2)].p) =
2122 g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].c)->back);
2123 (yyvsp[(1) - (2)].c)->back = NULL;
2125 if (!((link_t *) (yyvsp[(2) - (2)].p)->data)->src_name) {
2126 ((link_t *) (yyvsp[(2) - (2)].p)->data)->src =
2127 (yyvsp[(1) - (2)].c)->last;
2130 for (walk = (yyvsp[(2) - (2)].p); walk; walk = walk->next) {
2131 link_t *link = (link_t *) walk->data;
2133 if (!link->sink_name && walk->next) {
2134 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2135 _("link without sink element"));
2136 gst_parse_free_link (link);
2137 } else if (!link->src_name && !link->src) {
2138 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2139 _("link without source element"));
2140 gst_parse_free_link (link);
2143 ((graph_t *) graph)->links =
2144 g_slist_prepend (((graph_t *) graph)->links, link);
2146 (yyvsp[(1) - (2)].c)->back = link;
2150 g_slist_free ((yyvsp[(2) - (2)].p));
2151 (yyval.c) = (yyvsp[(1) - (2)].c);
2157 #line 635 "./grammar.y"
2159 (yyval.c) = (yyvsp[(1) - (2)].c);;
2164 #line 636 "./grammar.y"
2166 if ((yyvsp[(2) - (2)].c)->front) {
2167 if (!(yyvsp[(2) - (2)].c)->front->src_name) {
2168 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2169 _("link without source element"));
2170 gst_parse_free_link ((yyvsp[(2) - (2)].c)->front);
2172 ((graph_t *) graph)->links =
2173 g_slist_prepend (((graph_t *) graph)->links,
2174 (yyvsp[(2) - (2)].c)->front);
2177 if (!(yyvsp[(1) - (2)].l)->sink_name) {
2178 (yyvsp[(1) - (2)].l)->sink = (yyvsp[(2) - (2)].c)->first;
2180 (yyvsp[(2) - (2)].c)->front = (yyvsp[(1) - (2)].l);
2181 (yyval.c) = (yyvsp[(2) - (2)].c);
2187 #line 650 "./grammar.y"
2189 (yyval.c) = (yyvsp[(2) - (2)].c);
2190 if ((yyval.c)->front) {
2191 GstElement *element =
2192 gst_element_make_from_uri (GST_URI_SRC, (yyvsp[(1) - (2)].s), NULL);
2194 SET_ERROR (((graph_t *) graph)->error,
2195 GST_PARSE_ERROR_NO_SUCH_ELEMENT,
2196 _("no source element for URI \"%s\""), (yyvsp[(1) - (2)].s));
2198 (yyval.c)->front->src = element;
2199 ((graph_t *) graph)->links = g_slist_prepend (
2200 ((graph_t *) graph)->links, (yyval.c)->front);
2201 (yyval.c)->front = NULL;
2202 (yyval.c)->elements = g_slist_prepend ((yyval.c)->elements, element);
2205 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2206 _("no element to link URI \"%s\" to"), (yyvsp[(1) - (2)].s));
2208 g_free ((yyvsp[(1) - (2)].s));
2214 #line 670 "./grammar.y"
2216 GstElement *element =
2217 gst_element_make_from_uri (GST_URI_SINK, (yyvsp[(2) - (2)].s), NULL);
2219 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
2220 _("no sink element for URI \"%s\""), (yyvsp[(2) - (2)].s));
2221 gst_parse_link_free ((yyvsp[(1) - (2)].l));
2222 g_free ((yyvsp[(2) - (2)].s));
2224 } else if ((yyvsp[(1) - (2)].l)->sink_name
2225 || (yyvsp[(1) - (2)].l)->sink_pads) {
2226 gst_object_unref (element);
2227 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2228 _("could not link sink element for URI \"%s\""),
2229 (yyvsp[(2) - (2)].s));
2230 gst_parse_link_free ((yyvsp[(1) - (2)].l));
2231 g_free ((yyvsp[(2) - (2)].s));
2234 (yyval.c) = gst_parse_chain_new ();
2235 (yyval.c)->first = (yyval.c)->last = element;
2236 (yyval.c)->front = (yyvsp[(1) - (2)].l);
2237 (yyval.c)->front->sink = element;
2238 (yyval.c)->elements = g_slist_prepend (NULL, element);
2240 g_free ((yyvsp[(2) - (2)].s));
2246 #line 695 "./grammar.y"
2248 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_EMPTY,
2249 _("empty pipeline not allowed"));
2250 (yyval.g) = (graph_t *) graph;
2256 #line 698 "./grammar.y"
2258 (yyval.g) = (graph_t *) graph;
2259 if ((yyvsp[(1) - (1)].c)->front) {
2260 if (!(yyvsp[(1) - (1)].c)->front->src_name) {
2261 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2262 _("link without source element"));
2263 gst_parse_free_link ((yyvsp[(1) - (1)].c)->front);
2266 g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->front);
2268 (yyvsp[(1) - (1)].c)->front = NULL;
2270 if ((yyvsp[(1) - (1)].c)->back) {
2271 if (!(yyvsp[(1) - (1)].c)->back->sink_name) {
2272 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2273 _("link without sink element"));
2274 gst_parse_free_link ((yyvsp[(1) - (1)].c)->back);
2277 g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->back);
2279 (yyvsp[(1) - (1)].c)->back = NULL;
2281 (yyval.g)->chain = (yyvsp[(1) - (1)].c);
2287 /* Line 1267 of yacc.c. */
2288 #line 2199 "grammar.tab.c"
2292 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2296 YY_STACK_PRINT (yyss, yyssp);
2301 /* Now `shift' the result of the reduction. Determine what state
2302 that goes to, based on the state we popped back to and the rule
2303 number reduced by. */
2307 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2308 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2309 yystate = yytable[yystate];
2311 yystate = yydefgoto[yyn - YYNTOKENS];
2316 /*------------------------------------.
2317 | yyerrlab -- here on detecting error |
2318 `------------------------------------*/
2320 /* If not already recovering from an error, report this error. */
2323 #if ! YYERROR_VERBOSE
2324 yyerror (scanner, graph, YY_ ("syntax error"));
2327 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2329 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) {
2330 YYSIZE_T yyalloc = 2 * yysize;
2332 if (!(yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2333 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2334 if (yymsg != yymsgbuf)
2335 YYSTACK_FREE (yymsg);
2336 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2338 yymsg_alloc = yyalloc;
2341 yymsg_alloc = sizeof yymsgbuf;
2345 if (0 < yysize && yysize <= yymsg_alloc) {
2346 (void) yysyntax_error (yymsg, yystate, yychar);
2347 yyerror (scanner, graph, yymsg);
2349 yyerror (scanner, graph, YY_ ("syntax error"));
2351 goto yyexhaustedlab;
2359 if (yyerrstatus == 3) {
2360 /* If just tried and failed to reuse look-ahead token after an
2361 error, discard it. */
2363 if (yychar <= YYEOF) {
2364 /* Return failure if at end of input. */
2365 if (yychar == YYEOF)
2368 yydestruct ("Error: discarding", yytoken, &yylval, scanner, graph);
2373 /* Else will try to reuse look-ahead token after shifting the error
2378 /*---------------------------------------------------.
2379 | yyerrorlab -- error raised explicitly by YYERROR. |
2380 `---------------------------------------------------*/
2383 /* Pacify compilers like GCC when the user code never invokes
2384 YYERROR and the label yyerrorlab therefore never appears in user
2386 if ( /*CONSTCOND*/ 0)
2389 /* Do not reclaim the symbols of the rule which action triggered
2393 YY_STACK_PRINT (yyss, yyssp);
2398 /*-------------------------------------------------------------.
2399 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2400 `-------------------------------------------------------------*/
2402 yyerrstatus = 3; /* Each real token shifted decrements this. */
2405 yyn = yypact[yystate];
2406 if (yyn != YYPACT_NINF) {
2408 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) {
2415 /* Pop the current state because it cannot handle the error token. */
2420 yydestruct ("Error: popping", yystos[yystate], yyvsp, scanner, graph);
2423 YY_STACK_PRINT (yyss, yyssp);
2432 /* Shift the error token. */
2433 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2439 /*-------------------------------------.
2440 | yyacceptlab -- YYACCEPT comes here. |
2441 `-------------------------------------*/
2446 /*-----------------------------------.
2447 | yyabortlab -- YYABORT comes here. |
2448 `-----------------------------------*/
2454 /*-------------------------------------------------.
2455 | yyexhaustedlab -- memory exhaustion comes here. |
2456 `-------------------------------------------------*/
2458 yyerror (scanner, graph, YY_ ("memory exhausted"));
2464 if (yychar != YYEOF && yychar != YYEMPTY)
2465 yydestruct ("Cleanup: discarding lookahead",
2466 yytoken, &yylval, scanner, graph);
2467 /* Do not reclaim the symbols of the rule which action triggered
2468 this YYABORT or YYACCEPT. */
2470 YY_STACK_PRINT (yyss, yyssp);
2471 while (yyssp != yyss) {
2472 yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, scanner, graph);
2477 YYSTACK_FREE (yyss);
2480 if (yymsg != yymsgbuf)
2481 YYSTACK_FREE (yymsg);
2483 /* Make sure YYID is used. */
2484 return YYID (yyresult);
2488 #line 721 "./grammar.y"
2493 yyerror (void *scanner, graph_t * graph, const char *s)
2495 /* FIXME: This should go into the GError somehow, but how? */
2496 GST_WARNING ("Error during parsing: %s", s);
2502 _gst_parse_launch (const gchar * str, GError ** error)
2511 g_return_val_if_fail (str != NULL, NULL);
2517 #ifdef __GST_PARSE_TRACE
2518 GST_CAT_DEBUG (GST_CAT_PIPELINE, "TRACE: tracing enabled");
2519 __strings = __chains = __links = 0;
2520 #endif /* __GST_PARSE_TRACE */
2522 dstr = g_strdup (str);
2523 _gst_parse_yylex_init (&scanner);
2524 _gst_parse_yy_scan_string (dstr, scanner);
2530 if (yyparse (scanner, &g) != 0) {
2531 SET_ERROR (error, GST_PARSE_ERROR_SYNTAX,
2532 "Unrecoverable syntax error while parsing pipeline %s", str);
2534 _gst_parse_yylex_destroy (scanner);
2539 _gst_parse_yylex_destroy (scanner);
2542 GST_CAT_DEBUG (GST_CAT_PIPELINE, "got %u elements and %u links",
2543 g.chain ? g_slist_length (g.chain->elements) : 0,
2544 g_slist_length (g.links));
2548 } else if (!(((chain_t *) g.chain)->elements->next)) {
2549 /* only one toplevel element */
2550 ret = (GstElement *) ((chain_t *) g.chain)->elements->data;
2551 g_slist_free (((chain_t *) g.chain)->elements);
2552 if (GST_IS_BIN (ret))
2553 bin = GST_BIN (ret);
2554 gst_parse_chain_free (g.chain);
2556 /* put all elements in our bin */
2557 bin = GST_BIN (gst_element_factory_make ("pipeline", NULL));
2560 for (walk = g.chain->elements; walk; walk = walk->next) {
2561 if (walk->data != NULL)
2562 gst_bin_add (bin, GST_ELEMENT (walk->data));
2565 g_slist_free (g.chain->elements);
2566 ret = GST_ELEMENT (bin);
2567 gst_parse_chain_free (g.chain);
2571 for (walk = g.links; walk; walk = walk->next) {
2572 link_t *l = (link_t *) walk->data;
2577 l->src = gst_bin_get_by_name_recurse_up (bin, l->src_name);
2579 gst_object_unref (l->src);
2582 strcmp (GST_ELEMENT_NAME (ret), l->src_name) == 0 ? ret : NULL;
2586 SET_ERROR (error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
2587 "No element named \"%s\" - omitting link", l->src_name);
2588 gst_parse_free_link (l);
2595 l->sink = gst_bin_get_by_name_recurse_up (bin, l->sink_name);
2597 gst_object_unref (l->sink);
2600 strcmp (GST_ELEMENT_NAME (ret), l->sink_name) == 0 ? ret : NULL;
2604 SET_ERROR (error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
2605 "No element named \"%s\" - omitting link", l->sink_name);
2606 gst_parse_free_link (l);
2610 gst_parse_perform_link (l, &g);
2612 g_slist_free (g.links);
2615 #ifdef __GST_PARSE_TRACE
2616 GST_CAT_DEBUG (GST_CAT_PIPELINE,
2617 "TRACE: %u strings, %u chains and %u links left", __strings, __chains,
2619 if (__strings || __chains || __links) {
2620 g_warning ("TRACE: %u strings, %u chains and %u links left", __strings,
2623 #endif /* __GST_PARSE_TRACE */
2629 g_slist_foreach (g.chain->elements, (GFunc) gst_object_unref, NULL);
2630 g_slist_free (g.chain->elements);
2631 gst_parse_chain_free (g.chain);
2634 g_slist_foreach (g.links, (GFunc) gst_parse_free_link, NULL);
2635 g_slist_free (g.links);