The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

yapphp - A perl frontend to the Parse::Yapphp module

SYNOPSYS

yapphp [options] grammar[.yp]

yapphp -V

yapphp -h

DESCRIPTION

yapphp is a frontend to the Parse::Yapphp module, which lets you compile Parse::Yapphp grammar input files into PHP LALR(1) OO parser modules.

OPTIONS

Options, as of today, are all optionals :-)

-v, --verbose

Creates a file grammar.output describing your parser. It will show you a summary of conflicts, rules, the DFA (Deterministic Finite Automaton) states and overall usage of the parser.

-N, --no-line-numbers

Disable source file line numbering embedded in your parser module. I don't know why one should need it, but it's there.

-m module, --module=module

Define main parser's PHP class name. module may include a namespace prefix. If, for example, the module name is Foo\\Bar\\My\\Parser, the parser's class name is Parser, its namespace and that of the supporting lexer interface and parser driver is Foo\\Bar\\My.

-d directory, --directory=directory

Write generated output files to directory.

-o outfile, --output=outfile

This option is really unnecessary but is provided to allow for custom output file naming. Output files' names are derived from the --module parameter by default and there's no good reason to not rely on this. Nonetheless, the --output option overrides this behavior, creating outfile, outfile.driver.php and outfile.lexer_interface.php.

-t filename, --template=filename

The -t filename option allows you to specify a file which should be used as template for generating the parser output. The default is to use the internal template defined in Parse::Yapphp::Output.pm. For how to write your own template and which substitutions are available, have a look to the module Parse::Yapphp::Output.pm : it should be obvious.

grammar

The input grammar file. If no suffix is given, and the file does not exists, an attempt to open the file with a suffix of .yp is tried before exiting.

-V

Display current version of Parse::Yapphp and gracefully exits.

-h

Display the usage screen.

BUGS

None known now :-)

AUTHOR

William N. Braswell, Jr. <wbraswell_cpan@NOSPAM.nym.hush.com>

Oliver Schieche <schiecheo@cpan.NOSPAM.org>

(Remove "NOSPAM" respectively.)

COPYRIGHT

Copyright © 1998, 1999, 2000, 2001, Francois Desarmenien. Copyright © 2017 William N. Braswell, Jr. Copyright © 2018 Oliver Schieche (PHP portions)

See Parse::Yapphp(3) for legal use and distribution rights

SEE ALSO

Parse::Yapphp(3) Perl(1) yacc(1) bison(1)