Headline

Formating data structures such as source code as text

Illustration

Arguably, pretty printing is a synonym for unparsing. The term pretty printing hints at the fact that the output is supposed to be pretty. Thus, some emphasis is on the formatting rules, whereas unparsing may be as simple as mapping a parse tree to a corresponding string from which it could be parsed.

For instance, consider this parse tree (represented as a prefix term) of an if-statement:

if(eq(var("x"),var("y")),
  return(var("i")),
  skip)

A pretty printer may yield the following formatted text:

if (x==y)
  return i;

In contrast, a (simple) unparser may make less effort and leave out linebreaks and indentation:

if (x==y) return i;

Further, the term unparsing may be limited to parse trees as input, whereas pretty printing may be applied to formating data structures more generally. However, in practice, these terms are used often interchangeably.

Metadata


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.