6 #define YYERROR_VERBOSE 1
21 %token <s> IDENTIFIER STRING
30 %type <p> property_value value
31 %type <c> connection lconnection rconnection qconnection iconnection
44 qid: id { $$ = g_new0 (hash_t, 1); $$->id2 = $1 }
45 | id '.' id { $$ = g_new0 (hash_t, 1); $$->id1 = $1; $$->id2 = $3; }
48 value: STRING { $$ = g_new0 (property_t, 1);
49 $$->value_type = G_TYPE_STRING; $$->value.s = $1; }
50 | FLOAT { $$ = g_new0 (property_t, 1);
51 $$->value_type = G_TYPE_DOUBLE; $$->value.d = $1; }
52 | INTEGER { $$ = g_new0 (property_t, 1);
53 $$->value_type = G_TYPE_INT; $$->value.i = $1; }
54 | BOOLEAN { $$ = g_new0 (property_t, 1);
55 $$->value_type = G_TYPE_BOOLEAN; $$->value.b = $1; }
58 property_value: id '=' value { $$ = $3; $$->name = $1; }
61 element: id { $$ = g_new0 (element_t, 1); $$->name = $1; }
64 graph: /* empty */ { $$ = g_new0 (graph_t, 1); }
65 | graph element { GList *l = $$->connections_pending;
67 $$->elements = g_list_append ($$->elements, $2);
70 ((connection_t*) l->data)->sink = $$->current->name;
73 if ($$->connections_pending) {
74 g_list_free ($$->connections_pending);
75 $$->connections_pending = NULL;
78 | graph bin { $$ = $1; $$->bins = g_list_append ($$->bins, $2); }
79 | graph connection { $$ = $1; $$->connections = g_list_append ($$->connections, $2);
81 $2->src = $$->current->name;
83 $$->connections_pending = g_list_append ($$->connections_pending, $2);
85 | graph property_value { $$ = $1;
86 $$->current->property_values = g_list_append ($$->current->property_values,
91 bin: '{' graph '}' { $$ = $2; $$->current_bin_type = "gstthread"; }
92 | id '.' '(' graph ')' { $$ = $4; $$->current_bin_type = $1; }
95 connection: lconnection
101 lconnection: qid '+' '!' { $$ = g_new0 (connection_t, 1);
103 $$->src_pads = g_list_append ($$->src_pads, $1->id2);
107 rconnection: '!' '+' qid { $$ = g_new0 (connection_t, 1);
109 $$->sink_pads = g_list_append ($$->src_pads, $3->id2);
113 qconnection: qid '+' '!' '+' qid { $$ = g_new0 (connection_t, 1);
115 $$->src_pads = g_list_append ($$->src_pads, $1->id2);
117 $$->sink_pads = g_list_append ($$->sink_pads, $5->id2);
121 iconnection: '!' { $$ = g_new0 (connection_t, 1); }
122 | id '+' iconnection '+' id
124 $$->src_pads = g_list_append ($$->src_pads, $1);
125 $$->sink_pads = g_list_append ($$->sink_pads, $5);
134 yyerror (const char *s)
136 printf ("error: %s\n", s);
140 int main (int argc, char **argv)
142 ++argv, --argc; /* skip over program name */
144 yyin = fopen (argv[0], "r");