6 #include "../gstinfo.h"
7 #include "grammar.tab.h"
13 #ifdef G_HAVE_ISO_VARARGS
14 #define PRINT(...) GST_DEBUG (GST_CAT_PIPELINE, "flex: "__VA_ARGS__)
15 #elif defined(G_HAVE_GNUC_VARARGS)
16 #define PRINT(args...) GST_DEBUG (GST_CAT_PIPELINE, "flex: "##args)
18 #define PRINT(args...)
21 #define YY_DECL int _gst_parse_yylex (YYSTYPE *lvalp)
24 _operator [(){}.:!,;=]
25 _identifier [[:alpha:]][[:alnum:]\-_%]*
27 _char ("\\".)|([^[:space:]])
28 _string {_char}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
30 _comma [[:space:]]*","[[:space:]]*
31 _assign [[:space:]]*"="[[:space:]]*
33 /* we must do this here, because nearly everything matches a {_string} */
34 _assignment {_identifier}{_assign}{_string}
36 /* get pad/element references and stuff with dots right */
37 _padref "."{_identifier}
38 _ref {_identifier}"."{_identifier}?
39 _binref {_identifier}[[:space:]]*"."[[:space:]]*"("
42 _capschar ("\\".)|([^[:space:]\;!\.\,\(\)\]\[])
43 _capsstring {_capschar}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
44 _mimetype ({_capschar}+"/"{_capschar}+)|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\"")*"'")
45 _caps {_mimetype}(","[^!]|{_capsstring})*
46 _link ("!"[[:space:]]*{_caps}([[:space:]]*";"[[:space:]]*{_caps})*[[:space:]]*"!")|("!")
55 PRINT ("ASSIGNMENT: %s\n", yytext);
56 lvalp->s = gst_parse_strdup (yytext);
63 PRINT ("PADREF: %s\n", yytext);
64 lvalp->s = gst_parse_strdup (yytext);
70 PRINT ("REF: %s\n", yytext);
71 lvalp->s = gst_parse_strdup (yytext);
78 while (!g_ascii_isspace (*pos) && (*pos != '.')) pos++;
80 PRINT ("BINREF: %s\n", yytext);
81 lvalp->s = gst_parse_strdup (yytext);
87 PRINT ("IDENTIFIER: %s\n", yytext);
88 lvalp->s = gst_parse_strdup (yytext);
95 PRINT ("LINK: %s\n", yytext);
98 while (g_ascii_isspace (*c)) c++;
99 c = lvalp->s = gst_parse_strdup (c);
101 g_assert (*--c == '!');
102 while (g_ascii_isspace (*--c));
111 {_operator} { PRINT ("OPERATOR: [%s]\n", yytext); return *yytext; }
113 [[:space:]]+ { PRINT ("SPACE: [%s]\n", yytext); }
116 printf ("???: %s\n", yytext);