(* street address (start symbol is "street address") *) (* A BNF Example: This grammar is meant to parse a single text field, on a GUI form. The text would be presented to the compiler as a single string. This grammar works for some streets in Calgary, but not all. But this is provided to show how the BNF grammar elements relate to the Parser Object (the grammar) and to the Parse Tree (the analysis of a specific text). Milestones and benchmarks are provided for this example: StreetAddress.bnf (the Extended BNF grammar) StreetAddress.java (defines the Parser Object) StreetAddress.class (creates the Parser Object) StreetAddress.parser (the serialized, loadable Parser Object for this example) StreetAddress.ParserObject.xml (the XML dump of the loaded .parser file) StreetAddress.txt (a sample of strings that can be parsed correctly or uncorrectly) StreetAddress.ParseTree.xml (the XML dump of the parser's context) *) street address = house number, street id, quadrant; (* 10813 5th ST SW *) house number = integer; (* 10813 *) street id = ( street number | street name ), street type; (* 5 or 5th or Fifth, with "ST" *) street number = integer; (* 5 *) street name = simple string; (* Fifth *) street type = "ST" | "AVE" | "RD" | "TRAIL"; (* ST *) quadrant = "NW" | "NE" | "SW" | "SE"; (* SW *)