aParse - Augmented BNF

Augmented Backus-Naur Form (ABNF) is defined by RFC 5234. aParse reads grammar files that comply with RFC 5234 but with the following deviations.

2.1. Rule Naming

The name of a rule is ... a sequence of characters, beginning with an alphabetic character, and followed by a combination of alphabetics, digits, hyphens (dashes) and underscores.

The name of a rule may include the underscore _ character.

2.2. Rule Form

A rule is defined by the following sequence:

name = elements ;

The semi-colon ; is used to signal the end of a rule.

3.9. Comments

A hash starts a comment that continues to the end of line.

rule = elements # comment

The hash # rather than a semi-colon ; is used to start a comment.

4. ABNF Definition of ABNF

rulename = ALPHA *(ALPHA / DIGIT / "-" / "_") ;

rulename can include the underscore _ character.

element = rulename / group / option / char-val / num-val ;

prose-val is not supported.

B.1. Core Rules

No core rules are defined. All rules must be defined explicitly.