Procedural Footnote Language


Version 1.0

 

Abstract

This document sets out the proper syntax and usage of the Procedural Footnote Language (PFL) – a system of adding structured footnote objects to a text file.

Introduction

In the course of composing email or other text documents it may be desirable to add comments or other notes to clarify a statement when those additions may not fit the syntax of the statement, or may not significantly add to the reader’s understanding of the statement, and where the use of a parenthetical comment would adversely affect the readability of the statement. In such a situation footnotes are one method of including the additional information with minimal negative impact.

1. The PFL Document

A document complying with the PFL 1.0 format consists of plain ASCII text and is divided into two sections: the BODY and the FOOTNOTES.

1.1 The BODY Section

The BODY section consists of zero or more ASCII characters with an undefined structure, and containing zero or more footnote delimiters. A footnote delimiter consists of a positive integer enclosed in square brackets. As the square bracket is used in PFL as a delimiter to indicate a footnote, any square brackets in the body of a document must be “escaped out” by enclosing them in square brackets. All footnote delimiters in the BODY section must have a corresponding footnote in the FOOTNOTE section.

Example: This is body text containing a footnote tag[1]

Example: [[]This is body text[1] enclosed in square brackets.[]]

Footnote delimiters may be marked as being “optional” by enclosing the number within the square brackets in parentheses. Note that the corresponding footnote in the FOOTNOTE section does not contain the parentheses.

Example: This is an optional footnote delimiter[(2)].

1.2 The FOOTNOTES Section

The FOOTNOTES section consists of the PFL document identifier followed by zero or more footnotes in PFL format. The PFL document identifier is the text “PFL” followed by the version number, enclosed in square brackets, on a line by itself. Any text between the PFL document identifier and the first PFL footnote is ignored.

Example: [PFL1.0]

The proper syntax of a PFL footnote is a number enclosed by square brackets followed by a space followed by 1 or more ASCII characters. There must be no text between the start of the line and the start of the footnote. As with the body text any square brackets in the text portion of a PFL footnote must be escaped out by enclosing them in square brackets. All footnotes in the FOOTNOTE section must have a corresponding delimiter in the BODY section. The numbers of the footnotes in the FOOTNOTES section must be in sequential order and may not skip any values.

Example: [1] Hi Sherry!

Footnotes may also have one or two optional parameters. A first parameter will indicate the maximum number of times a footnote is to be evaluated, with any further delimiters referencing that footnote being ignored.

Example: The footnote “[1:3] Wubba[1]” would parse as ” Wubba Wubba Wubba”

A second parameter will indicate the minimum index value for the footnote to be evaluated. The footnote will not be evaluated before this index is reached. Note that a delimiter referencing the footnote will advance the index for that footnote, but will not add to the number of times the footnote has been evaluated unless the index is greater or equal to the first parameter

Example: The PFL document below …

 

[1]
[PFL1.0]
[1:2] Hi ho![1][2]
[2:1:2] It’s off to work we go!
[PFLEND]

… would evaluate to “Hi ho! Hi ho! It’s off to work we go!”

The minimal allowed document in PFL format under this specification would be:

 

[PFL1.0]

The traditional “Hello World” program would be represented in PFL as:

 

[1]
[PFL1.0]
[1] Hello World
[PFLEND]

 

2. Markers

There are a number of optional markers. These markers all take the form of one or more ASCII characters enclosed in square brackets.

3. Functions

PFL Defines a number of built in functions of a mathematical or logical nature. Each function is evaluated by the parser. The functions may be nested as required. Parameters enclosed in angle brackets are optional.

4. Possible Errors

The following are potential errors that may be encountered when parsing a PFL document.