- application code must include header files:
- ../../apgex/apgex.h (includes api.h & utilities.h)
- application compilation must include source code from the directories:
- ../../apgex
- ../../api
- ../../library
- ../../utilities
- application compilation must define macros:
- APG_BKR
- APG_AST
- APG_TRACE
- APG_ACHAR=32
Note that some examples will require 32-bit alphabet character codes. Therefore, all parsers in the application including the API for the pattern must use 32-bit characters. This emphasizes the importance of always converting input strings to achar
alphabet character codes prior to parsing.
The compiled example will execute the following cases. Run the application with no arguments for application usage.
- case 1: Display application information. (type names, type sizes and defined macros)
- case 2: Illustrate the basic use of the default mode, verifying and matching the parts of an email address.
- case 3: Illustrate all the details of an email pattern match.
- case 4: Illustrate the apgex object's properties before and after a successful match
- case 5: Illustrate pattern-matching in global mode.
- case 6: Illustrate pattern-matching in sticky mode.
- case 7: Illustrate the trace mode, with and without PPPT, ASCII and HTML displays.
- case 8: Illustrate patterns with User-Defined Terminals (UDTs).
- case 9: Illustrate simple testing for a matched pattern without detailed results.
- case 10: Illustrate using the AST for a complex translation of the matched pattern.
- case 11: Illustrate the replacement of matched phrases with simple phrases and compound phrases.
- case 12: Illustrate using matched phrases as delimiters to split a phrase into an array of sub-phrases.
- case 13: Illustrate defining word and line boundaries to find words and lines.
- case 14: Illustrate extracting quoted and unquoted fields from Comma Separated Value (CSV) records.
- case 15: Illustrate the use of patterns with wide characters.
- case 16: Illustrate back references, universal and parent modes.