Skip to content

Latest commit

 

History

History
50 lines (39 loc) · 1.6 KB

org-syntax-better-documentation.org

File metadata and controls

50 lines (39 loc) · 1.6 KB

How to read the EBNF syntax specifications?

The EBNF used here is not ISO EBNF. You can read the rules of the EBNF used in this document, here: https://www.w3.org/TR/xml/#sec-notation

I have a few modifications:

  1. Simply = instead of ::=
  2. Comments start with ; and are until the end of line, instead of being between /* and */
;; Any number or ascii character
Alphanumeric = [a-zA-Z0-9]

;; any Unicode character, excluding the surrogate blocks (special unicode bytes), FFFE, and FFFF
Char = #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]

;; Space, Carriage return, Newline or Tab
Whitespace = (#x20 | #x9 | #xD | #xA)+

Citations

Citation = "[cite" citestyle ":" ( globalprefix ";" )? (";" citationreference)+ (globalsuffix)? "]"

citestyle = ("/" style ("/" variant)?)?
style     = ( Alphanumeric | "_" | "-" )+
variant   = ( Alphanumeric | "_" | "-" | "/" )+

globalprefix = globalsuffix
globalsuffix = ( Standard-set-object - citationkey - ";" )+

citationreference  = ( prefix? citationkey suffix? )
prefix = Minimalset - citationkey - ";"
suffix = Minimalset - ";"
citationkey = "@" keyname
keyname = (Alphanumeric | [-.:?!`'/*@+|(){}<>&_^$#%~])+ - ";"

Entities

Entity = '\' name ("{}" | Char - Alphabetic)

name = ? String that corresponds to the first item in any list of org-entities or org-entities-user ?

Export snippets

Exportsnippet = "@@" backend ":" contents "@@"
backend = (Alphanumeric | "-")
contents = (Character+) - "@@"