YAPP(1)

πŸŽ€ NAME πŸŽ€

okay bestie, meet yapp β€” that's YAPP(1) from the User Contributed Perl Documentation corner 🫢. It's a Perl frontend to the Parse::Yapp module, and honestly? It's giving compiler-core main character energy: it compiles Parse::Yapp grammar input files into Perl LALR(1) OO parser modules ✨.

✨ SYNOPSYS ✨

Not me matching the original section spelling β€” it really is SYNOPSYS πŸ’…. Here's the invocation tea:

yapp [options] grammar[.yp]

yapp -V

yapp -h

πŸ’– DESCRIPTION πŸ’–

So yapp is a frontend to the Parse::Yapp module, no cap. It lets you compile Parse::Yapp grammar input files into Perl LALR(1) OO parser modules. Grammar goes in, parser module comes out β€” that's the whole vibe 🌸.

πŸ¦‹ OPTIONS πŸ¦‹

Options, as of today, are all optionals :-) β€” collect them like stickers, bestie.

  • -v β€” 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. Very "let's look under the hood" energy πŸ”₯.
  • -s β€” creates a standalone module in which the driver is included. Note: if you have more than one parser module called from a program, to have it standalone, you need this option only for one of your parser modules.
  • -n β€” disables source file line numbering embedded in your parser module. ngl I don't know why one should need it, but it's there 😭.
  • -m module β€” gives your parser module the package name (or name space or module name or class name or whatever-you-call-it) of module. It defaults to grammar.
  • -o outfile β€” the compiled output file will be named outfile for your parser module. It defaults to grammar.pm or, if you specified the option -m A::Module::Name (see below), to Name.pm, in the current working directory.
  • -t filename β€” lets you 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::Yapp::Output.pm. For how to write your own template and which substitutions are available, have a look at the module Parse::Yapp::Output.pm: it should be obvious πŸ‘€.
  • -b shebang β€” if you work on systems that understand so-called shebangs, and your generated parser is directly an executable script, you can specify one with the -b option, ie:
yapp -b '/usr/local/bin/perl -w' -o myscript.pl myscript.yp

This will output a file called myscript.pl whose very first line is:

#!/usr/local/bin/perl -w

The argument is mandatory, but if you specify an empty string, the value of $Config{perlpath} will be used instead.

  • grammar β€” the input grammar file. If no suffix is given, and the file does not exists (keeping the original grammar, bestie), an attempt to open the file with a suffix of .yp is tried before exiting.
  • -V β€” display current version of Parse::Yapp and gracefully exits. Slay, graceful exit πŸ’….
  • -h β€” display the usage screen.

🌸 BUGS 🌸

None known now :-) β€” we love a clean bug list, periodt.

πŸ‘‘ AUTHOR πŸ‘‘

William N. Braswell, Jr. <wbraswell_cpan@NOSPAM.nym.hush.com> (remove "NOSPAM"). Yes bestie, remove the NOSPAM part β€” that's the whole instruction 🫢.

Copyright Β© 1998, 1999, 2000, 2001, Francois Desarmenien. Copyright Β© 2017 William N. Braswell, Jr.

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

🌈 SEE ALSO 🌈

Parse::Yapp(3) Perl(1) yacc(1) bison(1) β€” go read the friends, bestie πŸ’œ.

πŸ’… cute sign-off: this page says perl v5.42.0, dated 2017-08-05, and yes it's YAPP(1) β€” mwah 🫢.

πŸ“¦ where this page comes from