5 #include "../gst_private.h"
8 #include "../gstinfo.h"
10 #include "grammar.tab.h"
12 #ifdef G_HAVE_ISO_VARARGS
13 #define PRINT(...) GST_CAT_DEBUG (GST_CAT_PIPELINE, "flex: " __VA_ARGS__)
14 #elif defined(G_HAVE_GNUC_VARARGS)
15 #define PRINT(args...) GST_CAT_DEBUG (GST_CAT_PIPELINE, "flex: " args)
18 PRINT (const char *format, ...)
22 va_start (varargs, format);
23 GST_CAT_LEVEL_LOG_valist (GST_CAT_PIPELINE, GST_LEVEL_DEBUG, NULL,
29 #define YY_DECL int _gst_parse_yylex (YYSTYPE *lvalp)
32 _operator [(){}.:!,;=]
33 _identifier [[:alpha:]][[:alnum:]\-_%]*
35 _char ("\\".)|([^[:space:]])
36 _string {_char}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
38 _comma [[:space:]]*","[[:space:]]*
39 _assign [[:space:]]*"="[[:space:]]*
41 _protocol [[:alpha:]][[:alnum:]+-\.]*
42 _url {_protocol}"://"{_string}|["."{_identifier}]?"/"{_string}
44 /* we must do this here, because nearly everything matches a {_string} */
45 _assignment {_identifier}{_assign}{_string}
47 /* get pad/element references and stuff with dots right */
48 _padref "."{_identifier}
49 _ref {_identifier}"."{_identifier}?
50 _binref {_identifier}[[:space:]]*"."[[:space:]]*"("
53 _mimechar ([[:alnum:]-])
54 _mimetype ({_mimechar}+"/"{_mimechar}+)|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
55 _capschar ("\\".)|([^\;!])
56 _capsstring {_capschar}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
57 _caps {_mimetype}(","[^!]|{_capsstring})*
58 _link ("!"[[:space:]]*{_caps}([[:space:]]*(";"[[:space:]]*{_caps})*[[:space:]]*)*"!")|("!")
67 PRINT ("ASSIGNMENT: %s", yytext);
68 lvalp->s = gst_parse_strdup (yytext);
75 PRINT ("PADREF: %s", yytext);
76 lvalp->s = gst_parse_strdup (yytext);
82 PRINT ("REF: %s", yytext);
83 lvalp->s = gst_parse_strdup (yytext);
90 while (!g_ascii_isspace (*pos) && (*pos != '.')) pos++;
92 PRINT ("BINREF: %s", yytext);
93 lvalp->s = gst_parse_strdup (yytext);
99 PRINT ("IDENTIFIER: %s", yytext);
100 lvalp->s = gst_parse_strdup (yytext);
107 PRINT ("LINK: %s", yytext);
110 while (g_ascii_isspace (*c)) c++;
111 c = lvalp->s = gst_parse_strdup (c);
113 g_assert (*--c == '!');
114 while (g_ascii_isspace (*--c));
123 PRINT ("URL: %s", yytext);
124 if (gst_uri_is_valid (yytext)) {
125 lvalp->s = g_strdup (yytext);
127 lvalp->s = gst_uri_construct ("file", yytext);
129 gst_parse_unescape (lvalp->s);
134 {_operator} { PRINT ("OPERATOR: [%s]", yytext); return *yytext; }
136 [[:space:]]+ { PRINT ("SPACE: [%s]", yytext); }
139 printf ("???: %s\n", yytext);