2 #include "../gst_private.h"
7 #include <glib/gprintf.h>
10 #include "../gstinfo.h"
11 #include "../gsturi.h"
12 #include "grammar.tab.h"
14 /* Override the default ECHO so as to avoid fortify warnings. Ignore the
15 embedded-NUL case for now. We know yytext is NUL-terminated. */
16 #define ECHO g_fprintf(yyout, "%s", yytext)
18 #ifdef G_HAVE_ISO_VARARGS
19 #define PRINT(...) GST_CAT_DEBUG (GST_CAT_PIPELINE, "flex: " __VA_ARGS__)
20 #elif defined(G_HAVE_GNUC_VARARGS)
21 #define PRINT(args...) GST_CAT_DEBUG (GST_CAT_PIPELINE, "flex: " args)
24 PRINT (const char *format, ...)
28 va_start (varargs, format);
29 GST_CAT_LEVEL_LOG_valist (GST_CAT_PIPELINE, GST_LEVEL_DEBUG, NULL,
38 _identifier [[:alnum:]_][[:alnum:]\-_%:]*
40 _char ("\\".)|([^[:space:]])
41 _string {_char}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\'")*"'")
43 _assign [[:space:]]*"="[[:space:]]*
45 _protocol [[:alpha:]][[:alnum:]+-\.]*
46 _url ({_protocol}"://"{_string}|["."{_identifier}]?"/"{_string})|({_protocol}"://")
48 /* we must do this here, because nearly everything matches a {_string} */
49 _assignment {_identifier}{_assign}{_string}
51 /* get pad/element references and stuff with dots right */
52 _padref "."{_identifier}
53 _ref {_identifier}"."{_identifier}?
54 _binref {_identifier}[[:space:]]*"."[[:space:]]*"("
57 _mimechar [[:alnum:]-]
58 _mimetype {_mimechar}+"/"{_mimechar}+
59 _capschar ("\\".)|([^\;!])
60 _capsstring {_capschar}+
61 _caps {_mimetype}(","[^!]|{_capsstring})*
62 _link ("!"[[:space:]]*{_caps}([[:space:]]*(";"[[:space:]]*{_caps})*[[:space:]]*)*"!")|("!")
69 %option never-interactive
75 PRINT ("ASSIGNMENT: %s", yytext);
76 yylval->s = gst_parse_strdup (yytext);
83 PRINT ("PADREF: %s", yytext);
84 yylval->s = gst_parse_strdup (yytext);
90 PRINT ("REF: %s", yytext);
91 yylval->s = gst_parse_strdup (yytext);
98 while (!g_ascii_isspace (*pos) && (*pos != '.')) pos++;
100 PRINT ("BINREF: %s", yytext);
101 yylval->s = gst_parse_strdup (yytext);
107 PRINT ("IDENTIFIER: %s", yytext);
108 yylval->s = gst_parse_strdup (yytext);
115 PRINT ("LINK: %s", yytext);
118 while (g_ascii_isspace (*c)) c++;
119 c = yylval->s = gst_parse_strdup (c);
122 g_assert_not_reached ();
123 while (g_ascii_isspace (*--c));
132 PRINT ("URL: %s", yytext);
133 yylval->s = g_strdup (yytext);
134 gst_parse_unescape (yylval->s);
139 {_operator} { PRINT ("OPERATOR: [%s]", yytext); return *yytext; }
141 [[:space:]]+ { PRINT ("SPACE: [%s]", yytext); }
144 PRINT ("Invalid Lexer element: %s\n", yytext);