APG
… an ABNF Parser Generator
|
This example will demonstrate the construction and use of the line parsing utilities.
SABNF grammars and many other files used by parser applications are defined as "lines" of text or characters. Lines are typically ended with one or more of the ASCII control characters
Parsing or separating the text into separate line and line ending data is needed in many APG applications and objects. The lines
object provides a unified means for identifying separate lines and iterating over them.
Similarly, arrays of Unicode characters often need the same facility. The linesu
object will do much the same for arrays of 32-bit Unicode code points as the lines
object does for character strings.
Unicode recognizes the following line ending characters:
Application requirements.
The compiled example will execute the following cases. Run the application with no arguments for application usage.