Created
November 18, 2018 09:39
-
-
Save shivamMg/e64fd2b9410fa157a1ceaee4b5987e43 to your computer and use it in GitHub Desktop.
EBNF for domain names (copied from https://www.ietf.org/rfc/rfc1035.txt)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <domain> ::= <subdomain> | " " | |
| <subdomain> ::= <label> | <subdomain> "." <label> | |
| <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ] | |
| <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> | |
| <let-dig-hyp> ::= <let-dig> | "-" | |
| <let-dig> ::= <letter> | <digit> | |
| <letter> ::= any one of the 52 alphabetic characters A through Z in | |
| upper case and a through z in lower case | |
| <digit> ::= any one of the ten digits 0 through 9 |
Author
Author
or better yet, since it's producing strings of the form: <label> ("." <label>)* just write it as:
<subdomain> ::= <label> {"." <label>}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
after removing left recursion: