Subject: Re: [PATCH] yacc, lex: new 'no-ylwrap' option to prevent use of the 'ylwrap' script

From: Akim Demaille <[email-masked]>
Date: Tue, 26 Jun 2012 16:34:02 +0200

Hi Stefano,

Thanks for this!

Le 25 juin 2012 à 16:01, Stefano Lattarini a écrit :

> When used with good yacc and lex implementations, like Flex and GNU Bison,
> the 'ylwarp'

ylwrap

> script (meant to work around the deficiencies of older or
> inferior yacc and lex implementations) creates far more problems and
> annoyances than it solves.  For more details, just see the huge amount of
> related bug reports and complaints:
>  

> use will allow us to switch the default in Automake 1.13 (i.e., we will
> start *not* using ylwrap by default) while still supporting users who
> want to continue using ylwrap.

Shouldn't some Autoconf machinery just check if -o is supported?
I don't see the need for the user to have to decide whether
to use ylwrap or not.  But I agree this is certainly harder to do.

> 
> * lib/Automake/Options.pm (_is_valid_easy_option, _process_option_list):
> Recognize the options 'no-ylwrap' and 'ylwrap'.
> * automake.in (handle_languages): Pass the new transform '?USE-YLWRAP?'
> to the processed $rule_file; this transform expands to false if the
> 'no-ylwrap' option is used, and to true otherwise.
> (yacc_lex_finish_helper): Don't require nor copy the 'ylwrap' script if
> the 'no-ylwrap' option is active.
> * lib/am/lex.am, lib/am/yacc.am: Simplify rules not to use the 'ylwrap'
> script if the '?USE-YLWRAP?' transform is true.  Related refactorings.
> * t/lex-multiple.sh: New test, checks that if we get ylwrap out of the
> way, we can build a program using several lexers at once.
> * t/list-of-tests.mk (handwritten_TESTS): Add it.
> * t/yacc-bison-skeleton.sh: Use the 'no-ylwrap' option.  This allow the

allows

> test to pass, at last!
> * t/yacc-bison-skeleton-cxx.sh: Likewise.
> * t/list-of-tests.mk (XFAIL_TESTS): Remove those two tests.
> 

> @@ -333,6 +334,11 @@ sub _process_option_list (\%@)
>           # This is a little of an hack, but good enough for the moment.
>           delete $options->{'parallel-tests'};
>         }
> +      elsif ($_ eq 'ylwrap')
> +        {
> +          # This is a little of an hack, but good enough for the moment.

a hack (several times apparently :).

> +          delete $options->{'no-ylwrap'};
> +        }
>       elsif (/^filename-length-max=(\d+)$/)
>         {
>           delete $options->{$_};