ABNF.Core

Core rules found in the Apendix B of the ABNF RFC.

Copyright 2015 Marcelo Gornstein <marcelog@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Source

Summary

alpha?(char)

ALPHA = %x41-5A / %x61-7A ; A-Z / a-z

bit?(char)

BIT = “0” / “1”

char?(char)

CHAR = %x01-7F ; any 7-bit US-ASCII character, excluding NUL

cr?(char)

CR = %x0D ; carriage return

ctl?(char)

CTL = %x00-1F / %x7F ; controls

digit?(char)

DIGIT = %x30-39; 0-9

dquote?(char)

DQUOTE = %x22 ; “ (Double Quote)

hexdig?(char)

HEXDIG = DIGIT / “A” / “B” / “C” / “D” / “E” / “F”

htab?(char)

HTAB = %x09 ; horizontal tab

lf?(char)

LF = %x0A ; linefeed

octet?(char)

OCTET = %x00-FF ; 8 bits of data

sp?(char)

SP = %x20

vchar?(char)

VCHAR = %x21-7E ; visible (printing) characters

wsp?(char)

WSP = SP / HTAB ; white space

Functions

alpha?(char)

Specs:

  • alpha?(char) :: boolean

ALPHA = %x41-5A / %x61-7A ; A-Z / a-z

Source
bit?(char)

Specs:

  • bit?(char) :: boolean

BIT = “0” / “1”

Source
char?(char)

Specs:

  • char?(char) :: boolean

CHAR = %x01-7F ; any 7-bit US-ASCII character, excluding NUL

Source
cr?(char)

Specs:

  • cr?(char) :: boolean

CR = %x0D ; carriage return

Source
ctl?(char)

Specs:

  • ctl?(char) :: boolean

CTL = %x00-1F / %x7F ; controls

Source
digit?(char)

Specs:

  • digit?(char) :: boolean

DIGIT = %x30-39; 0-9

Source
dquote?(char)

Specs:

  • dquote?(char) :: boolean

DQUOTE = %x22 ; “ (Double Quote)

Source
hexdig?(char)

Specs:

  • hexdig?(char) :: boolean

HEXDIG = DIGIT / “A” / “B” / “C” / “D” / “E” / “F”

Source
htab?(char)

Specs:

  • htab?(char) :: boolean

HTAB = %x09 ; horizontal tab

Source
lf?(char)

Specs:

  • lf?(char) :: boolean

LF = %x0A ; linefeed

Source
octet?(char)

Specs:

  • octet?(char) :: boolean

OCTET = %x00-FF ; 8 bits of data

Source
sp?(char)

Specs:

  • sp?(char) :: boolean

SP = %x20

Source
vchar?(char)

Specs:

  • vchar?(char) :: boolean

VCHAR = %x21-7E ; visible (printing) characters

Source
wsp?(char)

Specs:

  • wsp?(char) :: boolean

WSP = SP / HTAB ; white space

Source