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, free_string) \
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); \
330 gst_object_unref (bin); \
332 gst_parse_strfree (type); /* Need to clean up the string */ \
335 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT, \
336 _("no bin \"%s\", skipping"), type); \
337 g_slist_foreach (assign, (GFunc) gst_parse_strfree, NULL); \
338 g_slist_free (assign); \
341 for (walk = chain->elements; walk; walk = walk->next ) \
342 gst_bin_add (bin, GST_ELEMENT (walk->data)); \
343 g_slist_free (chain->elements); \
344 chain->elements = g_slist_prepend (NULL, bin); \
346 /* set the properties now */ \
347 for (walk = assign; walk; walk = walk->next) \
348 gst_parse_element_set ((gchar *) walk->data, GST_ELEMENT (bin), graph); \
349 g_slist_free (assign); \
353 #define MAKE_LINK(link, _src, _src_name, _src_pads, _sink, _sink_name, _sink_pads) \
355 link = gst_parse_link_new (); \
357 link->sink = _sink; \
358 link->src_name = _src_name; \
359 link->sink_name = _sink_name; \
360 link->src_pads = _src_pads; \
361 link->sink_pads = _sink_pads; \
365 #define MAKE_REF(link, _src, _pads) \
367 gchar *padname = _src; \
368 GSList *pads = _pads; \
370 while (*padname != '.') padname++; \
373 if (*padname != '\0') \
374 pads = g_slist_prepend (pads, gst_parse_strdup (padname)); \
376 MAKE_LINK (link, NULL, _src, pads, NULL, NULL, NULL); \
380 gst_parse_element_set (gchar * value, GstElement * element, graph_t * graph)
388 /* parse the string, so the property name is null-terminated an pos points
389 to the beginning of the value */
390 while (!g_ascii_isspace (*pos) && (*pos != '='))
397 while (g_ascii_isspace (*pos))
401 while (g_ascii_isspace (*pos))
405 pos[strlen (pos) - 1] = '\0';
407 gst_parse_unescape (pos);
409 if (gst_child_proxy_lookup (GST_OBJECT (element), value, &target, &pspec)) {
410 value_type = G_PARAM_SPEC_VALUE_TYPE (pspec);
411 GST_CAT_LOG (GST_CAT_PIPELINE, "parsing property %s as a %s", pspec->name,
412 g_type_name (value_type));
413 g_value_init (&v, value_type);
414 if (!gst_value_deserialize (&v, pos))
416 g_object_set_property (G_OBJECT (target), pspec->name, &v);
417 gst_object_unref (target);
419 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_PROPERTY,
420 _("no property \"%s\" in element \"%s\""), value,
421 GST_ELEMENT_NAME (element));
425 gst_parse_strfree (value);
431 gst_object_unref (target);
432 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
433 _("could not set property \"%s\" in element \"%s\" to \"%s\""),
434 value, GST_ELEMENT_NAME (element), pos);
438 gst_parse_free_link (link_t * link)
440 gst_parse_strfree (link->src_name);
441 gst_parse_strfree (link->sink_name);
442 g_slist_foreach (link->src_pads, (GFunc) gst_parse_strfree, NULL);
443 g_slist_foreach (link->sink_pads, (GFunc) gst_parse_strfree, NULL);
444 g_slist_free (link->src_pads);
445 g_slist_free (link->sink_pads);
447 gst_caps_unref (link->caps);
448 gst_parse_link_free (link);
452 gst_parse_found_pad (GstElement * src, GstPad * pad, gpointer data)
454 DelayedLink *link = (DelayedLink *) data;
456 GST_CAT_INFO (GST_CAT_PIPELINE, "trying delayed linking %s:%s to %s:%s",
457 GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (link->src_pad),
458 GST_STR_NULL (GST_ELEMENT_NAME (link->sink)),
459 GST_STR_NULL (link->sink_pad));
461 if (gst_element_link_pads_filtered (src, link->src_pad, link->sink,
462 link->sink_pad, link->caps)) {
463 /* do this here, we don't want to get any problems later on when
464 * unlocking states */
465 GST_CAT_DEBUG (GST_CAT_PIPELINE, "delayed linking %s:%s to %s:%s worked",
466 GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (link->src_pad),
467 GST_STR_NULL (GST_ELEMENT_NAME (link->sink)),
468 GST_STR_NULL (link->sink_pad));
469 g_signal_handler_disconnect (src, link->signal_id);
470 g_free (link->src_pad);
471 g_free (link->sink_pad);
473 gst_caps_unref (link->caps);
478 /* both padnames and the caps may be NULL */
480 gst_parse_perform_delayed_link (GstElement * src, const gchar * src_pad,
481 GstElement * sink, const gchar * sink_pad, GstCaps * caps)
484 gst_element_class_get_pad_template_list (GST_ELEMENT_GET_CLASS (src));
486 for (; templs; templs = templs->next) {
487 GstPadTemplate *templ = (GstPadTemplate *) templs->data;
489 if ((GST_PAD_TEMPLATE_DIRECTION (templ) == GST_PAD_SRC) &&
490 (GST_PAD_TEMPLATE_PRESENCE (templ) == GST_PAD_SOMETIMES)) {
491 DelayedLink *data = g_new (DelayedLink, 1);
493 /* TODO: maybe we should check if src_pad matches this template's names */
495 GST_CAT_DEBUG (GST_CAT_PIPELINE, "trying delayed link %s:%s to %s:%s",
496 GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (src_pad),
497 GST_STR_NULL (GST_ELEMENT_NAME (sink)), GST_STR_NULL (sink_pad));
499 data->src_pad = g_strdup (src_pad);
501 data->sink_pad = g_strdup (sink_pad);
503 data->caps = gst_caps_copy (caps);
507 data->signal_id = g_signal_connect (G_OBJECT (src), "pad-added",
508 G_CALLBACK (gst_parse_found_pad), data);
516 * performs a link and frees the struct. src and sink elements must be given
517 * return values 0 - link performed
522 gst_parse_perform_link (link_t * link, graph_t * graph)
524 GstElement *src = link->src;
525 GstElement *sink = link->sink;
526 GSList *srcs = link->src_pads;
527 GSList *sinks = link->sink_pads;
529 g_assert (GST_IS_ELEMENT (src));
530 g_assert (GST_IS_ELEMENT (sink));
532 GST_CAT_INFO (GST_CAT_PIPELINE,
533 "linking %s:%s to %s:%s (%u/%u) with caps \"%" GST_PTR_FORMAT "\"",
534 GST_ELEMENT_NAME (src), link->src_name ? link->src_name : "(any)",
535 GST_ELEMENT_NAME (sink), link->sink_name ? link->sink_name : "(any)",
536 g_slist_length (srcs), g_slist_length (sinks), link->caps);
538 if (!srcs || !sinks) {
539 if (gst_element_link_pads_filtered (src,
540 srcs ? (const gchar *) srcs->data : NULL, sink,
541 sinks ? (const gchar *) sinks->data : NULL, link->caps)) {
544 if (gst_parse_perform_delayed_link (src,
545 srcs ? (const gchar *) srcs->data : NULL,
546 sink, sinks ? (const gchar *) sinks->data : NULL, link->caps)) {
553 if (g_slist_length (link->src_pads) != g_slist_length (link->src_pads)) {
556 while (srcs && sinks) {
557 const gchar *src_pad = (const gchar *) srcs->data;
558 const gchar *sink_pad = (const gchar *) sinks->data;
560 srcs = g_slist_next (srcs);
561 sinks = g_slist_next (sinks);
562 if (gst_element_link_pads_filtered (src, src_pad, sink, sink_pad,
566 if (gst_parse_perform_delayed_link (src, src_pad,
567 sink, sink_pad, link->caps)) {
576 gst_parse_free_link (link);
580 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
581 _("could not link %s to %s"), GST_ELEMENT_NAME (src),
582 GST_ELEMENT_NAME (sink));
583 gst_parse_free_link (link);
588 static int yyerror (void *scanner, graph_t * graph, const char *s);
591 /* Enabling traces. */
596 /* Enabling verbose error messages. */
597 #ifdef YYERROR_VERBOSE
598 # undef YYERROR_VERBOSE
599 # define YYERROR_VERBOSE 1
601 # define YYERROR_VERBOSE 0
604 /* Enabling the token table. */
605 #ifndef YYTOKEN_TABLE
606 # define YYTOKEN_TABLE 0
609 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
610 typedef union YYSTYPE
611 #line 471 "./grammar.y"
620 /* Line 187 of yacc.c. */
621 #line 601 "grammar.tab.c"
624 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
625 # define YYSTYPE_IS_DECLARED 1
626 # define YYSTYPE_IS_TRIVIAL 1
631 /* Copy the second part of user declarations. */
634 /* Line 216 of yacc.c. */
635 #line 614 "grammar.tab.c"
642 typedef YYTYPE_UINT8 yytype_uint8;
644 typedef unsigned char yytype_uint8;
648 typedef YYTYPE_INT8 yytype_int8;
649 #elif (defined __STDC__ || defined __C99__FUNC__ \
650 || defined __cplusplus || defined _MSC_VER)
651 typedef signed char yytype_int8;
653 typedef short int yytype_int8;
657 typedef YYTYPE_UINT16 yytype_uint16;
659 typedef unsigned short int yytype_uint16;
663 typedef YYTYPE_INT16 yytype_int16;
665 typedef short int yytype_int16;
669 # ifdef __SIZE_TYPE__
670 # define YYSIZE_T __SIZE_TYPE__
671 # elif defined size_t
672 # define YYSIZE_T size_t
673 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
674 || defined __cplusplus || defined _MSC_VER)
675 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
676 # define YYSIZE_T size_t
678 # define YYSIZE_T unsigned int
682 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
687 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
688 # define YY_(msgid) dgettext ("bison-runtime", msgid)
692 # define YY_(msgid) msgid
696 /* Suppress unused-variable warnings by "using" E. */
697 #if ! defined lint || defined __GNUC__
698 # define YYUSE(e) ((void) (e))
700 # define YYUSE(e) /* empty */
703 /* Identity function, used to suppress warnings about constant conditions. */
707 #if (defined __STDC__ || defined __C99__FUNC__ \
708 || defined __cplusplus || defined _MSC_VER)
721 #if ! defined yyoverflow || YYERROR_VERBOSE
723 /* The parser invokes alloca or malloc; define the necessary symbols. */
725 # ifdef YYSTACK_USE_ALLOCA
726 # if YYSTACK_USE_ALLOCA
728 # define YYSTACK_ALLOC __builtin_alloca
729 # elif defined __BUILTIN_VA_ARG_INCR
730 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
732 # define YYSTACK_ALLOC __alloca
733 # elif defined _MSC_VER
734 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
735 # define alloca _alloca
737 # define YYSTACK_ALLOC alloca
738 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
739 || defined __cplusplus || defined _MSC_VER)
740 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
749 # ifdef YYSTACK_ALLOC
750 /* Pacify GCC's `empty if-body' warning. */
751 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
752 # ifndef YYSTACK_ALLOC_MAXIMUM
753 /* The OS might guarantee only one guard page at the bottom of the stack,
754 and a page size can be as small as 4096 bytes. So we cannot safely
755 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
756 to allow for a few compiler-allocated temporary stack slots. */
757 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
760 # define YYSTACK_ALLOC YYMALLOC
761 # define YYSTACK_FREE YYFREE
762 # ifndef YYSTACK_ALLOC_MAXIMUM
763 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
765 # if (defined __cplusplus && ! defined _STDLIB_H \
766 && ! ((defined YYMALLOC || defined malloc) \
767 && (defined YYFREE || defined free)))
768 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
774 # define YYMALLOC malloc
775 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
776 || defined __cplusplus || defined _MSC_VER)
777 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
782 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
783 || defined __cplusplus || defined _MSC_VER)
784 void free (void *); /* INFRINGES ON USER NAME SPACE */
788 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
791 #if (! defined yyoverflow \
792 && (! defined __cplusplus \
793 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
795 /* A type that is properly aligned for any stack member. */
802 /* The size of the maximum gap between one aligned stack and the next. */
803 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
805 /* The size of an array large to enough to hold all stacks, each with
807 # define YYSTACK_BYTES(N) \
808 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
809 + YYSTACK_GAP_MAXIMUM)
811 /* Copy COUNT objects from FROM to TO. The source and destination do
814 # if defined __GNUC__ && 1 < __GNUC__
815 # define YYCOPY(To, From, Count) \
816 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
818 # define YYCOPY(To, From, Count) \
822 for (yyi = 0; yyi < (Count); yyi++) \
823 (To)[yyi] = (From)[yyi]; \
829 /* Relocate STACK from its old location to the new one. The
830 local variables YYSIZE and YYSTACKSIZE give the old and new number of
831 elements in the stack, and YYPTR gives the new location of the
832 stack. Advance YYPTR to a properly aligned location for the next
834 # define YYSTACK_RELOCATE(Stack) \
837 YYSIZE_T yynewbytes; \
838 YYCOPY (&yyptr->Stack, Stack, yysize); \
839 Stack = &yyptr->Stack; \
840 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
841 yyptr += yynewbytes / sizeof (*yyptr); \
847 /* YYFINAL -- State number of the termination state. */
849 /* YYLAST -- Last index in YYTABLE. */
852 /* YYNTOKENS -- Number of terminals. */
854 /* YYNNTS -- Number of nonterminals. */
856 /* YYNRULES -- Number of rules. */
858 /* YYNRULES -- Number of states. */
861 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
863 #define YYMAXUTOK 264
865 #define YYTRANSLATE(YYX) \
866 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
868 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
869 static const yytype_uint8 yytranslate[] = {
870 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
871 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
872 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
873 2, 2, 2, 14, 2, 2, 2, 2, 2, 2,
874 10, 11, 2, 2, 12, 2, 13, 2, 2, 2,
875 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
876 2, 15, 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, 2, 2, 2, 2,
893 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
894 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
895 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
900 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
902 static const yytype_uint8 yyprhs[] = {
903 0, 0, 3, 5, 8, 9, 12, 17, 22, 26,
904 31, 33, 36, 39, 43, 45, 48, 50, 52, 53,
905 57, 59, 62, 65, 67, 69, 72, 75, 78, 81,
909 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
910 static const yytype_int8 yyrhs[] = {
911 27, 0, -1, 4, -1, 17, 8, -1, -1, 18,
912 8, -1, 10, 18, 26, 11, -1, 5, 18, 26,
913 11, -1, 5, 18, 11, -1, 5, 18, 1, 11,
914 -1, 6, -1, 6, 21, -1, 12, 4, -1, 12,
915 4, 21, -1, 7, -1, 7, 21, -1, 22, -1,
916 20, -1, -1, 23, 9, 23, -1, 24, -1, 24,
917 25, -1, 25, 1, -1, 17, -1, 19, -1, 26,
918 26, -1, 26, 25, -1, 26, 1, -1, 24, 26,
919 -1, 3, 26, -1, 24, 3, -1, -1, 26, -1
922 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
923 static const yytype_uint16 yyrline[] = {
924 0, 506, 506, 514, 518, 519, 521, 522, 525, 528,
925 533, 534, 538, 539, 542, 543, 546, 547, 548, 551,
926 564, 565, 566, 569, 574, 575, 610, 638, 639, 653,
931 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
932 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
933 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
934 static const char *const yytname[] = {
935 "$end", "error", "$undefined", "PARSE_URL", "IDENTIFIER", "BINREF",
936 "PADREF", "REF", "ASSIGNMENT", "LINK", "'('", "')'", "','", "'.'", "'!'",
937 "'='", "$accept", "element", "assignments", "bin", "pads", "padlist",
938 "reference", "linkpart", "link", "linklist", "chain", "graph", 0
943 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
945 static const yytype_uint16 yytoknum[] = {
946 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
947 40, 41, 44, 46, 33, 61
951 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
952 static const yytype_uint8 yyr1[] = {
953 0, 16, 17, 17, 18, 18, 19, 19, 19, 19,
954 20, 20, 21, 21, 22, 22, 23, 23, 23, 24,
955 25, 25, 25, 26, 26, 26, 26, 26, 26, 26,
959 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
960 static const yytype_uint8 yyr2[] = {
961 0, 2, 1, 2, 0, 2, 4, 4, 3, 4,
962 1, 2, 2, 3, 1, 2, 1, 1, 0, 3,
963 1, 2, 2, 1, 1, 2, 2, 2, 2, 2,
967 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
968 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
969 means the default is an error. */
970 static const yytype_uint8 yydefact[] = {
971 18, 18, 2, 4, 10, 14, 4, 23, 24, 17,
972 16, 0, 18, 0, 0, 0, 0, 0, 11, 15,
973 18, 3, 18, 30, 0, 27, 20, 0, 0, 1,
974 0, 5, 8, 0, 12, 0, 19, 0, 22, 9,
978 /* YYDEFGOTO[NTERM-NUM]. */
979 static const yytype_int8 yydefgoto[] = {
980 -1, 7, 16, 8, 9, 18, 10, 11, 26, 27,
984 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
986 #define YYPACT_NINF -6
987 static const yytype_int16 yypact[] = {
988 134, 158, -6, -6, -1, -1, -6, 6, -6, -6,
989 -6, 7, 166, 101, 18, 30, 89, 16, -6, -6,
990 2, -6, 129, 142, 42, -6, 150, 54, 66, -6,
991 11, -6, -6, 111, -1, 122, -6, 78, -6, -6,
995 /* YYPGOTO[NTERM-NUM]. */
996 static const yytype_int8 yypgoto[] = {
997 -6, -6, 19, -6, -6, -5, -6, 10, 3, 12,
1001 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1002 positive, shift that token. If negative, reduce the rule which
1003 number is the opposite. If zero, do what YYDEFACT says.
1004 If YYTABLE_NINF, syntax error. */
1005 #define YYTABLE_NINF -33
1006 static const yytype_int8 yytable[] = {
1007 19, 13, 15, 12, 12, 1, 2, 3, 4, 5,
1008 31, 17, 6, 24, 21, 12, 22, 33, 29, 12,
1009 34, 35, 39, 12, 15, 20, 12, 24, 0, 41,
1010 -29, 25, 36, 1, 2, 3, 4, 5, 37, -18,
1011 6, -29, -28, 25, 0, 1, 2, 3, 4, 5,
1012 0, -18, 6, -28, -26, 38, 0, -26, -26, -26,
1013 -26, -26, 0, -26, -26, -26, -25, 25, 0, 1,
1014 2, 3, 4, 5, 0, -18, 6, -25, -21, 38,
1015 0, -21, -21, -21, -21, -21, 0, -21, -21, -21,
1016 30, 0, 1, 2, 3, 4, 5, 31, -18, 6,
1017 32, -32, 25, 0, 1, 2, 3, 4, 5, 0,
1018 -18, 6, 25, 0, 1, 2, 3, 4, 5, 0,
1019 -18, 6, 40, 25, 0, 1, 2, 3, 4, 5,
1020 0, -18, 6, 42, -31, 4, 5, 1, 2, 3,
1021 4, 5, 0, 0, 6, 1, 2, 3, 4, 5,
1022 0, -18, 6, 23, 2, 3, 4, 5, 0, -18,
1023 6, 1, 2, 3, 4, 5, 0, 0, 6, 23,
1027 static const yytype_int8 yycheck[] = {
1028 5, 0, 1, 0, 1, 3, 4, 5, 6, 7,
1029 8, 12, 10, 12, 8, 12, 9, 16, 0, 16,
1030 4, 20, 11, 20, 23, 6, 23, 26, -1, 34,
1031 0, 1, 22, 3, 4, 5, 6, 7, 26, 9,
1032 10, 11, 0, 1, -1, 3, 4, 5, 6, 7,
1033 -1, 9, 10, 11, 0, 1, -1, 3, 4, 5,
1034 6, 7, -1, 9, 10, 11, 0, 1, -1, 3,
1035 4, 5, 6, 7, -1, 9, 10, 11, 0, 1,
1036 -1, 3, 4, 5, 6, 7, -1, 9, 10, 11,
1037 1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
1038 11, 0, 1, -1, 3, 4, 5, 6, 7, -1,
1039 9, 10, 1, -1, 3, 4, 5, 6, 7, -1,
1040 9, 10, 11, 1, -1, 3, 4, 5, 6, 7,
1041 -1, 9, 10, 11, 0, 6, 7, 3, 4, 5,
1042 6, 7, -1, -1, 10, 3, 4, 5, 6, 7,
1043 -1, 9, 10, 3, 4, 5, 6, 7, -1, 9,
1044 10, 3, 4, 5, 6, 7, -1, -1, 10, 3,
1045 4, 5, 6, 7, -1, -1, 10
1048 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1049 symbol of state STATE-NUM. */
1050 static const yytype_uint8 yystos[] = {
1051 0, 3, 4, 5, 6, 7, 10, 17, 19, 20,
1052 22, 23, 24, 26, 27, 26, 18, 12, 21, 21,
1053 18, 8, 9, 3, 26, 1, 24, 25, 26, 0,
1054 1, 8, 11, 26, 4, 26, 23, 25, 1, 11,
1058 #define yyerrok (yyerrstatus = 0)
1059 #define yyclearin (yychar = YYEMPTY)
1060 #define YYEMPTY (-2)
1063 #define YYACCEPT goto yyacceptlab
1064 #define YYABORT goto yyabortlab
1065 #define YYERROR goto yyerrorlab
1068 /* Like YYERROR except do call yyerror. This remains here temporarily
1069 to ease the transition to the new meaning of YYERROR, for GCC.
1070 Once GCC version 2 has supplanted version 1, this can go. */
1072 #define YYFAIL goto yyerrlab
1074 #define YYRECOVERING() (!!yyerrstatus)
1076 #define YYBACKUP(Token, Value) \
1078 if (yychar == YYEMPTY && yylen == 1) \
1082 yytoken = YYTRANSLATE (yychar); \
1088 yyerror (scanner, graph, YY_("syntax error: cannot back up")); \
1095 #define YYERRCODE 256
1098 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1099 If N is 0, then set CURRENT to the empty location which ends
1100 the previous symbol: RHS[0] (always defined). */
1102 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1103 #ifndef YYLLOC_DEFAULT
1104 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1108 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1109 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1110 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1111 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1115 (Current).first_line = (Current).last_line = \
1116 YYRHSLOC (Rhs, 0).last_line; \
1117 (Current).first_column = (Current).last_column = \
1118 YYRHSLOC (Rhs, 0).last_column; \
1124 /* YY_LOCATION_PRINT -- Print the location on the stream.
1125 This macro was not mandated originally: define only if we know
1126 we won't break user code: when these are the locations we know. */
1128 #ifndef YY_LOCATION_PRINT
1129 # if YYLTYPE_IS_TRIVIAL
1130 # define YY_LOCATION_PRINT(File, Loc) \
1131 fprintf (File, "%d.%d-%d.%d", \
1132 (Loc).first_line, (Loc).first_column, \
1133 (Loc).last_line, (Loc).last_column)
1135 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1140 /* YYLEX -- calling `yylex' with the right arguments. */
1143 # define YYLEX yylex (&yylval, YYLEX_PARAM)
1145 # define YYLEX yylex (&yylval)
1148 /* Enable debugging if requested. */
1152 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1153 # define YYFPRINTF fprintf
1156 # define YYDPRINTF(Args) \
1162 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1166 YYFPRINTF (stderr, "%s ", Title); \
1167 yy_symbol_print (stderr, \
1168 Type, Value, scanner, graph); \
1169 YYFPRINTF (stderr, "\n"); \
1174 /*--------------------------------.
1175 | Print this symbol on YYOUTPUT. |
1176 `--------------------------------*/
1179 #if (defined __STDC__ || defined __C99__FUNC__ \
1180 || defined __cplusplus || defined _MSC_VER)
1182 yy_symbol_value_print (FILE * yyoutput, int yytype,
1183 YYSTYPE const *const yyvaluep, void *scanner, graph_t * graph)
1186 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, graph)
1189 YYSTYPE const *const yyvaluep;
1199 if (yytype < YYNTOKENS)
1200 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1211 /*--------------------------------.
1212 | Print this symbol on YYOUTPUT. |
1213 `--------------------------------*/
1215 #if (defined __STDC__ || defined __C99__FUNC__ \
1216 || defined __cplusplus || defined _MSC_VER)
1218 yy_symbol_print (FILE * yyoutput, int yytype, YYSTYPE const *const yyvaluep,
1219 void *scanner, graph_t * graph)
1222 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, graph)
1225 YYSTYPE const *const yyvaluep;
1230 if (yytype < YYNTOKENS)
1231 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1233 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1235 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, graph);
1236 YYFPRINTF (yyoutput, ")");
1239 /*------------------------------------------------------------------.
1240 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1242 `------------------------------------------------------------------*/
1244 #if (defined __STDC__ || defined __C99__FUNC__ \
1245 || defined __cplusplus || defined _MSC_VER)
1247 yy_stack_print (yytype_int16 * bottom, yytype_int16 * top)
1250 yy_stack_print (bottom, top)
1251 yytype_int16 *bottom;
1255 YYFPRINTF (stderr, "Stack now");
1256 for (; bottom <= top; ++bottom)
1257 YYFPRINTF (stderr, " %d", *bottom);
1258 YYFPRINTF (stderr, "\n");
1261 # define YY_STACK_PRINT(Bottom, Top) \
1264 yy_stack_print ((Bottom), (Top)); \
1268 /*------------------------------------------------.
1269 | Report that the YYRULE is going to be reduced. |
1270 `------------------------------------------------*/
1272 #if (defined __STDC__ || defined __C99__FUNC__ \
1273 || defined __cplusplus || defined _MSC_VER)
1275 yy_reduce_print (YYSTYPE * yyvsp, int yyrule, void *scanner, graph_t * graph)
1278 yy_reduce_print (yyvsp, yyrule, scanner, graph)
1285 int yynrhs = yyr2[yyrule];
1287 unsigned long int yylno = yyrline[yyrule];
1289 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1291 /* The symbols being reduced. */
1292 for (yyi = 0; yyi < yynrhs; yyi++) {
1293 fprintf (stderr, " $%d = ", yyi + 1);
1294 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1295 &(yyvsp[(yyi + 1) - (yynrhs)])
1297 fprintf (stderr, "\n");
1301 # define YY_REDUCE_PRINT(Rule) \
1304 yy_reduce_print (yyvsp, Rule, scanner, graph); \
1307 /* Nonzero means print parse trace. It is left uninitialized so that
1308 multiple parsers can coexist. */
1310 #else /* !YYDEBUG */
1311 # define YYDPRINTF(Args)
1312 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1313 # define YY_STACK_PRINT(Bottom, Top)
1314 # define YY_REDUCE_PRINT(Rule)
1315 #endif /* !YYDEBUG */
1318 /* YYINITDEPTH -- initial size of the parser's stacks. */
1320 # define YYINITDEPTH 200
1323 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1324 if the built-in stack extension method is used).
1326 Do not make this value too large; the results are undefined if
1327 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1328 evaluated with infinite-precision integer arithmetic. */
1331 # define YYMAXDEPTH 10000
1339 # if defined __GLIBC__ && defined _STRING_H
1340 # define yystrlen strlen
1342 /* Return the length of YYSTR. */
1343 #if (defined __STDC__ || defined __C99__FUNC__ \
1344 || defined __cplusplus || defined _MSC_VER)
1346 yystrlen (const char *yystr)
1355 for (yylen = 0; yystr[yylen]; yylen++)
1363 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1364 # define yystpcpy stpcpy
1366 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1368 #if (defined __STDC__ || defined __C99__FUNC__ \
1369 || defined __cplusplus || defined _MSC_VER)
1371 yystpcpy (char *yydest, const char *yysrc)
1374 yystpcpy (yydest, yysrc)
1380 const char *yys = yysrc;
1382 while ((*yyd++ = *yys++) != '\0')
1391 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1392 quotes and backslashes, so that it's suitable for yyerror. The
1393 heuristic is that double-quoting is unnecessary unless the string
1394 contains an apostrophe, a comma, or backslash (other than
1395 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1396 null, do not copy; instead, return the length of what the result
1399 yytnamerr (char *yyres, const char *yystr)
1401 if (*yystr == '"') {
1403 char const *yyp = yystr;
1409 goto do_not_strip_quotes;
1413 goto do_not_strip_quotes;
1426 do_not_strip_quotes:;
1430 return yystrlen (yystr);
1432 return yystpcpy (yyres, yystr) - yyres;
1436 /* Copy into YYRESULT an error message about the unexpected token
1437 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1438 including the terminating null byte. If YYRESULT is null, do not
1439 copy anything; just return the number of bytes that would be
1440 copied. As a special case, return 0 if an ordinary "syntax error"
1441 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1442 size calculation. */
1444 yysyntax_error (char *yyresult, int yystate, int yychar)
1446 int yyn = yypact[yystate];
1448 if (!(YYPACT_NINF < yyn && yyn <= YYLAST))
1451 int yytype = YYTRANSLATE (yychar);
1452 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1453 YYSIZE_T yysize = yysize0;
1455 int yysize_overflow = 0;
1457 { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1458 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1462 /* This is so xgettext sees the translatable formats that are
1463 constructed on the fly. */
1464 YY_ ("syntax error, unexpected %s");
1465 YY_ ("syntax error, unexpected %s, expecting %s");
1466 YY_ ("syntax error, unexpected %s, expecting %s or %s");
1467 YY_ ("syntax error, unexpected %s, expecting %s or %s or %s");
1468 YY_ ("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1472 static char const yyunexpected[] = "syntax error, unexpected %s";
1473 static char const yyexpecting[] = ", expecting %s";
1474 static char const yyor[] = " or %s";
1475 char yyformat[sizeof yyunexpected
1476 + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1477 * (sizeof yyor - 1))];
1478 char const *yyprefix = yyexpecting;
1480 /* Start YYX at -YYN if negative to avoid negative indexes in
1482 int yyxbegin = yyn < 0 ? -yyn : 0;
1484 /* Stay within bounds of both yycheck and yytname. */
1485 int yychecklim = YYLAST - yyn + 1;
1486 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1489 yyarg[0] = yytname[yytype];
1490 yyfmt = yystpcpy (yyformat, yyunexpected);
1492 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1493 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) {
1494 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) {
1497 yyformat[sizeof yyunexpected - 1] = '\0';
1500 yyarg[yycount++] = yytname[yyx];
1501 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1502 yysize_overflow |= (yysize1 < yysize);
1504 yyfmt = yystpcpy (yyfmt, yyprefix);
1508 yyf = YY_ (yyformat);
1509 yysize1 = yysize + yystrlen (yyf);
1510 yysize_overflow |= (yysize1 < yysize);
1513 if (yysize_overflow)
1514 return YYSIZE_MAXIMUM;
1517 /* Avoid sprintf, as that infringes on the user's name space.
1518 Don't have undefined behavior even if the translation
1519 produced a string with the wrong number of "%s"s. */
1520 char *yyp = yyresult;
1523 while ((*yyp = *yyf) != '\0') {
1524 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) {
1525 yyp += yytnamerr (yyp, yyarg[yyi++]);
1536 #endif /* YYERROR_VERBOSE */
1539 /*-----------------------------------------------.
1540 | Release the memory associated to this symbol. |
1541 `-----------------------------------------------*/
1544 #if (defined __STDC__ || defined __C99__FUNC__ \
1545 || defined __cplusplus || defined _MSC_VER)
1547 yydestruct (const char *yymsg, int yytype, YYSTYPE * yyvaluep, void *scanner,
1551 yydestruct (yymsg, yytype, yyvaluep, scanner, graph)
1565 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1575 /* Prevent warnings from -Wmissing-prototypes. */
1577 #ifdef YYPARSE_PARAM
1578 #if defined __STDC__ || defined __cplusplus
1579 int yyparse (void *YYPARSE_PARAM);
1583 #else /* ! YYPARSE_PARAM */
1584 #if defined __STDC__ || defined __cplusplus
1585 int yyparse (void *scanner, graph_t * graph);
1589 #endif /* ! YYPARSE_PARAM */
1600 #ifdef YYPARSE_PARAM
1601 #if (defined __STDC__ || defined __C99__FUNC__ \
1602 || defined __cplusplus || defined _MSC_VER)
1604 yyparse (void *YYPARSE_PARAM)
1607 yyparse (YYPARSE_PARAM)
1608 void *YYPARSE_PARAM;
1610 #else /* ! YYPARSE_PARAM */
1611 #if (defined __STDC__ || defined __C99__FUNC__ \
1612 || defined __cplusplus || defined _MSC_VER)
1614 yyparse (void *scanner, graph_t * graph)
1617 yyparse (scanner, graph)
1623 /* The look-ahead symbol. */
1626 /* The semantic value of the look-ahead symbol. */
1629 /* Number of syntax errors so far. */
1636 /* Number of tokens to shift before error messages enabled. */
1639 /* Look-ahead token as an internal (translated) token number. */
1643 /* Buffer for error messages, and its allocated size. */
1645 char *yymsg = yymsgbuf;
1646 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1649 /* Three stacks and their tools:
1650 `yyss': related to states,
1651 `yyvs': related to semantic values,
1652 `yyls': related to locations.
1654 Refer to the stacks thru separate pointers, to allow yyoverflow
1655 to reallocate them elsewhere. */
1657 /* The state stack. */
1658 yytype_int16 yyssa[YYINITDEPTH];
1659 yytype_int16 *yyss = yyssa;
1660 yytype_int16 *yyssp;
1662 /* The semantic value stack. */
1663 YYSTYPE yyvsa[YYINITDEPTH];
1664 YYSTYPE *yyvs = yyvsa;
1669 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1671 YYSIZE_T yystacksize = YYINITDEPTH;
1673 /* The variables used to return semantic value and location from the
1678 /* The number of symbols on the RHS of the reduced rule.
1679 Keep to zero when no symbol should be popped. */
1682 YYDPRINTF ((stderr, "Starting parse\n"));
1687 yychar = YYEMPTY; /* Cause a token to be read. */
1689 /* Initialize stack pointers.
1690 Waste one element of value and location stack
1691 so that they stay on the same level as the state stack.
1692 The wasted elements are never initialized. */
1699 /*------------------------------------------------------------.
1700 | yynewstate -- Push a new state, which is found in yystate. |
1701 `------------------------------------------------------------*/
1703 /* In all cases, when you get here, the value and location stacks
1704 have just been pushed. So pushing a state here evens the stacks. */
1710 if (yyss + yystacksize - 1 <= yyssp) {
1711 /* Get the current used size of the three stacks, in elements. */
1712 YYSIZE_T yysize = yyssp - yyss + 1;
1716 /* Give user a chance to reallocate the stack. Use copies of
1717 these so that the &'s don't force the real ones into
1719 YYSTYPE *yyvs1 = yyvs;
1720 yytype_int16 *yyss1 = yyss;
1723 /* Each stack pointer address is followed by the size of the
1724 data in use in that stack, in bytes. This used to be a
1725 conditional around just the two extra args, but that might
1726 be undefined if yyoverflow is a macro. */
1727 yyoverflow (YY_ ("memory exhausted"),
1728 &yyss1, yysize * sizeof (*yyssp),
1729 &yyvs1, yysize * sizeof (*yyvsp), &yystacksize);
1734 #else /* no yyoverflow */
1735 # ifndef YYSTACK_RELOCATE
1736 goto yyexhaustedlab;
1738 /* Extend the stack our own way. */
1739 if (YYMAXDEPTH <= yystacksize)
1740 goto yyexhaustedlab;
1742 if (YYMAXDEPTH < yystacksize)
1743 yystacksize = YYMAXDEPTH;
1746 yytype_int16 *yyss1 = yyss;
1747 union yyalloc *yyptr =
1748 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1750 goto yyexhaustedlab;
1751 YYSTACK_RELOCATE (yyss);
1752 YYSTACK_RELOCATE (yyvs);
1754 # undef YYSTACK_RELOCATE
1756 YYSTACK_FREE (yyss1);
1759 #endif /* no yyoverflow */
1761 yyssp = yyss + yysize - 1;
1762 yyvsp = yyvs + yysize - 1;
1765 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1766 (unsigned long int) yystacksize));
1768 if (yyss + yystacksize - 1 <= yyssp)
1772 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1781 /* Do appropriate processing given the current state. Read a
1782 look-ahead token if we need one and don't already have one. */
1784 /* First try to decide what to do without reference to look-ahead token. */
1785 yyn = yypact[yystate];
1786 if (yyn == YYPACT_NINF)
1789 /* Not known => get a look-ahead token if don't already have one. */
1791 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1792 if (yychar == YYEMPTY) {
1793 YYDPRINTF ((stderr, "Reading a token: "));
1797 if (yychar <= YYEOF) {
1798 yychar = yytoken = YYEOF;
1799 YYDPRINTF ((stderr, "Now at end of input.\n"));
1801 yytoken = YYTRANSLATE (yychar);
1802 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1805 /* If the proper action on seeing token YYTOKEN is to reduce or to
1806 detect an error, take that action. */
1808 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1812 if (yyn == 0 || yyn == YYTABLE_NINF)
1821 /* Count tokens shifted since error; after three, turn off error
1826 /* Shift the look-ahead token. */
1827 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1829 /* Discard the shifted token unless it is eof. */
1830 if (yychar != YYEOF)
1839 /*-----------------------------------------------------------.
1840 | yydefault -- do the default action for the current state. |
1841 `-----------------------------------------------------------*/
1843 yyn = yydefact[yystate];
1849 /*-----------------------------.
1850 | yyreduce -- Do a reduction. |
1851 `-----------------------------*/
1853 /* yyn is the number of a rule to reduce with. */
1856 /* If YYLEN is nonzero, implement the default value of the action:
1859 Otherwise, the following line sets YYVAL to garbage.
1860 This behavior is undocumented and Bison
1861 users should not rely upon it. Assigning to YYVAL
1862 unconditionally makes the parser a bit smaller, and it avoids a
1863 GCC warning that YYVAL may be used uninitialized. */
1864 yyval = yyvsp[1 - yylen];
1867 YY_REDUCE_PRINT (yyn);
1870 #line 506 "./grammar.y"
1872 (yyval.e) = gst_element_factory_make ((yyvsp[(1) - (1)].s), NULL);
1873 if ((yyval.e) == NULL) {
1874 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
1875 _("no element \"%s\""), (yyvsp[(1) - (1)].s));
1876 gst_parse_strfree ((yyvsp[(1) - (1)].s));
1879 gst_parse_strfree ((yyvsp[(1) - (1)].s));
1885 #line 514 "./grammar.y"
1887 gst_parse_element_set ((yyvsp[(2) - (2)].s), (yyvsp[(1) - (2)].e), graph);
1888 (yyval.e) = (yyvsp[(1) - (2)].e);
1894 #line 518 "./grammar.y"
1901 #line 519 "./grammar.y"
1903 (yyval.p) = g_slist_prepend ((yyvsp[(1) - (2)].p), (yyvsp[(2) - (2)].s));;
1908 #line 521 "./grammar.y"
1910 GST_BIN_MAKE ((yyval.c), "bin", (yyvsp[(3) - (4)].c),
1911 (yyvsp[(2) - (4)].p), FALSE);;
1916 #line 522 "./grammar.y"
1918 GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), (yyvsp[(3) - (4)].c),
1919 (yyvsp[(2) - (4)].p), TRUE);
1920 gst_parse_strfree ((yyvsp[(1) - (4)].s));
1926 #line 525 "./grammar.y"
1928 GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (3)].s), NULL, (yyvsp[(2) - (3)].p),
1930 gst_parse_strfree ((yyvsp[(1) - (3)].s));
1936 #line 528 "./grammar.y"
1938 GST_BIN_MAKE ((yyval.c), (yyvsp[(1) - (4)].s), NULL, (yyvsp[(2) - (4)].p),
1940 gst_parse_strfree ((yyvsp[(1) - (4)].s));
1946 #line 533 "./grammar.y"
1948 (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].s));;
1953 #line 534 "./grammar.y"
1955 (yyval.p) = (yyvsp[(2) - (2)].p);
1956 (yyval.p) = g_slist_prepend ((yyval.p), (yyvsp[(1) - (2)].s));
1962 #line 538 "./grammar.y"
1964 (yyval.p) = g_slist_prepend (NULL, (yyvsp[(2) - (2)].s));;
1969 #line 539 "./grammar.y"
1971 (yyval.p) = g_slist_prepend ((yyvsp[(3) - (3)].p), (yyvsp[(2) - (3)].s));;
1976 #line 542 "./grammar.y"
1978 MAKE_REF ((yyval.l), (yyvsp[(1) - (1)].s), NULL);;
1983 #line 543 "./grammar.y"
1985 MAKE_REF ((yyval.l), (yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].p));;
1990 #line 546 "./grammar.y"
1992 (yyval.l) = (yyvsp[(1) - (1)].l);;
1997 #line 547 "./grammar.y"
1999 MAKE_REF ((yyval.l), NULL, (yyvsp[(1) - (1)].p));;
2004 #line 548 "./grammar.y"
2006 MAKE_REF ((yyval.l), NULL, NULL);;
2011 #line 551 "./grammar.y"
2013 (yyval.l) = (yyvsp[(1) - (3)].l);
2014 if ((yyvsp[(2) - (3)].s)) {
2015 (yyval.l)->caps = gst_caps_from_string ((yyvsp[(2) - (3)].s));
2016 if ((yyval.l)->caps == NULL)
2017 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2018 _("could not parse caps \"%s\""), (yyvsp[(2) - (3)].s));
2019 gst_parse_strfree ((yyvsp[(2) - (3)].s));
2021 (yyval.l)->sink_name = (yyvsp[(3) - (3)].l)->src_name;
2022 (yyval.l)->sink_pads = (yyvsp[(3) - (3)].l)->src_pads;
2023 gst_parse_link_free ((yyvsp[(3) - (3)].l));
2029 #line 564 "./grammar.y"
2031 (yyval.p) = g_slist_prepend (NULL, (yyvsp[(1) - (1)].l));;
2036 #line 565 "./grammar.y"
2038 (yyval.p) = g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].l));;
2043 #line 566 "./grammar.y"
2045 (yyval.p) = (yyvsp[(1) - (2)].p);;
2050 #line 569 "./grammar.y"
2052 (yyval.c) = gst_parse_chain_new ();
2053 (yyval.c)->first = (yyval.c)->last = (yyvsp[(1) - (1)].e);
2054 (yyval.c)->front = (yyval.c)->back = NULL;
2055 (yyval.c)->elements = g_slist_prepend (NULL, (yyvsp[(1) - (1)].e));
2061 #line 574 "./grammar.y"
2063 (yyval.c) = (yyvsp[(1) - (1)].c);;
2068 #line 575 "./grammar.y"
2070 if ((yyvsp[(1) - (2)].c)->back && (yyvsp[(2) - (2)].c)->front) {
2071 if (!(yyvsp[(1) - (2)].c)->back->sink_name) {
2072 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2073 _("link without source element"));
2074 gst_parse_free_link ((yyvsp[(1) - (2)].c)->back);
2076 ((graph_t *) graph)->links =
2077 g_slist_prepend (((graph_t *) graph)->links,
2078 (yyvsp[(1) - (2)].c)->back);
2080 if (!(yyvsp[(2) - (2)].c)->front->src_name) {
2081 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2082 _("link without sink element"));
2083 gst_parse_free_link ((yyvsp[(2) - (2)].c)->front);
2085 ((graph_t *) graph)->links =
2086 g_slist_prepend (((graph_t *) graph)->links,
2087 (yyvsp[(2) - (2)].c)->front);
2089 (yyvsp[(1) - (2)].c)->back = NULL;
2090 } else if ((yyvsp[(1) - (2)].c)->back) {
2091 if (!(yyvsp[(1) - (2)].c)->back->sink_name) {
2092 (yyvsp[(1) - (2)].c)->back->sink = (yyvsp[(2) - (2)].c)->first;
2094 } else if ((yyvsp[(2) - (2)].c)->front) {
2095 if (!(yyvsp[(2) - (2)].c)->front->src_name) {
2096 (yyvsp[(2) - (2)].c)->front->src = (yyvsp[(1) - (2)].c)->last;
2098 (yyvsp[(1) - (2)].c)->back = (yyvsp[(2) - (2)].c)->front;
2101 if ((yyvsp[(1) - (2)].c)->back) {
2102 ((graph_t *) graph)->links =
2103 g_slist_prepend (((graph_t *) graph)->links,
2104 (yyvsp[(1) - (2)].c)->back);
2106 (yyvsp[(1) - (2)].c)->last = (yyvsp[(2) - (2)].c)->last;
2107 (yyvsp[(1) - (2)].c)->back = (yyvsp[(2) - (2)].c)->back;
2108 (yyvsp[(1) - (2)].c)->elements =
2109 g_slist_concat ((yyvsp[(1) - (2)].c)->elements,
2110 (yyvsp[(2) - (2)].c)->elements);
2111 if ((yyvsp[(2) - (2)].c))
2112 gst_parse_chain_free ((yyvsp[(2) - (2)].c));
2113 (yyval.c) = (yyvsp[(1) - (2)].c);
2119 #line 610 "./grammar.y"
2123 if ((yyvsp[(1) - (2)].c)->back) {
2124 (yyvsp[(2) - (2)].p) =
2125 g_slist_prepend ((yyvsp[(2) - (2)].p), (yyvsp[(1) - (2)].c)->back);
2126 (yyvsp[(1) - (2)].c)->back = NULL;
2128 if (!((link_t *) (yyvsp[(2) - (2)].p)->data)->src_name) {
2129 ((link_t *) (yyvsp[(2) - (2)].p)->data)->src =
2130 (yyvsp[(1) - (2)].c)->last;
2133 for (walk = (yyvsp[(2) - (2)].p); walk; walk = walk->next) {
2134 link_t *link = (link_t *) walk->data;
2136 if (!link->sink_name && walk->next) {
2137 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2138 _("link without sink element"));
2139 gst_parse_free_link (link);
2140 } else if (!link->src_name && !link->src) {
2141 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2142 _("link without source element"));
2143 gst_parse_free_link (link);
2146 ((graph_t *) graph)->links =
2147 g_slist_prepend (((graph_t *) graph)->links, link);
2149 (yyvsp[(1) - (2)].c)->back = link;
2153 g_slist_free ((yyvsp[(2) - (2)].p));
2154 (yyval.c) = (yyvsp[(1) - (2)].c);
2160 #line 638 "./grammar.y"
2162 (yyval.c) = (yyvsp[(1) - (2)].c);;
2167 #line 639 "./grammar.y"
2169 if ((yyvsp[(2) - (2)].c)->front) {
2170 if (!(yyvsp[(2) - (2)].c)->front->src_name) {
2171 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2172 _("link without source element"));
2173 gst_parse_free_link ((yyvsp[(2) - (2)].c)->front);
2175 ((graph_t *) graph)->links =
2176 g_slist_prepend (((graph_t *) graph)->links,
2177 (yyvsp[(2) - (2)].c)->front);
2180 if (!(yyvsp[(1) - (2)].l)->sink_name) {
2181 (yyvsp[(1) - (2)].l)->sink = (yyvsp[(2) - (2)].c)->first;
2183 (yyvsp[(2) - (2)].c)->front = (yyvsp[(1) - (2)].l);
2184 (yyval.c) = (yyvsp[(2) - (2)].c);
2190 #line 653 "./grammar.y"
2192 (yyval.c) = (yyvsp[(2) - (2)].c);
2193 if ((yyval.c)->front) {
2194 GstElement *element =
2195 gst_element_make_from_uri (GST_URI_SRC, (yyvsp[(1) - (2)].s), NULL);
2197 SET_ERROR (((graph_t *) graph)->error,
2198 GST_PARSE_ERROR_NO_SUCH_ELEMENT,
2199 _("no source element for URI \"%s\""), (yyvsp[(1) - (2)].s));
2201 (yyval.c)->front->src = element;
2202 ((graph_t *) graph)->links = g_slist_prepend (
2203 ((graph_t *) graph)->links, (yyval.c)->front);
2204 (yyval.c)->front = NULL;
2205 (yyval.c)->elements = g_slist_prepend ((yyval.c)->elements, element);
2208 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2209 _("no element to link URI \"%s\" to"), (yyvsp[(1) - (2)].s));
2211 g_free ((yyvsp[(1) - (2)].s));
2217 #line 673 "./grammar.y"
2219 GstElement *element =
2220 gst_element_make_from_uri (GST_URI_SINK, (yyvsp[(2) - (2)].s), NULL);
2222 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
2223 _("no sink element for URI \"%s\""), (yyvsp[(2) - (2)].s));
2224 gst_parse_link_free ((yyvsp[(1) - (2)].l));
2225 g_free ((yyvsp[(2) - (2)].s));
2227 } else if ((yyvsp[(1) - (2)].l)->sink_name
2228 || (yyvsp[(1) - (2)].l)->sink_pads) {
2229 gst_object_unref (element);
2230 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2231 _("could not link sink element for URI \"%s\""),
2232 (yyvsp[(2) - (2)].s));
2233 gst_parse_link_free ((yyvsp[(1) - (2)].l));
2234 g_free ((yyvsp[(2) - (2)].s));
2237 (yyval.c) = gst_parse_chain_new ();
2238 (yyval.c)->first = (yyval.c)->last = element;
2239 (yyval.c)->front = (yyvsp[(1) - (2)].l);
2240 (yyval.c)->front->sink = element;
2241 (yyval.c)->elements = g_slist_prepend (NULL, element);
2243 g_free ((yyvsp[(2) - (2)].s));
2249 #line 698 "./grammar.y"
2251 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_EMPTY,
2252 _("empty pipeline not allowed"));
2253 (yyval.g) = (graph_t *) graph;
2259 #line 701 "./grammar.y"
2261 (yyval.g) = (graph_t *) graph;
2262 if ((yyvsp[(1) - (1)].c)->front) {
2263 if (!(yyvsp[(1) - (1)].c)->front->src_name) {
2264 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2265 _("link without source element"));
2266 gst_parse_free_link ((yyvsp[(1) - (1)].c)->front);
2269 g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->front);
2271 (yyvsp[(1) - (1)].c)->front = NULL;
2273 if ((yyvsp[(1) - (1)].c)->back) {
2274 if (!(yyvsp[(1) - (1)].c)->back->sink_name) {
2275 SET_ERROR (((graph_t *) graph)->error, GST_PARSE_ERROR_LINK,
2276 _("link without sink element"));
2277 gst_parse_free_link ((yyvsp[(1) - (1)].c)->back);
2280 g_slist_prepend ((yyval.g)->links, (yyvsp[(1) - (1)].c)->back);
2282 (yyvsp[(1) - (1)].c)->back = NULL;
2284 (yyval.g)->chain = (yyvsp[(1) - (1)].c);
2290 /* Line 1267 of yacc.c. */
2291 #line 2202 "grammar.tab.c"
2295 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2299 YY_STACK_PRINT (yyss, yyssp);
2304 /* Now `shift' the result of the reduction. Determine what state
2305 that goes to, based on the state we popped back to and the rule
2306 number reduced by. */
2310 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2311 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2312 yystate = yytable[yystate];
2314 yystate = yydefgoto[yyn - YYNTOKENS];
2319 /*------------------------------------.
2320 | yyerrlab -- here on detecting error |
2321 `------------------------------------*/
2323 /* If not already recovering from an error, report this error. */
2326 #if ! YYERROR_VERBOSE
2327 yyerror (scanner, graph, YY_ ("syntax error"));
2330 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2332 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) {
2333 YYSIZE_T yyalloc = 2 * yysize;
2335 if (!(yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2336 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2337 if (yymsg != yymsgbuf)
2338 YYSTACK_FREE (yymsg);
2339 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2341 yymsg_alloc = yyalloc;
2344 yymsg_alloc = sizeof yymsgbuf;
2348 if (0 < yysize && yysize <= yymsg_alloc) {
2349 (void) yysyntax_error (yymsg, yystate, yychar);
2350 yyerror (scanner, graph, yymsg);
2352 yyerror (scanner, graph, YY_ ("syntax error"));
2354 goto yyexhaustedlab;
2362 if (yyerrstatus == 3) {
2363 /* If just tried and failed to reuse look-ahead token after an
2364 error, discard it. */
2366 if (yychar <= YYEOF) {
2367 /* Return failure if at end of input. */
2368 if (yychar == YYEOF)
2371 yydestruct ("Error: discarding", yytoken, &yylval, scanner, graph);
2376 /* Else will try to reuse look-ahead token after shifting the error
2381 /*---------------------------------------------------.
2382 | yyerrorlab -- error raised explicitly by YYERROR. |
2383 `---------------------------------------------------*/
2386 /* Pacify compilers like GCC when the user code never invokes
2387 YYERROR and the label yyerrorlab therefore never appears in user
2389 if ( /*CONSTCOND*/ 0)
2392 /* Do not reclaim the symbols of the rule which action triggered
2396 YY_STACK_PRINT (yyss, yyssp);
2401 /*-------------------------------------------------------------.
2402 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2403 `-------------------------------------------------------------*/
2405 yyerrstatus = 3; /* Each real token shifted decrements this. */
2408 yyn = yypact[yystate];
2409 if (yyn != YYPACT_NINF) {
2411 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) {
2418 /* Pop the current state because it cannot handle the error token. */
2423 yydestruct ("Error: popping", yystos[yystate], yyvsp, scanner, graph);
2426 YY_STACK_PRINT (yyss, yyssp);
2435 /* Shift the error token. */
2436 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2442 /*-------------------------------------.
2443 | yyacceptlab -- YYACCEPT comes here. |
2444 `-------------------------------------*/
2449 /*-----------------------------------.
2450 | yyabortlab -- YYABORT comes here. |
2451 `-----------------------------------*/
2457 /*-------------------------------------------------.
2458 | yyexhaustedlab -- memory exhaustion comes here. |
2459 `-------------------------------------------------*/
2461 yyerror (scanner, graph, YY_ ("memory exhausted"));
2467 if (yychar != YYEOF && yychar != YYEMPTY)
2468 yydestruct ("Cleanup: discarding lookahead",
2469 yytoken, &yylval, scanner, graph);
2470 /* Do not reclaim the symbols of the rule which action triggered
2471 this YYABORT or YYACCEPT. */
2473 YY_STACK_PRINT (yyss, yyssp);
2474 while (yyssp != yyss) {
2475 yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, scanner, graph);
2480 YYSTACK_FREE (yyss);
2483 if (yymsg != yymsgbuf)
2484 YYSTACK_FREE (yymsg);
2486 /* Make sure YYID is used. */
2487 return YYID (yyresult);
2491 #line 724 "./grammar.y"
2496 yyerror (void *scanner, graph_t * graph, const char *s)
2498 /* FIXME: This should go into the GError somehow, but how? */
2499 GST_WARNING ("Error during parsing: %s", s);
2505 _gst_parse_launch (const gchar * str, GError ** error)
2514 g_return_val_if_fail (str != NULL, NULL);
2520 #ifdef __GST_PARSE_TRACE
2521 GST_CAT_DEBUG (GST_CAT_PIPELINE, "TRACE: tracing enabled");
2522 __strings = __chains = __links = 0;
2523 #endif /* __GST_PARSE_TRACE */
2525 dstr = g_strdup (str);
2526 _gst_parse_yylex_init (&scanner);
2527 _gst_parse_yy_scan_string (dstr, scanner);
2533 if (yyparse (scanner, &g) != 0) {
2534 SET_ERROR (error, GST_PARSE_ERROR_SYNTAX,
2535 "Unrecoverable syntax error while parsing pipeline %s", str);
2537 _gst_parse_yylex_destroy (scanner);
2542 _gst_parse_yylex_destroy (scanner);
2545 GST_CAT_DEBUG (GST_CAT_PIPELINE, "got %u elements and %u links",
2546 g.chain ? g_slist_length (g.chain->elements) : 0,
2547 g_slist_length (g.links));
2551 } else if (!(((chain_t *) g.chain)->elements->next)) {
2552 /* only one toplevel element */
2553 ret = (GstElement *) ((chain_t *) g.chain)->elements->data;
2554 g_slist_free (((chain_t *) g.chain)->elements);
2555 if (GST_IS_BIN (ret))
2556 bin = GST_BIN (ret);
2557 gst_parse_chain_free (g.chain);
2559 /* put all elements in our bin */
2560 bin = GST_BIN (gst_element_factory_make ("pipeline", NULL));
2563 for (walk = g.chain->elements; walk; walk = walk->next) {
2564 if (walk->data != NULL)
2565 gst_bin_add (bin, GST_ELEMENT (walk->data));
2568 g_slist_free (g.chain->elements);
2569 ret = GST_ELEMENT (bin);
2570 gst_parse_chain_free (g.chain);
2574 for (walk = g.links; walk; walk = walk->next) {
2575 link_t *l = (link_t *) walk->data;
2580 l->src = gst_bin_get_by_name_recurse_up (bin, l->src_name);
2582 gst_object_unref (l->src);
2585 strcmp (GST_ELEMENT_NAME (ret), l->src_name) == 0 ? ret : NULL;
2589 SET_ERROR (error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
2590 "No element named \"%s\" - omitting link", l->src_name);
2591 gst_parse_free_link (l);
2598 l->sink = gst_bin_get_by_name_recurse_up (bin, l->sink_name);
2600 gst_object_unref (l->sink);
2603 strcmp (GST_ELEMENT_NAME (ret), l->sink_name) == 0 ? ret : NULL;
2607 SET_ERROR (error, GST_PARSE_ERROR_NO_SUCH_ELEMENT,
2608 "No element named \"%s\" - omitting link", l->sink_name);
2609 gst_parse_free_link (l);
2613 gst_parse_perform_link (l, &g);
2615 g_slist_free (g.links);
2618 #ifdef __GST_PARSE_TRACE
2619 GST_CAT_DEBUG (GST_CAT_PIPELINE,
2620 "TRACE: %u strings, %u chains and %u links left", __strings, __chains,
2622 if (__strings || __chains || __links) {
2623 g_warning ("TRACE: %u strings, %u chains and %u links left", __strings,
2626 #endif /* __GST_PARSE_TRACE */
2632 g_slist_foreach (g.chain->elements, (GFunc) gst_object_unref, NULL);
2633 g_slist_free (g.chain->elements);
2634 gst_parse_chain_free (g.chain);
2637 g_slist_foreach (g.links, (GFunc) gst_parse_free_link, NULL);
2638 g_slist_free (g.links);