Consult the section on '-s' at http://perldoc.perl.org/perlrun.html:

   -s

   enables rudimentary switch parsing for switches on the command line
   after the program name but before any filename arguments (or before
   an argument of --). Any switch found there is removed from @ARGV and
   sets the corresponding variable in the Perl program. The following
   program prints "1" if the program is invoked with a -xyz switch, and
   "abc" if it is invoked with -xyz=abc.
        #!/usr/bin/perl -s
        if ($xyz) { print "$xyz\n" }

   Do note that a switch like --help creates the variable ${-help} ,
   which is not compliant with use strict "refs" . Also, when using
   this option on a script with warnings enabled you may get a lot of
   spurious "used only once" warnings.


So this is probably what you want:

        perl -MParse::RecDescent -s -RD_AUTOSTUB - grammar NewMakepp::Grammar

Untested, you may need to move -s, '-RD_AUTOSTUB and the '- grammar ...' arguments around to make it work.

On 1/12/2012 9:39 AM, Yuri Shtil wrote:
The documentation is a little unclear

I use perl -MParse::RecDescent - grammar NewMakepp::Grammar to create a parser 
module.

What do I do in order to generate stubs for undefined rules?
How do I pass RD_AUTOSTUB?

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


Reply via email to