mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
ges-launch: Update lexer / parser to handle set-*
+ cleanup of the lexer
This commit is contained in:
parent
ecf167e95e
commit
c6dedf2f36
3 changed files with 32 additions and 1 deletions
|
@ -107,6 +107,26 @@ ges_structure_parser_parse_symbol (GESStructureParser * self,
|
|||
self->add_comma = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
ges_structure_parser_parse_setter (GESStructureParser * self,
|
||||
const gchar * setter)
|
||||
{
|
||||
gchar *parsed_setter;
|
||||
|
||||
while (*setter == '-' || *setter == ' ')
|
||||
setter++;
|
||||
|
||||
while (*setter != '-')
|
||||
setter++;
|
||||
|
||||
setter++;
|
||||
|
||||
parsed_setter = g_strdup_printf ("set-property, property=%s, value=", setter);
|
||||
self->add_comma = FALSE;
|
||||
ges_structure_parser_parse_string (self, parsed_setter, TRUE);
|
||||
g_free (parsed_setter);
|
||||
}
|
||||
|
||||
GESStructureParser *
|
||||
ges_structure_parser_new (void)
|
||||
{
|
||||
|
|
|
@ -52,6 +52,7 @@ void ges_structure_parser_parse_string (GESStructureParser *self, const gchar *s
|
|||
void ges_structure_parser_parse_default (GESStructureParser *self, const gchar *text);
|
||||
void ges_structure_parser_parse_whitespace (GESStructureParser *self);
|
||||
void ges_structure_parser_parse_symbol (GESStructureParser *self, const gchar *symbol);
|
||||
void ges_structure_parser_parse_setter (GESStructureParser *self, const gchar *setter);
|
||||
void ges_structure_parser_end_of_file (GESStructureParser *self);
|
||||
|
||||
GESStructureParser *ges_structure_parser_new(void);
|
||||
|
|
|
@ -10,16 +10,26 @@
|
|||
%option never-interactive
|
||||
%option noinput
|
||||
|
||||
CLIP [ ]+--clip[ ]+|[ ]+-c[ ]+
|
||||
TRANSITION [ ]+--transition[ ]+|[ ]+-t[ ]+
|
||||
EFFECT [ ]+--effect[ ]+|[ ]+-e[ ]+
|
||||
|
||||
SETTER [ ]+--set-.[ ]+
|
||||
|
||||
%%
|
||||
|
||||
\"(\\.|[^"])*\" {
|
||||
ges_structure_parser_parse_string (yyextra, yytext, FALSE);
|
||||
}
|
||||
|
||||
[ ]+--clip[ ]+|[ ]+-c[ ]+|[ ]+--transition[ ]+|[ ]+-t[ ]+|[ ]+--effect[ ]+|[ ]+-e[ ]+|[ ]+--set-property[ ]+|[ ]+-s[ ]+ {
|
||||
{CLIP}|{TRANSITION}|{EFFECT} {
|
||||
ges_structure_parser_parse_symbol (yyextra, yytext);
|
||||
}
|
||||
|
||||
{SETTER} {
|
||||
ges_structure_parser_parse_setter (yyextra, yytext);
|
||||
}
|
||||
|
||||
[ \t\n]+ {
|
||||
ges_structure_parser_parse_whitespace (yyextra);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue