mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gst/parse: define pure-parser depending on bison version
After release bison 2.5 the declaration %pure-parser was deprecated in favor of %define api.pure Nonetheless, until bison 3.4, the declaration was treated as backward compatibility, but now bison shows a warning: warning: deprecated directive, use ‘%define api.pure’ The patch's approach is to handle both directives according with the used bison's version, by string replacement at source configuration stage.
This commit is contained in:
parent
e8c782d119
commit
78041a7748
2 changed files with 11 additions and 2 deletions
|
@ -796,7 +796,7 @@ static int yyerror (void *scanner, graph_t *graph, const char *s);
|
||||||
%lex-param { void *scanner }
|
%lex-param { void *scanner }
|
||||||
%parse-param { void *scanner }
|
%parse-param { void *scanner }
|
||||||
%parse-param { graph_t *graph }
|
%parse-param { graph_t *graph }
|
||||||
%pure-parser
|
@BISON_PURE_PARSER@
|
||||||
|
|
||||||
%start graph
|
%start graph
|
||||||
%%
|
%%
|
|
@ -27,6 +27,7 @@ gen_lex = configure_file(input : 'gen_lex.py.in',
|
||||||
configuration : flex_cdata)
|
configuration : flex_cdata)
|
||||||
|
|
||||||
# Find bison, configure grammar generator
|
# Find bison, configure grammar generator
|
||||||
|
bison_parser_cdata = configuration_data()
|
||||||
bison_cdata = configuration_data()
|
bison_cdata = configuration_data()
|
||||||
|
|
||||||
bison_min_version='2.4'
|
bison_min_version='2.4'
|
||||||
|
@ -44,7 +45,15 @@ else
|
||||||
message('bison version @0@ >= @1@: YES'.format(bversion, bison_min_version))
|
message('bison version @0@ >= @1@: YES'.format(bversion, bison_min_version))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if bversion.version_compare('>' + '2.5')
|
||||||
|
bison_parser_cdata.set('BISON_PURE_PARSER', '%define api.pure full')
|
||||||
|
else
|
||||||
|
bison_parser_cdata.set('BISON_PURE_PARSER', '%pure-parser')
|
||||||
|
endif
|
||||||
|
|
||||||
|
gen_grammar_file = configure_file(input : 'grammar.y.in',
|
||||||
|
output : 'grammar.y',
|
||||||
|
configuration : bison_parser_cdata)
|
||||||
|
|
||||||
bison_cdata.set('BISON', bison.path())
|
bison_cdata.set('BISON', bison.path())
|
||||||
bison_cdata.set('BISON_ARGS', '')
|
bison_cdata.set('BISON_ARGS', '')
|
||||||
|
@ -61,7 +70,7 @@ parser = custom_target('parselex',
|
||||||
)
|
)
|
||||||
|
|
||||||
grammar = custom_target('parsegrammar',
|
grammar = custom_target('parsegrammar',
|
||||||
input : 'grammar.y',
|
input : gen_grammar_file,
|
||||||
output : ['grammar.tab.c', 'grammar.tab.h'],
|
output : ['grammar.tab.c', 'grammar.tab.h'],
|
||||||
command : [python3, gen_grammar, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@'],
|
command : [python3, gen_grammar, '@OUTPUT0@', '@OUTPUT1@', '@INPUT@'],
|
||||||
depends : [parser],
|
depends : [parser],
|
||||||
|
|
Loading…
Reference in a new issue