Next / Previous / Contents / Shipman's homepage

Abstract

Describes the implementation of a parser for a shorthand notation for ornithological field records.

This publication is available in Web form and also as a PDF document. Please forward any comments to john@nmt.edu.

Table of Contents

1. Parsing the shorthand bird notes format
2. Formal syntax of the input file
3. Structuring the ParseResults instance
4. Code prologue
5. Imports
6. Specification functions
6.1. local-parser
6.2. input-file
6.3. output-file
7. Manifest constants
7.1. IN_FILE_PAT: Input file name syntax
7.2. IN_FILE_EXT: Input file extension
7.3. OUT_FILE_EXT: Output file extension
7.4. DAY_SYMBOL: Symbol for a day line
7.5. LOC_SYMBOL: Symbol for a location
7.6. NOTABLE_SYMBOL: Symbol for a notable sighting
7.7. LONG_SYMBOL: Expanded entry flag
7.8. APPROX_SYMBOL
7.9. MANY_SYMBOL
7.10. Parser names
8. main(): Main program
9. localParser(): Helper function for local parser construction
10. buildParser(): Build up the parser for the entire input file
10.1. INTEGER
10.2. COUNT_SUFFIX
10.3. EXPLICIT_COUNT
10.4. COUNT_GROUP
10.5. SEX_CODE
10.6. AGE_CODE
10.7. COUNT_AGE_SEX
10.8. STATUS_CODE
10.9. LONG_FLAG
10.10. SUFFIX_GROUP
10.11. NOTABLE
10.12. AB6
10.13. REL_CODE
10.14. ALT_AB6
10.15. BIRD_ID
10.16. BIRD_GROUP
10.17. CENSUS_LINE
10.18. LOC_DESC
10.19. LOC_CODE
10.20. LOC_DEF
10.21. LOC_LINE
10.22. DETAIL_LINE
10.23. DAY_LOC_DESC
10.24. DAY_LOC_CODE
10.25. DATE
10.26. STATE_CODE
10.27. DAY_LINE
10.28. DAY_GROUP
10.29. FILE: The top-level parser
11. parseInput(): Parse and extract the input data
12. buildXml(): Build the XML representation
13. addAllDays(): Iterate over the daily sets
14. addDay(): Add one day-notes
15. addDetails(): Process each detail-line
16. processLocLine(): Process a loc-line
17. processBirdGroup(): Process one bird-group
18. findBirdId(): Check the kind of bird
19. addSuffix: Process a suffix-group
20. buildAgeSexGroup(): Attach suffix information to a birdnotes.Sighting
21. class Args(): Command line processing
21.1. Args.__init__()
21.2. Args()._parseArgs(): Run the command line through argparse
21.3. Args()._checkFileName(): Type checker for the file name argument
22. Epilogue