EnglishFrenchSpanish

OnWorks favicon

pretzel-it - Online in the Cloud

Run pretzel-it in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command pretzel-it that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


pretzel-it - use Pretzel to build a prettyprinter

SYNOPSIS


pretzel-it [-iqvdnh] language ppname

DESCRIPTION


Pretzel-it is a shell script that uses pretzel(1) to build a simple prettyprinter
executable. It minimizes building a Pretzel prettyprinter to just one shell command. See
pretzel(1) for a general overview and a description of the input files.

You have to provide the same two input files to pretzel-it as to pretzel. These two files
are called the formatted token file (suffix .ft) and the formatted grammar file (suffix
.fg). Both files need to have the same prefix language. From this input, pretzel-it
generates an executable prettyprinter called ppname.

Example
Say, you have written two files foo.ft and foo.fg that contain the prettyprinting
information for your favourite programming language foo. To get an executable
prettyprinter foopp for it, simply type:

pretzel-it foo foopp

OPTIONS


Pretzel-it has the following options:

-i Don't remove intermediate products of pretzeling.

-q Run quietly.

-v Verbose mode, print shell commands before invoking (for debugging).

-d Turn prettyprinter debugging features on by default; also produce a detailed
diagnosis file (suffix .output) that contains a detailed analysis of the
grammar and possible problems with it (to ease debugging the prettyprinting
grammar).

-h Print full usage message.

-n Noweb mode. See section Interfacing with noweb(1) below.

THE GENERATED PRETTYPRINTER


The generated executable will be a program that reads source code from the standard input
and will write prettyprinted code to the standard output. The prettyprinted code can be
typeset using latex together with the pretzel-latex document style.

Example
Say, you have built foopp already and have a scrap of source code in a file bar.foo. Type

foopp <bar.foo >bar.tex

and the prettyprinter will prettyprint the code and write LaTeX code to bar.tex. To use
this code in your documents, simple include the pretzel-latex document style and include
the file inside the new ppcode LaTeX environment. Here's a minimal LaTeX file to look at
the prettyprinted code:

\documenstyle[pretzel-latex]{article}
\begin{document}
\begin{ppcode}
\input{foo.tex}
\end{ppcode}
\end{document}

INTERFACING WITH NOWEB


Using the -n option will produce a prettyprinting filter ppname compatible to Norman
Ramsey's noweb(1) literate programming system. The filter can be inserted into the noweb
pipeline using noweave's -filter option.

For example, you can build a noweb prettyprinting filter for Pascal by issuing

pretzel-it -n pascal prettypascal

inside the languages/pascal directory, you'll get a prettyprinting filter prettypascal .
This filter then can be used within noweave(1) by saying:

noweave -filter prettypascal foo.nw > foo.tex

This will prettyprint all code chunks using the Pascal prettyprinter. You will need to
include the pretzel-noweb.sty LaTeX document style after including the noweb.sty ( see
nowebstyle(1) ) to get the output typeset correctly by LaTeX.

You can get debugging output from the prettyprinting filter by setting the environment
variable PRETZEL_NOWEB_DEBUG to a non-null value, e.g. in the bash(1) shell by saying:

export PRETZEL_NOWEB_DEBUG=on

Debug output stops only when the value is explicitly unset (in bash(1) this is the unset
builtin command.

The noweb option at present works only for LaTeX as target typesetter. If the
prettyprinter experiences problems when prettyprinting a certain code chunk, it
automatically switches to standard verbatim output of noweb. Through the inclusion of code
within rules of the formatted grammar file it is possible to automate indexing. For more
information see chapters 3 and 4 of the Pretzelbook, contained in the Pretzel
distribution.

CAVEATS


The pretzel-it shell script can only be run if the environment variables PRETZEL_LIBDIR
and PRETZEL_INCLUDE are set to the Pretzel library directory (/usr/lib/pretzel on Debian
systems) and the Pretzel include directory (/usr/include/pretzel on Debian systems).
During execution, pretzel-it might issue warnings that are due to the programs it invokes
(pretzel-it invokes pretzel(1), flex(1), bison(1) and the GNU C++ compiler).

The -n (noweb) option works only for LaTeX as target typesetter and is still very much
experimental.

Use pretzel-it online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    formkiq-core
    formkiq-core
    FormKiQ Core is an Open Source Document
    Management System (DMS), available to
    run as a headless software or with a
    web-based client, deployed to your
    Amazon We...
    Download formkiq-core
  • 2
    Blackfriday
    Blackfriday
    Blackfriday is a Markdown processor
    implemented in Go. It is paranoid about
    its input (so you can safely feed it
    user-supplied data), it is fast, it
    supports c...
    Download Blackfriday
  • 3
    QNAP NAS GPL Source
    QNAP NAS GPL Source
    GPL source for QNAP Turbo NAS.
    Audience: Developers. User interface:
    Web-based. Programming Language: C,
    Java. Categories:System, Storage,
    Operating System Ker...
    Download QNAP NAS GPL Source
  • 4
    deep-clean
    deep-clean
    A Kotlin script that nukes all build
    caches from Gradle/Android projects.
    Useful when Gradle or the IDE let you
    down. The script has been tested on
    macOS, but ...
    Download deep-clean
  • 5
    Eclipse Checkstyle Plug-in
    Eclipse Checkstyle Plug-in
    The Eclipse Checkstyle plug-in
    integrates the Checkstyle Java code
    auditor into the Eclipse IDE. The
    plug-in provides real-time feedback to
    the user about viol...
    Download Eclipse Checkstyle Plug-in
  • 6
    AstrOrzPlayer
    AstrOrzPlayer
    AstrOrz Player is a free media player
    software, part based on WMP and VLC. The
    player is in a minimalist style, with
    more than ten theme colors, and can also
    b...
    Download AstrOrzPlayer
  • More »

Linux commands

  • 1
    a2query
    a2query
    a2query - retrieve runtime
    configuration from a local Apache 2 HTTP
    server ...
    Run a2query
  • 2
    a2x
    a2x
    a2x - A toolchain manager for AsciiDoc
    (converts Asciidoc text files to other
    file formats) ...
    Run a2x
  • 3
    cooktime
    cooktime
    cooktime - set file times ...
    Run cooktime
  • 4
    cook_bom
    cook_bom
    cook_bom - bill of materials ...
    Run cook_bom
  • 5
    gbackground
    gbackground
    gbackground - interval-based gnome
    background changer SYNTAX: gbackground
    DESCRIPTION: This program allows to
    change periodically the gnome background
    in inter...
    Run gbackground
  • 6
    gbacorr
    gbacorr
    gbacorr - Compute
    auto/cross-correlation coefficients ...
    Run gbacorr
  • More »

Ad