The purpose of this program was to convert a document full of postal addresses into an XML version. The program used symbolic links which let it be called under scanner or parser. The scanner recognized symbols while the parser produced an XML file. The XML was created by tokenizing the input and following a Backus Naur Form (BNF), which also catches and flags improperly formatted lines.
The rules of the BNF are pictured above.
Here we can see the BNF running on a proper postal file input, producing no skipped lines.
The program running in scanner mode, tokenizing the input.
Sample input with both valid and flagged entries.
The program catching improperly formatted inputs as errors.