Skip to content

Commit

Permalink
Another ABNF example.
Browse files Browse the repository at this point in the history
  • Loading branch information
katef committed Feb 4, 2017
1 parent ed62650 commit e572f9c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/postal.abnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
; borrowed from https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_form

postal-address = name-part street zip-part

name-part = *(personal-part SP) last-name [SP suffix] CRLF
name-part =/ personal-part CRLF

personal-part = first-name / (initial ".")
first-name = *ALPHA
initial = ALPHA
last-name = *ALPHA
suffix = ("Jr." / "Sr." / 1*("I" / "V" / "X"))

street = [apt SP] house-num SP street-name CRLF
apt = 1*4DIGIT
house-num = 1*8(DIGIT / ALPHA)
street-name = 1*VCHAR

zip-part = town-name "," SP state 1*2SP zip-code CRLF
town-name = 1*(ALPHA / SP)
state = 2ALPHA
zip-code = 5DIGIT ["-" 4DIGIT]

0 comments on commit e572f9c

Please sign in to comment.