-bin: '(' assignments chain ')' { GST_BIN_MAKE ($$, "bin", $3, $2, no_free); }
- | BINREF assignments chain ')' { GST_BIN_MAKE ($$, $1, $3, $2, gst_parse_strfree);
- gst_parse_strfree ($1);
+
+/*************************************************************
+* Grammar explanation: (cont'd)
+* a _chain_ is a list of _elementary_s that have _link_s inbetween
+* which are represented through infix-notation.
+*
+* fakesrc ! sometransformation ! fakesink
+*
+* every _link_ can be augmented with _pads_.
+*
+* coffeesrc .sound ! speakersink
+* multisrc .movie,ads ! .projector,smallscreen multisink
+*
+* and every _link_ can be setup to filter media-types
+* mediasrc ! audio/x-raw, signed=TRUE ! stereosink
+*
+* User HINT:
+* if the lexer does not recognize your media-type it
+* will make it an element name. that results in errors
+* like
+* NO SUCH ELEMENT: no element audio7x-raw
+* '7' vs. '/' in https://en.wikipedia.org/wiki/QWERTZ
+*
+* Parsing HINT:
+* in the parser we need to differ between chains that can
+* be extended by more elementaries (_openchain_) and others
+* that are syntactically closed (handled later in this file).
+* (e.g. fakesrc ! sinkreferencename.padname)
+**************************************************************/
+chain: openchain { $$=$1;
+ if($$->last.name){
+ SET_ERROR (graph->error, GST_PARSE_ERROR_SYNTAX,
+ _("unexpected reference \"%s\" - ignoring"), $$->last.name);
+ gst_parse_strfree($$->last.name);
+ $$->last.name=NULL;
+ }
+ if($$->last.pads){
+ SET_ERROR (graph->error, GST_PARSE_ERROR_SYNTAX,
+ _("unexpected pad-reference \"%s\" - ignoring"), (gchar*)$$->last.pads->data);
+ g_slist_foreach ($$->last.pads, (GFunc) gst_parse_strfree, NULL);
+ g_slist_free ($$->last.pads);
+ $$->last.pads=NULL;
+ }