ABNF

This is an attempt to write as much of eno's specification down as ABNF. Note that it is currently not complete nor up to date with the final specification, and that by design it is not possible to cover all aspects of the specification in that format (or at least not practically possible).

;; *************************************
;; *                                   *
;; *        WORK IN PROGRESS           *
;; *                                   *
;; *************************************


document = instruction *( 1*newline instruction )


;; Whitespace

ignored-whitespace = whitespace
retained-whitespace = whitespace

whitespace = 1*( SP / HTAB )

SP   = U+0020  ; " " (Space)
HTAB = U+0009  ; "  " (Horizontal tab)


;; Newline

newline = LF / CR LF

LF = U+000A  ; "\n" (Line feed)
CR = U+000D  ; "\r" (Carriage return)


;; Element

instruction = trimmed-instruction / block-text

trimmed-instruction = [ignored-whitespace] instruction-body [ignored-whitespace]

instruction-body =  comment
instruction-body =/ fieldset-entry
instruction-body =/ name-instruction
instruction-body =/ line-continuation
instruction-body =/ list-item
instruction-body =/ block-instruction


;; Comment

comment = comment-operator [ ( [ignored-whitespace] value ) ]

comment-operator = GREATER-THAN-SIGN

GREATER-THAN-SIGN = U+003E  ; ">"


;; Fieldset entry

fieldset-entry = name [ignored-whitespace]
              fieldset-entry-operator [ignored-whitespace] value

fieldset-entry-operator = EQUALS-SIGN

EQUALS-SIGN = U+003D  ; "="


;; Name

name-instruction = name ( original-declaration / template-declaration )

original-declaration = [ignored-whitespace] name-operator [ ( [ignored-whitespace] value ) ]

template-declaration = ignored-whitespace template-instruction

name = escaped-name / unescaped-name

escaped-name = 1*BACKTICK [ignored-whitespace] required-token [ignored-whitespace] 1*BACKTICK  ; Note: The number of backticks at the start and end must be the same

unescaped-name = required-token

name-operator = COLON

BACKTICK = U+0060  ; "`"
COLON = U+003A     ; ":"


;; Line continuation

line-continuation = ( line-continuation-operator / newline-continuation-operator )
                    [ ( [ignored-whitespace] value ) ]

newline-continuation-operator = VERTICAL-BAR
line-continuation-operator = BACKSLASH

VERTICAL-BAR = U+007C  ; "|"
BACKSLASH    = U+005C  ; "\"


;; List item

list-item = list-item-operator [ignored-whitespace] value

list-item-operator = DASH

DASH = U+002D  ; "-"


;; Section

section = section-operator [ignored-whitespace] name [ignored-whitespace] [template-instruction]

section-operator = 1*HASH

HASH = U+0023


;; Token

optional-token = *non-eol
required-token = 1*non-eol

non-eol =  %x09
non-eol =/ %x20-10FFFF


;; Value

value = optional-token


;; Template

template-instruction = ( copy-operator / deep-copy-operator ) [ignored-whitespace] name

copy-operator = LESS-THAN-SIGN

deep-copy-operator = 2( LESS-THAN-SIGN )

LESS-THAN-SIGN = U+003C ; "<"


;; Block

block-instruction = block-operator [ignored-whitespace] name

block-operator = 2*DASH

block-text = [retained-whitespace] value

Next page: FAQ